IO
is the basis for all input and output in Ruby.
+ * An I/O stream may be duplexed (that is, bidirectional), and
+ * so may use more than one native operating system stream.
+ *
+ * Many of the examples in this section use class File
,
+ * the only standard subclass of IO
. The two classes are
+ * closely associated.
+ *
+ * As used in this section, portname may take any of the
+ * following forms.
+ *
+ * * A plain string represents a filename suitable for the underlying
+ * operating system.
+ *
+ * * A string starting with ``|
'' indicates a subprocess.
+ * The remainder of the string following the ``|
'' is
+ * invoked as a process with appropriate input/output channels
+ * connected to it.
+ *
+ * * A string equal to ``|-
'' will create another Ruby
+ * instance as a subprocess.
+ *
+ * Ruby will convert pathnames between different operating system
+ * conventions if possible. For instance, on a Windows system the
+ * filename ``/gumby/ruby/test.rb
'' will be opened as
+ * ``\gumby\ruby\test.rb
''. When specifying a
+ * Windows-style filename in a Ruby string, remember to escape the
+ * backslashes:
+ *
+ * "c:\\gumby\\ruby\\test.rb"
+ *
+ * Our examples here will use the Unix-style forward slashes;
+ * File::SEPARATOR
can be used to get the
+ * platform-specific separator character.
+ *
+ * I/O ports may be opened in any one of several different modes, which
+ * are shown in this section as mode_string. This mode string
+ * must be one of the values listed in the following table.
+ *
+ * Mode | Meaning
+ * -----+--------------------------------------------------------
+ * "r" | Read-only, starts at beginning of file (default mode).
+ * -----+--------------------------------------------------------
+ * "r+" | Read-write, starts at beginning of file.
+ * -----+--------------------------------------------------------
+ * "w" | Write-only, truncates existing file
+ * | to zero length or creates a new file for writing.
+ * -----+--------------------------------------------------------
+ * "w+" | Read-write, truncates existing file to zero length
+ * | or creates a new file for reading and writing.
+ * -----+--------------------------------------------------------
+ * "a" | Write-only, starts at end of file if file exists,
+ * | otherwise creates a new file for writing.
+ * -----+--------------------------------------------------------
+ * "a+" | Read-write, starts at end of file if file exists,
+ * | otherwise creates a new file for reading and
+ * | writing.
+ * -----+--------------------------------------------------------
+ * "b" | (DOS/Windows only) Binary file mode (may appear with
+ * | any of the key letters listed above).
+ *
+ */
+
void
Init_IO()
{
diff --git a/lib/rdoc/code_objects.rb b/lib/rdoc/code_objects.rb
index 7fdbbde027..bfacff1321 100644
--- a/lib/rdoc/code_objects.rb
+++ b/lib/rdoc/code_objects.rb
@@ -527,6 +527,9 @@ module RDoc
attr_overridable :params, :param, :parameters, :parameter
+ attr_accessor :call_seq
+
+
include TokenStream
def initialize(text, name)
@@ -540,6 +543,7 @@ module RDoc
@aliases = []
@is_alias_for = nil
@comment = ""
+ @call_seq = nil
end
def <=>(other)
diff --git a/lib/rdoc/generators/html_generator.rb b/lib/rdoc/generators/html_generator.rb
index 89349f4b00..c5a12eee39 100644
--- a/lib/rdoc/generators/html_generator.rb
+++ b/lib/rdoc/generators/html_generator.rb
@@ -394,16 +394,21 @@ module Generators
def build_method_detail_list
outer = []
+ methods = @methods.sort
for singleton in [true, false]
for vis in [ :public, :protected, :private ]
res = []
- @methods.each do |m|
+ methods.each do |m|
if m.document_self and m.visibility == vis and m.singleton == singleton
row = {}
- row["name"] = CGI.escapeHTML(m.name)
+ if m.call_seq
+ row["callseq"] = m.call_seq
+ else
+ row["name"] = CGI.escapeHTML(m.name)
+ row["params"] = m.params
+ end
desc = m.description.strip
row["m_desc"] = desc unless desc.empty?
- row["params"] = m.params
row["aref"] = m.aref
row["visibility"] = m.visibility.to_s
@@ -878,20 +883,33 @@ module Generators
@context.singleton
end
- def params
- p = @context.params.gsub(/\s*\#.*/, '')
- p = p.tr("\n", " ").squeeze(" ")
- p = "(" + p + ")" unless p[0] == ?(
-
- if (block = @context.block_params)
- block.gsub!(/\s*\#.*/, '')
- block = block.tr("\n", " ").squeeze(" ")
- if block[0] == ?(
- block.sub!(/^\(/, '').sub!(/\)/, '')
- end
- p << " {|#{block.strip}| ...}"
+ def call_seq
+ cs = @context.call_seq
+ if cs
+ cs.gsub(/\n/, "%name% | -= | -%value% | -
- | %desc% | -
%name% | -[%rw%] | -%a_desc% | -
Path: | -%full_path% -IF:cvsurl - (CVS) -ENDIF:cvsurl - | -
Last Update: | -%dtm_modified% | -
In: | -
-START:infiles
-IF:full_path_url
-
-ENDIF:full_path_url
- %full_path%
-IF:full_path_url
-
-ENDIF:full_path_url
-IF:cvsurl
- (CVS)
-ENDIF:cvsurl
- -END:infiles - |
-
Parent: | --IF:par_url - -ENDIF:par_url - %parent% -IF:par_url - -ENDIF:par_url - | -
-%sourcecode% --
%code%- - -} - - -##################################################################### -### I N D E X F I L E T E M P L A T E S -##################################################################### - -FR_INDEX_BODY = %{ -!INCLUDE! -} - -FILE_INDEX = XHTML_PREAMBLE + %{ - - - -
%name% | %age% |
Included modules |
%type% %category% methods |
- -IF:codeurl - -ENDIF:codeurl -%name%%params% -IF:codeurl - -ENDIF:codeurl - |
-%sourcecode% --ENDIF:sourcecode -END:methods -ENDIF:methods -END:method_list -ENDIF:method_list -} - -################################################################### +##################################################################### +### C O N T E X T C O N T E N T T E M P L A T E +##################################################################### CONTEXT_CONTENT = %{ +
-%diagram% - |
Required files |
Methods |
Constants |
%name% | = | %value% |
%name% | += | +%value% | +
%desc% | ||
+ | %desc% | +
External Aliases |
Attributes |
%name% | -IF:rw -[%rw%] | -ENDIF:rw -IFNOT:rw --ENDIF:rw - | %a_desc% | -
%name% | +[%rw%] | +%a_desc% | +
Classes and Modules |
|
+ |||||||||||||||
Last Update: | +%dtm_modified% | +
In: | +
+START:infiles
+IF:full_path_url
+
+ENDIF:full_path_url
+ %full_path%
+IF:full_path_url
+
+ENDIF:full_path_url
+IF:cvsurl
+ (CVS)
+ENDIF:cvsurl
+ +END:infiles + |
+
Parent: | ++IF:par_url + +ENDIF:par_url + %parent% +IF:par_url + +ENDIF:par_url + | +
+%sourcecode% ++
%code%+ +
%code%} -########################## Index ################################ + +##################################################################### +### I N D E X F I L E T E M P L A T E S +##################################################################### FR_INDEX_BODY = %{ !INCLUDE! } -FILE_INDEX = %{ - - - - -
%name% | %rw% | %a_desc% |
-ENDIF:sourcecode -END:methods -ENDIF:methods -END:method_list -ENDIF:method_list -} - -######################################################################## - -ONE_PAGE = %{ - - - --%sourcecode% -
Path: | %full_path% |
Modified: | %dtm_modified% |
%name% | %age% |
%name% | %rw% | %a_desc% |
+ENDIF:sourcecode +END:methods +ENDIF:methods +END:method_list +ENDIF:method_list +} + +######################################################################## + +ONE_PAGE = %{ + + + ++%sourcecode% +
Path: | %full_path% |
Modified: | %dtm_modified% |