* array.c: Documentation: change => in call-seq to ->.

Harmonize "#=>" in examples. [ruby-core:30206]

* bignum.c: ditto

* class.c: ditto

* compar.c: ditto

* cont.c: ditto

* dir.c: ditto

* encoding.c: ditto

* enum.c: ditto

* enumerator.c: ditto

* error.c: ditto

* eval.c: ditto

* file.c: ditto

* gc.c: ditto

* hash.c: ditto

* io.c: ditto

* load.c: ditto

* marshal.c: ditto

* math.c: ditto

* numeric.c: ditto

* object.c: ditto

* pack.c: ditto

* proc.c: ditto

* process.c: ditto

* random.c: ditto

* range.c: ditto

* re.c: ditto

* ruby.c: ditto

* signal.c: ditto

* sprintf.c: ditto

* string.c: ditto

* struct.c: ditto

* thread.c: ditto

* time.c: ditto

* transcode.c: ditto

* variable.c: ditto

* vm_eval.c: ditto

* vm_method.c: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@27870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
marcandre 2010-05-17 21:50:00 +00:00
parent 9c5fb33a69
commit 26134a6dc1
37 changed files with 1421 additions and 1421 deletions

View file

@ -1112,7 +1112,7 @@ rb_big2str(VALUE x, int base)
/* /*
* call-seq: * call-seq:
* big.to_s(base=10) => string * big.to_s(base=10) -> string
* *
* Returns a string containing the representation of <i>big</i> radix * Returns a string containing the representation of <i>big</i> radix
* <i>base</i> (2 through 36). * <i>base</i> (2 through 36).
@ -1382,7 +1382,7 @@ rb_big_to_f(VALUE x)
/* /*
* call-seq: * call-seq:
* big <=> numeric => -1, 0, +1 or nil * big <=> numeric -> -1, 0, +1 or nil
* *
* Comparison---Returns -1, 0, or +1 depending on whether <i>big</i> is * Comparison---Returns -1, 0, or +1 depending on whether <i>big</i> is
* less than, equal to, or greater than <i>numeric</i>. This is the * less than, equal to, or greater than <i>numeric</i>. This is the
@ -1543,7 +1543,7 @@ big_le(VALUE x, VALUE y)
/* /*
* call-seq: * call-seq:
* big == obj => true or false * big == obj -> true or false
* *
* Returns <code>true</code> only if <i>obj</i> has the same value * Returns <code>true</code> only if <i>obj</i> has the same value
* as <i>big</i>. Contrast this with <code>Bignum#eql?</code>, which * as <i>big</i>. Contrast this with <code>Bignum#eql?</code>, which
@ -1581,7 +1581,7 @@ rb_big_eq(VALUE x, VALUE y)
/* /*
* call-seq: * call-seq:
* big.eql?(obj) => true or false * big.eql?(obj) -> true or false
* *
* Returns <code>true</code> only if <i>obj</i> is a * Returns <code>true</code> only if <i>obj</i> is a
* <code>Bignum</code> with the same value as <i>big</i>. Contrast this * <code>Bignum</code> with the same value as <i>big</i>. Contrast this
@ -1602,7 +1602,7 @@ rb_big_eql(VALUE x, VALUE y)
/* /*
* call-seq: * call-seq:
* -big => integer * -big -> integer
* *
* Unary minus (returns an integer whose value is 0-big) * Unary minus (returns an integer whose value is 0-big)
*/ */
@ -1619,7 +1619,7 @@ rb_big_uminus(VALUE x)
/* /*
* call-seq: * call-seq:
* ~big => integer * ~big -> integer
* *
* Inverts the bits in big. As Bignums are conceptually infinite * Inverts the bits in big. As Bignums are conceptually infinite
* length, the result acts as if it had an infinite number of one * length, the result acts as if it had an infinite number of one
@ -1876,7 +1876,7 @@ bigadd(VALUE x, VALUE y, int sign)
/* /*
* call-seq: * call-seq:
* big + other => Numeric * big + other -> Numeric
* *
* Adds big and other, returning the result. * Adds big and other, returning the result.
*/ */
@ -1913,7 +1913,7 @@ rb_big_plus(VALUE x, VALUE y)
/* /*
* call-seq: * call-seq:
* big - other => Numeric * big - other -> Numeric
* *
* Subtracts other from big, returning the result. * Subtracts other from big, returning the result.
*/ */
@ -2273,7 +2273,7 @@ bigmul0(VALUE x, VALUE y)
/* /*
* call-seq: * call-seq:
* big * other => Numeric * big * other -> Numeric
* *
* Multiplies big and other, returning the result. * Multiplies big and other, returning the result.
*/ */
@ -2522,7 +2522,7 @@ rb_big_divide(VALUE x, VALUE y, ID op)
/* /*
* call-seq: * call-seq:
* big / other => Numeric * big / other -> Numeric
* *
* Performs division: the class of the resulting object depends on * Performs division: the class of the resulting object depends on
* the class of <code>numeric</code> and on the magnitude of the * the class of <code>numeric</code> and on the magnitude of the
@ -2537,7 +2537,7 @@ rb_big_div(VALUE x, VALUE y)
/* /*
* call-seq: * call-seq:
* big.div(other) => integer * big.div(other) -> integer
* *
* Performs integer division: returns integer value. * Performs integer division: returns integer value.
*/ */
@ -2550,8 +2550,8 @@ rb_big_idiv(VALUE x, VALUE y)
/* /*
* call-seq: * call-seq:
* big % other => Numeric * big % other -> Numeric
* big.modulo(other) => Numeric * big.modulo(other) -> Numeric
* *
* Returns big modulo other. See Numeric.divmod for more * Returns big modulo other. See Numeric.divmod for more
* information. * information.
@ -2580,7 +2580,7 @@ rb_big_modulo(VALUE x, VALUE y)
/* /*
* call-seq: * call-seq:
* big.remainder(numeric) => number * big.remainder(numeric) -> number
* *
* Returns the remainder after dividing <i>big</i> by <i>numeric</i>. * Returns the remainder after dividing <i>big</i> by <i>numeric</i>.
* *
@ -2610,7 +2610,7 @@ rb_big_remainder(VALUE x, VALUE y)
/* /*
* call-seq: * call-seq:
* big.divmod(numeric) => array * big.divmod(numeric) -> array
* *
* See <code>Numeric#divmod</code>. * See <code>Numeric#divmod</code>.
* *
@ -2770,7 +2770,7 @@ bigsqr(VALUE x)
/* /*
* call-seq: * call-seq:
* big ** exponent => numeric * big ** exponent -> numeric
* *
* Raises _big_ to the _exponent_ power (which may be an integer, float, * Raises _big_ to the _exponent_ power (which may be an integer, float,
* or anything that will coerce to a number). The result may be * or anything that will coerce to a number). The result may be
@ -2891,7 +2891,7 @@ bigand_int(VALUE x, long y)
/* /*
* call-seq: * call-seq:
* big & numeric => integer * big & numeric -> integer
* *
* Performs bitwise +and+ between _big_ and _numeric_. * Performs bitwise +and+ between _big_ and _numeric_.
*/ */
@ -2982,7 +2982,7 @@ bigor_int(VALUE x, long y)
/* /*
* call-seq: * call-seq:
* big | numeric => integer * big | numeric -> integer
* *
* Performs bitwise +or+ between _big_ and _numeric_. * Performs bitwise +or+ between _big_ and _numeric_.
*/ */
@ -3073,7 +3073,7 @@ bigxor_int(VALUE x, long y)
} }
/* /*
* call-seq: * call-seq:
* big ^ numeric => integer * big ^ numeric -> integer
* *
* Performs bitwise +exclusive or+ between _big_ and _numeric_. * Performs bitwise +exclusive or+ between _big_ and _numeric_.
*/ */
@ -3143,7 +3143,7 @@ check_shiftdown(VALUE y, VALUE x)
/* /*
* call-seq: * call-seq:
* big << numeric => integer * big << numeric -> integer
* *
* Shifts big left _numeric_ positions (right if _numeric_ is negative). * Shifts big left _numeric_ positions (right if _numeric_ is negative).
*/ */
@ -3207,7 +3207,7 @@ big_lshift(VALUE x, unsigned long shift)
/* /*
* call-seq: * call-seq:
* big >> numeric => integer * big >> numeric -> integer
* *
* Shifts big right _numeric_ positions (left if _numeric_ is negative). * Shifts big right _numeric_ positions (left if _numeric_ is negative).
*/ */
@ -3351,7 +3351,7 @@ rb_big_aref(VALUE x, VALUE y)
/* /*
* call-seq: * call-seq:
* big.hash => fixnum * big.hash -> fixnum
* *
* Compute a hash based on the value of _big_. * Compute a hash based on the value of _big_.
*/ */

12
class.c
View file

@ -698,7 +698,7 @@ rb_mod_included_modules(VALUE mod)
/* /*
* call-seq: * call-seq:
* mod.include?(module) => true or false * mod.include?(module) -> true or false
* *
* Returns <code>true</code> if <i>module</i> is included in * Returns <code>true</code> if <i>module</i> is included in
* <i>mod</i> or one of <i>mod</i>'s ancestors. * <i>mod</i> or one of <i>mod</i>'s ancestors.
@ -863,7 +863,7 @@ class_instance_method_list(int argc, VALUE *argv, VALUE mod, int (*func) (ID, lo
/* /*
* call-seq: * call-seq:
* mod.instance_methods(include_super=true) => array * mod.instance_methods(include_super=true) -> array
* *
* Returns an array containing the names of instance methods that is callable * Returns an array containing the names of instance methods that is callable
* from outside in the receiver. For a module, these are the public methods; * from outside in the receiver. For a module, these are the public methods;
@ -896,7 +896,7 @@ rb_class_instance_methods(int argc, VALUE *argv, VALUE mod)
/* /*
* call-seq: * call-seq:
* mod.protected_instance_methods(include_super=true) => array * mod.protected_instance_methods(include_super=true) -> array
* *
* Returns a list of the protected instance methods defined in * Returns a list of the protected instance methods defined in
* <i>mod</i>. If the optional parameter is not <code>false</code>, the * <i>mod</i>. If the optional parameter is not <code>false</code>, the
@ -911,7 +911,7 @@ rb_class_protected_instance_methods(int argc, VALUE *argv, VALUE mod)
/* /*
* call-seq: * call-seq:
* mod.private_instance_methods(include_super=true) => array * mod.private_instance_methods(include_super=true) -> array
* *
* Returns a list of the private instance methods defined in * Returns a list of the private instance methods defined in
* <i>mod</i>. If the optional parameter is not <code>false</code>, the * <i>mod</i>. If the optional parameter is not <code>false</code>, the
@ -934,7 +934,7 @@ rb_class_private_instance_methods(int argc, VALUE *argv, VALUE mod)
/* /*
* call-seq: * call-seq:
* mod.public_instance_methods(include_super=true) => array * mod.public_instance_methods(include_super=true) -> array
* *
* Returns a list of the public instance methods defined in <i>mod</i>. * Returns a list of the public instance methods defined in <i>mod</i>.
* If the optional parameter is not <code>false</code>, the methods of * If the optional parameter is not <code>false</code>, the methods of
@ -949,7 +949,7 @@ rb_class_public_instance_methods(int argc, VALUE *argv, VALUE mod)
/* /*
* call-seq: * call-seq:
* obj.singleton_methods(all=true) => array * obj.singleton_methods(all=true) -> array
* *
* Returns an array of the names of singleton methods for <i>obj</i>. * Returns an array of the names of singleton methods for <i>obj</i>.
* If the optional <i>all</i> parameter is true, the list will include * If the optional <i>all</i> parameter is true, the list will include

View file

@ -49,7 +49,7 @@ cmp_failed(void)
/* /*
* call-seq: * call-seq:
* obj == other => true or false * obj == other -> true or false
* *
* Compares two objects based on the receiver's <code><=></code> * Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns 0. Also returns true if * method, returning true if it returns 0. Also returns true if
@ -69,7 +69,7 @@ cmp_equal(VALUE x, VALUE y)
/* /*
* call-seq: * call-seq:
* obj > other => true or false * obj > other -> true or false
* *
* Compares two objects based on the receiver's <code><=></code> * Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns 1. * method, returning true if it returns 1.
@ -86,7 +86,7 @@ cmp_gt(VALUE x, VALUE y)
/* /*
* call-seq: * call-seq:
* obj >= other => true or false * obj >= other -> true or false
* *
* Compares two objects based on the receiver's <code><=></code> * Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns 0 or 1. * method, returning true if it returns 0 or 1.
@ -103,7 +103,7 @@ cmp_ge(VALUE x, VALUE y)
/* /*
* call-seq: * call-seq:
* obj < other => true or false * obj < other -> true or false
* *
* Compares two objects based on the receiver's <code><=></code> * Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns -1. * method, returning true if it returns -1.
@ -120,7 +120,7 @@ cmp_lt(VALUE x, VALUE y)
/* /*
* call-seq: * call-seq:
* obj <= other => true or false * obj <= other -> true or false
* *
* Compares two objects based on the receiver's <code><=></code> * Compares two objects based on the receiver's <code><=></code>
* method, returning true if it returns -1 or 0. * method, returning true if it returns -1 or 0.
@ -137,7 +137,7 @@ cmp_le(VALUE x, VALUE y)
/* /*
* call-seq: * call-seq:
* obj.between?(min, max) => true or false * obj.between?(min, max) -> true or false
* *
* Returns <code>false</code> if <i>obj</i> <code><=></code> * Returns <code>false</code> if <i>obj</i> <code><=></code>
* <i>min</i> is less than zero or if <i>anObject</i> <code><=></code> * <i>min</i> is less than zero or if <i>anObject</i> <code><=></code>

2
cont.c
View file

@ -806,7 +806,7 @@ cont_restore_0(rb_context_t *cont, VALUE *addr_in_prev_frame)
/* /*
* call-seq: * call-seq:
* callcc {|cont| block } => obj * callcc {|cont| block } -> obj
* *
* Generates a <code>Continuation</code> object, which it passes to the * Generates a <code>Continuation</code> object, which it passes to the
* associated block. Performing a <em>cont</em><code>.call</code> will * associated block. Performing a <em>cont</em><code>.call</code> will

66
dir.c
View file

@ -428,8 +428,8 @@ dir_initialize(int argc, VALUE *argv, VALUE dir)
/* /*
* call-seq: * call-seq:
* Dir.open( string ) => aDir * Dir.open( string ) -> aDir
* Dir.open( string ) {| aDir | block } => anObject * Dir.open( string ) {| aDir | block } -> anObject
* *
* With no block, <code>open</code> is a synonym for * With no block, <code>open</code> is a synonym for
* <code>Dir::new</code>. If a block is present, it is passed * <code>Dir::new</code>. If a block is present, it is passed
@ -474,7 +474,7 @@ dir_check(VALUE dir)
/* /*
* call-seq: * call-seq:
* dir.inspect => string * dir.inspect -> string
* *
* Return a string describing this Dir object. * Return a string describing this Dir object.
*/ */
@ -493,7 +493,7 @@ dir_inspect(VALUE dir)
/* /*
* call-seq: * call-seq:
* dir.path => string or nil * dir.path -> string or nil
* *
* Returns the path parameter passed to <em>dir</em>'s constructor. * Returns the path parameter passed to <em>dir</em>'s constructor.
* *
@ -558,7 +558,7 @@ dir_path(VALUE dir)
/* /*
* call-seq: * call-seq:
* dir.read => string or nil * dir.read -> string or nil
* *
* Reads the next entry from <em>dir</em> and returns it as a string. * Reads the next entry from <em>dir</em> and returns it as a string.
* Returns <code>nil</code> at the end of the stream. * Returns <code>nil</code> at the end of the stream.
@ -591,8 +591,8 @@ dir_read(VALUE dir)
/* /*
* call-seq: * call-seq:
* dir.each { |filename| block } => dir * dir.each { |filename| block } -> dir
* dir.each => an_enumerator * dir.each -> an_enumerator
* *
* Calls the block once for each entry in this directory, passing the * Calls the block once for each entry in this directory, passing the
* filename of each entry as a parameter to the block. * filename of each entry as a parameter to the block.
@ -629,8 +629,8 @@ dir_each(VALUE dir)
#ifdef HAVE_TELLDIR #ifdef HAVE_TELLDIR
/* /*
* call-seq: * call-seq:
* dir.pos => integer * dir.pos -> integer
* dir.tell => integer * dir.tell -> integer
* *
* Returns the current position in <em>dir</em>. See also * Returns the current position in <em>dir</em>. See also
* <code>Dir#seek</code>. * <code>Dir#seek</code>.
@ -657,7 +657,7 @@ dir_tell(VALUE dir)
#ifdef HAVE_SEEKDIR #ifdef HAVE_SEEKDIR
/* /*
* call-seq: * call-seq:
* dir.seek( integer ) => dir * dir.seek( integer ) -> dir
* *
* Seeks to a particular location in <em>dir</em>. <i>integer</i> * Seeks to a particular location in <em>dir</em>. <i>integer</i>
* must be a value returned by <code>Dir#tell</code>. * must be a value returned by <code>Dir#tell</code>.
@ -685,7 +685,7 @@ dir_seek(VALUE dir, VALUE pos)
/* /*
* call-seq: * call-seq:
* dir.pos( integer ) => integer * dir.pos( integer ) -> integer
* *
* Synonym for <code>Dir#seek</code>, but returns the position * Synonym for <code>Dir#seek</code>, but returns the position
* parameter. * parameter.
@ -706,7 +706,7 @@ dir_set_pos(VALUE dir, VALUE pos)
/* /*
* call-seq: * call-seq:
* dir.rewind => dir * dir.rewind -> dir
* *
* Repositions <em>dir</em> to the first entry. * Repositions <em>dir</em> to the first entry.
* *
@ -730,7 +730,7 @@ dir_rewind(VALUE dir)
/* /*
* call-seq: * call-seq:
* dir.close => nil * dir.close -> nil
* *
* Closes the directory stream. Any further attempts to access * Closes the directory stream. Any further attempts to access
* <em>dir</em> will raise an <code>IOError</code>. * <em>dir</em> will raise an <code>IOError</code>.
@ -791,8 +791,8 @@ chdir_restore(struct chdir_data *args)
/* /*
* call-seq: * call-seq:
* Dir.chdir( [ string] ) => 0 * Dir.chdir( [ string] ) -> 0
* Dir.chdir( [ string] ) {| path | block } => anObject * Dir.chdir( [ string] ) {| path | block } -> anObject
* *
* Changes the current working directory of the process to the given * Changes the current working directory of the process to the given
* string. When called without an argument, changes the directory to * string. When called without an argument, changes the directory to
@ -882,8 +882,8 @@ rb_dir_getwd(void)
/* /*
* call-seq: * call-seq:
* Dir.getwd => string * Dir.getwd -> string
* Dir.pwd => string * Dir.pwd -> string
* *
* Returns the path to the current working directory of this process as * Returns the path to the current working directory of this process as
* a string. * a string.
@ -913,7 +913,7 @@ check_dirname(volatile VALUE *dir)
#if defined(HAVE_CHROOT) #if defined(HAVE_CHROOT)
/* /*
* call-seq: * call-seq:
* Dir.chroot( string ) => 0 * Dir.chroot( string ) -> 0
* *
* Changes this process's idea of the file system root. Only a * Changes this process's idea of the file system root. Only a
* privileged process may make this call. Not available on all * privileged process may make this call. Not available on all
@ -937,7 +937,7 @@ dir_s_chroot(VALUE dir, VALUE path)
/* /*
* call-seq: * call-seq:
* Dir.mkdir( string [, integer] ) => 0 * Dir.mkdir( string [, integer] ) -> 0
* *
* Makes a new directory named by <i>string</i>, with permissions * Makes a new directory named by <i>string</i>, with permissions
* specified by the optional parameter <i>anInteger</i>. The * specified by the optional parameter <i>anInteger</i>. The
@ -971,9 +971,9 @@ dir_s_mkdir(int argc, VALUE *argv, VALUE obj)
/* /*
* call-seq: * call-seq:
* Dir.delete( string ) => 0 * Dir.delete( string ) -> 0
* Dir.rmdir( string ) => 0 * Dir.rmdir( string ) -> 0
* Dir.unlink( string ) => 0 * Dir.unlink( string ) -> 0
* *
* Deletes the named directory. Raises a subclass of * Deletes the named directory. Raises a subclass of
* <code>SystemCallError</code> if the directory isn't empty. * <code>SystemCallError</code> if the directory isn't empty.
@ -1702,8 +1702,8 @@ dir_globs(long argc, VALUE *argv, int flags)
/* /*
* call-seq: * call-seq:
* Dir[ array ] => array * Dir[ array ] -> array
* Dir[ string [, string ...] ] => array * Dir[ string [, string ...] ] -> array
* *
* Equivalent to calling * Equivalent to calling
* <code>Dir.glob(</code><i>array,</i><code>0)</code> and * <code>Dir.glob(</code><i>array,</i><code>0)</code> and
@ -1721,8 +1721,8 @@ dir_s_aref(int argc, VALUE *argv, VALUE obj)
/* /*
* call-seq: * call-seq:
* Dir.glob( pattern, [flags] ) => array * Dir.glob( pattern, [flags] ) -> array
* Dir.glob( pattern, [flags] ) {| filename | block } => nil * Dir.glob( pattern, [flags] ) {| filename | block } -> nil
* *
* Returns the filenames found by expanding <i>pattern</i> which is * Returns the filenames found by expanding <i>pattern</i> which is
* an +Array+ of the patterns or the pattern +String+, either as an * an +Array+ of the patterns or the pattern +String+, either as an
@ -1822,8 +1822,8 @@ dir_open_dir(int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* Dir.foreach( dirname ) {| filename | block } => nil * Dir.foreach( dirname ) {| filename | block } -> nil
* Dir.foreach( dirname ) => an_enumerator * Dir.foreach( dirname ) -> an_enumerator
* *
* Calls the block once for each entry in the named directory, passing * Calls the block once for each entry in the named directory, passing
* the filename of each entry as a parameter to the block. * the filename of each entry as a parameter to the block.
@ -1853,7 +1853,7 @@ dir_foreach(int argc, VALUE *argv, VALUE io)
/* /*
* call-seq: * call-seq:
* Dir.entries( dirname ) => array * Dir.entries( dirname ) -> array
* *
* Returns an array containing all of the filenames in the given * Returns an array containing all of the filenames in the given
* directory. Will raise a <code>SystemCallError</code> if the named * directory. Will raise a <code>SystemCallError</code> if the named
@ -1873,8 +1873,8 @@ dir_entries(int argc, VALUE *argv, VALUE io)
/* /*
* call-seq: * call-seq:
* File.fnmatch( pattern, path, [flags] ) => (true or false) * File.fnmatch( pattern, path, [flags] ) -> (true or false)
* File.fnmatch?( pattern, path, [flags] ) => (true or false) * File.fnmatch?( pattern, path, [flags] ) -> (true or false)
* *
* Returns true if <i>path</i> matches against <i>pattern</i> The * Returns true if <i>path</i> matches against <i>pattern</i> The
* pattern is not a regular expression; instead it follows rules * pattern is not a regular expression; instead it follows rules
@ -1978,8 +1978,8 @@ VALUE rb_home_dir(const char *user, VALUE result);
/* /*
* call-seq: * call-seq:
* Dir.home() => "/home/me" * Dir.home() -> "/home/me"
* Dir.home("root") => "/root" * Dir.home("root") -> "/root"
* *
* Returns the home directory of the current user or the named user * Returns the home directory of the current user or the named user
* if given. * if given.

View file

@ -315,7 +315,7 @@ rb_enc_replicate(const char *name, rb_encoding *encoding)
/* /*
* call-seq: * call-seq:
* enc.replicate(name) => encoding * enc.replicate(name) -> encoding
* *
* Returns a replicated encoding of _enc_ whose name is _name_. * Returns a replicated encoding of _enc_ whose name is _name_.
* The new encoding should have the same byte structure of _enc_. * The new encoding should have the same byte structure of _enc_.
@ -381,7 +381,7 @@ rb_encdb_dummy(const char *name)
/* /*
* call-seq: * call-seq:
* enc.dummy? => true or false * enc.dummy? -> true or false
* *
* Returns true for dummy encodings. * Returns true for dummy encodings.
* A dummy encoding is an encoding for which character handling is not properly * A dummy encoding is an encoding for which character handling is not properly
@ -400,7 +400,7 @@ enc_dummy_p(VALUE enc)
/* /*
* call-seq: * call-seq:
* enc.ascii_compatible? => true or false * enc.ascii_compatible? -> true or false
* *
* Returns whether ASCII-compatible or not. * Returns whether ASCII-compatible or not.
* *
@ -791,7 +791,7 @@ rb_enc_copy(VALUE obj1, VALUE obj2)
/* /*
* call-seq: * call-seq:
* obj.encoding => encoding * obj.encoding -> encoding
* *
* Returns the Encoding object that represents the encoding of obj. * Returns the Encoding object that represents the encoding of obj.
*/ */
@ -905,7 +905,7 @@ rb_enc_tolower(int c, rb_encoding *enc)
/* /*
* call-seq: * call-seq:
* enc.inspect => string * enc.inspect -> string
* *
* Returns a string which represents the encoding for programmers. * Returns a string which represents the encoding for programmers.
* *
@ -924,11 +924,11 @@ enc_inspect(VALUE self)
/* /*
* call-seq: * call-seq:
* enc.name => string * enc.name -> string
* *
* Returns the name of the encoding. * Returns the name of the encoding.
* *
* Encoding::UTF_8.name => "UTF-8" * Encoding::UTF_8.name #=> "UTF-8"
*/ */
static VALUE static VALUE
enc_name(VALUE self) enc_name(VALUE self)
@ -951,11 +951,11 @@ enc_names_i(st_data_t name, st_data_t idx, st_data_t args)
/* /*
* call-seq: * call-seq:
* enc.names => array * enc.names -> array
* *
* Returns the list of name and aliases of the encoding. * Returns the list of name and aliases of the encoding.
* *
* Encoding::WINDOWS_31J.names => ["Windows-31J", "CP932", "csWindows31J"] * Encoding::WINDOWS_31J.names #=> ["Windows-31J", "CP932", "csWindows31J"]
*/ */
static VALUE static VALUE
enc_names(VALUE self) enc_names(VALUE self)
@ -970,19 +970,19 @@ enc_names(VALUE self)
/* /*
* call-seq: * call-seq:
* Encoding.list => [enc1, enc2, ...] * Encoding.list -> [enc1, enc2, ...]
* *
* Returns the list of loaded encodings. * Returns the list of loaded encodings.
* *
* Encoding.list * Encoding.list
* => [#<Encoding:ASCII-8BIT>, #<Encoding:UTF-8>, * #=> [#<Encoding:ASCII-8BIT>, #<Encoding:UTF-8>,
* #<Encoding:ISO-2022-JP (dummy)>] * #<Encoding:ISO-2022-JP (dummy)>]
* *
* Encoding.find("US-ASCII") * Encoding.find("US-ASCII")
* => #<Encoding:US-ASCII> * #=> #<Encoding:US-ASCII>
* *
* Encoding.list * Encoding.list
* => [#<Encoding:ASCII-8BIT>, #<Encoding:UTF-8>, * #=> [#<Encoding:ASCII-8BIT>, #<Encoding:UTF-8>,
* #<Encoding:US-ASCII>, #<Encoding:ISO-2022-JP (dummy)>] * #<Encoding:US-ASCII>, #<Encoding:ISO-2022-JP (dummy)>]
* *
*/ */
@ -996,14 +996,14 @@ enc_list(VALUE klass)
/* /*
* call-seq: * call-seq:
* Encoding.find(string) => enc * Encoding.find(string) -> enc
* Encoding.find(symbol) => enc * Encoding.find(symbol) -> enc
* *
* Search the encoding with specified <i>name</i>. * Search the encoding with specified <i>name</i>.
* <i>name</i> should be a string or symbol. * <i>name</i> should be a string or symbol.
* *
* Encoding.find("US-ASCII") => #<Encoding:US-ASCII> * Encoding.find("US-ASCII") #=> #<Encoding:US-ASCII>
* Encoding.find(:Shift_JIS) => #<Encoding:Shift_JIS> * Encoding.find(:Shift_JIS) #=> #<Encoding:Shift_JIS>
* *
* Names which this method accept are encoding names and aliases * Names which this method accept are encoding names and aliases
* including following special aliases * including following special aliases
@ -1026,7 +1026,7 @@ enc_find(VALUE klass, VALUE enc)
/* /*
* call-seq: * call-seq:
* Encoding.compatible?(str1, str2) => enc or nil * Encoding.compatible?(str1, str2) -> enc or nil
* *
* Checks the compatibility of two strings. * Checks the compatibility of two strings.
* If they are compatible, means concatenatable, * If they are compatible, means concatenatable,
@ -1034,12 +1034,12 @@ enc_find(VALUE klass, VALUE enc)
* If they are not compatible, nil is returned. * If they are not compatible, nil is returned.
* *
* Encoding.compatible?("\xa1".force_encoding("iso-8859-1"), "b") * Encoding.compatible?("\xa1".force_encoding("iso-8859-1"), "b")
* => #<Encoding:ISO-8859-1> * #=> #<Encoding:ISO-8859-1>
* *
* Encoding.compatible?( * Encoding.compatible?(
* "\xa1".force_encoding("iso-8859-1"), * "\xa1".force_encoding("iso-8859-1"),
* "\xa1\xa1".force_encoding("euc-jp")) * "\xa1\xa1".force_encoding("euc-jp"))
* => nil * #=> nil
* *
*/ */
static VALUE static VALUE
@ -1226,7 +1226,7 @@ rb_enc_default_external(void)
/* /*
* call-seq: * call-seq:
* Encoding.default_external => enc * Encoding.default_external -> enc
* *
* Returns default external encoding. * Returns default external encoding.
* *
@ -1282,7 +1282,7 @@ rb_enc_default_internal(void)
/* /*
* call-seq: * call-seq:
* Encoding.default_internal => enc * Encoding.default_internal -> enc
* *
* Returns default internal encoding. * Returns default internal encoding.
* *
@ -1318,21 +1318,21 @@ set_default_internal(VALUE klass, VALUE encoding)
/* /*
* call-seq: * call-seq:
* Encoding.locale_charmap => string * Encoding.locale_charmap -> string
* *
* Returns the locale charmap name. * Returns the locale charmap name.
* *
* Debian GNU/Linux * Debian GNU/Linux
* LANG=C * LANG=C
* Encoding.locale_charmap => "ANSI_X3.4-1968" * Encoding.locale_charmap #=> "ANSI_X3.4-1968"
* LANG=ja_JP.EUC-JP * LANG=ja_JP.EUC-JP
* Encoding.locale_charmap => "EUC-JP" * Encoding.locale_charmap #=> "EUC-JP"
* *
* SunOS 5 * SunOS 5
* LANG=C * LANG=C
* Encoding.locale_charmap => "646" * Encoding.locale_charmap #=> "646"
* LANG=ja * LANG=ja
* Encoding.locale_charmap => "eucJP" * Encoding.locale_charmap #=> "eucJP"
* *
* The result is highly platform dependent. * The result is highly platform dependent.
* So Encoding.find(Encoding.locale_charmap) may cause an error. * So Encoding.find(Encoding.locale_charmap) may cause an error.
@ -1426,12 +1426,12 @@ rb_enc_name_list_i(st_data_t name, st_data_t idx, st_data_t arg)
/* /*
* call-seq: * call-seq:
* Encoding.name_list => ["enc1", "enc2", ...] * Encoding.name_list -> ["enc1", "enc2", ...]
* *
* Returns the list of available encoding names. * Returns the list of available encoding names.
* *
* Encoding.name_list * Encoding.name_list
* => ["US-ASCII", "ASCII-8BIT", "UTF-8", * #=> ["US-ASCII", "ASCII-8BIT", "UTF-8",
* "ISO-8859-1", "Shift_JIS", "EUC-JP", * "ISO-8859-1", "Shift_JIS", "EUC-JP",
* "Windows-31J", * "Windows-31J",
* "BINARY", "CP932", "eucJP"] * "BINARY", "CP932", "eucJP"]
@ -1473,12 +1473,12 @@ rb_enc_aliases_enc_i(st_data_t name, st_data_t orig, st_data_t arg)
/* /*
* call-seq: * call-seq:
* Encoding.aliases => {"alias1" => "orig1", "alias2" => "orig2", ...} * Encoding.aliases -> {"alias1" => "orig1", "alias2" => "orig2", ...}
* *
* Returns the hash of available encoding alias and original encoding name. * Returns the hash of available encoding alias and original encoding name.
* *
* Encoding.aliases * Encoding.aliases
* => {"BINARY"=>"ASCII-8BIT", "ASCII"=>"US-ASCII", "ANSI_X3.4-1986"=>"US-ASCII", * #=> {"BINARY"=>"ASCII-8BIT", "ASCII"=>"US-ASCII", "ANSI_X3.4-1986"=>"US-ASCII",
* "SJIS"=>"Shift_JIS", "eucJP"=>"EUC-JP", "CP932"=>"Windows-31J"} * "SJIS"=>"Shift_JIS", "eucJP"=>"EUC-JP", "CP932"=>"Windows-31J"}
* *
*/ */

154
enum.c
View file

@ -56,8 +56,8 @@ grep_iter_i(VALUE i, VALUE args, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.grep(pattern) => array * enum.grep(pattern) -> array
* enum.grep(pattern) {| obj | block } => array * enum.grep(pattern) {| obj | block } -> array
* *
* Returns an array of every element in <i>enum</i> for which * Returns an array of every element in <i>enum</i> for which
* <code>Pattern === element</code>. If the optional <em>block</em> is * <code>Pattern === element</code>. If the optional <em>block</em> is
@ -121,9 +121,9 @@ count_all_i(VALUE i, VALUE memop, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.count => int * enum.count -> int
* enum.count(item) => int * enum.count(item) -> int
* enum.count {| obj | block } => int * enum.count {| obj | block } -> int
* *
* Returns the number of items in <i>enum</i>, where #size is called * Returns the number of items in <i>enum</i>, where #size is called
* if it responds to it, otherwise the items are counted through * if it responds to it, otherwise the items are counted through
@ -179,10 +179,10 @@ find_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.detect(ifnone = nil) {| obj | block } => obj or nil * enum.detect(ifnone = nil) {| obj | block } -> obj or nil
* enum.find(ifnone = nil) {| obj | block } => obj or nil * enum.find(ifnone = nil) {| obj | block } -> obj or nil
* enum.detect(ifnone = nil) => an_enumerator * enum.detect(ifnone = nil) -> an_enumerator
* enum.find(ifnone = nil) => an_enumerator * enum.find(ifnone = nil) -> an_enumerator
* *
* Passes each entry in <i>enum</i> to <em>block</em>. Returns the * Passes each entry in <i>enum</i> to <em>block</em>. Returns the
* first for which <em>block</em> is not false. If no * first for which <em>block</em> is not false. If no
@ -244,9 +244,9 @@ find_index_iter_i(VALUE i, VALUE memop, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.find_index(value) => int or nil * enum.find_index(value) -> int or nil
* enum.find_index {| obj | block } => int or nil * enum.find_index {| obj | block } -> int or nil
* enum.find_index => an_enumerator * enum.find_index -> an_enumerator
* *
* Compares each entry in <i>enum</i> with <em>value</em> or passes * Compares each entry in <i>enum</i> with <em>value</em> or passes
* to <em>block</em>. Returns the index for the first for which the * to <em>block</em>. Returns the index for the first for which the
@ -298,10 +298,10 @@ find_all_i(VALUE i, VALUE ary, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.find_all {| obj | block } => array * enum.find_all {| obj | block } -> array
* enum.select {| obj | block } => array * enum.select {| obj | block } -> array
* enum.find_all => an_enumerator * enum.find_all -> an_enumerator
* enum.select => an_enumerator * enum.select -> an_enumerator
* *
* Returns an array containing all elements of <i>enum</i> for which * Returns an array containing all elements of <i>enum</i> for which
* <em>block</em> is not <code>false</code> (see also * <em>block</em> is not <code>false</code> (see also
@ -340,8 +340,8 @@ reject_i(VALUE i, VALUE ary, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.reject {| obj | block } => array * enum.reject {| obj | block } -> array
* enum.reject => an_enumerator * enum.reject -> an_enumerator
* *
* Returns an array for all elements of <i>enum</i> for which * Returns an array for all elements of <i>enum</i> for which
* <em>block</em> is false (see also <code>Enumerable#find_all</code>). * <em>block</em> is false (see also <code>Enumerable#find_all</code>).
@ -384,10 +384,10 @@ collect_all(VALUE i, VALUE ary, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.collect {| obj | block } => array * enum.collect {| obj | block } -> array
* enum.map {| obj | block } => array * enum.map {| obj | block } -> array
* enum.collect => an_enumerator * enum.collect -> an_enumerator
* enum.map => an_enumerator * enum.map -> an_enumerator
* *
* Returns a new array with the results of running <em>block</em> once * Returns a new array with the results of running <em>block</em> once
* for every element in <i>enum</i>. * for every element in <i>enum</i>.
@ -431,10 +431,10 @@ flat_map_i(VALUE i, VALUE ary, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.flat_map {| obj | block } => array * enum.flat_map {| obj | block } -> array
* enum.collect_concat {| obj | block } => array * enum.collect_concat {| obj | block } -> array
* enum.flat_map => an_enumerator * enum.flat_map -> an_enumerator
* enum.collect_concat => an_enumerator * enum.collect_concat -> an_enumerator
* *
* Returns a new array with the concatenated results of running * Returns a new array with the concatenated results of running
* <em>block</em> once for every element in <i>enum</i>. * <em>block</em> once for every element in <i>enum</i>.
@ -460,8 +460,8 @@ enum_flat_map(VALUE obj)
/* /*
* call-seq: * call-seq:
* enum.to_a => array * enum.to_a -> array
* enum.entries => array * enum.entries -> array
* *
* Returns an array containing the items in <i>enum</i>. * Returns an array containing the items in <i>enum</i>.
* *
@ -513,15 +513,15 @@ inject_op_i(VALUE i, VALUE p, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.inject(initial, sym) => obj * enum.inject(initial, sym) -> obj
* enum.inject(sym) => obj * enum.inject(sym) -> obj
* enum.inject(initial) {| memo, obj | block } => obj * enum.inject(initial) {| memo, obj | block } -> obj
* enum.inject {| memo, obj | block } => obj * enum.inject {| memo, obj | block } -> obj
* *
* enum.reduce(initial, sym) => obj * enum.reduce(initial, sym) -> obj
* enum.reduce(sym) => obj * enum.reduce(sym) -> obj
* enum.reduce(initial) {| memo, obj | block } => obj * enum.reduce(initial) {| memo, obj | block } -> obj
* enum.reduce {| memo, obj | block } => obj * enum.reduce {| memo, obj | block } -> obj
* *
* Combines all elements of <i>enum</i> by applying a binary * Combines all elements of <i>enum</i> by applying a binary
* operation, specified by a block or a symbol that names a * operation, specified by a block or a symbol that names a
@ -603,8 +603,8 @@ partition_i(VALUE i, VALUE *ary, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.partition {| obj | block } => [ true_array, false_array ] * enum.partition {| obj | block } -> [ true_array, false_array ]
* enum.partition => an_enumerator * enum.partition -> an_enumerator
* *
* Returns two arrays, the first containing the elements of * Returns two arrays, the first containing the elements of
* <i>enum</i> for which the block evaluates to true, the second * <i>enum</i> for which the block evaluates to true, the second
@ -652,8 +652,8 @@ group_by_i(VALUE i, VALUE hash, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.group_by {| obj | block } => a_hash * enum.group_by {| obj | block } -> a_hash
* enum.group_by => an_enumerator * enum.group_by -> an_enumerator
* *
* Returns a hash, which keys are evaluated result from the * Returns a hash, which keys are evaluated result from the
* block, and values are arrays of elements in <i>enum</i> * block, and values are arrays of elements in <i>enum</i>
@ -740,8 +740,8 @@ enum_first(int argc, VALUE *argv, VALUE obj)
/* /*
* call-seq: * call-seq:
* enum.sort => array * enum.sort -> array
* enum.sort {| a, b | block } => array * enum.sort {| a, b | block } -> array
* *
* Returns an array containing the items in <i>enum</i> sorted, * Returns an array containing the items in <i>enum</i> sorted,
* either according to their own <code><=></code> method, or by using * either according to their own <code><=></code> method, or by using
@ -792,8 +792,8 @@ sort_by_cmp(const void *ap, const void *bp, void *data)
/* /*
* call-seq: * call-seq:
* enum.sort_by {| obj | block } => array * enum.sort_by {| obj | block } -> array
* enum.sort_by => an_enumerator * enum.sort_by -> an_enumerator
* *
* Sorts <i>enum</i> using a set of keys generated by mapping the * Sorts <i>enum</i> using a set of keys generated by mapping the
* values in <i>enum</i> through the given block. * values in <i>enum</i> through the given block.
@ -924,7 +924,7 @@ DEFINE_ENUMFUNCS(all)
/* /*
* call-seq: * call-seq:
* enum.all? [{|obj| block } ] => true or false * enum.all? [{|obj| block } ] -> true or false
* *
* Passes each element of the collection to the given block. The method * Passes each element of the collection to the given block. The method
* returns <code>true</code> if the block never returns * returns <code>true</code> if the block never returns
@ -959,7 +959,7 @@ DEFINE_ENUMFUNCS(any)
/* /*
* call-seq: * call-seq:
* enum.any? [{|obj| block } ] => true or false * enum.any? [{|obj| block } ] -> true or false
* *
* Passes each element of the collection to the given block. The method * Passes each element of the collection to the given block. The method
* returns <code>true</code> if the block ever returns a value other * returns <code>true</code> if the block ever returns a value other
@ -1000,7 +1000,7 @@ DEFINE_ENUMFUNCS(one)
/* /*
* call-seq: * call-seq:
* enum.one? [{|obj| block }] => true or false * enum.one? [{|obj| block }] -> true or false
* *
* Passes each element of the collection to the given block. The method * Passes each element of the collection to the given block. The method
* returns <code>true</code> if the block returns <code>true</code> * returns <code>true</code> if the block returns <code>true</code>
@ -1037,7 +1037,7 @@ DEFINE_ENUMFUNCS(none)
/* /*
* call-seq: * call-seq:
* enum.none? [{|obj| block }] => true or false * enum.none? [{|obj| block }] -> true or false
* *
* Passes each element of the collection to the given block. The method * Passes each element of the collection to the given block. The method
* returns <code>true</code> if the block never returns <code>true</code> * returns <code>true</code> if the block never returns <code>true</code>
@ -1100,8 +1100,8 @@ min_ii(VALUE i, VALUE *memo, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.min => obj * enum.min -> obj
* enum.min {| a,b | block } => obj * enum.min {| a,b | block } -> obj
* *
* Returns the object in <i>enum</i> with the minimum value. The * Returns the object in <i>enum</i> with the minimum value. The
* first form assumes all objects implement <code>Comparable</code>; * first form assumes all objects implement <code>Comparable</code>;
@ -1167,8 +1167,8 @@ max_ii(VALUE i, VALUE *memo, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.max => obj * enum.max -> obj
* enum.max {|a,b| block } => obj * enum.max {|a,b| block } -> obj
* *
* Returns the object in _enum_ with the maximum value. The * Returns the object in _enum_ with the maximum value. The
* first form assumes all objects implement <code>Comparable</code>; * first form assumes all objects implement <code>Comparable</code>;
@ -1306,8 +1306,8 @@ minmax_ii(VALUE i, VALUE _memo, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.minmax => [min,max] * enum.minmax -> [min,max]
* enum.minmax {|a,b| block } => [min,max] * enum.minmax {|a,b| block } -> [min,max]
* *
* Returns two elements array which contains the minimum and the * Returns two elements array which contains the minimum and the
* maximum value in the enumerable. The first form assumes all * maximum value in the enumerable. The first form assumes all
@ -1365,8 +1365,8 @@ min_by_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.min_by {|obj| block } => obj * enum.min_by {|obj| block } -> obj
* enum.min_by => an_enumerator * enum.min_by -> an_enumerator
* *
* Returns the object in <i>enum</i> that gives the minimum * Returns the object in <i>enum</i> that gives the minimum
* value from the given block. * value from the given block.
@ -1411,8 +1411,8 @@ max_by_i(VALUE i, VALUE *memo, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.max_by {|obj| block } => obj * enum.max_by {|obj| block } -> obj
* enum.max_by => an_enumerator * enum.max_by -> an_enumerator
* *
* Returns the object in <i>enum</i> that gives the maximum * Returns the object in <i>enum</i> that gives the maximum
* value from the given block. * value from the given block.
@ -1508,8 +1508,8 @@ minmax_by_i(VALUE i, VALUE _memo, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.minmax_by {|obj| block } => [min, max] * enum.minmax_by {|obj| block } -> [min, max]
* enum.minmax_by => an_enumerator * enum.minmax_by -> an_enumerator
* *
* Returns two elements array array containing the objects in * Returns two elements array array containing the objects in
* <i>enum</i> that gives the minimum and maximum values respectively * <i>enum</i> that gives the minimum and maximum values respectively
@ -1552,8 +1552,8 @@ member_i(VALUE iter, VALUE *memo, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.include?(obj) => true or false * enum.include?(obj) -> true or false
* enum.member?(obj) => true or false * enum.member?(obj) -> true or false
* *
* Returns <code>true</code> if any member of <i>enum</i> equals * Returns <code>true</code> if any member of <i>enum</i> equals
* <i>obj</i>. Equality is tested using <code>==</code>. * <i>obj</i>. Equality is tested using <code>==</code>.
@ -1653,8 +1653,8 @@ each_val_i(VALUE i, VALUE p, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.each_entry {|obj| block} => enum * enum.each_entry {|obj| block} -> enum
* enum.each_entry => an_enumerator * enum.each_entry -> an_enumerator
* *
* Calls <i>block</i> once for each element in +self+, passing that * Calls <i>block</i> once for each element in +self+, passing that
* element as a parameter, converting multiple values from yield to an * element as a parameter, converting multiple values from yield to an
@ -1904,8 +1904,8 @@ zip_i(VALUE val, NODE *memo, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.zip(arg, ...) => an_enumerator * enum.zip(arg, ...) -> an_enumerator
* enum.zip(arg, ...) {|arr| block } => nil * enum.zip(arg, ...) {|arr| block } -> nil
* *
* Takes one element from <i>enum</i> and merges corresponding * Takes one element from <i>enum</i> and merges corresponding
* elements from each <i>args</i>. This generates a sequence of * elements from each <i>args</i>. This generates a sequence of
@ -1970,7 +1970,7 @@ take_i(VALUE i, VALUE *arg, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.take(n) => array * enum.take(n) -> array
* *
* Returns first n elements from <i>enum</i>. * Returns first n elements from <i>enum</i>.
* *
@ -2007,8 +2007,8 @@ take_while_i(VALUE i, VALUE *ary, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.take_while {|arr| block } => array * enum.take_while {|arr| block } -> array
* enum.take_while => an_enumerator * enum.take_while -> an_enumerator
* *
* Passes elements to the block until the block returns +nil+ or +false+, * Passes elements to the block until the block returns +nil+ or +false+,
* then stops iterating and returns an array of all prior elements. * then stops iterating and returns an array of all prior elements.
@ -2045,7 +2045,7 @@ drop_i(VALUE i, VALUE *arg, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.drop(n) => array * enum.drop(n) -> array
* *
* Drops first n elements from <i>enum</i>, and returns rest elements * Drops first n elements from <i>enum</i>, and returns rest elements
* in an array. * in an array.
@ -2088,8 +2088,8 @@ drop_while_i(VALUE i, VALUE *args, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.drop_while {|arr| block } => array * enum.drop_while {|arr| block } -> array
* enum.drop_while => an_enumerator * enum.drop_while -> an_enumerator
* *
* Drops elements up to, but not including, the first element for * Drops elements up to, but not including, the first element for
* which the block returns +nil+ or +false+ and returns an array * which the block returns +nil+ or +false+ and returns an array
@ -2257,8 +2257,8 @@ chunk_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.chunk {|elt| ... } => an_enumerator * enum.chunk {|elt| ... } -> an_enumerator
* enum.chunk(initial_state) {|elt, state| ... } => an_enumerator * enum.chunk(initial_state) {|elt, state| ... } -> an_enumerator
* *
* Creates an enumerator for each chunked elements. * Creates an enumerator for each chunked elements.
* The consecutive elements which have same block value are chunked. * The consecutive elements which have same block value are chunked.
@ -2432,9 +2432,9 @@ slicebefore_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* enum.slice_before(pattern) => an_enumerator * enum.slice_before(pattern) -> an_enumerator
* enum.slice_before {|elt| bool } => an_enumerator * enum.slice_before {|elt| bool } -> an_enumerator
* enum.slice_before(initial_state) {|elt, state| bool } => an_enumerator * enum.slice_before(initial_state) {|elt, state| bool } -> an_enumerator
* *
* Creates an enumerator for each chunked elements. * Creates an enumerator for each chunked elements.
* The beginnings of chunks are defined by _pattern_ and the block. * The beginnings of chunks are defined by _pattern_ and the block.

View file

@ -474,7 +474,7 @@ get_next_values(VALUE obj, struct enumerator *e)
/* /*
* call-seq: * call-seq:
* e.next_values => array * e.next_values -> array
* *
* Returns the next object as an array in the enumerator, * Returns the next object as an array in the enumerator,
* and move the internal position forward. * and move the internal position forward.
@ -553,7 +553,7 @@ ary2sv(VALUE args, int dup)
/* /*
* call-seq: * call-seq:
* e.next => object * e.next -> object
* *
* Returns the next object in the enumerator, and move the internal * Returns the next object in the enumerator, and move the internal
* position forward. When the position reached at the end, StopIteration * position forward. When the position reached at the end, StopIteration
@ -592,7 +592,7 @@ enumerator_peek_values(VALUE obj)
/* /*
* call-seq: * call-seq:
* e.peek_values => array * e.peek_values -> array
* *
* Returns the next object as an array in the enumerator, * Returns the next object as an array in the enumerator,
* but don't move the internal position forward. * but don't move the internal position forward.
@ -624,7 +624,7 @@ enumerator_peek_values_m(VALUE obj)
/* /*
* call-seq: * call-seq:
* e.peek => object * e.peek -> object
* *
* Returns the next object in the enumerator, but don't move the internal * Returns the next object in the enumerator, but don't move the internal
* position forward. When the position reached at the end, StopIteration * position forward. When the position reached at the end, StopIteration
@ -651,7 +651,7 @@ enumerator_peek(VALUE obj)
/* /*
* call-seq: * call-seq:
* e.feed obj => nil * e.feed obj -> nil
* *
* Set the value for the next yield in the enumerator returns. * Set the value for the next yield in the enumerator returns.
* *
@ -700,7 +700,7 @@ enumerator_feed(VALUE obj, VALUE v)
/* /*
* call-seq: * call-seq:
* e.rewind => e * e.rewind -> e
* *
* Rewinds the enumeration sequence by the next method. * Rewinds the enumeration sequence by the next method.
* *
@ -781,7 +781,7 @@ inspect_enumerator(VALUE obj, VALUE dummy, int recur)
/* /*
* call-seq: * call-seq:
* e.inspect => string * e.inspect -> string
* *
* Create a printable version of <i>e</i>. * Create a printable version of <i>e</i>.
*/ */
@ -1041,7 +1041,7 @@ generator_each(VALUE obj)
/* /*
* call-seq: * call-seq:
* stopiteration.result => value * stopiteration.result -> value
* *
* Returns the return value of the iterator. * Returns the return value of the iterator.
* *

38
error.c
View file

@ -194,7 +194,7 @@ rb_warning(const char *fmt, ...)
/* /*
* call-seq: * call-seq:
* warn(msg) => nil * warn(msg) -> nil
* *
* Display the given message (followed by a newline) on STDERR unless * Display the given message (followed by a newline) on STDERR unless
* warnings are disabled (for example with the <code>-W0</code> flag). * warnings are disabled (for example with the <code>-W0</code> flag).
@ -429,7 +429,7 @@ rb_exc_new3(VALUE etype, VALUE str)
/* /*
* call-seq: * call-seq:
* Exception.new(msg = nil) => exception * Exception.new(msg = nil) -> exception
* *
* Construct a new Exception object, optionally passing in * Construct a new Exception object, optionally passing in
* a message. * a message.
@ -475,7 +475,7 @@ exc_exception(int argc, VALUE *argv, VALUE self)
/* /*
* call-seq: * call-seq:
* exception.to_s => string * exception.to_s -> string
* *
* Returns exception's message (or the name of the exception if * Returns exception's message (or the name of the exception if
* no message is set). * no message is set).
@ -493,7 +493,7 @@ exc_to_s(VALUE exc)
/* /*
* call-seq: * call-seq:
* exception.message => string * exception.message -> string
* *
* Returns the result of invoking <code>exception.to_s</code>. * Returns the result of invoking <code>exception.to_s</code>.
* Normally this returns the exception's message or name. By * Normally this returns the exception's message or name. By
@ -509,7 +509,7 @@ exc_message(VALUE exc)
/* /*
* call-seq: * call-seq:
* exception.inspect => string * exception.inspect -> string
* *
* Return this exception's class name an message * Return this exception's class name an message
*/ */
@ -537,7 +537,7 @@ exc_inspect(VALUE exc)
/* /*
* call-seq: * call-seq:
* exception.backtrace => array * exception.backtrace -> array
* *
* Returns any backtrace associated with the exception. The backtrace * Returns any backtrace associated with the exception. The backtrace
* is an array of strings, each containing either ``filename:lineNo: in * is an array of strings, each containing either ``filename:lineNo: in
@ -597,7 +597,7 @@ rb_check_backtrace(VALUE bt)
/* /*
* call-seq: * call-seq:
* exc.set_backtrace(array) => array * exc.set_backtrace(array) -> array
* *
* Sets the backtrace information associated with <i>exc</i>. The * Sets the backtrace information associated with <i>exc</i>. The
* argument must be an array of <code>String</code> objects in the * argument must be an array of <code>String</code> objects in the
@ -613,7 +613,7 @@ exc_set_backtrace(VALUE exc, VALUE bt)
/* /*
* call-seq: * call-seq:
* exc == obj => true or false * exc == obj -> true or false
* *
* Equality---If <i>obj</i> is not an <code>Exception</code>, returns * Equality---If <i>obj</i> is not an <code>Exception</code>, returns
* <code>false</code>. Otherwise, returns <code>true</code> if <i>exc</i> and * <code>false</code>. Otherwise, returns <code>true</code> if <i>exc</i> and
@ -653,7 +653,7 @@ exc_equal(VALUE exc, VALUE obj)
/* /*
* call-seq: * call-seq:
* SystemExit.new(status=0) => system_exit * SystemExit.new(status=0) -> system_exit
* *
* Create a new +SystemExit+ exception with the given status. * Create a new +SystemExit+ exception with the given status.
*/ */
@ -674,7 +674,7 @@ exit_initialize(int argc, VALUE *argv, VALUE exc)
/* /*
* call-seq: * call-seq:
* system_exit.status => fixnum * system_exit.status -> fixnum
* *
* Return the status value associated with this system exit. * Return the status value associated with this system exit.
*/ */
@ -688,7 +688,7 @@ exit_status(VALUE exc)
/* /*
* call-seq: * call-seq:
* system_exit.success? => true or false * system_exit.success? -> true or false
* *
* Returns +true+ if exiting successful, +false+ if not. * Returns +true+ if exiting successful, +false+ if not.
*/ */
@ -719,7 +719,7 @@ rb_name_error(ID id, const char *fmt, ...)
/* /*
* call-seq: * call-seq:
* NameError.new(msg [, name]) => name_error * NameError.new(msg [, name]) -> name_error
* *
* Construct a new NameError exception. If given the <i>name</i> * Construct a new NameError exception. If given the <i>name</i>
* parameter may subsequently be examined using the <code>NameError.name</code> * parameter may subsequently be examined using the <code>NameError.name</code>
@ -739,7 +739,7 @@ name_err_initialize(int argc, VALUE *argv, VALUE self)
/* /*
* call-seq: * call-seq:
* name_error.name => string or nil * name_error.name -> string or nil
* *
* Return the name associated with this NameError exception. * Return the name associated with this NameError exception.
*/ */
@ -752,7 +752,7 @@ name_err_name(VALUE self)
/* /*
* call-seq: * call-seq:
* name_error.to_s => string * name_error.to_s -> string
* *
* Produce a nicely-formatted string representing the +NameError+. * Produce a nicely-formatted string representing the +NameError+.
*/ */
@ -774,7 +774,7 @@ name_err_to_s(VALUE exc)
/* /*
* call-seq: * call-seq:
* NoMethodError.new(msg, name [, args]) => no_method_error * NoMethodError.new(msg, name [, args]) -> no_method_error
* *
* Construct a NoMethodError exception for a method of the given name * Construct a NoMethodError exception for a method of the given name
* called with the given arguments. The name may be accessed using * called with the given arguments. The name may be accessed using
@ -903,7 +903,7 @@ name_err_mesg_load(VALUE klass, VALUE str)
/* /*
* call-seq: * call-seq:
* no_method_error.args => obj * no_method_error.args -> obj
* *
* Return the arguments passed in as the third parameter to * Return the arguments passed in as the third parameter to
* the constructor. * the constructor.
@ -988,7 +988,7 @@ get_syserr(int n)
/* /*
* call-seq: * call-seq:
* SystemCallError.new(msg, errno) => system_call_error_subclass * SystemCallError.new(msg, errno) -> system_call_error_subclass
* *
* If _errno_ corresponds to a known system error code, constructs * If _errno_ corresponds to a known system error code, constructs
* the appropriate <code>Errno</code> class for that error, otherwise * the appropriate <code>Errno</code> class for that error, otherwise
@ -1043,7 +1043,7 @@ syserr_initialize(int argc, VALUE *argv, VALUE self)
/* /*
* call-seq: * call-seq:
* system_call_error.errno => fixnum * system_call_error.errno -> fixnum
* *
* Return this SystemCallError's error number. * Return this SystemCallError's error number.
*/ */
@ -1056,7 +1056,7 @@ syserr_errno(VALUE self)
/* /*
* call-seq: * call-seq:
* system_call_error === other => true or false * system_call_error === other -> true or false
* *
* Return +true+ if the receiver is a generic +SystemCallError+, or * Return +true+ if the receiver is a generic +SystemCallError+, or
* if the error numbers +self+ and _other_ are the same. * if the error numbers +self+ and _other_ are the same.

18
eval.c
View file

@ -263,7 +263,7 @@ ruby_exec_node(void *n)
/* /*
* call-seq: * call-seq:
* Module.nesting => array * Module.nesting -> array
* *
* Returns the list of +Modules+ nested at the point of call. * Returns the list of +Modules+ nested at the point of call.
* *
@ -295,7 +295,7 @@ rb_mod_nesting(void)
/* /*
* call-seq: * call-seq:
* Module.constants => array * Module.constants -> array
* *
* Returns an array of the names of all constants defined in the * Returns an array of the names of all constants defined in the
* system. This list includes the names of all modules and classes. * system. This list includes the names of all modules and classes.
@ -805,7 +805,7 @@ rb_frame_pop(void)
/* /*
* call-seq: * call-seq:
* append_features(mod) => mod * append_features(mod) -> mod
* *
* When this module is included in another, Ruby calls * When this module is included in another, Ruby calls
* <code>append_features</code> in this module, passing it the * <code>append_features</code> in this module, passing it the
@ -833,7 +833,7 @@ rb_mod_append_features(VALUE module, VALUE include)
/* /*
* call-seq: * call-seq:
* include(module, ...) => self * include(module, ...) -> self
* *
* Invokes <code>Module.append_features</code> on each parameter in reverse order. * Invokes <code>Module.append_features</code> on each parameter in reverse order.
*/ */
@ -867,7 +867,7 @@ rb_extend_object(VALUE obj, VALUE module)
/* /*
* call-seq: * call-seq:
* extend_object(obj) => obj * extend_object(obj) -> obj
* *
* Extends the specified object by adding this module's constants and * Extends the specified object by adding this module's constants and
* methods (which are added as singleton methods). This is the callback * methods (which are added as singleton methods). This is the callback
@ -901,7 +901,7 @@ rb_mod_extend_object(VALUE mod, VALUE obj)
/* /*
* call-seq: * call-seq:
* obj.extend(module, ...) => obj * obj.extend(module, ...) -> obj
* *
* Adds to _obj_ the instance methods from each module given as a * Adds to _obj_ the instance methods from each module given as a
* parameter. * parameter.
@ -943,7 +943,7 @@ rb_obj_extend(int argc, VALUE *argv, VALUE obj)
/* /*
* call-seq: * call-seq:
* include(module, ...) => self * include(module, ...) -> self
* *
* Invokes <code>Module.append_features</code> * Invokes <code>Module.append_features</code>
* on each parameter in turn. Effectively adds the methods and constants * on each parameter in turn. Effectively adds the methods and constants
@ -1078,8 +1078,8 @@ errat_setter(VALUE val, ID id, VALUE *var)
/* /*
* call-seq: * call-seq:
* __method__ => symbol * __method__ -> symbol
* __callee__ => symbol * __callee__ -> symbol
* *
* Returns the name of the current method as a Symbol. * Returns the name of the current method as a Symbol.
* If called outside of a method, it returns <code>nil</code>. * If called outside of a method, it returns <code>nil</code>.

190
file.c
View file

@ -278,7 +278,7 @@ static struct timespec stat_mtimespec(struct stat *st);
/* /*
* call-seq: * call-seq:
* stat <=> other_stat => -1, 0, 1, nil * stat <=> other_stat -> -1, 0, 1, nil
* *
* Compares <code>File::Stat</code> objects by comparing their * Compares <code>File::Stat</code> objects by comparing their
* respective modification times. * respective modification times.
@ -310,7 +310,7 @@ rb_stat_cmp(VALUE self, VALUE other)
/* /*
* call-seq: * call-seq:
* stat.dev => fixnum * stat.dev -> fixnum
* *
* Returns an integer representing the device on which <i>stat</i> * Returns an integer representing the device on which <i>stat</i>
* resides. * resides.
@ -326,7 +326,7 @@ rb_stat_dev(VALUE self)
/* /*
* call-seq: * call-seq:
* stat.dev_major => fixnum * stat.dev_major -> fixnum
* *
* Returns the major part of <code>File_Stat#dev</code> or * Returns the major part of <code>File_Stat#dev</code> or
* <code>nil</code>. * <code>nil</code>.
@ -348,7 +348,7 @@ rb_stat_dev_major(VALUE self)
/* /*
* call-seq: * call-seq:
* stat.dev_minor => fixnum * stat.dev_minor -> fixnum
* *
* Returns the minor part of <code>File_Stat#dev</code> or * Returns the minor part of <code>File_Stat#dev</code> or
* <code>nil</code>. * <code>nil</code>.
@ -370,7 +370,7 @@ rb_stat_dev_minor(VALUE self)
/* /*
* call-seq: * call-seq:
* stat.ino => fixnum * stat.ino -> fixnum
* *
* Returns the inode number for <i>stat</i>. * Returns the inode number for <i>stat</i>.
* *
@ -390,7 +390,7 @@ rb_stat_ino(VALUE self)
/* /*
* call-seq: * call-seq:
* stat.mode => fixnum * stat.mode -> fixnum
* *
* Returns an integer representing the permission bits of * Returns an integer representing the permission bits of
* <i>stat</i>. The meaning of the bits is platform dependent; on * <i>stat</i>. The meaning of the bits is platform dependent; on
@ -409,7 +409,7 @@ rb_stat_mode(VALUE self)
/* /*
* call-seq: * call-seq:
* stat.nlink => fixnum * stat.nlink -> fixnum
* *
* Returns the number of hard links to <i>stat</i>. * Returns the number of hard links to <i>stat</i>.
* *
@ -427,7 +427,7 @@ rb_stat_nlink(VALUE self)
/* /*
* call-seq: * call-seq:
* stat.uid => fixnum * stat.uid -> fixnum
* *
* Returns the numeric user id of the owner of <i>stat</i>. * Returns the numeric user id of the owner of <i>stat</i>.
* *
@ -443,7 +443,7 @@ rb_stat_uid(VALUE self)
/* /*
* call-seq: * call-seq:
* stat.gid => fixnum * stat.gid -> fixnum
* *
* Returns the numeric group id of the owner of <i>stat</i>. * Returns the numeric group id of the owner of <i>stat</i>.
* *
@ -459,7 +459,7 @@ rb_stat_gid(VALUE self)
/* /*
* call-seq: * call-seq:
* stat.rdev => fixnum or nil * stat.rdev -> fixnum or nil
* *
* Returns an integer representing the device type on which * Returns an integer representing the device type on which
* <i>stat</i> resides. Returns <code>nil</code> if the operating * <i>stat</i> resides. Returns <code>nil</code> if the operating
@ -481,7 +481,7 @@ rb_stat_rdev(VALUE self)
/* /*
* call-seq: * call-seq:
* stat.rdev_major => fixnum * stat.rdev_major -> fixnum
* *
* Returns the major part of <code>File_Stat#rdev</code> or * Returns the major part of <code>File_Stat#rdev</code> or
* <code>nil</code>. * <code>nil</code>.
@ -503,7 +503,7 @@ rb_stat_rdev_major(VALUE self)
/* /*
* call-seq: * call-seq:
* stat.rdev_minor => fixnum * stat.rdev_minor -> fixnum
* *
* Returns the minor part of <code>File_Stat#rdev</code> or * Returns the minor part of <code>File_Stat#rdev</code> or
* <code>nil</code>. * <code>nil</code>.
@ -525,7 +525,7 @@ rb_stat_rdev_minor(VALUE self)
/* /*
* call-seq: * call-seq:
* stat.size => fixnum * stat.size -> fixnum
* *
* Returns the size of <i>stat</i> in bytes. * Returns the size of <i>stat</i> in bytes.
* *
@ -540,7 +540,7 @@ rb_stat_size(VALUE self)
/* /*
* call-seq: * call-seq:
* stat.blksize => integer or nil * stat.blksize -> integer or nil
* *
* Returns the native file system's block size. Will return <code>nil</code> * Returns the native file system's block size. Will return <code>nil</code>
* on platforms that don't support this information. * on platforms that don't support this information.
@ -561,7 +561,7 @@ rb_stat_blksize(VALUE self)
/* /*
* call-seq: * call-seq:
* stat.blocks => integer or nil * stat.blocks -> integer or nil
* *
* Returns the number of native file system blocks allocated for this * Returns the number of native file system blocks allocated for this
* file, or <code>nil</code> if the operating system doesn't * file, or <code>nil</code> if the operating system doesn't
@ -658,7 +658,7 @@ stat_ctime(struct stat *st)
/* /*
* call-seq: * call-seq:
* stat.atime => time * stat.atime -> time
* *
* Returns the last access time for this file as an object of class * Returns the last access time for this file as an object of class
* <code>Time</code>. * <code>Time</code>.
@ -709,7 +709,7 @@ rb_stat_ctime(VALUE self)
/* /*
* call-seq: * call-seq:
* stat.inspect => string * stat.inspect -> string
* *
* Produce a nicely formatted description of <i>stat</i>. * Produce a nicely formatted description of <i>stat</i>.
* *
@ -840,7 +840,7 @@ w32_io_info(VALUE *file, BY_HANDLE_FILE_INFORMATION *st)
/* /*
* call-seq: * call-seq:
* File.stat(file_name) => stat * File.stat(file_name) -> stat
* *
* Returns a <code>File::Stat</code> object for the named file (see * Returns a <code>File::Stat</code> object for the named file (see
* <code>File::Stat</code>). * <code>File::Stat</code>).
@ -864,7 +864,7 @@ rb_file_s_stat(VALUE klass, VALUE fname)
/* /*
* call-seq: * call-seq:
* ios.stat => stat * ios.stat -> stat
* *
* Returns status information for <em>ios</em> as an object of type * Returns status information for <em>ios</em> as an object of type
* <code>File::Stat</code>. * <code>File::Stat</code>.
@ -893,7 +893,7 @@ rb_io_stat(VALUE obj)
/* /*
* call-seq: * call-seq:
* File.lstat(file_name) => stat * File.lstat(file_name) -> stat
* *
* Same as <code>File::stat</code>, but does not follow the last symbolic * Same as <code>File::stat</code>, but does not follow the last symbolic
* link. Instead, reports on the link itself. * link. Instead, reports on the link itself.
@ -925,7 +925,7 @@ rb_file_s_lstat(VALUE klass, VALUE fname)
/* /*
* call-seq: * call-seq:
* file.lstat => stat * file.lstat -> stat
* *
* Same as <code>IO#stat</code>, but does not follow the last symbolic * Same as <code>IO#stat</code>, but does not follow the last symbolic
* link. Instead, reports on the link itself. * link. Instead, reports on the link itself.
@ -1053,8 +1053,8 @@ access_internal(const char *path, int mode)
*/ */
/* /*
* File.directory?(file_name) => true or false * File.directory?(file_name) -> true or false
* File.directory?(file_name) => true or false * File.directory?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file is a directory, * Returns <code>true</code> if the named file is a directory,
* <code>false</code> otherwise. * <code>false</code> otherwise.
@ -1066,8 +1066,8 @@ access_internal(const char *path, int mode)
* Document-method: exist? * Document-method: exist?
* *
* call-seq: * call-seq:
* Dir.exist?(file_name) => true or false * Dir.exist?(file_name) -> true or false
* Dir.exists?(file_name) => true or false * Dir.exists?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file is a directory, * Returns <code>true</code> if the named file is a directory,
* <code>false</code> otherwise. * <code>false</code> otherwise.
@ -1078,7 +1078,7 @@ access_internal(const char *path, int mode)
* Document-method: directory? * Document-method: directory?
* *
* call-seq: * call-seq:
* File.directory?(file_name) => true or false * File.directory?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file is a directory, * Returns <code>true</code> if the named file is a directory,
* <code>false</code> otherwise. * <code>false</code> otherwise.
@ -1102,7 +1102,7 @@ rb_file_directory_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.pipe?(file_name) => true or false * File.pipe?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file is a pipe. * Returns <code>true</code> if the named file is a pipe.
*/ */
@ -1126,7 +1126,7 @@ rb_file_pipe_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.symlink?(file_name) => true or false * File.symlink?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file is a symbolic link. * Returns <code>true</code> if the named file is a symbolic link.
*/ */
@ -1163,7 +1163,7 @@ rb_file_symlink_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.socket?(file_name) => true or false * File.socket?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file is a socket. * Returns <code>true</code> if the named file is a socket.
*/ */
@ -1197,7 +1197,7 @@ rb_file_socket_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.blockdev?(file_name) => true or false * File.blockdev?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file is a block device. * Returns <code>true</code> if the named file is a block device.
*/ */
@ -1225,7 +1225,7 @@ rb_file_blockdev_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.chardev?(file_name) => true or false * File.chardev?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file is a character device. * Returns <code>true</code> if the named file is a character device.
*/ */
@ -1246,8 +1246,8 @@ rb_file_chardev_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.exist?(file_name) => true or false * File.exist?(file_name) -> true or false
* File.exists?(file_name) => true or false * File.exists?(file_name) -> true or false
* *
* Return <code>true</code> if the named file exists. * Return <code>true</code> if the named file exists.
*/ */
@ -1263,7 +1263,7 @@ rb_file_exist_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.readable?(file_name) => true or false * File.readable?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file is readable by the effective * Returns <code>true</code> if the named file is readable by the effective
* user id of this process. * user id of this process.
@ -1281,7 +1281,7 @@ rb_file_readable_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.readable_real?(file_name) => true or false * File.readable_real?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file is readable by the real * Returns <code>true</code> if the named file is readable by the real
* user id of this process. * user id of this process.
@ -1307,7 +1307,7 @@ rb_file_readable_real_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.world_readable?(file_name) => fixnum or nil * File.world_readable?(file_name) -> fixnum or nil
* *
* If <i>file_name</i> is readable by others, returns an integer * If <i>file_name</i> is readable by others, returns an integer
* representing the file permission bits of <i>file_name</i>. Returns * representing the file permission bits of <i>file_name</i>. Returns
@ -1335,7 +1335,7 @@ rb_file_world_readable_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.writable?(file_name) => true or false * File.writable?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file is writable by the effective * Returns <code>true</code> if the named file is writable by the effective
* user id of this process. * user id of this process.
@ -1353,7 +1353,7 @@ rb_file_writable_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.writable_real?(file_name) => true or false * File.writable_real?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file is writable by the real * Returns <code>true</code> if the named file is writable by the real
* user id of this process. * user id of this process.
@ -1371,7 +1371,7 @@ rb_file_writable_real_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.world_writable?(file_name) => fixnum or nil * File.world_writable?(file_name) -> fixnum or nil
* *
* If <i>file_name</i> is writable by others, returns an integer * If <i>file_name</i> is writable by others, returns an integer
* representing the file permission bits of <i>file_name</i>. Returns * representing the file permission bits of <i>file_name</i>. Returns
@ -1399,7 +1399,7 @@ rb_file_world_writable_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.executable?(file_name) => true or false * File.executable?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file is executable by the effective * Returns <code>true</code> if the named file is executable by the effective
* user id of this process. * user id of this process.
@ -1417,7 +1417,7 @@ rb_file_executable_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.executable_real?(file_name) => true or false * File.executable_real?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file is executable by the real * Returns <code>true</code> if the named file is executable by the real
* user id of this process. * user id of this process.
@ -1439,7 +1439,7 @@ rb_file_executable_real_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.file?(file_name) => true or false * File.file?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file exists and is a * Returns <code>true</code> if the named file exists and is a
* regular file. * regular file.
@ -1457,7 +1457,7 @@ rb_file_file_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.zero?(file_name) => true or false * File.zero?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file exists and has * Returns <code>true</code> if the named file exists and has
* a zero size. * a zero size.
@ -1475,7 +1475,7 @@ rb_file_zero_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.size?(file_name) => Integer or nil * File.size?(file_name) -> Integer or nil
* *
* Returns +nil+ if +file_name+ doesn't exist or has zero size, the size of the * Returns +nil+ if +file_name+ doesn't exist or has zero size, the size of the
* file otherwise. * file otherwise.
@ -1493,7 +1493,7 @@ rb_file_size_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.owned?(file_name) => true or false * File.owned?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file exists and the * Returns <code>true</code> if the named file exists and the
* effective used id of the calling process is the owner of * effective used id of the calling process is the owner of
@ -1522,7 +1522,7 @@ rb_file_rowned_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.grpowned?(file_name) => true or false * File.grpowned?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file exists and the * Returns <code>true</code> if the named file exists and the
* effective group id of the calling process is the owner of * effective group id of the calling process is the owner of
@ -1558,7 +1558,7 @@ check3rdbyte(VALUE fname, int mode)
/* /*
* call-seq: * call-seq:
* File.setuid?(file_name) => true or false * File.setuid?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file has the setuid bit set. * Returns <code>true</code> if the named file has the setuid bit set.
*/ */
@ -1575,7 +1575,7 @@ rb_file_suid_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.setgid?(file_name) => true or false * File.setgid?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file has the setgid bit set. * Returns <code>true</code> if the named file has the setgid bit set.
*/ */
@ -1592,7 +1592,7 @@ rb_file_sgid_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.sticky?(file_name) => true or false * File.sticky?(file_name) -> true or false
* *
* Returns <code>true</code> if the named file has the sticky bit set. * Returns <code>true</code> if the named file has the sticky bit set.
*/ */
@ -1609,7 +1609,7 @@ rb_file_sticky_p(VALUE obj, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.identical?(file_1, file_2) => true or false * File.identical?(file_1, file_2) -> true or false
* *
* Returns <code>true</code> if the named files are identical. * Returns <code>true</code> if the named files are identical.
* *
@ -1675,7 +1675,7 @@ rb_file_identical_p(VALUE obj, VALUE fname1, VALUE fname2)
/* /*
* call-seq: * call-seq:
* File.size(file_name) => integer * File.size(file_name) -> integer
* *
* Returns the size of <code>file_name</code>. * Returns the size of <code>file_name</code>.
*/ */
@ -1735,7 +1735,7 @@ rb_file_ftype(const struct stat *st)
/* /*
* call-seq: * call-seq:
* File.ftype(file_name) => string * File.ftype(file_name) -> string
* *
* Identifies the type of the named file; the return string is one of * Identifies the type of the named file; the return string is one of
* ``<code>file</code>'', ``<code>directory</code>'', * ``<code>file</code>'', ``<code>directory</code>'',
@ -1765,7 +1765,7 @@ rb_file_s_ftype(VALUE klass, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.atime(file_name) => time * File.atime(file_name) -> time
* *
* Returns the last access time for the named file as a Time object). * Returns the last access time for the named file as a Time object).
* *
@ -1787,7 +1787,7 @@ rb_file_s_atime(VALUE klass, VALUE fname)
/* /*
* call-seq: * call-seq:
* file.atime => time * file.atime -> time
* *
* Returns the last access time (a <code>Time</code> object) * Returns the last access time (a <code>Time</code> object)
* for <i>file</i>, or epoch if <i>file</i> has not been accessed. * for <i>file</i>, or epoch if <i>file</i> has not been accessed.
@ -1811,7 +1811,7 @@ rb_file_atime(VALUE obj)
/* /*
* call-seq: * call-seq:
* File.mtime(file_name) => time * File.mtime(file_name) -> time
* *
* Returns the modification time for the named file as a Time object. * Returns the modification time for the named file as a Time object.
* *
@ -1856,7 +1856,7 @@ rb_file_mtime(VALUE obj)
/* /*
* call-seq: * call-seq:
* File.ctime(file_name) => time * File.ctime(file_name) -> time
* *
* Returns the change time for the named file (the time at which * Returns the change time for the named file (the time at which
* directory information about the file was changed, not the file * directory information about the file was changed, not the file
@ -1904,7 +1904,7 @@ rb_file_ctime(VALUE obj)
/* /*
* call-seq: * call-seq:
* file.size => integer * file.size -> integer
* *
* Returns the size of <i>file</i> in bytes. * Returns the size of <i>file</i> in bytes.
* *
@ -1966,7 +1966,7 @@ rb_file_s_chmod(int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* file.chmod(mode_int) => 0 * file.chmod(mode_int) -> 0
* *
* Changes permission bits on <i>file</i> to the bit pattern * Changes permission bits on <i>file</i> to the bit pattern
* represented by <i>mode_int</i>. Actual effects are platform * represented by <i>mode_int</i>. Actual effects are platform
@ -2013,7 +2013,7 @@ lchmod_internal(const char *path, void *mode)
/* /*
* call-seq: * call-seq:
* File.lchmod(mode_int, file_name, ...) => integer * File.lchmod(mode_int, file_name, ...) -> integer
* *
* Equivalent to <code>File::chmod</code>, but does not follow symbolic * Equivalent to <code>File::chmod</code>, but does not follow symbolic
* links (so it will change the permissions associated with the link, * links (so it will change the permissions associated with the link,
@ -2095,7 +2095,7 @@ rb_file_s_chown(int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* file.chown(owner_int, group_int ) => 0 * file.chown(owner_int, group_int ) -> 0
* *
* Changes the owner and group of <i>file</i> to the given numeric * Changes the owner and group of <i>file</i> to the given numeric
* owner and group id's. Only a process with superuser privileges may * owner and group id's. Only a process with superuser privileges may
@ -2145,7 +2145,7 @@ lchown_internal(const char *path, void *arg)
/* /*
* call-seq: * call-seq:
* file.lchown(owner_int, group_int, file_name,..) => integer * file.lchown(owner_int, group_int, file_name,..) -> integer
* *
* Equivalent to <code>File::chown</code>, but does not follow symbolic * Equivalent to <code>File::chown</code>, but does not follow symbolic
* links (so it will change the owner associated with the link, not the * links (so it will change the owner associated with the link, not the
@ -2292,7 +2292,7 @@ utime_internal(const char *path, void *arg)
/* /*
* call-seq: * call-seq:
* File.utime(atime, mtime, file_name,...) => integer * File.utime(atime, mtime, file_name,...) -> integer
* *
* Sets the access and modification times of each * Sets the access and modification times of each
* named file to the first two arguments. Returns * named file to the first two arguments. Returns
@ -2357,7 +2357,7 @@ sys_fail2(VALUE s1, VALUE s2)
#ifdef HAVE_LINK #ifdef HAVE_LINK
/* /*
* call-seq: * call-seq:
* File.link(old_name, new_name) => 0 * File.link(old_name, new_name) -> 0
* *
* Creates a new name for an existing file using a hard link. Will not * Creates a new name for an existing file using a hard link. Will not
* overwrite <i>new_name</i> if it already exists (raising a subclass * overwrite <i>new_name</i> if it already exists (raising a subclass
@ -2388,7 +2388,7 @@ rb_file_s_link(VALUE klass, VALUE from, VALUE to)
#ifdef HAVE_SYMLINK #ifdef HAVE_SYMLINK
/* /*
* call-seq: * call-seq:
* File.symlink(old_name, new_name) => 0 * File.symlink(old_name, new_name) -> 0
* *
* Creates a symbolic link called <i>new_name</i> for the existing file * Creates a symbolic link called <i>new_name</i> for the existing file
* <i>old_name</i>. Raises a <code>NotImplemented</code> exception on * <i>old_name</i>. Raises a <code>NotImplemented</code> exception on
@ -2470,8 +2470,8 @@ unlink_internal(const char *path, void *arg)
/* /*
* call-seq: * call-seq:
* File.delete(file_name, ...) => integer * File.delete(file_name, ...) -> integer
* File.unlink(file_name, ...) => integer * File.unlink(file_name, ...) -> integer
* *
* Deletes the named files, returning the number of names * Deletes the named files, returning the number of names
* passed as arguments. Raises an exception on any error. * passed as arguments. Raises an exception on any error.
@ -2490,7 +2490,7 @@ rb_file_s_unlink(VALUE klass, VALUE args)
/* /*
* call-seq: * call-seq:
* File.rename(old_name, new_name) => 0 * File.rename(old_name, new_name) -> 0
* *
* Renames the given file to the new name. Raises a * Renames the given file to the new name. Raises a
* <code>SystemCallError</code> if the file cannot be renamed. * <code>SystemCallError</code> if the file cannot be renamed.
@ -2535,8 +2535,8 @@ rb_file_s_rename(VALUE klass, VALUE from, VALUE to)
/* /*
* call-seq: * call-seq:
* File.umask() => integer * File.umask() -> integer
* File.umask(integer) => integer * File.umask(integer) -> integer
* *
* Returns the current umask value for this process. If the optional * Returns the current umask value for this process. If the optional
* argument is given, set the umask to that value and return the * argument is given, set the umask to that value and return the
@ -3648,7 +3648,7 @@ rb_file_s_path(VALUE klass, VALUE fname)
/* /*
* call-seq: * call-seq:
* File.split(file_name) => array * File.split(file_name) -> array
* *
* Splits the given string into a directory and a file component and * Splits the given string into a directory and a file component and
* returns them in a two-element array. See also * returns them in a two-element array. See also
@ -3756,7 +3756,7 @@ rb_file_s_join(VALUE klass, VALUE args)
#if defined(HAVE_TRUNCATE) || defined(HAVE_CHSIZE) #if defined(HAVE_TRUNCATE) || defined(HAVE_CHSIZE)
/* /*
* call-seq: * call-seq:
* File.truncate(file_name, integer) => 0 * File.truncate(file_name, integer) -> 0
* *
* Truncates the file <i>file_name</i> to be at most <i>integer</i> * Truncates the file <i>file_name</i> to be at most <i>integer</i>
* bytes long. Not available on all platforms. * bytes long. Not available on all platforms.
@ -3804,7 +3804,7 @@ rb_file_s_truncate(VALUE klass, VALUE path, VALUE len)
#if defined(HAVE_FTRUNCATE) || defined(HAVE_CHSIZE) #if defined(HAVE_FTRUNCATE) || defined(HAVE_CHSIZE)
/* /*
* call-seq: * call-seq:
* file.truncate(integer) => 0 * file.truncate(integer) -> 0
* *
* Truncates <i>file</i> to at most <i>integer</i> bytes. The file * Truncates <i>file</i> to at most <i>integer</i> bytes. The file
* must be opened for writing. Not available on all platforms. * must be opened for writing. Not available on all platforms.
@ -3879,7 +3879,7 @@ rb_thread_flock(void *data)
/* /*
* call-seq: * call-seq:
* file.flock (locking_constant ) => 0 or false * file.flock (locking_constant )-> 0 or false
* *
* Locks or unlocks a file according to <i>locking_constant</i> (a * Locks or unlocks a file according to <i>locking_constant</i> (a
* logical <em>or</em> of the values in the table below). * logical <em>or</em> of the values in the table below).
@ -3985,7 +3985,7 @@ test_check(int n, int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* test(int_cmd, file1 [, file2] ) => obj * test(int_cmd, file1 [, file2] ) -> obj
* *
* Uses the integer <i>aCmd</i> to perform various tests on * Uses the integer <i>aCmd</i> to perform various tests on
* <i>file1</i> (first table below) or on <i>file1</i> and * <i>file1</i> (first table below) or on <i>file1</i> and
@ -4203,7 +4203,7 @@ rb_stat_s_alloc(VALUE klass)
/* /*
* call-seq: * call-seq:
* *
* File::Stat.new(file_name) => stat * File::Stat.new(file_name) -> stat
* *
* Create a File::Stat object for the given file name (raising an * Create a File::Stat object for the given file name (raising an
* exception if the file doesn't exist). * exception if the file doesn't exist).
@ -4258,7 +4258,7 @@ rb_stat_init_copy(VALUE copy, VALUE orig)
/* /*
* call-seq: * call-seq:
* stat.ftype => string * stat.ftype -> string
* *
* Identifies the type of <i>stat</i>. The return string is one of: * Identifies the type of <i>stat</i>. The return string is one of:
* ``<code>file</code>'', ``<code>directory</code>'', * ``<code>file</code>'', ``<code>directory</code>'',
@ -4278,7 +4278,7 @@ rb_stat_ftype(VALUE obj)
/* /*
* call-seq: * call-seq:
* stat.directory? => true or false * stat.directory? -> true or false
* *
* Returns <code>true</code> if <i>stat</i> is a directory, * Returns <code>true</code> if <i>stat</i> is a directory,
* <code>false</code> otherwise. * <code>false</code> otherwise.
@ -4296,7 +4296,7 @@ rb_stat_d(VALUE obj)
/* /*
* call-seq: * call-seq:
* stat.pipe? => true or false * stat.pipe? -> true or false
* *
* Returns <code>true</code> if the operating system supports pipes and * Returns <code>true</code> if the operating system supports pipes and
* <i>stat</i> is a pipe; <code>false</code> otherwise. * <i>stat</i> is a pipe; <code>false</code> otherwise.
@ -4314,7 +4314,7 @@ rb_stat_p(VALUE obj)
/* /*
* call-seq: * call-seq:
* stat.symlink? => true or false * stat.symlink? -> true or false
* *
* Returns <code>true</code> if <i>stat</i> is a symbolic link, * Returns <code>true</code> if <i>stat</i> is a symbolic link,
* <code>false</code> if it isn't or if the operating system doesn't * <code>false</code> if it isn't or if the operating system doesn't
@ -4340,7 +4340,7 @@ rb_stat_l(VALUE obj)
/* /*
* call-seq: * call-seq:
* stat.socket? => true or false * stat.socket? -> true or false
* *
* Returns <code>true</code> if <i>stat</i> is a socket, * Returns <code>true</code> if <i>stat</i> is a socket,
* <code>false</code> if it isn't or if the operating system doesn't * <code>false</code> if it isn't or if the operating system doesn't
@ -4362,7 +4362,7 @@ rb_stat_S(VALUE obj)
/* /*
* call-seq: * call-seq:
* stat.blockdev? => true or false * stat.blockdev? -> true or false
* *
* Returns <code>true</code> if the file is a block device, * Returns <code>true</code> if the file is a block device,
* <code>false</code> if it isn't or if the operating system doesn't * <code>false</code> if it isn't or if the operating system doesn't
@ -4385,7 +4385,7 @@ rb_stat_b(VALUE obj)
/* /*
* call-seq: * call-seq:
* stat.chardev? => true or false * stat.chardev? -> true or false
* *
* Returns <code>true</code> if the file is a character device, * Returns <code>true</code> if the file is a character device,
* <code>false</code> if it isn't or if the operating system doesn't * <code>false</code> if it isn't or if the operating system doesn't
@ -4405,7 +4405,7 @@ rb_stat_c(VALUE obj)
/* /*
* call-seq: * call-seq:
* stat.owned? => true or false * stat.owned? -> true or false
* *
* Returns <code>true</code> if the effective user id of the process is * Returns <code>true</code> if the effective user id of the process is
* the same as the owner of <i>stat</i>. * the same as the owner of <i>stat</i>.
@ -4431,7 +4431,7 @@ rb_stat_rowned(VALUE obj)
/* /*
* call-seq: * call-seq:
* stat.grpowned? => true or false * stat.grpowned? -> true or false
* *
* Returns true if the effective group id of the process is the same as * Returns true if the effective group id of the process is the same as
* the group id of <i>stat</i>. On Windows NT, returns <code>false</code>. * the group id of <i>stat</i>. On Windows NT, returns <code>false</code>.
@ -4452,7 +4452,7 @@ rb_stat_grpowned(VALUE obj)
/* /*
* call-seq: * call-seq:
* stat.readable? => true or false * stat.readable? -> true or false
* *
* Returns <code>true</code> if <i>stat</i> is readable by the * Returns <code>true</code> if <i>stat</i> is readable by the
* effective user id of this process. * effective user id of this process.
@ -4518,7 +4518,7 @@ rb_stat_R(VALUE obj)
/* /*
* call-seq: * call-seq:
* stat.world_readable? => fixnum or nil * stat.world_readable? -> fixnum or nil
* *
* If <i>stat</i> is readable by others, returns an integer * If <i>stat</i> is readable by others, returns an integer
* representing the file permission bits of <i>stat</i>. Returns * representing the file permission bits of <i>stat</i>. Returns
@ -4610,7 +4610,7 @@ rb_stat_W(VALUE obj)
/* /*
* call-seq: * call-seq:
* stat.world_writable? => fixnum or nil * stat.world_writable? -> fixnum or nil
* *
* If <i>stat</i> is writable by others, returns an integer * If <i>stat</i> is writable by others, returns an integer
* representing the file permission bits of <i>stat</i>. Returns * representing the file permission bits of <i>stat</i>. Returns
@ -4636,7 +4636,7 @@ rb_stat_ww(VALUE obj)
/* /*
* call-seq: * call-seq:
* stat.executable? => true or false * stat.executable? -> true or false
* *
* Returns <code>true</code> if <i>stat</i> is executable or if the * Returns <code>true</code> if <i>stat</i> is executable or if the
* operating system doesn't distinguish executable files from * operating system doesn't distinguish executable files from
@ -4673,7 +4673,7 @@ rb_stat_x(VALUE obj)
/* /*
* call-seq: * call-seq:
* stat.executable_real? => true or false * stat.executable_real? -> true or false
* *
* Same as <code>executable?</code>, but tests using the real owner of * Same as <code>executable?</code>, but tests using the real owner of
* the process. * the process.
@ -4705,7 +4705,7 @@ rb_stat_X(VALUE obj)
/* /*
* call-seq: * call-seq:
* stat.file? => true or false * stat.file? -> true or false
* *
* Returns <code>true</code> if <i>stat</i> is a regular file (not * Returns <code>true</code> if <i>stat</i> is a regular file (not
* a device file, pipe, socket, etc.). * a device file, pipe, socket, etc.).
@ -4723,7 +4723,7 @@ rb_stat_f(VALUE obj)
/* /*
* call-seq: * call-seq:
* stat.zero? => true or false * stat.zero? -> true or false
* *
* Returns <code>true</code> if <i>stat</i> is a zero-length file; * Returns <code>true</code> if <i>stat</i> is a zero-length file;
* <code>false</code> otherwise. * <code>false</code> otherwise.
@ -4741,7 +4741,7 @@ rb_stat_z(VALUE obj)
/* /*
* call-seq: * call-seq:
* state.size => integer * state.size -> integer
* *
* Returns the size of <i>stat</i> in bytes. * Returns the size of <i>stat</i> in bytes.
* *
@ -4760,7 +4760,7 @@ rb_stat_s(VALUE obj)
/* /*
* call-seq: * call-seq:
* stat.setuid? => true or false * stat.setuid? -> true or false
* *
* Returns <code>true</code> if <i>stat</i> has the set-user-id * Returns <code>true</code> if <i>stat</i> has the set-user-id
* permission bit set, <code>false</code> if it doesn't or if the * permission bit set, <code>false</code> if it doesn't or if the
@ -4780,7 +4780,7 @@ rb_stat_suid(VALUE obj)
/* /*
* call-seq: * call-seq:
* stat.setgid? => true or false * stat.setgid? -> true or false
* *
* Returns <code>true</code> if <i>stat</i> has the set-group-id * Returns <code>true</code> if <i>stat</i> has the set-group-id
* permission bit set, <code>false</code> if it doesn't or if the * permission bit set, <code>false</code> if it doesn't or if the
@ -4801,7 +4801,7 @@ rb_stat_sgid(VALUE obj)
/* /*
* call-seq: * call-seq:
* stat.sticky? => true or false * stat.sticky? -> true or false
* *
* Returns <code>true</code> if <i>stat</i> has its sticky bit set, * Returns <code>true</code> if <i>stat</i> has its sticky bit set,
* <code>false</code> if it doesn't or if the operating system doesn't * <code>false</code> if it doesn't or if the operating system doesn't

32
gc.c
View file

@ -485,7 +485,7 @@ rb_memerror(void)
/* /*
* call-seq: * call-seq:
* GC.stress => true or false * GC.stress -> true or false
* *
* returns current status of GC stress mode. * returns current status of GC stress mode.
*/ */
@ -499,7 +499,7 @@ gc_stress_get(VALUE self)
/* /*
* call-seq: * call-seq:
* GC.stress = bool => bool * GC.stress = bool -> bool
* *
* updates GC stress mode. * updates GC stress mode.
* *
@ -520,7 +520,7 @@ gc_stress_set(VALUE self, VALUE flag)
/* /*
* call-seq: * call-seq:
* GC::Profiler.enable? => true or false * GC::Profiler.enable? -> true or false
* *
* returns current status of GC profile mode. * returns current status of GC profile mode.
*/ */
@ -534,7 +534,7 @@ gc_profile_enable_get(VALUE self)
/* /*
* call-seq: * call-seq:
* GC::Profiler.enable => nil * GC::Profiler.enable -> nil
* *
* updates GC profile mode. * updates GC profile mode.
* start profiler for GC. * start profiler for GC.
@ -552,7 +552,7 @@ gc_profile_enable(void)
/* /*
* call-seq: * call-seq:
* GC::Profiler.disable => nil * GC::Profiler.disable -> nil
* *
* updates GC profile mode. * updates GC profile mode.
* stop profiler for GC. * stop profiler for GC.
@ -570,7 +570,7 @@ gc_profile_disable(void)
/* /*
* call-seq: * call-seq:
* GC::Profiler.clear => nil * GC::Profiler.clear -> nil
* *
* clear before profile data. * clear before profile data.
* *
@ -782,7 +782,7 @@ ruby_xfree(void *x)
/* /*
* call-seq: * call-seq:
* GC.enable => true or false * GC.enable -> true or false
* *
* Enables garbage collection, returning <code>true</code> if garbage * Enables garbage collection, returning <code>true</code> if garbage
* collection was previously disabled. * collection was previously disabled.
@ -805,7 +805,7 @@ rb_gc_enable(void)
/* /*
* call-seq: * call-seq:
* GC.disable => true or false * GC.disable -> true or false
* *
* Disables garbage collection, returning <code>true</code> if garbage * Disables garbage collection, returning <code>true</code> if garbage
* collection was already disabled. * collection was already disabled.
@ -2237,9 +2237,9 @@ rb_gc_mark_machine_stack(rb_thread_t *th)
/* /*
* call-seq: * call-seq:
* GC.start => nil * GC.start -> nil
* gc.garbage_collect => nil * gc.garbage_collect -> nil
* ObjectSpace.garbage_collect => nil * ObjectSpace.garbage_collect -> nil
* *
* Initiates garbage collection, unless manually disabled. * Initiates garbage collection, unless manually disabled.
* *
@ -2423,8 +2423,8 @@ os_obj_of(VALUE of)
/* /*
* call-seq: * call-seq:
* ObjectSpace.each_object([module]) {|obj| ... } => fixnum * ObjectSpace.each_object([module]) {|obj| ... } -> fixnum
* ObjectSpace.each_object([module]) => an_enumerator * ObjectSpace.each_object([module]) -> an_enumerator
* *
* Calls the block once for each living, nonimmediate object in this * Calls the block once for each living, nonimmediate object in this
* Ruby process. If <i>module</i> is specified, calls the block * Ruby process. If <i>module</i> is specified, calls the block
@ -2804,8 +2804,8 @@ id2ref(VALUE obj, VALUE objid)
* Document-method: object_id * Document-method: object_id
* *
* call-seq: * call-seq:
* obj.__id__ => fixnum * obj.__id__ -> fixnum
* obj.object_id => fixnum * obj.object_id -> fixnum
* *
* Returns an integer identifier for <i>obj</i>. The same number will * Returns an integer identifier for <i>obj</i>. The same number will
* be returned on all calls to <code>id</code> for a given object, and * be returned on all calls to <code>id</code> for a given object, and
@ -2817,7 +2817,7 @@ id2ref(VALUE obj, VALUE objid)
/* /*
* call-seq: * call-seq:
* obj.hash => fixnum * obj.hash -> fixnum
* *
* Generates a <code>Fixnum</code> hash value for this object. This * Generates a <code>Fixnum</code> hash value for this object. This
* function must have the property that <code>a.eql?(b)</code> implies * function must have the property that <code>a.eql?(b)</code> implies

86
hash.c
View file

@ -290,9 +290,9 @@ default_proc_arity_check(VALUE proc)
/* /*
* call-seq: * call-seq:
* Hash.new => hash * Hash.new -> new_hash
* Hash.new(obj) => aHash * Hash.new(obj) -> new_hash
* Hash.new {|hash, key| block } => aHash * Hash.new {|hash, key| block } -> new_hash
* *
* Returns a new, empty hash. If this hash is subsequently accessed by * Returns a new, empty hash. If this hash is subsequently accessed by
* a key that doesn't correspond to a hash entry, the value returned * a key that doesn't correspond to a hash entry, the value returned
@ -348,9 +348,9 @@ rb_hash_initialize(int argc, VALUE *argv, VALUE hash)
/* /*
* call-seq: * call-seq:
* Hash[ key, value, ... ] => hash * Hash[ key, value, ... ] -> new_hash
* Hash[ [ [key, value], ... ] ] => hash * Hash[ [ [key, value], ... ] ] -> new_hash
* Hash[ object ] => hash * Hash[ object ] -> new_hash
* *
* Creates a new hash populated with the given objects. Equivalent to * Creates a new hash populated with the given objects. Equivalent to
* the literal <code>{ <i>key</i> => <i>value</i>, ... }</code>. In the first * the literal <code>{ <i>key</i> => <i>value</i>, ... }</code>. In the first
@ -485,7 +485,7 @@ rb_hash_rehash(VALUE hash)
/* /*
* call-seq: * call-seq:
* hsh[key] => value * hsh[key] -> value
* *
* Element Reference---Retrieves the <i>value</i> object corresponding * Element Reference---Retrieves the <i>value</i> object corresponding
* to the <i>key</i> object. If not found, returns the default value (see * to the <i>key</i> object. If not found, returns the default value (see
@ -527,8 +527,8 @@ rb_hash_lookup(VALUE hash, VALUE key)
/* /*
* call-seq: * call-seq:
* hsh.fetch(key [, default] ) => obj * hsh.fetch(key [, default] ) -> obj
* hsh.fetch(key) {| key | block } => obj * hsh.fetch(key) {| key | block } -> obj
* *
* Returns a value from the hash for the given key. If the key can't be * Returns a value from the hash for the given key. If the key can't be
* found, there are several options: With no other arguments, it will * found, there are several options: With no other arguments, it will
@ -589,7 +589,7 @@ rb_hash_fetch(VALUE hash, VALUE key)
/* /*
* call-seq: * call-seq:
* hsh.default(key=nil) => obj * hsh.default(key=nil) -> obj
* *
* Returns the default value, the value that would be returned by * Returns the default value, the value that would be returned by
* <i>hsh</i>[<i>key</i>] if <i>key</i> did not exist in <i>hsh</i>. * <i>hsh</i>[<i>key</i>] if <i>key</i> did not exist in <i>hsh</i>.
@ -624,7 +624,7 @@ rb_hash_default(int argc, VALUE *argv, VALUE hash)
/* /*
* call-seq: * call-seq:
* hsh.default = obj => obj * hsh.default = obj -> obj
* *
* Sets the default value, the value returned for a key that does not * Sets the default value, the value returned for a key that does not
* exist in the hash. It is not possible to set the default to a * exist in the hash. It is not possible to set the default to a
@ -679,7 +679,7 @@ VALUE rb_obj_is_proc(VALUE proc);
/* /*
* call-seq: * call-seq:
* hsh.default_proc = proc_obj => proc_obj * hsh.default_proc = proc_obj -> proc_obj
* *
* Sets the default proc to be executed on each key lookup. * Sets the default proc to be executed on each key lookup.
* *
@ -723,7 +723,7 @@ key_i(VALUE key, VALUE value, VALUE arg)
/* /*
* call-seq: * call-seq:
* hsh.key(value) => key * hsh.key(value) -> key
* *
* Returns the key for a given value. If not found, returns <code>nil</code>. * Returns the key for a given value. If not found, returns <code>nil</code>.
* *
@ -774,8 +774,8 @@ rb_hash_delete_key(VALUE hash, VALUE key)
/* /*
* call-seq: * call-seq:
* hsh.delete(key) => value * hsh.delete(key) -> value
* hsh.delete(key) {| key | block } => value * hsh.delete(key) {| key | block } -> value
* *
* Deletes and returns a key-value pair from <i>hsh</i> whose key is * Deletes and returns a key-value pair from <i>hsh</i> whose key is
* equal to <i>key</i>. If the key is not found, returns the * equal to <i>key</i>. If the key is not found, returns the
@ -945,7 +945,7 @@ rb_hash_reject(VALUE hash)
/* /*
* call-seq: * call-seq:
* hsh.values_at(key, ...) => array * hsh.values_at(key, ...) -> array
* *
* Return an array containing the values associated with the given keys. * Return an array containing the values associated with the given keys.
* Also see <code>Hash.select</code>. * Also see <code>Hash.select</code>.
@ -977,8 +977,8 @@ select_i(VALUE key, VALUE value, VALUE result)
/* /*
* call-seq: * call-seq:
* hsh.select {|key, value| block} => a_hash * hsh.select {|key, value| block} -> a_hash
* hsh.select => an_enumerator * hsh.select -> an_enumerator
* *
* Returns a new hash consisting of entries for which the block returns true. * Returns a new hash consisting of entries for which the block returns true.
* *
@ -1090,8 +1090,8 @@ rb_hash_clear(VALUE hash)
/* /*
* call-seq: * call-seq:
* hsh[key] = value => value * hsh[key] = value -> value
* hsh.store(key, value) => value * hsh.store(key, value) -> value
* *
* Element Assignment---Associates the value given by * Element Assignment---Associates the value given by
* <i>value</i> with the key given by <i>key</i>. * <i>value</i> with the key given by <i>key</i>.
@ -1167,8 +1167,8 @@ rb_hash_replace(VALUE hash, VALUE hash2)
/* /*
* call-seq: * call-seq:
* hsh.length => fixnum * hsh.length -> fixnum
* hsh.size => fixnum * hsh.size -> fixnum
* *
* Returns the number of key-value pairs in the hash. * Returns the number of key-value pairs in the hash.
* *
@ -1189,7 +1189,7 @@ rb_hash_size(VALUE hash)
/* /*
* call-seq: * call-seq:
* hsh.empty? => true or false * hsh.empty? -> true or false
* *
* Returns <code>true</code> if <i>hsh</i> contains no key-value pairs. * Returns <code>true</code> if <i>hsh</i> contains no key-value pairs.
* *
@ -1377,8 +1377,8 @@ inspect_hash(VALUE hash, VALUE dummy, int recur)
/* /*
* call-seq: * call-seq:
* hsh.to_s => string * hsh.to_s -> string
* hsh.inspect => string * hsh.inspect -> string
* *
* Return the contents of this hash as a string. * Return the contents of this hash as a string.
* *
@ -1417,7 +1417,7 @@ keys_i(VALUE key, VALUE value, VALUE ary)
/* /*
* call-seq: * call-seq:
* hsh.keys => array * hsh.keys -> array
* *
* Returns a new array populated with the keys from this hash. See also * Returns a new array populated with the keys from this hash. See also
* <code>Hash#values</code>. * <code>Hash#values</code>.
@ -1448,7 +1448,7 @@ values_i(VALUE key, VALUE value, VALUE ary)
/* /*
* call-seq: * call-seq:
* hsh.values => array * hsh.values -> array
* *
* Returns a new array populated with the values from <i>hsh</i>. See * Returns a new array populated with the values from <i>hsh</i>. See
* also <code>Hash#keys</code>. * also <code>Hash#keys</code>.
@ -1471,10 +1471,10 @@ rb_hash_values(VALUE hash)
/* /*
* call-seq: * call-seq:
* hsh.has_key?(key) => true or false * hsh.has_key?(key) -> true or false
* hsh.include?(key) => true or false * hsh.include?(key) -> true or false
* hsh.key?(key) => true or false * hsh.key?(key) -> true or false
* hsh.member?(key) => true or false * hsh.member?(key) -> true or false
* *
* Returns <code>true</code> if the given key is present in <i>hsh</i>. * Returns <code>true</code> if the given key is present in <i>hsh</i>.
* *
@ -1510,8 +1510,8 @@ rb_hash_search_value(VALUE key, VALUE value, VALUE arg)
/* /*
* call-seq: * call-seq:
* hsh.has_value?(value) => true or false * hsh.has_value?(value) -> true or false
* hsh.value?(value) => true or false * hsh.value?(value) -> true or false
* *
* Returns <code>true</code> if the given value is present for some key * Returns <code>true</code> if the given value is present for some key
* in <i>hsh</i>. * in <i>hsh</i>.
@ -1603,7 +1603,7 @@ hash_equal(VALUE hash1, VALUE hash2, int eql)
/* /*
* call-seq: * call-seq:
* hsh == other_hash => true or false * hsh == other_hash -> true or false
* *
* Equality---Two hashes are equal if they each contain the same number * Equality---Two hashes are equal if they each contain the same number
* of keys and if each key-value pair is equal to (according to * of keys and if each key-value pair is equal to (according to
@ -1689,7 +1689,7 @@ rb_hash_invert_i(VALUE key, VALUE value, VALUE hash)
/* /*
* call-seq: * call-seq:
* hsh.invert -> aHash * hsh.invert -> new_hash
* *
* Returns a new hash created by using <i>hsh</i>'s values as keys, and * Returns a new hash created by using <i>hsh</i>'s values as keys, and
* the keys as values. * the keys as values.
@ -1731,10 +1731,10 @@ rb_hash_update_block_i(VALUE key, VALUE value, VALUE hash)
/* /*
* call-seq: * call-seq:
* hsh.merge!(other_hash) => hsh * hsh.merge!(other_hash) -> hsh
* hsh.update(other_hash) => hsh * hsh.update(other_hash) -> hsh
* hsh.merge!(other_hash){|key, oldval, newval| block} => hsh * hsh.merge!(other_hash){|key, oldval, newval| block} -> hsh
* hsh.update(other_hash){|key, oldval, newval| block} => hsh * hsh.update(other_hash){|key, oldval, newval| block} -> hsh
* *
* Adds the contents of <i>other_hash</i> to <i>hsh</i>. If no * Adds the contents of <i>other_hash</i> to <i>hsh</i>. If no
* block is specified, entries with duplicate keys are overwritten * block is specified, entries with duplicate keys are overwritten
@ -1768,8 +1768,8 @@ rb_hash_update(VALUE hash1, VALUE hash2)
/* /*
* call-seq: * call-seq:
* hsh.merge(other_hash) -> a_hash * hsh.merge(other_hash) -> new_hash
* hsh.merge(other_hash){|key, oldval, newval| block} -> a_hash * hsh.merge(other_hash){|key, oldval, newval| block} -> new_hash
* *
* Returns a new hash containing the contents of <i>other_hash</i> and * Returns a new hash containing the contents of <i>other_hash</i> and
* the contents of <i>hsh</i>. If no block is specified, the value for * the contents of <i>hsh</i>. If no block is specified, the value for
@ -1900,7 +1900,7 @@ rb_hash_flatten(int argc, VALUE *argv, VALUE hash)
/* /*
* call-seq: * call-seq:
* hsh.compare_by_identity => hsh * hsh.compare_by_identity -> hsh
* *
* Makes <i>hsh</i> compare its keys by their identity, i.e. it * Makes <i>hsh</i> compare its keys by their identity, i.e. it
* will consider exact same objects as same keys. * will consider exact same objects as same keys.
@ -1925,7 +1925,7 @@ rb_hash_compare_by_id(VALUE hash)
/* /*
* call-seq: * call-seq:
* hsh.compare_by_identity? => true or false * hsh.compare_by_identity? -> true or false
* *
* Returns <code>true</code> if <i>hsh</i> will compare its keys by * Returns <code>true</code> if <i>hsh</i> will compare its keys by
* their identity. Also see <code>Hash#compare_by_identity</code>. * their identity. Also see <code>Hash#compare_by_identity</code>.

416
io.c

File diff suppressed because it is too large Load diff

12
load.c
View file

@ -348,7 +348,7 @@ rb_load_protect(VALUE fname, int wrap, int *state)
/* /*
* call-seq: * call-seq:
* load(filename, wrap=false) => true * load(filename, wrap=false) -> true
* *
* Loads and executes the Ruby * Loads and executes the Ruby
* program in the file _filename_. If the filename does not * program in the file _filename_. If the filename does not
@ -422,7 +422,7 @@ load_unlock(const char *ftptr, int done)
/* /*
* call-seq: * call-seq:
* require(string) => true or false * require(string) -> true or false
* *
* Ruby tries to load the library named _string_, returning * Ruby tries to load the library named _string_, returning
* +true+ if successful. If the filename does not resolve to * +true+ if successful. If the filename does not resolve to
@ -651,7 +651,7 @@ ruby_init_ext(const char *name, void (*init)(void))
/* /*
* call-seq: * call-seq:
* mod.autoload(module, filename) => nil * mod.autoload(module, filename) -> nil
* *
* Registers _filename_ to be loaded (using <code>Kernel::require</code>) * Registers _filename_ to be loaded (using <code>Kernel::require</code>)
* the first time that _module_ (which may be a <code>String</code> or * the first time that _module_ (which may be a <code>String</code> or
@ -675,7 +675,7 @@ rb_mod_autoload(VALUE mod, VALUE sym, VALUE file)
/* /*
* call-seq: * call-seq:
* mod.autoload?(name) => String or nil * mod.autoload?(name) -> String or nil
* *
* Returns _filename_ to be loaded if _name_ is registered as * Returns _filename_ to be loaded if _name_ is registered as
* +autoload+ in the namespace of _mod_. * +autoload+ in the namespace of _mod_.
@ -694,7 +694,7 @@ rb_mod_autoload_p(VALUE mod, VALUE sym)
/* /*
* call-seq: * call-seq:
* autoload(module, filename) => nil * autoload(module, filename) -> nil
* *
* Registers _filename_ to be loaded (using <code>Kernel::require</code>) * Registers _filename_ to be loaded (using <code>Kernel::require</code>)
* the first time that _module_ (which may be a <code>String</code> or * the first time that _module_ (which may be a <code>String</code> or
@ -715,7 +715,7 @@ rb_f_autoload(VALUE obj, VALUE sym, VALUE file)
/* /*
* call-seq: * call-seq:
* autoload?(name) => String or nil * autoload?(name) -> String or nil
* *
* Returns _filename_ to be loaded if _name_ is registered as * Returns _filename_ to be loaded if _name_ is registered as
* +autoload+. * +autoload+.

View file

@ -869,7 +869,7 @@ clear_dump_arg(struct dump_arg *arg)
/* /*
* call-seq: * call-seq:
* dump( obj [, anIO] , limit=--1 ) => anIO * dump( obj [, anIO] , limit=--1 ) -> anIO
* *
* Serializes obj and all descendant objects. If anIO is * Serializes obj and all descendant objects. If anIO is
* specified, the serialized data will be written to it, otherwise the * specified, the serialized data will be written to it, otherwise the
@ -1753,8 +1753,8 @@ clear_load_arg(struct load_arg *arg)
/* /*
* call-seq: * call-seq:
* load( source [, proc] ) => obj * load( source [, proc] ) -> obj
* restore( source [, proc] ) => obj * restore( source [, proc] ) -> obj
* *
* Returns the result of converting the serialized data in source into a * Returns the result of converting the serialized data in source into a
* Ruby object (possibly with associated subordinate objects). source * Ruby object (possibly with associated subordinate objects). source

52
math.c
View file

@ -30,7 +30,7 @@ extern VALUE rb_to_float(VALUE val);
/* /*
* call-seq: * call-seq:
* Math.atan2(y, x) => float * Math.atan2(y, x) -> float
* *
* Computes the arc tangent given <i>y</i> and <i>x</i>. Returns * Computes the arc tangent given <i>y</i> and <i>x</i>. Returns
* -PI..PI. * -PI..PI.
@ -63,7 +63,7 @@ math_atan2(VALUE obj, VALUE y, VALUE x)
/* /*
* call-seq: * call-seq:
* Math.cos(x) => float * Math.cos(x) -> float
* *
* Computes the cosine of <i>x</i> (expressed in radians). Returns * Computes the cosine of <i>x</i> (expressed in radians). Returns
* -1..1. * -1..1.
@ -78,7 +78,7 @@ math_cos(VALUE obj, VALUE x)
/* /*
* call-seq: * call-seq:
* Math.sin(x) => float * Math.sin(x) -> float
* *
* Computes the sine of <i>x</i> (expressed in radians). Returns * Computes the sine of <i>x</i> (expressed in radians). Returns
* -1..1. * -1..1.
@ -95,7 +95,7 @@ math_sin(VALUE obj, VALUE x)
/* /*
* call-seq: * call-seq:
* Math.tan(x) => float * Math.tan(x) -> float
* *
* Returns the tangent of <i>x</i> (expressed in radians). * Returns the tangent of <i>x</i> (expressed in radians).
*/ */
@ -110,7 +110,7 @@ math_tan(VALUE obj, VALUE x)
/* /*
* call-seq: * call-seq:
* Math.acos(x) => float * Math.acos(x) -> float
* *
* Computes the arc cosine of <i>x</i>. Returns 0..PI. * Computes the arc cosine of <i>x</i>. Returns 0..PI.
*/ */
@ -130,7 +130,7 @@ math_acos(VALUE obj, VALUE x)
/* /*
* call-seq: * call-seq:
* Math.asin(x) => float * Math.asin(x) -> float
* *
* Computes the arc sine of <i>x</i>. Returns -{PI/2} .. {PI/2}. * Computes the arc sine of <i>x</i>. Returns -{PI/2} .. {PI/2}.
*/ */
@ -150,7 +150,7 @@ math_asin(VALUE obj, VALUE x)
/* /*
* call-seq: * call-seq:
* Math.atan(x) => float * Math.atan(x) -> float
* *
* Computes the arc tangent of <i>x</i>. Returns -{PI/2} .. {PI/2}. * Computes the arc tangent of <i>x</i>. Returns -{PI/2} .. {PI/2}.
*/ */
@ -172,7 +172,7 @@ cosh(double x)
/* /*
* call-seq: * call-seq:
* Math.cosh(x) => float * Math.cosh(x) -> float
* *
* Computes the hyperbolic cosine of <i>x</i> (expressed in radians). * Computes the hyperbolic cosine of <i>x</i> (expressed in radians).
*/ */
@ -195,7 +195,7 @@ sinh(double x)
/* /*
* call-seq: * call-seq:
* Math.sinh(x) => float * Math.sinh(x) -> float
* *
* Computes the hyperbolic sine of <i>x</i> (expressed in * Computes the hyperbolic sine of <i>x</i> (expressed in
* radians). * radians).
@ -218,7 +218,7 @@ tanh(double x)
/* /*
* call-seq: * call-seq:
* Math.tanh() => float * Math.tanh() -> float
* *
* Computes the hyperbolic tangent of <i>x</i> (expressed in * Computes the hyperbolic tangent of <i>x</i> (expressed in
* radians). * radians).
@ -233,7 +233,7 @@ math_tanh(VALUE obj, VALUE x)
/* /*
* call-seq: * call-seq:
* Math.acosh(x) => float * Math.acosh(x) -> float
* *
* Computes the inverse hyperbolic cosine of <i>x</i>. * Computes the inverse hyperbolic cosine of <i>x</i>.
*/ */
@ -253,7 +253,7 @@ math_acosh(VALUE obj, VALUE x)
/* /*
* call-seq: * call-seq:
* Math.asinh(x) => float * Math.asinh(x) -> float
* *
* Computes the inverse hyperbolic sine of <i>x</i>. * Computes the inverse hyperbolic sine of <i>x</i>.
*/ */
@ -267,7 +267,7 @@ math_asinh(VALUE obj, VALUE x)
/* /*
* call-seq: * call-seq:
* Math.atanh(x) => float * Math.atanh(x) -> float
* *
* Computes the inverse hyperbolic tangent of <i>x</i>. * Computes the inverse hyperbolic tangent of <i>x</i>.
*/ */
@ -290,7 +290,7 @@ math_atanh(VALUE obj, VALUE x)
/* /*
* call-seq: * call-seq:
* Math.exp(x) => float * Math.exp(x) -> float
* *
* Returns e**x. * Returns e**x.
* *
@ -318,8 +318,8 @@ math_exp(VALUE obj, VALUE x)
/* /*
* call-seq: * call-seq:
* Math.log(numeric) => float * Math.log(numeric) -> float
* Math.log(num,base) => float * Math.log(num,base) -> float
* *
* Returns the natural logarithm of <i>numeric</i>. * Returns the natural logarithm of <i>numeric</i>.
* If additional second argument is given, it will be the base * If additional second argument is given, it will be the base
@ -367,7 +367,7 @@ extern double log2(double);
/* /*
* call-seq: * call-seq:
* Math.log2(numeric) => float * Math.log2(numeric) -> float
* *
* Returns the base 2 logarithm of <i>numeric</i>. * Returns the base 2 logarithm of <i>numeric</i>.
* *
@ -395,7 +395,7 @@ math_log2(VALUE obj, VALUE x)
/* /*
* call-seq: * call-seq:
* Math.log10(numeric) => float * Math.log10(numeric) -> float
* *
* Returns the base 10 logarithm of <i>numeric</i>. * Returns the base 10 logarithm of <i>numeric</i>.
* *
@ -422,7 +422,7 @@ math_log10(VALUE obj, VALUE x)
/* /*
* call-seq: * call-seq:
* Math.sqrt(numeric) => float * Math.sqrt(numeric) -> float
* *
* Returns the non-negative square root of <i>numeric</i>. * Returns the non-negative square root of <i>numeric</i>.
* *
@ -460,7 +460,7 @@ math_sqrt(VALUE obj, VALUE x)
/* /*
* call-seq: * call-seq:
* Math.cbrt(numeric) => float * Math.cbrt(numeric) -> float
* *
* Returns the cube root of <i>numeric</i>. * Returns the cube root of <i>numeric</i>.
* *
@ -499,7 +499,7 @@ math_cbrt(VALUE obj, VALUE x)
/* /*
* call-seq: * call-seq:
* Math.frexp(numeric) => [ fraction, exponent ] * Math.frexp(numeric) -> [ fraction, exponent ]
* *
* Returns a two-element array containing the normalized fraction (a * Returns a two-element array containing the normalized fraction (a
* <code>Float</code>) and exponent (a <code>Fixnum</code>) of * <code>Float</code>) and exponent (a <code>Fixnum</code>) of
@ -540,7 +540,7 @@ math_ldexp(VALUE obj, VALUE x, VALUE n)
/* /*
* call-seq: * call-seq:
* Math.hypot(x, y) => float * Math.hypot(x, y) -> float
* *
* Returns sqrt(x**2 + y**2), the hypotenuse of a right-angled triangle * Returns sqrt(x**2 + y**2), the hypotenuse of a right-angled triangle
* with sides <i>x</i> and <i>y</i>. * with sides <i>x</i> and <i>y</i>.
@ -557,7 +557,7 @@ math_hypot(VALUE obj, VALUE x, VALUE y)
/* /*
* call-seq: * call-seq:
* Math.erf(x) => float * Math.erf(x) -> float
* *
* Calculates the error function of x. * Calculates the error function of x.
*/ */
@ -571,7 +571,7 @@ math_erf(VALUE obj, VALUE x)
/* /*
* call-seq: * call-seq:
* Math.erfc(x) => float * Math.erfc(x) -> float
* *
* Calculates the complementary error function of x. * Calculates the complementary error function of x.
*/ */
@ -585,7 +585,7 @@ math_erfc(VALUE obj, VALUE x)
/* /*
* call-seq: * call-seq:
* Math.gamma(x) => float * Math.gamma(x) -> float
* *
* Calculates the gamma function of x. * Calculates the gamma function of x.
* *
@ -674,7 +674,7 @@ math_gamma(VALUE obj, VALUE x)
/* /*
* call-seq: * call-seq:
* Math.lgamma(x) => [float, -1 or 1] * Math.lgamma(x) -> [float, -1 or 1]
* *
* Calculates the logarithmic gamma of x and * Calculates the logarithmic gamma of x and
* the sign of gamma of x. * the sign of gamma of x.

150
object.c
View file

@ -36,7 +36,7 @@ static ID id_init_copy, id_init_clone, id_init_dup;
/* /*
* call-seq: * call-seq:
* obj === other => true or false * obj === other -> true or false
* *
* Case Equality---For class <code>Object</code>, effectively the same * Case Equality---For class <code>Object</code>, effectively the same
* as calling <code>#==</code>, but typically overridden by descendants * as calling <code>#==</code>, but typically overridden by descendants
@ -62,9 +62,9 @@ rb_eql(VALUE obj1, VALUE obj2)
/* /*
* call-seq: * call-seq:
* obj == other => true or false * obj == other -> true or false
* obj.equal?(other) => true or false * obj.equal?(other) -> true or false
* obj.eql?(other) => true or false * obj.eql?(other) -> true or false
* *
* Equality---At the <code>Object</code> level, <code>==</code> returns * Equality---At the <code>Object</code> level, <code>==</code> returns
* <code>true</code> only if <i>obj</i> and <i>other</i> are the * <code>true</code> only if <i>obj</i> and <i>other</i> are the
@ -106,7 +106,7 @@ rb_obj_hash(VALUE obj)
/* /*
* call-seq: * call-seq:
* !obj => true or false * !obj -> true or false
* *
* Boolean negate. * Boolean negate.
*/ */
@ -119,7 +119,7 @@ rb_obj_not(VALUE obj)
/* /*
* call-seq: * call-seq:
* obj != other => true or false * obj != other -> true or false
* *
* Returns true if two objects are not-equal, otherwise false. * Returns true if two objects are not-equal, otherwise false.
*/ */
@ -144,7 +144,7 @@ rb_class_real(VALUE cl)
/* /*
* call-seq: * call-seq:
* obj.class => class * obj.class -> class
* *
* Returns the class of <i>obj</i>, now preferred over * Returns the class of <i>obj</i>, now preferred over
* <code>Object#type</code>, as an object's type in Ruby is only * <code>Object#type</code>, as an object's type in Ruby is only
@ -164,7 +164,7 @@ rb_obj_class(VALUE obj)
/* /*
* call-seq: * call-seq:
* obj.singleton_class => class * obj.singleton_class -> class
* *
* Returns the singleton class of <i>obj</i>. This method creates * Returns the singleton class of <i>obj</i>. This method creates
* a new singleton class if <i>obj</i> does not have it. * a new singleton class if <i>obj</i> does not have it.
@ -327,7 +327,7 @@ rb_obj_init_dup_clone(VALUE obj, VALUE orig)
/* /*
* call-seq: * call-seq:
* obj.to_s => string * obj.to_s -> string
* *
* Returns a string representing <i>obj</i>. The default * Returns a string representing <i>obj</i>. The default
* <code>to_s</code> prints the object's class and an encoding of the * <code>to_s</code> prints the object's class and an encoding of the
@ -397,7 +397,7 @@ inspect_obj(VALUE obj, VALUE str, int recur)
/* /*
* call-seq: * call-seq:
* obj.inspect => string * obj.inspect -> string
* *
* Returns a string containing a human-readable representation of * Returns a string containing a human-readable representation of
* <i>obj</i>. If not overridden and no instance variables, uses the * <i>obj</i>. If not overridden and no instance variables, uses the
@ -442,7 +442,7 @@ rb_obj_inspect(VALUE obj)
/* /*
* call-seq: * call-seq:
* obj.instance_of?(class) => true or false * obj.instance_of?(class) -> true or false
* *
* Returns <code>true</code> if <i>obj</i> is an instance of the given * Returns <code>true</code> if <i>obj</i> is an instance of the given
* class. See also <code>Object#kind_of?</code>. * class. See also <code>Object#kind_of?</code>.
@ -467,8 +467,8 @@ rb_obj_is_instance_of(VALUE obj, VALUE c)
/* /*
* call-seq: * call-seq:
* obj.is_a?(class) => true or false * obj.is_a?(class) -> true or false
* obj.kind_of?(class) => true or false * obj.kind_of?(class) -> true or false
* *
* Returns <code>true</code> if <i>class</i> is the class of * Returns <code>true</code> if <i>class</i> is the class of
* <i>obj</i>, or if <i>class</i> is one of the superclasses of * <i>obj</i>, or if <i>class</i> is one of the superclasses of
@ -517,7 +517,7 @@ rb_obj_is_kind_of(VALUE obj, VALUE c)
/* /*
* call-seq: * call-seq:
* obj.tap{|x|...} => obj * obj.tap{|x|...} -> obj
* *
* Yields <code>x</code> to the block, and then returns <code>x</code>. * Yields <code>x</code> to the block, and then returns <code>x</code>.
* The primary purpose of this method is to "tap into" a method chain, * The primary purpose of this method is to "tap into" a method chain,
@ -687,7 +687,7 @@ rb_obj_dummy(void)
/* /*
* call-seq: * call-seq:
* obj.tainted? => true or false * obj.tainted? -> true or false
* *
* Returns <code>true</code> if the object is tainted. * Returns <code>true</code> if the object is tainted.
*/ */
@ -725,7 +725,7 @@ rb_obj_taint(VALUE obj)
/* /*
* call-seq: * call-seq:
* obj.untaint => obj * obj.untaint -> obj
* *
* Removes the taint from <i>obj</i>. * Removes the taint from <i>obj</i>.
*/ */
@ -745,7 +745,7 @@ rb_obj_untaint(VALUE obj)
/* /*
* call-seq: * call-seq:
* obj.untrusted? => true or false * obj.untrusted? -> true or false
* *
* Returns <code>true</code> if the object is untrusted. * Returns <code>true</code> if the object is untrusted.
*/ */
@ -781,7 +781,7 @@ rb_obj_untrust(VALUE obj)
/* /*
* call-seq: * call-seq:
* obj.trust => obj * obj.trust -> obj
* *
* Removes the untrusted mark from <i>obj</i>. * Removes the untrusted mark from <i>obj</i>.
*/ */
@ -809,7 +809,7 @@ static st_table *immediate_frozen_tbl = 0;
/* /*
* call-seq: * call-seq:
* obj.freeze => obj * obj.freeze -> obj
* *
* Prevents further modifications to <i>obj</i>. A * Prevents further modifications to <i>obj</i>. A
* <code>RuntimeError</code> will be raised if modification is attempted. * <code>RuntimeError</code> will be raised if modification is attempted.
@ -848,7 +848,7 @@ rb_obj_freeze(VALUE obj)
/* /*
* call-seq: * call-seq:
* obj.frozen? => true or false * obj.frozen? -> true or false
* *
* Returns the freeze status of <i>obj</i>. * Returns the freeze status of <i>obj</i>.
* *
@ -877,7 +877,7 @@ rb_obj_frozen_p(VALUE obj)
/* /*
* call-seq: * call-seq:
* nil.to_i => 0 * nil.to_i -> 0
* *
* Always returns zero. * Always returns zero.
* *
@ -893,7 +893,7 @@ nil_to_i(VALUE obj)
/* /*
* call-seq: * call-seq:
* nil.to_f => 0.0 * nil.to_f -> 0.0
* *
* Always returns zero. * Always returns zero.
* *
@ -908,7 +908,7 @@ nil_to_f(VALUE obj)
/* /*
* call-seq: * call-seq:
* nil.to_s => "" * nil.to_s -> ""
* *
* Always returns the empty string. * Always returns the empty string.
*/ */
@ -923,7 +923,7 @@ nil_to_s(VALUE obj)
* Document-method: to_a * Document-method: to_a
* *
* call-seq: * call-seq:
* nil.to_a => [] * nil.to_a -> []
* *
* Always returns an empty array. * Always returns an empty array.
* *
@ -938,7 +938,7 @@ nil_to_a(VALUE obj)
/* /*
* call-seq: * call-seq:
* nil.inspect => "nil" * nil.inspect -> "nil"
* *
* Always returns the string "nil". * Always returns the string "nil".
*/ */
@ -961,7 +961,7 @@ nil_inspect(VALUE obj)
/* /*
* call-seq: * call-seq:
* true.to_s => "true" * true.to_s -> "true"
* *
* The string representation of <code>true</code> is "true". * The string representation of <code>true</code> is "true".
*/ */
@ -975,7 +975,7 @@ true_to_s(VALUE obj)
/* /*
* call-seq: * call-seq:
* true & obj => true or false * true & obj -> true or false
* *
* And---Returns <code>false</code> if <i>obj</i> is * And---Returns <code>false</code> if <i>obj</i> is
* <code>nil</code> or <code>false</code>, <code>true</code> otherwise. * <code>nil</code> or <code>false</code>, <code>true</code> otherwise.
@ -989,7 +989,7 @@ true_and(VALUE obj, VALUE obj2)
/* /*
* call-seq: * call-seq:
* true | obj => true * true | obj -> true
* *
* Or---Returns <code>true</code>. As <i>anObject</i> is an argument to * Or---Returns <code>true</code>. As <i>anObject</i> is an argument to
* a method call, it is always evaluated; there is no short-circuit * a method call, it is always evaluated; there is no short-circuit
@ -1012,7 +1012,7 @@ true_or(VALUE obj, VALUE obj2)
/* /*
* call-seq: * call-seq:
* true ^ obj => !obj * true ^ obj -> !obj
* *
* Exclusive Or---Returns <code>true</code> if <i>obj</i> is * Exclusive Or---Returns <code>true</code> if <i>obj</i> is
* <code>nil</code> or <code>false</code>, <code>false</code> * <code>nil</code> or <code>false</code>, <code>false</code>
@ -1038,7 +1038,7 @@ true_xor(VALUE obj, VALUE obj2)
/* /*
* call-seq: * call-seq:
* false.to_s => "false" * false.to_s -> "false"
* *
* 'nuf said... * 'nuf said...
*/ */
@ -1051,8 +1051,8 @@ false_to_s(VALUE obj)
/* /*
* call-seq: * call-seq:
* false & obj => false * false & obj -> false
* nil & obj => false * nil & obj -> false
* *
* And---Returns <code>false</code>. <i>obj</i> is always * And---Returns <code>false</code>. <i>obj</i> is always
* evaluated as it is the argument to a method call---there is no * evaluated as it is the argument to a method call---there is no
@ -1068,8 +1068,8 @@ false_and(VALUE obj, VALUE obj2)
/* /*
* call-seq: * call-seq:
* false | obj => true or false * false | obj -> true or false
* nil | obj => true or false * nil | obj -> true or false
* *
* Or---Returns <code>false</code> if <i>obj</i> is * Or---Returns <code>false</code> if <i>obj</i> is
* <code>nil</code> or <code>false</code>; <code>true</code> otherwise. * <code>nil</code> or <code>false</code>; <code>true</code> otherwise.
@ -1085,8 +1085,8 @@ false_or(VALUE obj, VALUE obj2)
/* /*
* call-seq: * call-seq:
* false ^ obj => true or false * false ^ obj -> true or false
* nil ^ obj => true or false * nil ^ obj -> true or false
* *
* Exclusive Or---If <i>obj</i> is <code>nil</code> or * Exclusive Or---If <i>obj</i> is <code>nil</code> or
* <code>false</code>, returns <code>false</code>; otherwise, returns * <code>false</code>, returns <code>false</code>; otherwise, returns
@ -1102,7 +1102,7 @@ false_xor(VALUE obj, VALUE obj2)
/* /*
* call_seq: * call_seq:
* nil.nil? => true * nil.nil? -> true
* *
* Only the object <i>nil</i> responds <code>true</code> to <code>nil?</code>. * Only the object <i>nil</i> responds <code>true</code> to <code>nil?</code>.
*/ */
@ -1115,8 +1115,8 @@ rb_true(VALUE obj)
/* /*
* call_seq: * call_seq:
* nil.nil? => true * nil.nil? -> true
* <anything_else>.nil? => false * <anything_else>.nil? -> false
* *
* Only the object <i>nil</i> responds <code>true</code> to <code>nil?</code>. * Only the object <i>nil</i> responds <code>true</code> to <code>nil?</code>.
*/ */
@ -1131,7 +1131,7 @@ rb_false(VALUE obj)
/* /*
* call-seq: * call-seq:
* obj =~ other => nil * obj =~ other -> nil
* *
* Pattern Match---Overridden by descendants (notably * Pattern Match---Overridden by descendants (notably
* <code>Regexp</code> and <code>String</code>) to provide meaningful * <code>Regexp</code> and <code>String</code>) to provide meaningful
@ -1146,7 +1146,7 @@ rb_obj_match(VALUE obj1, VALUE obj2)
/* /*
* call-seq: * call-seq:
* obj !~ other => true or false * obj !~ other -> true or false
* *
* Returns true if two objects do not match (using the <i>=~</i> * Returns true if two objects do not match (using the <i>=~</i>
* method), otherwise false. * method), otherwise false.
@ -1199,7 +1199,7 @@ rb_obj_cmp(VALUE obj1, VALUE obj2)
/* /*
* call-seq: * call-seq:
* mod.to_s => string * mod.to_s -> string
* *
* Return a string representing this module or class. For basic * Return a string representing this module or class. For basic
* classes and modules, this is the name. For singletons, we * classes and modules, this is the name. For singletons, we
@ -1231,7 +1231,7 @@ rb_mod_to_s(VALUE klass)
/* /*
* call-seq: * call-seq:
* mod.freeze => mod * mod.freeze -> mod
* *
* Prevents further modifications to <i>mod</i>. * Prevents further modifications to <i>mod</i>.
* *
@ -1247,7 +1247,7 @@ rb_mod_freeze(VALUE mod)
/* /*
* call-seq: * call-seq:
* mod === obj => true or false * mod === obj -> true or false
* *
* Case Equality---Returns <code>true</code> if <i>anObject</i> is an * Case Equality---Returns <code>true</code> if <i>anObject</i> is an
* instance of <i>mod</i> or one of <i>mod</i>'s descendants. Of * instance of <i>mod</i> or one of <i>mod</i>'s descendants. Of
@ -1263,7 +1263,7 @@ rb_mod_eqq(VALUE mod, VALUE arg)
/* /*
* call-seq: * call-seq:
* mod <= other => true, false, or nil * mod <= other -> true, false, or nil
* *
* Returns true if <i>mod</i> is a subclass of <i>other</i> or * Returns true if <i>mod</i> is a subclass of <i>other</i> or
* is the same as <i>other</i>. Returns * is the same as <i>other</i>. Returns
@ -1302,7 +1302,7 @@ rb_class_inherited_p(VALUE mod, VALUE arg)
/* /*
* call-seq: * call-seq:
* mod < other => true, false, or nil * mod < other -> true, false, or nil
* *
* Returns true if <i>mod</i> is a subclass of <i>other</i>. Returns * Returns true if <i>mod</i> is a subclass of <i>other</i>. Returns
* <code>nil</code> if there's no relationship between the two. * <code>nil</code> if there's no relationship between the two.
@ -1321,7 +1321,7 @@ rb_mod_lt(VALUE mod, VALUE arg)
/* /*
* call-seq: * call-seq:
* mod >= other => true, false, or nil * mod >= other -> true, false, or nil
* *
* Returns true if <i>mod</i> is an ancestor of <i>other</i>, or the * Returns true if <i>mod</i> is an ancestor of <i>other</i>, or the
* two modules are the same. Returns * two modules are the same. Returns
@ -1347,7 +1347,7 @@ rb_mod_ge(VALUE mod, VALUE arg)
/* /*
* call-seq: * call-seq:
* mod > other => true, false, or nil * mod > other -> true, false, or nil
* *
* Returns true if <i>mod</i> is an ancestor of <i>other</i>. Returns * Returns true if <i>mod</i> is an ancestor of <i>other</i>. Returns
* <code>nil</code> if there's no relationship between the two. * <code>nil</code> if there's no relationship between the two.
@ -1365,7 +1365,7 @@ rb_mod_gt(VALUE mod, VALUE arg)
/* /*
* call-seq: * call-seq:
* mod <=> other_mod => -1, 0, +1, or nil * mod <=> other_mod -> -1, 0, +1, or nil
* *
* Comparison---Returns -1 if <i>mod</i> includes <i>other_mod</i>, 0 if * Comparison---Returns -1 if <i>mod</i> includes <i>other_mod</i>, 0 if
* <i>mod</i> is the same as <i>other_mod</i>, and +1 if <i>mod</i> is * <i>mod</i> is the same as <i>other_mod</i>, and +1 if <i>mod</i> is
@ -1413,8 +1413,8 @@ rb_class_s_alloc(VALUE klass)
/* /*
* call-seq: * call-seq:
* Module.new => mod * Module.new -> mod
* Module.new {|mod| block } => mod * Module.new {|mod| block } -> mod
* *
* Creates a new anonymous module. If a block is given, it is passed * Creates a new anonymous module. If a block is given, it is passed
* the module object, and the block is evaluated in the context of this * the module object, and the block is evaluated in the context of this
@ -1447,7 +1447,7 @@ rb_mod_initialize(VALUE module)
/* /*
* call-seq: * call-seq:
* Class.new(super_class=Object) => a_class * Class.new(super_class=Object) -> a_class
* *
* Creates a new anonymous (unnamed) class with the given superclass * Creates a new anonymous (unnamed) class with the given superclass
* (or <code>Object</code> if no parameter is given). You can give a * (or <code>Object</code> if no parameter is given). You can give a
@ -1480,7 +1480,7 @@ rb_class_initialize(int argc, VALUE *argv, VALUE klass)
/* /*
* call-seq: * call-seq:
* class.allocate() => obj * class.allocate() -> obj
* *
* Allocates space for a new object of <i>class</i>'s class and does not * Allocates space for a new object of <i>class</i>'s class and does not
* call initialize on the new instance. The returned object must be an * call initialize on the new instance. The returned object must be an
@ -1528,7 +1528,7 @@ rb_class_allocate_instance(VALUE klass)
/* /*
* call-seq: * call-seq:
* class.new(args, ...) => obj * class.new(args, ...) -> obj
* *
* Calls <code>allocate</code> to create a new object of * Calls <code>allocate</code> to create a new object of
* <i>class</i>'s class, then invokes that object's * <i>class</i>'s class, then invokes that object's
@ -1588,8 +1588,8 @@ rb_class_superclass(VALUE klass)
/* /*
* call-seq: * call-seq:
* attr_reader(symbol, ...) => nil * attr_reader(symbol, ...) -> nil
* attr(symbol, ...) => nil * attr(symbol, ...) -> nil
* *
* Creates instance variables and corresponding methods that return the * Creates instance variables and corresponding methods that return the
* value of each instance variable. Equivalent to calling * value of each instance variable. Equivalent to calling
@ -1620,7 +1620,7 @@ rb_mod_attr(int argc, VALUE *argv, VALUE klass)
/* /*
* call-seq: * call-seq:
* attr_writer(symbol, ...) => nil * attr_writer(symbol, ...) -> nil
* *
* Creates an accessor method to allow assignment to the attribute * Creates an accessor method to allow assignment to the attribute
* <i>aSymbol</i><code>.id2name</code>. * <i>aSymbol</i><code>.id2name</code>.
@ -1639,7 +1639,7 @@ rb_mod_attr_writer(int argc, VALUE *argv, VALUE klass)
/* /*
* call-seq: * call-seq:
* attr_accessor(symbol, ...) => nil * attr_accessor(symbol, ...) -> nil
* *
* Defines a named attribute for this module, where the name is * Defines a named attribute for this module, where the name is
* <i>symbol.</i><code>id2name</code>, creating an instance variable * <i>symbol.</i><code>id2name</code>, creating an instance variable
@ -1665,7 +1665,7 @@ rb_mod_attr_accessor(int argc, VALUE *argv, VALUE klass)
/* /*
* call-seq: * call-seq:
* mod.const_get(sym, inherit=true) => obj * mod.const_get(sym, inherit=true) -> obj
* *
* Returns the value of the named constant in <i>mod</i>. * Returns the value of the named constant in <i>mod</i>.
* *
@ -1697,7 +1697,7 @@ rb_mod_const_get(int argc, VALUE *argv, VALUE mod)
/* /*
* call-seq: * call-seq:
* mod.const_set(sym, obj) => obj * mod.const_set(sym, obj) -> obj
* *
* Sets the named constant to the given object, returning that object. * Sets the named constant to the given object, returning that object.
* Creates a new constant if no constant with the given name previously * Creates a new constant if no constant with the given name previously
@ -1721,7 +1721,7 @@ rb_mod_const_set(VALUE mod, VALUE name, VALUE value)
/* /*
* call-seq: * call-seq:
* mod.const_defined?(sym, inherit=true) => true or false * mod.const_defined?(sym, inherit=true) -> true or false
* *
* Returns <code>true</code> if a constant with the given name is * Returns <code>true</code> if a constant with the given name is
* defined by <i>mod</i>, or its ancestors if +inherit+ is not false. * defined by <i>mod</i>, or its ancestors if +inherit+ is not false.
@ -1753,7 +1753,7 @@ rb_mod_const_defined(int argc, VALUE *argv, VALUE mod)
/* /*
* call-seq: * call-seq:
* obj.methods => array * obj.methods -> array
* *
* Returns a list of the names of methods publicly accessible in * Returns a list of the names of methods publicly accessible in
* <i>obj</i>. This will include all the methods accessible in * <i>obj</i>. This will include all the methods accessible in
@ -1794,7 +1794,7 @@ rb_obj_methods(int argc, VALUE *argv, VALUE obj)
/* /*
* call-seq: * call-seq:
* obj.protected_methods(all=true) => array * obj.protected_methods(all=true) -> array
* *
* Returns the list of protected methods accessible to <i>obj</i>. If * Returns the list of protected methods accessible to <i>obj</i>. If
* the <i>all</i> parameter is set to <code>false</code>, only those methods * the <i>all</i> parameter is set to <code>false</code>, only those methods
@ -1815,7 +1815,7 @@ rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj)
/* /*
* call-seq: * call-seq:
* obj.private_methods(all=true) => array * obj.private_methods(all=true) -> array
* *
* Returns the list of private methods accessible to <i>obj</i>. If * Returns the list of private methods accessible to <i>obj</i>. If
* the <i>all</i> parameter is set to <code>false</code>, only those methods * the <i>all</i> parameter is set to <code>false</code>, only those methods
@ -1836,7 +1836,7 @@ rb_obj_private_methods(int argc, VALUE *argv, VALUE obj)
/* /*
* call-seq: * call-seq:
* obj.public_methods(all=true) => array * obj.public_methods(all=true) -> array
* *
* Returns the list of public methods accessible to <i>obj</i>. If * Returns the list of public methods accessible to <i>obj</i>. If
* the <i>all</i> parameter is set to <code>false</code>, only those methods * the <i>all</i> parameter is set to <code>false</code>, only those methods
@ -1857,7 +1857,7 @@ rb_obj_public_methods(int argc, VALUE *argv, VALUE obj)
/* /*
* call-seq: * call-seq:
* obj.instance_variable_get(symbol) => obj * obj.instance_variable_get(symbol) -> obj
* *
* Returns the value of the given instance variable, or nil if the * Returns the value of the given instance variable, or nil if the
* instance variable is not set. The <code>@</code> part of the * instance variable is not set. The <code>@</code> part of the
@ -1888,7 +1888,7 @@ rb_obj_ivar_get(VALUE obj, VALUE iv)
/* /*
* call-seq: * call-seq:
* obj.instance_variable_set(symbol, obj) => obj * obj.instance_variable_set(symbol, obj) -> obj
* *
* Sets the instance variable names by <i>symbol</i> to * Sets the instance variable names by <i>symbol</i> to
* <i>object</i>, thereby frustrating the efforts of the class's * <i>object</i>, thereby frustrating the efforts of the class's
@ -1919,7 +1919,7 @@ rb_obj_ivar_set(VALUE obj, VALUE iv, VALUE val)
/* /*
* call-seq: * call-seq:
* obj.instance_variable_defined?(symbol) => true or false * obj.instance_variable_defined?(symbol) -> true or false
* *
* Returns <code>true</code> if the given instance variable is * Returns <code>true</code> if the given instance variable is
* defined in <i>obj</i>. * defined in <i>obj</i>.
@ -1948,7 +1948,7 @@ rb_obj_ivar_defined(VALUE obj, VALUE iv)
/* /*
* call-seq: * call-seq:
* mod.class_variable_get(symbol) => obj * mod.class_variable_get(symbol) -> obj
* *
* Returns the value of the given class variable (or throws a * Returns the value of the given class variable (or throws a
* <code>NameError</code> exception). The <code>@@</code> part of the * <code>NameError</code> exception). The <code>@@</code> part of the
@ -1973,7 +1973,7 @@ rb_mod_cvar_get(VALUE obj, VALUE iv)
/* /*
* call-seq: * call-seq:
* obj.class_variable_set(symbol, obj) => obj * obj.class_variable_set(symbol, obj) -> obj
* *
* Sets the class variable names by <i>symbol</i> to * Sets the class variable names by <i>symbol</i> to
* <i>object</i>. * <i>object</i>.
@ -2002,7 +2002,7 @@ rb_mod_cvar_set(VALUE obj, VALUE iv, VALUE val)
/* /*
* call-seq: * call-seq:
* obj.class_variable_defined?(symbol) => true or false * obj.class_variable_defined?(symbol) -> true or false
* *
* Returns <code>true</code> if the given class variable is defined * Returns <code>true</code> if the given class variable is defined
* in <i>obj</i>. * in <i>obj</i>.
@ -2193,7 +2193,7 @@ rb_Integer(VALUE val)
/* /*
* call-seq: * call-seq:
* Integer(arg,base=0) => integer * Integer(arg,base=0) -> integer
* *
* Converts <i>arg</i> to a <code>Fixnum</code> or <code>Bignum</code>. * Converts <i>arg</i> to a <code>Fixnum</code> or <code>Bignum</code>.
* Numeric types are converted directly (with floating point numbers * Numeric types are converted directly (with floating point numbers
@ -2365,7 +2365,7 @@ rb_Float(VALUE val)
/* /*
* call-seq: * call-seq:
* Float(arg) => float * Float(arg) -> float
* *
* Returns <i>arg</i> converted to a float. Numeric types are converted * Returns <i>arg</i> converted to a float. Numeric types are converted
* directly, the rest are converted using <i>arg</i>.to_f. As of Ruby * directly, the rest are converted using <i>arg</i>.to_f. As of Ruby
@ -2436,7 +2436,7 @@ rb_String(VALUE val)
/* /*
* call-seq: * call-seq:
* String(arg) => string * String(arg) -> string
* *
* Converts <i>arg</i> to a <code>String</code> by calling its * Converts <i>arg</i> to a <code>String</code> by calling its
* <code>to_s</code> method. * <code>to_s</code> method.
@ -2468,7 +2468,7 @@ rb_Array(VALUE val)
/* /*
* call-seq: * call-seq:
* Array(arg) => array * Array(arg) -> array
* *
* Returns <i>arg</i> as an <code>Array</code>. First tries to call * Returns <i>arg</i> as an <code>Array</code>. First tries to call
* <i>arg</i><code>.to_ary</code>, then <i>arg</i><code>.to_a</code>. * <i>arg</i><code>.to_ary</code>, then <i>arg</i><code>.to_a</code>.

2
pack.c
View file

@ -1203,7 +1203,7 @@ infected_str_new(const char *ptr, long len, VALUE str)
/* /*
* call-seq: * call-seq:
* str.unpack(format) => anArray * str.unpack(format) -> anArray
* *
* Decodes <i>str</i> (which may contain binary data) according to the * Decodes <i>str</i> (which may contain binary data) according to the
* format string, returning an array of each value extracted. The * format string, returning an array of each value extracted. The

138
proc.c
View file

@ -124,69 +124,69 @@ proc_clone(VALUE self)
/* /*
* call-seq: * call-seq:
* prc.lambda? => true or false * prc.lambda? -> true or false
* *
* Returns true for a Proc object which argument handling is rigid. * Returns true for a Proc object which argument handling is rigid.
* Such procs are typically generated by lambda. * Such procs are typically generated by lambda.
* *
* A Proc object generated by proc ignore extra arguments. * A Proc object generated by proc ignore extra arguments.
* *
* proc {|a,b| [a,b] }.call(1,2,3) => [1,2] * proc {|a,b| [a,b] }.call(1,2,3) #=> [1,2]
* *
* It provides nil for lacked arguments. * It provides nil for lacked arguments.
* *
* proc {|a,b| [a,b] }.call(1) => [1,nil] * proc {|a,b| [a,b] }.call(1) #=> [1,nil]
* *
* It expand single-array argument. * It expand single-array argument.
* *
* proc {|a,b| [a,b] }.call([1,2]) => [1,2] * proc {|a,b| [a,b] }.call([1,2]) #=> [1,2]
* *
* A Proc object generated by lambda doesn't have such tricks. * A Proc object generated by lambda doesn't have such tricks.
* *
* lambda {|a,b| [a,b] }.call(1,2,3) => ArgumentError * lambda {|a,b| [a,b] }.call(1,2,3) #=> ArgumentError
* lambda {|a,b| [a,b] }.call(1) => ArgumentError * lambda {|a,b| [a,b] }.call(1) #=> ArgumentError
* lambda {|a,b| [a,b] }.call([1,2]) => ArgumentError * lambda {|a,b| [a,b] }.call([1,2]) #=> ArgumentError
* *
* Proc#lambda? is a predicate for the tricks. * Proc#lambda? is a predicate for the tricks.
* It returns true if no tricks. * It returns true if no tricks.
* *
* lambda {}.lambda? => true * lambda {}.lambda? #=> true
* proc {}.lambda? => false * proc {}.lambda? #=> false
* *
* Proc.new is same as proc. * Proc.new is same as proc.
* *
* Proc.new {}.lambda? => false * Proc.new {}.lambda? #=> false
* *
* lambda, proc and Proc.new preserves the tricks of * lambda, proc and Proc.new preserves the tricks of
* a Proc object given by & argument. * a Proc object given by & argument.
* *
* lambda(&lambda {}).lambda? => true * lambda(&lambda {}).lambda? #=> true
* proc(&lambda {}).lambda? => true * proc(&lambda {}).lambda? #=> true
* Proc.new(&lambda {}).lambda? => true * Proc.new(&lambda {}).lambda? #=> true
* *
* lambda(&proc {}).lambda? => false * lambda(&proc {}).lambda? #=> false
* proc(&proc {}).lambda? => false * proc(&proc {}).lambda? #=> false
* Proc.new(&proc {}).lambda? => false * Proc.new(&proc {}).lambda? #=> false
* *
* A Proc object generated by & argument has the tricks * A Proc object generated by & argument has the tricks
* *
* def n(&b) b.lambda? end * def n(&b) b.lambda? end
* n {} => false * n {} #=> false
* *
* The & argument preserves the tricks if a Proc object is given * The & argument preserves the tricks if a Proc object is given
* by & argument. * by & argument.
* *
* n(&lambda {}) => true * n(&lambda {}) #=> true
* n(&proc {}) => false * n(&proc {}) #=> false
* n(&Proc.new {}) => false * n(&Proc.new {}) #=> false
* *
* A Proc object converted from a method has no tricks. * A Proc object converted from a method has no tricks.
* *
* def m() end * def m() end
* method(:m).to_proc.lambda? => true * method(:m).to_proc.lambda? #=> true
* *
* n(&method(:m)) => true * n(&method(:m)) #=> true
* n(&method(:m).to_proc) => true * n(&method(:m).to_proc) #=> true
* *
* define_method is treated same as method definition. * define_method is treated same as method definition.
* The defined method has no tricks. * The defined method has no tricks.
@ -194,8 +194,8 @@ proc_clone(VALUE self)
* class C * class C
* define_method(:d) {} * define_method(:d) {}
* end * end
* C.new.e(1,2) => ArgumentError * C.new.e(1,2) #=> ArgumentError
* C.new.method(:d).to_proc.lambda? => true * C.new.method(:d).to_proc.lambda? #=> true
* *
* define_method always defines a method without the tricks, * define_method always defines a method without the tricks,
* even if a non-lambda Proc object is given. * even if a non-lambda Proc object is given.
@ -204,8 +204,8 @@ proc_clone(VALUE self)
* class C * class C
* define_method(:e, &proc {}) * define_method(:e, &proc {})
* end * end
* C.new.e(1,2) => ArgumentError * C.new.e(1,2) #=> ArgumentError
* C.new.method(:e).to_proc.lambda? => true * C.new.method(:e).to_proc.lambda? #=> true
* *
* This exception is for a wrapper of define_method. * This exception is for a wrapper of define_method.
* It eases defining a method defining method which defines a usual method which has no tricks. * It eases defining a method defining method which defines a usual method which has no tricks.
@ -218,7 +218,7 @@ proc_clone(VALUE self)
* class C * class C
* def2(:f) {} * def2(:f) {}
* end * end
* C.new.f(1,2) => ArgumentError * C.new.f(1,2) #=> ArgumentError
* *
* The wrapper, def2, defines a method which has no tricks. * The wrapper, def2, defines a method which has no tricks.
* *
@ -348,7 +348,7 @@ rb_f_binding(VALUE self)
/* /*
* call-seq: * call-seq:
* binding.eval(string [, filename [,lineno]]) => obj * binding.eval(string [, filename [,lineno]]) -> obj
* *
* Evaluates the Ruby expression(s) in <em>string</em>, in the * Evaluates the Ruby expression(s) in <em>string</em>, in the
* <em>binding</em>'s context. If the optional <em>filename</em> and * <em>binding</em>'s context. If the optional <em>filename</em> and
@ -426,8 +426,8 @@ proc_new(VALUE klass, int is_lambda)
/* /*
* call-seq: * call-seq:
* Proc.new {|...| block } => a_proc * Proc.new {|...| block } -> a_proc
* Proc.new => a_proc * Proc.new -> a_proc
* *
* Creates a new <code>Proc</code> object, bound to the current * Creates a new <code>Proc</code> object, bound to the current
* context. <code>Proc::new</code> may be called without a block only * context. <code>Proc::new</code> may be called without a block only
@ -452,7 +452,7 @@ rb_proc_s_new(int argc, VALUE *argv, VALUE klass)
/* /*
* call-seq: * call-seq:
* proc { |...| block } => a_proc * proc { |...| block } -> a_proc
* *
* Equivalent to <code>Proc.new</code>. * Equivalent to <code>Proc.new</code>.
*/ */
@ -478,7 +478,7 @@ rb_f_lambda(void)
/* /*
* call-seq: * call-seq:
* lambda { |...| block } => a_proc * lambda { |...| block } -> a_proc
* *
* Equivalent to <code>Proc.new</code>, except the resulting Proc objects * Equivalent to <code>Proc.new</code>, except the resulting Proc objects
* check the number of parameters passed when called. * check the number of parameters passed when called.
@ -494,9 +494,9 @@ proc_lambda(void)
/* /*
* call-seq: * call-seq:
* prc.call(params,...) => obj * prc.call(params,...) -> obj
* prc[params,...] => obj * prc[params,...] -> obj
* prc.(params,...) => obj * prc.(params,...) -> obj
* *
* Invokes the block, setting the block's parameters to the values in * Invokes the block, setting the block's parameters to the values in
* <i>params</i> using something close to method calling semantics. * <i>params</i> using something close to method calling semantics.
@ -528,7 +528,7 @@ proc_lambda(void)
/* /*
* call-seq: * call-seq:
* prc === obj => obj * prc === obj -> obj
* *
* Invokes the block, with <i>obj</i> as the block's parameter. It is * Invokes the block, with <i>obj</i> as the block's parameter. It is
* to allow a proc object to be a target of when clause in the case statement. * to allow a proc object to be a target of when clause in the case statement.
@ -693,7 +693,7 @@ iseq_location(rb_iseq_t *iseq)
/* /*
* call-seq: * call-seq:
* prc.source_location => [String, Fixnum] * prc.source_location -> [String, Fixnum]
* *
* returns the ruby source filename and line number containing this proc * returns the ruby source filename and line number containing this proc
* or nil if this proc was not defined in ruby (i.e. native) * or nil if this proc was not defined in ruby (i.e. native)
@ -726,7 +726,7 @@ unnamed_parameters(int arity)
/* /*
* call-seq: * call-seq:
* proc.parameters => array * proc.parameters -> array
* *
* returns the parameter information of this proc * returns the parameter information of this proc
*/ */
@ -744,7 +744,7 @@ rb_proc_parameters(VALUE self)
/* /*
* call-seq: * call-seq:
* prc == other_proc => true or false * prc == other_proc -> true or false
* *
* Return <code>true</code> if <i>prc</i> is the same object as * Return <code>true</code> if <i>prc</i> is the same object as
* <i>other_proc</i>, or if they are both procs with the same body. * <i>other_proc</i>, or if they are both procs with the same body.
@ -775,7 +775,7 @@ proc_eq(VALUE self, VALUE other)
/* /*
* call-seq: * call-seq:
* prc.hash => integer * prc.hash -> integer
* *
* Return hash value corresponding to proc body. * Return hash value corresponding to proc body.
*/ */
@ -795,7 +795,7 @@ proc_hash(VALUE self)
/* /*
* call-seq: * call-seq:
* prc.to_s => string * prc.to_s -> string
* *
* Shows the unique identifier for this proc, along with * Shows the unique identifier for this proc, along with
* an indication of where the proc was defined. * an indication of where the proc was defined.
@ -1000,7 +1000,7 @@ mnew(VALUE klass, VALUE obj, ID id, VALUE mclass, int scope)
/* /*
* call-seq: * call-seq:
* meth == other_meth => true or false * meth == other_meth -> true or false
* *
* Two method objects are equal if they are bound to the same * Two method objects are equal if they are bound to the same
* object and refer to the same method definition. * object and refer to the same method definition.
@ -1032,7 +1032,7 @@ method_eq(VALUE method, VALUE other)
/* /*
* call-seq: * call-seq:
* meth.hash => integer * meth.hash -> integer
* *
* Return a hash value corresponding to the method object. * Return a hash value corresponding to the method object.
*/ */
@ -1054,7 +1054,7 @@ method_hash(VALUE method)
/* /*
* call-seq: * call-seq:
* meth.unbind => unbound_method * meth.unbind -> unbound_method
* *
* Dissociates <i>meth</i> from it's current receiver. The resulting * Dissociates <i>meth</i> from it's current receiver. The resulting
* <code>UnboundMethod</code> can subsequently be bound to a new object * <code>UnboundMethod</code> can subsequently be bound to a new object
@ -1082,7 +1082,7 @@ method_unbind(VALUE obj)
/* /*
* call-seq: * call-seq:
* meth.receiver => object * meth.receiver -> object
* *
* Returns the bound receiver of the method object. * Returns the bound receiver of the method object.
*/ */
@ -1098,7 +1098,7 @@ method_receiver(VALUE obj)
/* /*
* call-seq: * call-seq:
* meth.name => symbol * meth.name -> symbol
* *
* Returns the name of the method. * Returns the name of the method.
*/ */
@ -1114,7 +1114,7 @@ method_name(VALUE obj)
/* /*
* call-seq: * call-seq:
* meth.owner => class_or_module * meth.owner -> class_or_module
* *
* Returns the class or module that defines the method. * Returns the class or module that defines the method.
*/ */
@ -1130,7 +1130,7 @@ method_owner(VALUE obj)
/* /*
* call-seq: * call-seq:
* obj.method(sym) => method * obj.method(sym) -> method
* *
* Looks up the named method as a receiver in <i>obj</i>, returning a * Looks up the named method as a receiver in <i>obj</i>, returning a
* <code>Method</code> object (or raising <code>NameError</code>). The * <code>Method</code> object (or raising <code>NameError</code>). The
@ -1164,7 +1164,7 @@ rb_obj_method(VALUE obj, VALUE vid)
/* /*
* call-seq: * call-seq:
* obj.public_method(sym) => method * obj.public_method(sym) -> method
* *
* Similar to _method_, searches public method only. * Similar to _method_, searches public method only.
*/ */
@ -1177,7 +1177,7 @@ rb_obj_public_method(VALUE obj, VALUE vid)
/* /*
* call-seq: * call-seq:
* mod.instance_method(symbol) => unbound_method * mod.instance_method(symbol) -> unbound_method
* *
* Returns an +UnboundMethod+ representing the given * Returns an +UnboundMethod+ representing the given
* instance method in _mod_. * instance method in _mod_.
@ -1214,7 +1214,7 @@ rb_mod_instance_method(VALUE mod, VALUE vid)
/* /*
* call-seq: * call-seq:
* mod.public_instance_method(symbol) => unbound_method * mod.public_instance_method(symbol) -> unbound_method
* *
* Similar to _instance_method_, searches public method only. * Similar to _instance_method_, searches public method only.
*/ */
@ -1227,8 +1227,8 @@ rb_mod_public_instance_method(VALUE mod, VALUE vid)
/* /*
* call-seq: * call-seq:
* define_method(symbol, method) => new_method * define_method(symbol, method) -> new_method
* define_method(symbol) { block } => proc * define_method(symbol) { block } -> proc
* *
* Defines an instance method in the receiver. The _method_ * Defines an instance method in the receiver. The _method_
* parameter can be a +Proc+, a +Method+ or an +UnboundMethod+ object. * parameter can be a +Proc+, a +Method+ or an +UnboundMethod+ object.
@ -1324,8 +1324,8 @@ rb_mod_define_method(int argc, VALUE *argv, VALUE mod)
/* /*
* call-seq: * call-seq:
* define_singleton_method(symbol, method) => new_method * define_singleton_method(symbol, method) -> new_method
* define_singleton_method(symbol) { block } => proc * define_singleton_method(symbol) { block } -> proc
* *
* Defines a singleton method in the receiver. The _method_ * Defines a singleton method in the receiver. The _method_
* parameter can be a +Proc+, a +Method+ or an +UnboundMethod+ object. * parameter can be a +Proc+, a +Method+ or an +UnboundMethod+ object.
@ -1378,8 +1378,8 @@ method_clone(VALUE self)
/* /*
* call-seq: * call-seq:
* meth.call(args, ...) => obj * meth.call(args, ...) -> obj
* meth[args, ...] => obj * meth[args, ...] -> obj
* *
* Invokes the <i>meth</i> with the specified arguments, returning the * Invokes the <i>meth</i> with the specified arguments, returning the
* method's return value. * method's return value.
@ -1588,7 +1588,7 @@ rb_method_entry_arity(const rb_method_entry_t *me)
/* /*
* call-seq: * call-seq:
* meth.arity => fixnum * meth.arity -> fixnum
* *
* Returns an indication of the number of arguments accepted by a * Returns an indication of the number of arguments accepted by a
* method. Returns a nonnegative integer for methods that take a fixed * method. Returns a nonnegative integer for methods that take a fixed
@ -1678,7 +1678,7 @@ rb_method_get_iseq(VALUE method)
/* /*
* call-seq: * call-seq:
* meth.source_location => [String, Fixnum] * meth.source_location -> [String, Fixnum]
* *
* returns the ruby source filename and line number containing this method * returns the ruby source filename and line number containing this method
* or nil if this method was not defined in ruby (i.e. native) * or nil if this method was not defined in ruby (i.e. native)
@ -1698,7 +1698,7 @@ rb_method_location(VALUE method)
/* /*
* call-seq: * call-seq:
* meth.parameters => array * meth.parameters -> array
* *
* returns the parameter information of this method * returns the parameter information of this method
*/ */
@ -1715,8 +1715,8 @@ rb_method_parameters(VALUE method)
/* /*
* call-seq: * call-seq:
* meth.to_s => string * meth.to_s -> string
* meth.inspect => string * meth.inspect -> string
* *
* Show the name of the underlying method. * Show the name of the underlying method.
* *
@ -1815,7 +1815,7 @@ rb_proc_new(
/* /*
* call-seq: * call-seq:
* meth.to_proc => prc * meth.to_proc -> prc
* *
* Returns a <code>Proc</code> object corresponding to this method. * Returns a <code>Proc</code> object corresponding to this method.
*/ */
@ -1842,7 +1842,7 @@ method_proc(VALUE method)
/* /*
* call_seq: * call_seq:
* local_jump_error.exit_value => obj * local_jump_error.exit_value -> obj
* *
* Returns the exit value associated with this +LocalJumpError+. * Returns the exit value associated with this +LocalJumpError+.
*/ */
@ -1854,7 +1854,7 @@ localjump_xvalue(VALUE exc)
/* /*
* call-seq: * call-seq:
* local_jump_error.reason => symbol * local_jump_error.reason -> symbol
* *
* The reason this block was terminated: * The reason this block was terminated:
* :break, :redo, :retry, :next, :return, or :noreason. * :break, :redo, :retry, :next, :return, or :noreason.
@ -1868,7 +1868,7 @@ localjump_reason(VALUE exc)
/* /*
* call-seq: * call-seq:
* prc.binding => binding * prc.binding -> binding
* *
* Returns the binding associated with <i>prc</i>. Note that * Returns the binding associated with <i>prc</i>. Note that
* <code>Kernel#eval</code> accepts either a <code>Proc</code> or a * <code>Kernel#eval</code> accepts either a <code>Proc</code> or a
@ -1954,8 +1954,8 @@ curry(VALUE dummy, VALUE args, int argc, VALUE *argv, VALUE passed_proc)
/* /*
* call-seq: * call-seq:
* prc.curry => a_proc * prc.curry -> a_proc
* prc.curry(arity) => a_proc * prc.curry(arity) -> a_proc
* *
* Returns a curried proc. If the optional <i>arity</i> argument is given, * Returns a curried proc. If the optional <i>arity</i> argument is given,
* it determines the number of arguments. * it determines the number of arguments.

182
process.c
View file

@ -139,7 +139,7 @@ static VALUE rb_cProcessTms;
/* /*
* call-seq: * call-seq:
* Process.pid => fixnum * Process.pid -> fixnum
* *
* Returns the process id of this process. Not available on all * Returns the process id of this process. Not available on all
* platforms. * platforms.
@ -157,7 +157,7 @@ get_pid(void)
/* /*
* call-seq: * call-seq:
* Process.ppid => fixnum * Process.ppid -> fixnum
* *
* Returns the process id of the parent of this process. Returns * Returns the process id of the parent of this process. Returns
* untrustworthy value on Win32/64. Not available on all platforms. * untrustworthy value on Win32/64. Not available on all platforms.
@ -234,8 +234,8 @@ rb_last_status_clear(void)
/* /*
* call-seq: * call-seq:
* stat.to_i => fixnum * stat.to_i -> fixnum
* stat.to_int => fixnum * stat.to_int -> fixnum
* *
* Returns the bits in _stat_ as a <code>Fixnum</code>. Poking * Returns the bits in _stat_ as a <code>Fixnum</code>. Poking
* around in these bits is platform dependent. * around in these bits is platform dependent.
@ -255,7 +255,7 @@ pst_to_i(VALUE st)
/* /*
* call-seq: * call-seq:
* stat.pid => fixnum * stat.pid -> fixnum
* *
* Returns the process ID that this status object represents. * Returns the process ID that this status object represents.
* *
@ -307,7 +307,7 @@ pst_message(VALUE str, rb_pid_t pid, int status)
/* /*
* call-seq: * call-seq:
* stat.to_s => string * stat.to_s -> string
* *
* Show pid and exit status as a string. * Show pid and exit status as a string.
*/ */
@ -330,7 +330,7 @@ pst_to_s(VALUE st)
/* /*
* call-seq: * call-seq:
* stat.inspect => string * stat.inspect -> string
* *
* Override the inspection method. * Override the inspection method.
*/ */
@ -358,7 +358,7 @@ pst_inspect(VALUE st)
/* /*
* call-seq: * call-seq:
* stat == other => true or false * stat == other -> true or false
* *
* Returns +true+ if the integer value of _stat_ * Returns +true+ if the integer value of _stat_
* equals <em>other</em>. * equals <em>other</em>.
@ -374,7 +374,7 @@ pst_equal(VALUE st1, VALUE st2)
/* /*
* call-seq: * call-seq:
* stat & num => fixnum * stat & num -> fixnum
* *
* Logical AND of the bits in _stat_ with <em>num</em>. * Logical AND of the bits in _stat_ with <em>num</em>.
* *
@ -395,7 +395,7 @@ pst_bitand(VALUE st1, VALUE st2)
/* /*
* call-seq: * call-seq:
* stat >> num => fixnum * stat >> num -> fixnum
* *
* Shift the bits in _stat_ right <em>num</em> places. * Shift the bits in _stat_ right <em>num</em> places.
* *
@ -416,7 +416,7 @@ pst_rshift(VALUE st1, VALUE st2)
/* /*
* call-seq: * call-seq:
* stat.stopped? => true or false * stat.stopped? -> true or false
* *
* Returns +true+ if this process is stopped. This is only * Returns +true+ if this process is stopped. This is only
* returned if the corresponding <code>wait</code> call had the * returned if the corresponding <code>wait</code> call had the
@ -437,7 +437,7 @@ pst_wifstopped(VALUE st)
/* /*
* call-seq: * call-seq:
* stat.stopsig => fixnum or nil * stat.stopsig -> fixnum or nil
* *
* Returns the number of the signal that caused _stat_ to stop * Returns the number of the signal that caused _stat_ to stop
* (or +nil+ if self is not stopped). * (or +nil+ if self is not stopped).
@ -456,7 +456,7 @@ pst_wstopsig(VALUE st)
/* /*
* call-seq: * call-seq:
* stat.signaled? => true or false * stat.signaled? -> true or false
* *
* Returns +true+ if _stat_ terminated because of * Returns +true+ if _stat_ terminated because of
* an uncaught signal. * an uncaught signal.
@ -476,7 +476,7 @@ pst_wifsignaled(VALUE st)
/* /*
* call-seq: * call-seq:
* stat.termsig => fixnum or nil * stat.termsig -> fixnum or nil
* *
* Returns the number of the signal that caused _stat_ to * Returns the number of the signal that caused _stat_ to
* terminate (or +nil+ if self was not terminated by an * terminate (or +nil+ if self was not terminated by an
@ -496,7 +496,7 @@ pst_wtermsig(VALUE st)
/* /*
* call-seq: * call-seq:
* stat.exited? => true or false * stat.exited? -> true or false
* *
* Returns +true+ if _stat_ exited normally (for * Returns +true+ if _stat_ exited normally (for
* example using an <code>exit()</code> call or finishing the * example using an <code>exit()</code> call or finishing the
@ -517,7 +517,7 @@ pst_wifexited(VALUE st)
/* /*
* call-seq: * call-seq:
* stat.exitstatus => fixnum or nil * stat.exitstatus -> fixnum or nil
* *
* Returns the least significant eight bits of the return code of * Returns the least significant eight bits of the return code of
* _stat_. Only available if <code>exited?</code> is * _stat_. Only available if <code>exited?</code> is
@ -547,7 +547,7 @@ pst_wexitstatus(VALUE st)
/* /*
* call-seq: * call-seq:
* stat.success? => true, false or nil * stat.success? -> true, false or nil
* *
* Returns +true+ if _stat_ is successful, +false+ if not. * Returns +true+ if _stat_ is successful, +false+ if not.
* Returns +nil+ if <code>exited?</code> is not +true+. * Returns +nil+ if <code>exited?</code> is not +true+.
@ -566,7 +566,7 @@ pst_success_p(VALUE st)
/* /*
* call-seq: * call-seq:
* stat.coredump? => true or false * stat.coredump? -> true or false
* *
* Returns +true+ if _stat_ generated a coredump * Returns +true+ if _stat_ generated a coredump
* when it terminated. Not available on all platforms. * when it terminated. Not available on all platforms.
@ -725,9 +725,9 @@ rb_waitpid(rb_pid_t pid, int *st, int flags)
/* /*
* call-seq: * call-seq:
* Process.wait() => fixnum * Process.wait() -> fixnum
* Process.wait(pid=-1, flags=0) => fixnum * Process.wait(pid=-1, flags=0) -> fixnum
* Process.waitpid(pid=-1, flags=0) => fixnum * Process.waitpid(pid=-1, flags=0) -> fixnum
* *
* Waits for a child process to exit, returns its process id, and * Waits for a child process to exit, returns its process id, and
* sets <code>$?</code> to a <code>Process::Status</code> object * sets <code>$?</code> to a <code>Process::Status</code> object
@ -798,8 +798,8 @@ proc_wait(int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* Process.wait2(pid=-1, flags=0) => [pid, status] * Process.wait2(pid=-1, flags=0) -> [pid, status]
* Process.waitpid2(pid=-1, flags=0) => [pid, status] * Process.waitpid2(pid=-1, flags=0) -> [pid, status]
* *
* Waits for a child process to exit (see Process::waitpid for exact * Waits for a child process to exit (see Process::waitpid for exact
* semantics) and returns an array containing the process id and the * semantics) and returns an array containing the process id and the
@ -824,7 +824,7 @@ proc_wait2(int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* Process.waitall => [ [pid1,status1], ...] * Process.waitall -> [ [pid1,status1], ...]
* *
* Waits for all children, returning an array of * Waits for all children, returning an array of
* _pid_/_status_ pairs (where _status_ is a * _pid_/_status_ pairs (where _status_ is a
@ -922,7 +922,7 @@ rb_detach_process(rb_pid_t pid)
/* /*
* call-seq: * call-seq:
* Process.detach(pid) => thread * Process.detach(pid) -> thread
* *
* Some operating systems retain the status of terminated child * Some operating systems retain the status of terminated child
* processes until the parent collects that status (normally using * processes until the parent collects that status (normally using
@ -2590,8 +2590,8 @@ rb_fork(int *status, int (*chfunc)(void*), void *charg, VALUE fds)
#if defined(HAVE_FORK) && !defined(CANNOT_FORK_WITH_PTHREAD) #if defined(HAVE_FORK) && !defined(CANNOT_FORK_WITH_PTHREAD)
/* /*
* call-seq: * call-seq:
* Kernel.fork [{ block }] => fixnum or nil * Kernel.fork [{ block }] -> fixnum or nil
* Process.fork [{ block }] => fixnum or nil * Process.fork [{ block }] -> fixnum or nil
* *
* Creates a subprocess. If a block is specified, that block is run * Creates a subprocess. If a block is specified, that block is run
* in the subprocess, and the subprocess terminates with a status of * in the subprocess, and the subprocess terminates with a status of
@ -2918,7 +2918,7 @@ rb_spawn(int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* system([env,] command... [,options]) => true, false or nil * system([env,] command... [,options]) -> true, false or nil
* *
* Executes _command..._ in a subshell. * Executes _command..._ in a subshell.
* _command..._ is one of following forms. * _command..._ is one of following forms.
@ -2983,8 +2983,8 @@ rb_f_system(int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* spawn([env,] command... [,options]) => pid * spawn([env,] command... [,options]) -> pid
* Process.spawn([env,] command... [,options]) => pid * Process.spawn([env,] command... [,options]) -> pid
* *
* spawn executes specified command and return its pid. * spawn executes specified command and return its pid.
* *
@ -3234,7 +3234,7 @@ rb_f_spawn(int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* sleep([duration]) => fixnum * sleep([duration]) -> fixnum
* *
* Suspends the current thread for _duration_ seconds (which may be any number, * Suspends the current thread for _duration_ seconds (which may be any number,
* including a +Float+ with fractional seconds). Returns the actual number of * including a +Float+ with fractional seconds). Returns the actual number of
@ -3274,7 +3274,7 @@ rb_f_sleep(int argc, VALUE *argv)
#if (defined(HAVE_GETPGRP) && defined(GETPGRP_VOID)) || defined(HAVE_GETPGID) #if (defined(HAVE_GETPGRP) && defined(GETPGRP_VOID)) || defined(HAVE_GETPGID)
/* /*
* call-seq: * call-seq:
* Process.getpgrp => integer * Process.getpgrp -> integer
* *
* Returns the process group ID for this process. Not available on * Returns the process group ID for this process. Not available on
* all platforms. * all platforms.
@ -3307,7 +3307,7 @@ proc_getpgrp(void)
#if defined(HAVE_SETPGID) || (defined(HAVE_SETPGRP) && defined(SETPGRP_VOID)) #if defined(HAVE_SETPGID) || (defined(HAVE_SETPGRP) && defined(SETPGRP_VOID))
/* /*
* call-seq: * call-seq:
* Process.setpgrp => 0 * Process.setpgrp -> 0
* *
* Equivalent to <code>setpgid(0,0)</code>. Not available on all * Equivalent to <code>setpgid(0,0)</code>. Not available on all
* platforms. * platforms.
@ -3336,7 +3336,7 @@ proc_setpgrp(void)
#if defined(HAVE_GETPGID) #if defined(HAVE_GETPGID)
/* /*
* call-seq: * call-seq:
* Process.getpgid(pid) => integer * Process.getpgid(pid) -> integer
* *
* Returns the process group ID for the given process id. Not * Returns the process group ID for the given process id. Not
* available on all platforms. * available on all platforms.
@ -3362,7 +3362,7 @@ proc_getpgid(VALUE obj, VALUE pid)
#ifdef HAVE_SETPGID #ifdef HAVE_SETPGID
/* /*
* call-seq: * call-seq:
* Process.setpgid(pid, integer) => 0 * Process.setpgid(pid, integer) -> 0
* *
* Sets the process group ID of _pid_ (0 indicates this * Sets the process group ID of _pid_ (0 indicates this
* process) to <em>integer</em>. Not available on all platforms. * process) to <em>integer</em>. Not available on all platforms.
@ -3392,7 +3392,7 @@ static rb_pid_t ruby_setsid(void);
#endif #endif
/* /*
* call-seq: * call-seq:
* Process.setsid => fixnum * Process.setsid -> fixnum
* *
* Establishes this process as a new session and process group * Establishes this process as a new session and process group
* leader, with no controlling tty. Returns the session id. Not * leader, with no controlling tty. Returns the session id. Not
@ -3446,7 +3446,7 @@ ruby_setsid(void)
#ifdef HAVE_GETPRIORITY #ifdef HAVE_GETPRIORITY
/* /*
* call-seq: * call-seq:
* Process.getpriority(kind, integer) => fixnum * Process.getpriority(kind, integer) -> fixnum
* *
* Gets the scheduling priority for specified process, process group, * Gets the scheduling priority for specified process, process group,
* or user. <em>kind</em> indicates the kind of entity to find: one * or user. <em>kind</em> indicates the kind of entity to find: one
@ -3483,7 +3483,7 @@ proc_getpriority(VALUE obj, VALUE which, VALUE who)
#ifdef HAVE_GETPRIORITY #ifdef HAVE_GETPRIORITY
/* /*
* call-seq: * call-seq:
* Process.setpriority(kind, integer, priority) => 0 * Process.setpriority(kind, integer, priority) -> 0
* *
* See <code>Process#getpriority</code>. * See <code>Process#getpriority</code>.
* *
@ -3678,7 +3678,7 @@ rlimit_resource_value(VALUE rval)
#if defined(HAVE_GETRLIMIT) && defined(RLIM2NUM) #if defined(HAVE_GETRLIMIT) && defined(RLIM2NUM)
/* /*
* call-seq: * call-seq:
* Process.getrlimit(resource) => [cur_limit, max_limit] * Process.getrlimit(resource) -> [cur_limit, max_limit]
* *
* Gets the resource limit of the process. * Gets the resource limit of the process.
* _cur_limit_ means current (soft) limit and * _cur_limit_ means current (soft) limit and
@ -3715,8 +3715,8 @@ proc_getrlimit(VALUE obj, VALUE resource)
#if defined(HAVE_SETRLIMIT) && defined(NUM2RLIM) #if defined(HAVE_SETRLIMIT) && defined(NUM2RLIM)
/* /*
* call-seq: * call-seq:
* Process.setrlimit(resource, cur_limit, max_limit) => nil * Process.setrlimit(resource, cur_limit, max_limit) -> nil
* Process.setrlimit(resource, cur_limit) => nil * Process.setrlimit(resource, cur_limit) -> nil
* *
* Sets the resource limit of the process. * Sets the resource limit of the process.
* _cur_limit_ means current (soft) limit and * _cur_limit_ means current (soft) limit and
@ -3818,7 +3818,7 @@ check_gid_switch(void)
#if defined HAVE_SETUID #if defined HAVE_SETUID
/* /*
* call-seq: * call-seq:
* Process::Sys.setuid(integer) => nil * Process::Sys.setuid(integer) -> nil
* *
* Set the user ID of the current process to _integer_. Not * Set the user ID of the current process to _integer_. Not
* available on all platforms. * available on all platforms.
@ -3840,7 +3840,7 @@ p_sys_setuid(VALUE obj, VALUE id)
#if defined HAVE_SETRUID #if defined HAVE_SETRUID
/* /*
* call-seq: * call-seq:
* Process::Sys.setruid(integer) => nil * Process::Sys.setruid(integer) -> nil
* *
* Set the real user ID of the calling process to _integer_. * Set the real user ID of the calling process to _integer_.
* Not available on all platforms. * Not available on all platforms.
@ -3862,7 +3862,7 @@ p_sys_setruid(VALUE obj, VALUE id)
#if defined HAVE_SETEUID #if defined HAVE_SETEUID
/* /*
* call-seq: * call-seq:
* Process::Sys.seteuid(integer) => nil * Process::Sys.seteuid(integer) -> nil
* *
* Set the effective user ID of the calling process to * Set the effective user ID of the calling process to
* _integer_. Not available on all platforms. * _integer_. Not available on all platforms.
@ -3884,7 +3884,7 @@ p_sys_seteuid(VALUE obj, VALUE id)
#if defined HAVE_SETREUID #if defined HAVE_SETREUID
/* /*
* call-seq: * call-seq:
* Process::Sys.setreuid(rid, eid) => nil * Process::Sys.setreuid(rid, eid) -> nil
* *
* Sets the (integer) real and/or effective user IDs of the current * Sets the (integer) real and/or effective user IDs of the current
* process to _rid_ and _eid_, respectively. A value of * process to _rid_ and _eid_, respectively. A value of
@ -3908,7 +3908,7 @@ p_sys_setreuid(VALUE obj, VALUE rid, VALUE eid)
#if defined HAVE_SETRESUID #if defined HAVE_SETRESUID
/* /*
* call-seq: * call-seq:
* Process::Sys.setresuid(rid, eid, sid) => nil * Process::Sys.setresuid(rid, eid, sid) -> nil
* *
* Sets the (integer) real, effective, and saved user IDs of the * Sets the (integer) real, effective, and saved user IDs of the
* current process to _rid_, _eid_, and _sid_ respectively. A * current process to _rid_, _eid_, and _sid_ respectively. A
@ -3931,9 +3931,9 @@ p_sys_setresuid(VALUE obj, VALUE rid, VALUE eid, VALUE sid)
/* /*
* call-seq: * call-seq:
* Process.uid => fixnum * Process.uid -> fixnum
* Process::UID.rid => fixnum * Process::UID.rid -> fixnum
* Process::Sys.getuid => fixnum * Process::Sys.getuid -> fixnum
* *
* Returns the (real) user ID of this process. * Returns the (real) user ID of this process.
* *
@ -3951,7 +3951,7 @@ proc_getuid(VALUE obj)
#if defined(HAVE_SETRESUID) || defined(HAVE_SETREUID) || defined(HAVE_SETRUID) || defined(HAVE_SETUID) #if defined(HAVE_SETRESUID) || defined(HAVE_SETREUID) || defined(HAVE_SETRUID) || defined(HAVE_SETUID)
/* /*
* call-seq: * call-seq:
* Process.uid= integer => numeric * Process.uid= integer -> numeric
* *
* Sets the (integer) user ID for this process. Not available on all * Sets the (integer) user ID for this process. Not available on all
* platforms. * platforms.
@ -4017,7 +4017,7 @@ setreuid(rb_uid_t ruid, rb_uid_t euid)
/* /*
* call-seq: * call-seq:
* Process::UID.change_privilege(integer) => fixnum * Process::UID.change_privilege(integer) -> fixnum
* *
* Change the current process's real and effective user ID to that * Change the current process's real and effective user ID to that
* specified by _integer_. Returns the new user ID. Not * specified by _integer_. Returns the new user ID. Not
@ -4171,7 +4171,7 @@ p_uid_change_privilege(VALUE obj, VALUE id)
#if defined HAVE_SETGID #if defined HAVE_SETGID
/* /*
* call-seq: * call-seq:
* Process::Sys.setgid(integer) => nil * Process::Sys.setgid(integer) -> nil
* *
* Set the group ID of the current process to _integer_. Not * Set the group ID of the current process to _integer_. Not
* available on all platforms. * available on all platforms.
@ -4193,7 +4193,7 @@ p_sys_setgid(VALUE obj, VALUE id)
#if defined HAVE_SETRGID #if defined HAVE_SETRGID
/* /*
* call-seq: * call-seq:
* Process::Sys.setrgid(integer) => nil * Process::Sys.setrgid(integer) -> nil
* *
* Set the real group ID of the calling process to _integer_. * Set the real group ID of the calling process to _integer_.
* Not available on all platforms. * Not available on all platforms.
@ -4215,7 +4215,7 @@ p_sys_setrgid(VALUE obj, VALUE id)
#if defined HAVE_SETEGID #if defined HAVE_SETEGID
/* /*
* call-seq: * call-seq:
* Process::Sys.setegid(integer) => nil * Process::Sys.setegid(integer) -> nil
* *
* Set the effective group ID of the calling process to * Set the effective group ID of the calling process to
* _integer_. Not available on all platforms. * _integer_. Not available on all platforms.
@ -4237,7 +4237,7 @@ p_sys_setegid(VALUE obj, VALUE id)
#if defined HAVE_SETREGID #if defined HAVE_SETREGID
/* /*
* call-seq: * call-seq:
* Process::Sys.setregid(rid, eid) => nil * Process::Sys.setregid(rid, eid) -> nil
* *
* Sets the (integer) real and/or effective group IDs of the current * Sets the (integer) real and/or effective group IDs of the current
* process to <em>rid</em> and <em>eid</em>, respectively. A value of * process to <em>rid</em> and <em>eid</em>, respectively. A value of
@ -4260,7 +4260,7 @@ p_sys_setregid(VALUE obj, VALUE rid, VALUE eid)
#if defined HAVE_SETRESGID #if defined HAVE_SETRESGID
/* /*
* call-seq: * call-seq:
* Process::Sys.setresgid(rid, eid, sid) => nil * Process::Sys.setresgid(rid, eid, sid) -> nil
* *
* Sets the (integer) real, effective, and saved user IDs of the * Sets the (integer) real, effective, and saved user IDs of the
* current process to <em>rid</em>, <em>eid</em>, and <em>sid</em> * current process to <em>rid</em>, <em>eid</em>, and <em>sid</em>
@ -4284,7 +4284,7 @@ p_sys_setresgid(VALUE obj, VALUE rid, VALUE eid, VALUE sid)
#if defined HAVE_ISSETUGID #if defined HAVE_ISSETUGID
/* /*
* call-seq: * call-seq:
* Process::Sys.issetugid => true or false * Process::Sys.issetugid -> true or false
* *
* Returns +true+ if the process was created as a result * Returns +true+ if the process was created as a result
* of an execve(2) system call which had either of the setuid or * of an execve(2) system call which had either of the setuid or
@ -4311,9 +4311,9 @@ p_sys_issetugid(VALUE obj)
/* /*
* call-seq: * call-seq:
* Process.gid => fixnum * Process.gid -> fixnum
* Process::GID.rid => fixnum * Process::GID.rid -> fixnum
* Process::Sys.getgid => fixnum * Process::Sys.getgid -> fixnum
* *
* Returns the (real) group ID for this process. * Returns the (real) group ID for this process.
* *
@ -4331,7 +4331,7 @@ proc_getgid(VALUE obj)
#if defined(HAVE_SETRESGID) || defined(HAVE_SETREGID) || defined(HAVE_SETRGID) || defined(HAVE_SETGID) #if defined(HAVE_SETRESGID) || defined(HAVE_SETREGID) || defined(HAVE_SETRGID) || defined(HAVE_SETGID)
/* /*
* call-seq: * call-seq:
* Process.gid= fixnum => fixnum * Process.gid= fixnum -> fixnum
* *
* Sets the group ID for this process. * Sets the group ID for this process.
*/ */
@ -4373,7 +4373,7 @@ static int maxgroups = 32;
#ifdef HAVE_GETGROUPS #ifdef HAVE_GETGROUPS
/* /*
* call-seq: * call-seq:
* Process.groups => array * Process.groups -> array
* *
* Get an <code>Array</code> of the gids of groups in the * Get an <code>Array</code> of the gids of groups in the
* supplemental group access list for this process. * supplemental group access list for this process.
@ -4409,7 +4409,7 @@ proc_getgroups(VALUE obj)
#ifdef HAVE_SETGROUPS #ifdef HAVE_SETGROUPS
/* /*
* call-seq: * call-seq:
* Process.groups= array => array * Process.groups= array -> array
* *
* Set the supplemental group access list to the given * Set the supplemental group access list to the given
* <code>Array</code> of group IDs. * <code>Array</code> of group IDs.
@ -4470,7 +4470,7 @@ proc_setgroups(VALUE obj, VALUE ary)
#ifdef HAVE_INITGROUPS #ifdef HAVE_INITGROUPS
/* /*
* call-seq: * call-seq:
* Process.initgroups(username, gid) => array * Process.initgroups(username, gid) -> array
* *
* Initializes the supplemental group access list by reading the * Initializes the supplemental group access list by reading the
* system group database and using all groups of which the given user * system group database and using all groups of which the given user
@ -4500,7 +4500,7 @@ proc_initgroups(VALUE obj, VALUE uname, VALUE base_grp)
/* /*
* call-seq: * call-seq:
* Process.maxgroups => fixnum * Process.maxgroups -> fixnum
* *
* Returns the maximum number of gids allowed in the supplemental * Returns the maximum number of gids allowed in the supplemental
* group access list. * group access list.
@ -4517,7 +4517,7 @@ proc_getmaxgroups(VALUE obj)
/* /*
* call-seq: * call-seq:
* Process.maxgroups= fixnum => fixnum * Process.maxgroups= fixnum -> fixnum
* *
* Sets the maximum number of gids allowed in the supplemental group * Sets the maximum number of gids allowed in the supplemental group
* access list. * access list.
@ -4539,8 +4539,8 @@ proc_setmaxgroups(VALUE obj, VALUE val)
#if defined(HAVE_DAEMON) || (defined(HAVE_FORK) && defined(HAVE_SETSID)) #if defined(HAVE_DAEMON) || (defined(HAVE_FORK) && defined(HAVE_SETSID))
/* /*
* call-seq: * call-seq:
* Process.daemon() => 0 * Process.daemon() -> 0
* Process.daemon(nochdir=nil,noclose=nil) => 0 * Process.daemon(nochdir=nil,noclose=nil) -> 0
* *
* Detach the process from controlling terminal and run in * Detach the process from controlling terminal and run in
* the background as system daemon. Unless the argument * the background as system daemon. Unless the argument
@ -4635,7 +4635,7 @@ setregid(rb_gid_t rgid, rb_gid_t egid)
/* /*
* call-seq: * call-seq:
* Process::GID.change_privilege(integer) => fixnum * Process::GID.change_privilege(integer) -> fixnum
* *
* Change the current process's real and effective group ID to that * Change the current process's real and effective group ID to that
* specified by _integer_. Returns the new group ID. Not * specified by _integer_. Returns the new group ID. Not
@ -4788,9 +4788,9 @@ p_gid_change_privilege(VALUE obj, VALUE id)
/* /*
* call-seq: * call-seq:
* Process.euid => fixnum * Process.euid -> fixnum
* Process::UID.eid => fixnum * Process::UID.eid -> fixnum
* Process::Sys.geteuid => fixnum * Process::Sys.geteuid -> fixnum
* *
* Returns the effective user ID for this process. * Returns the effective user ID for this process.
* *
@ -4884,8 +4884,8 @@ rb_seteuid_core(rb_uid_t euid)
/* /*
* call-seq: * call-seq:
* Process::UID.grant_privilege(integer) => fixnum * Process::UID.grant_privilege(integer) -> fixnum
* Process::UID.eid= integer => fixnum * Process::UID.eid= integer -> fixnum
* *
* Set the effective user ID, and if possible, the saved user ID of * Set the effective user ID, and if possible, the saved user ID of
* the process to the given _integer_. Returns the new * the process to the given _integer_. Returns the new
@ -4906,9 +4906,9 @@ p_uid_grant_privilege(VALUE obj, VALUE id)
/* /*
* call-seq: * call-seq:
* Process.egid => fixnum * Process.egid -> fixnum
* Process::GID.eid => fixnum * Process::GID.eid -> fixnum
* Process::Sys.geteid => fixnum * Process::Sys.geteid -> fixnum
* *
* Returns the effective group ID for this process. Not available on * Returns the effective group ID for this process. Not available on
* all platforms. * all platforms.
@ -4927,7 +4927,7 @@ proc_getegid(VALUE obj)
#if defined(HAVE_SETRESGID) || defined(HAVE_SETREGID) || defined(HAVE_SETEGID) || defined(HAVE_SETGID) || defined(_POSIX_SAVED_IDS) #if defined(HAVE_SETRESGID) || defined(HAVE_SETREGID) || defined(HAVE_SETEGID) || defined(HAVE_SETGID) || defined(_POSIX_SAVED_IDS)
/* /*
* call-seq: * call-seq:
* Process.egid = fixnum => fixnum * Process.egid = fixnum -> fixnum
* *
* Sets the effective group ID for this process. Not available on all * Sets the effective group ID for this process. Not available on all
* platforms. * platforms.
@ -5004,8 +5004,8 @@ rb_setegid_core(rb_gid_t egid)
/* /*
* call-seq: * call-seq:
* Process::GID.grant_privilege(integer) => fixnum * Process::GID.grant_privilege(integer) -> fixnum
* Process::GID.eid = integer => fixnum * Process::GID.eid = integer -> fixnum
* *
* Set the effective group ID, and if possible, the saved group ID of * Set the effective group ID, and if possible, the saved group ID of
* the process to the given _integer_. Returns the new * the process to the given _integer_. Returns the new
@ -5026,7 +5026,7 @@ p_gid_grant_privilege(VALUE obj, VALUE id)
/* /*
* call-seq: * call-seq:
* Process::UID.re_exchangeable? => true or false * Process::UID.re_exchangeable? -> true or false
* *
* Returns +true+ if the real and effective user IDs of a * Returns +true+ if the real and effective user IDs of a
* process may be exchanged on the current platform. * process may be exchanged on the current platform.
@ -5048,7 +5048,7 @@ p_uid_exchangeable(void)
/* /*
* call-seq: * call-seq:
* Process::UID.re_exchange => fixnum * Process::UID.re_exchange -> fixnum
* *
* Exchange real and effective user IDs and return the new effective * Exchange real and effective user IDs and return the new effective
* user ID. Not available on all platforms. * user ID. Not available on all platforms.
@ -5083,7 +5083,7 @@ p_uid_exchange(VALUE obj)
/* /*
* call-seq: * call-seq:
* Process::GID.re_exchangeable? => true or false * Process::GID.re_exchangeable? -> true or false
* *
* Returns +true+ if the real and effective group IDs of a * Returns +true+ if the real and effective group IDs of a
* process may be exchanged on the current platform. * process may be exchanged on the current platform.
@ -5105,7 +5105,7 @@ p_gid_exchangeable(void)
/* /*
* call-seq: * call-seq:
* Process::GID.re_exchange => fixnum * Process::GID.re_exchange -> fixnum
* *
* Exchange real and effective group IDs and return the new effective * Exchange real and effective group IDs and return the new effective
* group ID. Not available on all platforms. * group ID. Not available on all platforms.
@ -5141,7 +5141,7 @@ p_gid_exchange(VALUE obj)
/* /*
* call-seq: * call-seq:
* Process::UID.sid_available? => true or false * Process::UID.sid_available? -> true or false
* *
* Returns +true+ if the current platform has saved user * Returns +true+ if the current platform has saved user
* ID functionality. * ID functionality.
@ -5171,8 +5171,8 @@ p_uid_sw_ensure(rb_uid_t id)
/* /*
* call-seq: * call-seq:
* Process::UID.switch => fixnum * Process::UID.switch -> fixnum
* Process::UID.switch {|| block} => object * Process::UID.switch {|| block} -> object
* *
* Switch the effective and real user IDs of the current process. If * Switch the effective and real user IDs of the current process. If
* a <em>block</em> is given, the user IDs will be switched back * a <em>block</em> is given, the user IDs will be switched back
@ -5250,7 +5250,7 @@ p_uid_switch(VALUE obj)
/* /*
* call-seq: * call-seq:
* Process::GID.sid_available? => true or false * Process::GID.sid_available? -> true or false
* *
* Returns +true+ if the current platform has saved group * Returns +true+ if the current platform has saved group
* ID functionality. * ID functionality.
@ -5279,8 +5279,8 @@ p_gid_sw_ensure(rb_gid_t id)
/* /*
* call-seq: * call-seq:
* Process::GID.switch => fixnum * Process::GID.switch -> fixnum
* Process::GID.switch {|| block} => object * Process::GID.switch {|| block} -> object
* *
* Switch the effective and real group IDs of the current process. If * Switch the effective and real group IDs of the current process. If
* a <em>block</em> is given, the group IDs will be switched back * a <em>block</em> is given, the group IDs will be switched back
@ -5359,7 +5359,7 @@ p_gid_switch(VALUE obj)
#if defined(HAVE_TIMES) #if defined(HAVE_TIMES)
/* /*
* call-seq: * call-seq:
* Process.times => aStructTms * Process.times -> aStructTms
* *
* Returns a <code>Tms</code> structure (see <code>Struct::Tms</code> * Returns a <code>Tms</code> structure (see <code>Struct::Tms</code>
* on page 388) that contains user and system CPU times for this * on page 388) that contains user and system CPU times for this

View file

@ -732,7 +732,7 @@ random_load(VALUE obj, VALUE dump)
/* /*
* call-seq: * call-seq:
* srand(number=0) => old_seed * srand(number=0) -> old_seed
* *
* Seeds the pseudorandom number generator to the value of * Seeds the pseudorandom number generator to the value of
* <i>number</i>. If <i>number</i> is omitted * <i>number</i>. If <i>number</i> is omitted
@ -1107,7 +1107,7 @@ random_equal(VALUE self, VALUE other)
/* /*
* call-seq: * call-seq:
* rand(max=0) => number * rand(max=0) -> number
* *
* Converts <i>max</i> to an integer using max1 = * Converts <i>max</i> to an integer using max1 =
* max<code>.to_i.abs</code>. If _max_ is +nil+ the result is zero, returns a * max<code>.to_i.abs</code>. If _max_ is +nil+ the result is zero, returns a

54
range.c
View file

@ -69,7 +69,7 @@ rb_range_new(VALUE beg, VALUE end, int exclude_end)
/* /*
* call-seq: * call-seq:
* Range.new(start, end, exclusive=false) => range * Range.new(start, end, exclusive=false) -> range
* *
* Constructs a range using the given <i>start</i> and <i>end</i>. If the third * Constructs a range using the given <i>start</i> and <i>end</i>. If the third
* parameter is omitted or is <code>false</code>, the <i>range</i> will include * parameter is omitted or is <code>false</code>, the <i>range</i> will include
@ -94,7 +94,7 @@ range_initialize(int argc, VALUE *argv, VALUE range)
/* /*
* call-seq: * call-seq:
* rng.exclude_end? => true or false * rng.exclude_end? -> true or false
* *
* Returns <code>true</code> if <i>rng</i> excludes its end value. * Returns <code>true</code> if <i>rng</i> excludes its end value.
*/ */
@ -122,7 +122,7 @@ recursive_equal(VALUE range, VALUE obj, int recur)
/* /*
* call-seq: * call-seq:
* rng == obj => true or false * rng == obj -> true or false
* *
* Returns <code>true</code> only if <i>obj</i> is a Range, has equivalent * Returns <code>true</code> only if <i>obj</i> is a Range, has equivalent
* beginning and end items (by comparing them with <code>==</code>), and has * beginning and end items (by comparing them with <code>==</code>), and has
@ -190,7 +190,7 @@ recursive_eql(VALUE range, VALUE obj, int recur)
/* /*
* call-seq: * call-seq:
* rng.eql?(obj) => true or false * rng.eql?(obj) -> true or false
* *
* Returns <code>true</code> only if <i>obj</i> is a Range, has equivalent * Returns <code>true</code> only if <i>obj</i> is a Range, has equivalent
* beginning and end items (by comparing them with #eql?), and has the same * beginning and end items (by comparing them with #eql?), and has the same
@ -233,7 +233,7 @@ recursive_hash(VALUE range, VALUE dummy, int recur)
/* /*
* call-seq: * call-seq:
* rng.hash => fixnum * rng.hash -> fixnum
* *
* Generate a hash value such that two ranges with the same start and * Generate a hash value such that two ranges with the same start and
* end points, and the same value for the "exclude end" flag, generate * end points, and the same value for the "exclude end" flag, generate
@ -318,8 +318,8 @@ discrete_object_p(VALUE obj)
/* /*
* call-seq: * call-seq:
* rng.step(n=1) {| obj | block } => rng * rng.step(n=1) {| obj | block } -> rng
* rng.step(n=1) => an_enumerator * rng.step(n=1) -> an_enumerator
* *
* Iterates over <i>rng</i>, passing each <i>n</i>th element to the block. If * Iterates over <i>rng</i>, passing each <i>n</i>th element to the block. If
* the range contains numbers, <i>n</i> is added for each iteration. Otherwise * the range contains numbers, <i>n</i> is added for each iteration. Otherwise
@ -455,8 +455,8 @@ sym_each_i(VALUE v, void *arg)
/* /*
* call-seq: * call-seq:
* rng.each {| i | block } => rng * rng.each {| i | block } -> rng
* rng.each => an_enumerator * rng.each -> an_enumerator
* *
* Iterates over the elements <i>rng</i>, passing each in turn to the * Iterates over the elements <i>rng</i>, passing each in turn to the
* block. You can only iterate if the start object of the range * block. You can only iterate if the start object of the range
@ -524,7 +524,7 @@ range_each(VALUE range)
/* /*
* call-seq: * call-seq:
* rng.begin => obj * rng.begin -> obj
* *
* Returns the first object in <i>rng</i>. * Returns the first object in <i>rng</i>.
*/ */
@ -538,7 +538,7 @@ range_begin(VALUE range)
/* /*
* call-seq: * call-seq:
* rng.end => obj * rng.end -> obj
* *
* Returns the object that defines the end of <i>rng</i>. * Returns the object that defines the end of <i>rng</i>.
* *
@ -570,8 +570,8 @@ first_i(VALUE i, VALUE *ary)
/* /*
* call-seq: * call-seq:
* rng.first => obj * rng.first -> obj
* rng.first(n) => an_array * rng.first(n) -> an_array
* *
* Returns the first object in <i>rng</i>, or the first +n+ elements. * Returns the first object in <i>rng</i>, or the first +n+ elements.
*/ */
@ -594,8 +594,8 @@ range_first(int argc, VALUE *argv, VALUE range)
/* /*
* call-seq: * call-seq:
* rng.last => obj * rng.last -> obj
* rng.last(n) => an_array * rng.last(n) -> an_array
* *
* Returns the last object in <i>rng</i>, or the last +n+ elements. * Returns the last object in <i>rng</i>, or the last +n+ elements.
*/ */
@ -612,8 +612,8 @@ range_last(int argc, VALUE *argv, VALUE range)
/* /*
* call-seq: * call-seq:
* rng.min => obj * rng.min -> obj
* rng.min {| a,b | block } => obj * rng.min {| a,b | block } -> obj
* *
* Returns the minimum value in <i>rng</i>. The second uses * Returns the minimum value in <i>rng</i>. The second uses
* the block to compare values. Returns nil if the first * the block to compare values. Returns nil if the first
@ -641,8 +641,8 @@ range_min(VALUE range)
/* /*
* call-seq: * call-seq:
* rng.max => obj * rng.max -> obj
* rng.max {| a,b | block } => obj * rng.max {| a,b | block } -> obj
* *
* Returns the maximum value in <i>rng</i>. The second uses * Returns the maximum value in <i>rng</i>. The second uses
* the block to compare values. Returns nil if the first * the block to compare values. Returns nil if the first
@ -749,7 +749,7 @@ rb_range_beg_len(VALUE range, long *begp, long *lenp, long len, int err)
/* /*
* call-seq: * call-seq:
* rng.to_s => string * rng.to_s -> string
* *
* Convert this range object to a printable form. * Convert this range object to a printable form.
*/ */
@ -789,7 +789,7 @@ inspect_range(VALUE range, VALUE dummy, int recur)
/* /*
* call-seq: * call-seq:
* rng.inspect => string * rng.inspect -> string
* *
* Convert this range object to a printable form (using * Convert this range object to a printable form (using
* <code>inspect</code> to convert the start and end * <code>inspect</code> to convert the start and end
@ -805,7 +805,7 @@ range_inspect(VALUE range)
/* /*
* call-seq: * call-seq:
* rng === obj => true or false * rng === obj -> true or false
* *
* Returns <code>true</code> if <i>obj</i> is an element of * Returns <code>true</code> if <i>obj</i> is an element of
* <i>rng</i>, <code>false</code> otherwise. Conveniently, * <i>rng</i>, <code>false</code> otherwise. Conveniently,
@ -832,15 +832,15 @@ range_eqq(VALUE range, VALUE val)
/* /*
* call-seq: * call-seq:
* rng.member?(val) => true or false * rng.member?(val) -> true or false
* rng.include?(val) => true or false * rng.include?(val) -> true or false
* *
* Returns <code>true</code> if <i>obj</i> is an element of * Returns <code>true</code> if <i>obj</i> is an element of
* <i>rng</i>, <code>false</code> otherwise. If beg and end are * <i>rng</i>, <code>false</code> otherwise. If beg and end are
* numeric, comparison is done according magnitude of values. * numeric, comparison is done according magnitude of values.
* *
* ("a".."z").include?("g") # => true * ("a".."z").include?("g") # -> true
* ("a".."z").include?("A") # => false * ("a".."z").include?("A") # -> false
*/ */
static VALUE static VALUE
@ -893,7 +893,7 @@ range_include(VALUE range, VALUE val)
/* /*
* call-seq: * call-seq:
* rng.cover?(val) => true or false * rng.cover?(val) -> true or false
* *
* Returns <code>true</code> if <i>obj</i> is between beg and end, * Returns <code>true</code> if <i>obj</i> is between beg and end,
* i.e <code>beg <= obj <= end</code> (or <i>end</i> exclusive when * i.e <code>beg <= obj <= end</code> (or <i>end</i> exclusive when

94
re.c
View file

@ -402,7 +402,7 @@ rb_reg_desc(const char *s, long len, VALUE re)
/* /*
* call-seq: * call-seq:
* rxp.source => str * rxp.source -> str
* *
* Returns the original string of the pattern. * Returns the original string of the pattern.
* *
@ -427,7 +427,7 @@ rb_reg_source(VALUE re)
/* /*
* call-seq: * call-seq:
* rxp.inspect => string * rxp.inspect -> string
* *
* Produce a nicely formatted string-version of _rxp_. Perhaps surprisingly, * Produce a nicely formatted string-version of _rxp_. Perhaps surprisingly,
* <code>#inspect</code> actually produces the more natural version of * <code>#inspect</code> actually produces the more natural version of
@ -449,7 +449,7 @@ rb_reg_inspect(VALUE re)
/* /*
* call-seq: * call-seq:
* rxp.to_s => str * rxp.to_s -> str
* *
* Returns a string containing the regular expression and its options (using the * Returns a string containing the regular expression and its options (using the
* <code>(?opts:source)</code> notation. This string can be fed back in to * <code>(?opts:source)</code> notation. This string can be fed back in to
@ -596,7 +596,7 @@ rb_reg_raise_str(VALUE str, int options, const char *err)
/* /*
* call-seq: * call-seq:
* rxp.casefold? => true or false * rxp.casefold? -> true or false
* *
* Returns the value of the case-insensitive flag. * Returns the value of the case-insensitive flag.
* *
@ -616,7 +616,7 @@ rb_reg_casefold_p(VALUE re)
/* /*
* call-seq: * call-seq:
* rxp.options => fixnum * rxp.options -> fixnum
* *
* Returns the set of bits corresponding to the options used when creating this * Returns the set of bits corresponding to the options used when creating this
* Regexp (see <code>Regexp::new</code> for details. Note that additional bits * Regexp (see <code>Regexp::new</code> for details. Note that additional bits
@ -655,7 +655,7 @@ reg_names_iter(const OnigUChar *name, const OnigUChar *name_end,
/* /*
* call-seq: * call-seq:
* rxp.names => [name1, name2, ...] * rxp.names -> [name1, name2, ...]
* *
* Returns a list of names of captures as an array of strings. * Returns a list of names of captures as an array of strings.
* *
@ -696,7 +696,7 @@ reg_named_captures_iter(const OnigUChar *name, const OnigUChar *name_end,
/* /*
* call-seq: * call-seq:
* rxp.named_captures => hash * rxp.named_captures -> hash
* *
* Returns a hash representing information about named captures of <i>rxp</i>. * Returns a hash representing information about named captures of <i>rxp</i>.
* *
@ -933,7 +933,7 @@ match_init_copy(VALUE obj, VALUE orig)
/* /*
* call-seq: * call-seq:
* mtch.regexp => regexp * mtch.regexp -> regexp
* *
* Returns the regexp. * Returns the regexp.
* *
@ -950,7 +950,7 @@ match_regexp(VALUE match)
/* /*
* call-seq: * call-seq:
* mtch.names => [name1, name2, ...] * mtch.names -> [name1, name2, ...]
* *
* Returns a list of names of captures as an array of strings. * Returns a list of names of captures as an array of strings.
* It is same as mtch.regexp.names. * It is same as mtch.regexp.names.
@ -971,8 +971,8 @@ match_names(VALUE match)
/* /*
* call-seq: * call-seq:
* mtch.length => integer * mtch.length -> integer
* mtch.size => integer * mtch.size -> integer
* *
* Returns the number of elements in the match array. * Returns the number of elements in the match array.
* *
@ -1031,7 +1031,7 @@ rb_reg_backref_number(VALUE match, VALUE backref)
/* /*
* call-seq: * call-seq:
* mtch.offset(n) => array * mtch.offset(n) -> array
* *
* Returns a two-element array containing the beginning and ending offsets of * Returns a two-element array containing the beginning and ending offsets of
* the <em>n</em>th match. * the <em>n</em>th match.
@ -1068,7 +1068,7 @@ match_offset(VALUE match, VALUE n)
/* /*
* call-seq: * call-seq:
* mtch.begin(n) => integer * mtch.begin(n) -> integer
* *
* Returns the offset of the start of the <em>n</em>th element of the match * Returns the offset of the start of the <em>n</em>th element of the match
* array in the string. * array in the string.
@ -1103,7 +1103,7 @@ match_begin(VALUE match, VALUE n)
/* /*
* call-seq: * call-seq:
* mtch.end(n) => integer * mtch.end(n) -> integer
* *
* Returns the offset of the character immediately following the end of the * Returns the offset of the character immediately following the end of the
* <em>n</em>th element of the match array in the string. * <em>n</em>th element of the match array in the string.
@ -1145,7 +1145,7 @@ rb_match_busy(VALUE match)
/* /*
* call-seq: * call-seq:
* rxp.fixed_encoding? => true or false * rxp.fixed_encoding? -> true or false
* *
* Returns false if rxp is applicable to * Returns false if rxp is applicable to
* a string with any ASCII compatible encoding. * a string with any ASCII compatible encoding.
@ -1440,7 +1440,7 @@ rb_reg_last_match(VALUE match)
/* /*
* call-seq: * call-seq:
* mtch.pre_match => str * mtch.pre_match -> str
* *
* Returns the portion of the original string before the current match. * Returns the portion of the original string before the current match.
* Equivalent to the special variable <code>$`</code>. * Equivalent to the special variable <code>$`</code>.
@ -1467,7 +1467,7 @@ rb_reg_match_pre(VALUE match)
/* /*
* call-seq: * call-seq:
* mtch.post_match => str * mtch.post_match -> str
* *
* Returns the portion of the original string after the current match. * Returns the portion of the original string after the current match.
* Equivalent to the special variable <code>$'</code>. * Equivalent to the special variable <code>$'</code>.
@ -1569,7 +1569,7 @@ match_array(VALUE match, int start)
/* /*
* call-seq: * call-seq:
* mtch.to_a => anArray * mtch.to_a -> anArray
* *
* Returns the array of matches. * Returns the array of matches.
* *
@ -1598,7 +1598,7 @@ match_to_a(VALUE match)
/* /*
* call-seq: * call-seq:
* mtch.captures => array * mtch.captures -> array
* *
* Returns the array of captures; equivalent to <code>mtch.to_a[1..-1]</code>. * Returns the array of captures; equivalent to <code>mtch.to_a[1..-1]</code>.
* *
@ -1633,10 +1633,10 @@ name_to_backref_number(struct re_registers *regs, VALUE regexp, const char* name
/* /*
* call-seq: * call-seq:
* mtch[i] => str or nil * mtch[i] -> str or nil
* mtch[start, length] => array * mtch[start, length] -> array
* mtch[range] => array * mtch[range] -> array
* mtch[name] => str or nil * mtch[name] -> str or nil
* *
* Match Reference---<code>MatchData</code> acts as an array, and may be * Match Reference---<code>MatchData</code> acts as an array, and may be
* accessed using the normal array indexing techniques. <i>mtch</i>[0] is * accessed using the normal array indexing techniques. <i>mtch</i>[0] is
@ -1709,7 +1709,7 @@ match_entry(VALUE match, long n)
/* /*
* call-seq: * call-seq:
* *
* mtch.values_at([index]*) => array * mtch.values_at([index]*) -> array
* *
* Uses each <i>index</i> to access the matching values, returning an array of * Uses each <i>index</i> to access the matching values, returning an array of
* the corresponding matches. * the corresponding matches.
@ -1732,7 +1732,7 @@ match_values_at(int argc, VALUE *argv, VALUE match)
/* /*
* call-seq: * call-seq:
* mtch.to_s => str * mtch.to_s -> str
* *
* Returns the entire matched string. * Returns the entire matched string.
* *
@ -1755,7 +1755,7 @@ match_to_s(VALUE match)
/* /*
* call-seq: * call-seq:
* mtch.string => str * mtch.string -> str
* *
* Returns a frozen copy of the string passed in to <code>match</code>. * Returns a frozen copy of the string passed in to <code>match</code>.
* *
@ -1791,7 +1791,7 @@ match_inspect_name_iter(const OnigUChar *name, const OnigUChar *name_end,
/* /*
* call-seq: * call-seq:
* mtch.inspect => str * mtch.inspect -> str
* *
* Returns a printable version of <i>mtch</i>. * Returns a printable version of <i>mtch</i>.
* *
@ -2508,7 +2508,7 @@ rb_reg_regcomp(VALUE str)
static st_index_t reg_hash(VALUE re); static st_index_t reg_hash(VALUE re);
/* /*
* call-seq: * call-seq:
* rxp.hash => fixnum * rxp.hash -> fixnum
* *
* Produce a hash based on the text and options of this regular expression. * Produce a hash based on the text and options of this regular expression.
*/ */
@ -2534,8 +2534,8 @@ reg_hash(VALUE re)
/* /*
* call-seq: * call-seq:
* rxp == other_rxp => true or false * rxp == other_rxp -> true or false
* rxp.eql?(other_rxp) => true or false * rxp.eql?(other_rxp) -> true or false
* *
* Equality---Two regexps are equal if their patterns are identical, they have * Equality---Two regexps are equal if their patterns are identical, they have
* the same character set code, and their <code>casefold?</code> values are the * the same character set code, and their <code>casefold?</code> values are the
@ -2565,7 +2565,7 @@ rb_reg_equal(VALUE re1, VALUE re2)
/* /*
* call-seq: * call-seq:
* mtch.hash => integer * mtch.hash -> integer
* *
* Produce a hash based on the target string, regexp and matched * Produce a hash based on the target string, regexp and matched
* positions of this matchdata. * positions of this matchdata.
@ -2588,7 +2588,7 @@ match_hash(VALUE match)
/* /*
* call-seq: * call-seq:
* mtch == mtch2 => true or false * mtch == mtch2 -> true or false
* *
* Equality---Two matchdata are equal if their target strings, * Equality---Two matchdata are equal if their target strings,
* patterns, and matched positions are identical. * patterns, and matched positions are identical.
@ -2651,7 +2651,7 @@ reg_match_pos(VALUE re, VALUE *strp, long pos)
/* /*
* call-seq: * call-seq:
* rxp =~ str => integer or nil * rxp =~ str -> integer or nil
* *
* Match---Matches <i>rxp</i> against <i>str</i>. * Match---Matches <i>rxp</i> against <i>str</i>.
* *
@ -2708,7 +2708,7 @@ rb_reg_match(VALUE re, VALUE str)
/* /*
* call-seq: * call-seq:
* rxp === str => true or false * rxp === str -> true or false
* *
* Case Equality---Synonym for <code>Regexp#=~</code> used in case statements. * Case Equality---Synonym for <code>Regexp#=~</code> used in case statements.
* *
@ -2744,7 +2744,7 @@ rb_reg_eqq(VALUE re, VALUE str)
/* /*
* call-seq: * call-seq:
* ~ rxp => integer or nil * ~ rxp -> integer or nil
* *
* Match---Matches <i>rxp</i> against the contents of <code>$_</code>. * Match---Matches <i>rxp</i> against the contents of <code>$_</code>.
* Equivalent to <code><i>rxp</i> =~ $_</code>. * Equivalent to <code><i>rxp</i> =~ $_</code>.
@ -2775,8 +2775,8 @@ rb_reg_match2(VALUE re)
/* /*
* call-seq: * call-seq:
* rxp.match(str) => matchdata or nil * rxp.match(str) -> matchdata or nil
* rxp.match(str,pos) => matchdata or nil * rxp.match(str,pos) -> matchdata or nil
* *
* Returns a <code>MatchData</code> object describing the match, or * Returns a <code>MatchData</code> object describing the match, or
* <code>nil</code> if there was no match. This is equivalent to retrieving the * <code>nil</code> if there was no match. This is equivalent to retrieving the
@ -2836,10 +2836,10 @@ rb_reg_match_m(int argc, VALUE *argv, VALUE re)
/* /*
* call-seq: * call-seq:
* Regexp.new(string [, options] [, lang]) => regexp * Regexp.new(string [, options] [, lang]) -> regexp
* Regexp.new(regexp) => regexp * Regexp.new(regexp) -> regexp
* Regexp.compile(string [, options] [, lang]) => regexp * Regexp.compile(string [, options] [, lang]) -> regexp
* Regexp.compile(regexp) => regexp * Regexp.compile(regexp) -> regexp
* *
* Constructs a new regular expression from <i>pattern</i>, which can be either * Constructs a new regular expression from <i>pattern</i>, which can be either
* a <code>String</code> or a <code>Regexp</code> (in which case that regexp's * a <code>String</code> or a <code>Regexp</code> (in which case that regexp's
@ -3013,8 +3013,8 @@ rb_reg_quote(VALUE str)
/* /*
* call-seq: * call-seq:
* Regexp.escape(str) => string * Regexp.escape(str) -> string
* Regexp.quote(str) => string * Regexp.quote(str) -> string
* *
* Escapes any characters that would have special meaning in a regular * Escapes any characters that would have special meaning in a regular
* expression. Returns a new escaped string, or self if no characters are * expression. Returns a new escaped string, or self if no characters are
@ -3188,8 +3188,8 @@ rb_reg_s_union(VALUE self, VALUE args0)
/* /*
* call-seq: * call-seq:
* Regexp.union(pat1, pat2, ...) => new_regexp * Regexp.union(pat1, pat2, ...) -> new_regexp
* Regexp.union(pats_ary) => new_regexp * Regexp.union(pats_ary) -> new_regexp
* *
* Return a <code>Regexp</code> object that is the union of the given * Return a <code>Regexp</code> object that is the union of the given
* <em>pattern</em>s, i.e., will match any of its parts. The <em>pattern</em>s * <em>pattern</em>s, i.e., will match any of its parts. The <em>pattern</em>s
@ -3404,8 +3404,8 @@ match_setter(VALUE val)
/* /*
* call-seq: * call-seq:
* Regexp.last_match => matchdata * Regexp.last_match -> matchdata
* Regexp.last_match(n) => str * Regexp.last_match(n) -> str
* *
* The first form returns the <code>MatchData</code> object generated by the * The first form returns the <code>MatchData</code> object generated by the
* last successful pattern match. Equivalent to reading the global variable * last successful pattern match. Equivalent to reading the global variable

14
ruby.c
View file

@ -1146,8 +1146,8 @@ uscore_get(void)
/* /*
* call-seq: * call-seq:
* sub(pattern, replacement) => $_ * sub(pattern, replacement) -> $_
* sub(pattern) { block } => $_ * sub(pattern) { block } -> $_
* *
* Equivalent to <code>$_.sub(<i>args</i>)</code>, except that * Equivalent to <code>$_.sub(<i>args</i>)</code>, except that
* <code>$_</code> will be updated if substitution occurs. * <code>$_</code> will be updated if substitution occurs.
@ -1166,8 +1166,8 @@ rb_f_sub(argc, argv)
/* /*
* call-seq: * call-seq:
* gsub(pattern, replacement) => string * gsub(pattern, replacement) -> string
* gsub(pattern) {|...| block } => string * gsub(pattern) {|...| block } -> string
* *
* Equivalent to <code>$_.gsub...</code>, except that <code>$_</code> * Equivalent to <code>$_.gsub...</code>, except that <code>$_</code>
* receives the modified result. * receives the modified result.
@ -1187,7 +1187,7 @@ rb_f_gsub(argc, argv)
/* /*
* call-seq: * call-seq:
* chop => string * chop -> string
* *
* Equivalent to <code>($_.dup).chop!</code>, except <code>nil</code> * Equivalent to <code>($_.dup).chop!</code>, except <code>nil</code>
* is never returned. See <code>String#chop!</code>. * is never returned. See <code>String#chop!</code>.
@ -1206,8 +1206,8 @@ rb_f_chop(void)
/* /*
* call-seq: * call-seq:
* chomp => $_ * chomp -> $_
* chomp(string) => $_ * chomp(string) -> $_
* *
* Equivalent to <code>$_ = $_.chomp(<em>string</em>)</code>. See * Equivalent to <code>$_ = $_.chomp(<em>string</em>)</code>. See
* <code>String#chomp</code>. * <code>String#chomp</code>.

View file

@ -217,8 +217,8 @@ ruby_signal_name(int no)
/* /*
* call-seq: * call-seq:
* SignalException.new(sig_name) => signal_exception * SignalException.new(sig_name) -> signal_exception
* SignalException.new(sig_number [, name]) => signal_exception * SignalException.new(sig_number [, name]) -> signal_exception
* *
* Construct a new SignalException object. +sig_name+ should be a known * Construct a new SignalException object. +sig_name+ should be a known
* signal name. * signal name.
@ -276,7 +276,7 @@ esignal_init(int argc, VALUE *argv, VALUE self)
/* /*
* call-seq: * call-seq:
* signal_exception.signo => num * signal_exception.signo -> num
* *
* Returns a signal number. * Returns a signal number.
*/ */
@ -307,7 +307,7 @@ ruby_default_signal(int sig)
/* /*
* call-seq: * call-seq:
* Process.kill(signal, pid, ...) => fixnum * Process.kill(signal, pid, ...) -> fixnum
* *
* Sends the given signal to the specified process id(s), or to the * Sends the given signal to the specified process id(s), or to the
* current process if _pid_ is zero. _signal_ may be an * current process if _pid_ is zero. _signal_ may be an
@ -900,8 +900,8 @@ rb_trap_restore_mask(void)
/* /*
* call-seq: * call-seq:
* Signal.trap( signal, command ) => obj * Signal.trap( signal, command ) -> obj
* Signal.trap( signal ) {| | block } => obj * Signal.trap( signal ) {| | block } -> obj
* *
* Specifies the handling of signals. The first parameter is a signal * Specifies the handling of signals. The first parameter is a signal
* name (a string such as ``SIGALRM'', ``SIGUSR1'', and so on) or a * name (a string such as ``SIGALRM'', ``SIGUSR1'', and so on) or a
@ -965,7 +965,7 @@ sig_trap(int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* Signal.list => a_hash * Signal.list -> a_hash
* *
* Returns a list of signal names mapped to the corresponding * Returns a list of signal names mapped to the corresponding
* underlying signal numbers. * underlying signal numbers.

View file

@ -172,8 +172,8 @@ get_hash(volatile VALUE *hash, int argc, const VALUE *argv)
/* /*
* call-seq: * call-seq:
* format(format_string [, arguments...] ) => string * format(format_string [, arguments...] ) -> string
* sprintf(format_string [, arguments...] ) => string * sprintf(format_string [, arguments...] ) -> string
* *
* Returns the string resulting from applying <i>format_string</i> to * Returns the string resulting from applying <i>format_string</i> to
* any additional arguments. Within the format string, any characters * any additional arguments. Within the format string, any characters

322
string.c
View file

@ -903,7 +903,7 @@ rb_str_resurrect(VALUE str)
/* /*
* call-seq: * call-seq:
* String.new(str="") => new_str * String.new(str="") -> new_str
* *
* Returns a new string object containing a copy of <i>str</i>. * Returns a new string object containing a copy of <i>str</i>.
*/ */
@ -1098,8 +1098,8 @@ rb_str_strlen(VALUE str)
/* /*
* call-seq: * call-seq:
* str.length => integer * str.length -> integer
* str.size => integer * str.size -> integer
* *
* Returns the character length of <i>str</i>. * Returns the character length of <i>str</i>.
*/ */
@ -1115,7 +1115,7 @@ rb_str_length(VALUE str)
/* /*
* call-seq: * call-seq:
* str.bytesize => integer * str.bytesize -> integer
* *
* Returns the length of <i>str</i> in bytes. * Returns the length of <i>str</i> in bytes.
*/ */
@ -1128,7 +1128,7 @@ rb_str_bytesize(VALUE str)
/* /*
* call-seq: * call-seq:
* str.empty? => true or false * str.empty? -> true or false
* *
* Returns <code>true</code> if <i>str</i> has a length of zero. * Returns <code>true</code> if <i>str</i> has a length of zero.
* *
@ -1146,7 +1146,7 @@ rb_str_empty(VALUE str)
/* /*
* call-seq: * call-seq:
* str + other_str => new_str * str + other_str -> new_str
* *
* Concatenation---Returns a new <code>String</code> containing * Concatenation---Returns a new <code>String</code> containing
* <i>other_str</i> concatenated to <i>str</i>. * <i>other_str</i> concatenated to <i>str</i>.
@ -1177,7 +1177,7 @@ rb_str_plus(VALUE str1, VALUE str2)
/* /*
* call-seq: * call-seq:
* str * integer => new_str * str * integer -> new_str
* *
* Copy---Returns a new <code>String</code> containing <i>integer</i> copies of * Copy---Returns a new <code>String</code> containing <i>integer</i> copies of
* the receiver. * the receiver.
@ -1220,7 +1220,7 @@ rb_str_times(VALUE str, VALUE times)
/* /*
* call-seq: * call-seq:
* str % arg => new_str * str % arg -> new_str
* *
* Format---Uses <i>str</i> as a format specification, and returns the result * Format---Uses <i>str</i> as a format specification, and returns the result
* of applying it to <i>arg</i>. If the format specification contains more than * of applying it to <i>arg</i>. If the format specification contains more than
@ -1974,10 +1974,10 @@ rb_str_append(VALUE str, VALUE str2)
/* /*
* call-seq: * call-seq:
* str << integer => str * str << integer -> str
* str.concat(integer) => str * str.concat(integer) -> str
* str << obj => str * str << obj -> str
* str.concat(obj) => str * str.concat(obj) -> str
* *
* Append---Concatenates the given object to <i>str</i>. If the object is a * Append---Concatenates the given object to <i>str</i>. If the object is a
* <code>Integer</code>, it is considered as a codepoint, and is converted * <code>Integer</code>, it is considered as a codepoint, and is converted
@ -2058,7 +2058,7 @@ rb_str_hash_cmp(VALUE str1, VALUE str2)
/* /*
* call-seq: * call-seq:
* str.hash => fixnum * str.hash -> fixnum
* *
* Return a hash based on the string's length and content. * Return a hash based on the string's length and content.
*/ */
@ -2135,7 +2135,7 @@ str_eql(const VALUE str1, const VALUE str2)
} }
/* /*
* call-seq: * call-seq:
* str == obj => true or false * str == obj -> true or false
* *
* Equality---If <i>obj</i> is not a <code>String</code>, returns * Equality---If <i>obj</i> is not a <code>String</code>, returns
* <code>false</code>. Otherwise, returns <code>true</code> if <i>str</i> * <code>false</code>. Otherwise, returns <code>true</code> if <i>str</i>
@ -2157,7 +2157,7 @@ rb_str_equal(VALUE str1, VALUE str2)
/* /*
* call-seq: * call-seq:
* str.eql?(other) => true or false * str.eql?(other) -> true or false
* *
* Two strings are equal if they have the same length and content. * Two strings are equal if they have the same length and content.
*/ */
@ -2171,7 +2171,7 @@ rb_str_eql(VALUE str1, VALUE str2)
/* /*
* call-seq: * call-seq:
* str <=> other_str => -1, 0, +1 or nil * str <=> other_str -> -1, 0, +1 or nil
* *
* Comparison---Returns -1 if <i>other_str</i> is greater than, 0 if * Comparison---Returns -1 if <i>other_str</i> is greater than, 0 if
* <i>other_str</i> is equal to, and +1 if <i>other_str</i> is less than * <i>other_str</i> is equal to, and +1 if <i>other_str</i> is less than
@ -2222,7 +2222,7 @@ rb_str_cmp_m(VALUE str1, VALUE str2)
/* /*
* call-seq: * call-seq:
* str.casecmp(other_str) => -1, 0, +1 or nil * str.casecmp(other_str) -> -1, 0, +1 or nil
* *
* Case-insensitive version of <code>String#<=></code>. * Case-insensitive version of <code>String#<=></code>.
* *
@ -2336,8 +2336,8 @@ rb_str_index(VALUE str, VALUE sub, long offset)
/* /*
* call-seq: * call-seq:
* str.index(substring [, offset]) => fixnum or nil * str.index(substring [, offset]) -> fixnum or nil
* str.index(regexp [, offset]) => fixnum or nil * str.index(regexp [, offset]) -> fixnum or nil
* *
* Returns the index of the first occurrence of the given <i>substring</i> or * Returns the index of the first occurrence of the given <i>substring</i> or
* pattern (<i>regexp</i>) in <i>str</i>. Returns <code>nil</code> if not * pattern (<i>regexp</i>) in <i>str</i>. Returns <code>nil</code> if not
@ -2447,8 +2447,8 @@ rb_str_rindex(VALUE str, VALUE sub, long pos)
/* /*
* call-seq: * call-seq:
* str.rindex(substring [, fixnum]) => fixnum or nil * str.rindex(substring [, fixnum]) -> fixnum or nil
* str.rindex(regexp [, fixnum]) => fixnum or nil * str.rindex(regexp [, fixnum]) -> fixnum or nil
* *
* Returns the index of the last occurrence of the given <i>substring</i> or * Returns the index of the last occurrence of the given <i>substring</i> or
* pattern (<i>regexp</i>) in <i>str</i>. Returns <code>nil</code> if not * pattern (<i>regexp</i>) in <i>str</i>. Returns <code>nil</code> if not
@ -2522,7 +2522,7 @@ rb_str_rindex_m(int argc, VALUE *argv, VALUE str)
/* /*
* call-seq: * call-seq:
* str =~ obj => fixnum or nil * str =~ obj -> fixnum or nil
* *
* Match---If <i>obj</i> is a <code>Regexp</code>, use it as a pattern to match * Match---If <i>obj</i> is a <code>Regexp</code>, use it as a pattern to match
* against <i>str</i>,and returns the position the match starts, or * against <i>str</i>,and returns the position the match starts, or
@ -2555,8 +2555,8 @@ static VALUE get_pat(VALUE, int);
/* /*
* call-seq: * call-seq:
* str.match(pattern) => matchdata or nil * str.match(pattern) -> matchdata or nil
* str.match(pattern, pos) => matchdata or nil * str.match(pattern, pos) -> matchdata or nil
* *
* Converts <i>pattern</i> to a <code>Regexp</code> (if it isn't already one), * Converts <i>pattern</i> to a <code>Regexp</code> (if it isn't already one),
* then invokes its <code>match</code> method on <i>str</i>. If the second * then invokes its <code>match</code> method on <i>str</i>. If the second
@ -2741,8 +2741,8 @@ enc_succ_alnum_char(char *p, long len, rb_encoding *enc, char *carry)
/* /*
* call-seq: * call-seq:
* str.succ => new_str * str.succ -> new_str
* str.next => new_str * str.next -> new_str
* *
* Returns the successor to <i>str</i>. The successor is calculated by * Returns the successor to <i>str</i>. The successor is calculated by
* incrementing characters starting from the rightmost alphanumeric (or * incrementing characters starting from the rightmost alphanumeric (or
@ -2840,8 +2840,8 @@ rb_str_succ(VALUE orig)
/* /*
* call-seq: * call-seq:
* str.succ! => str * str.succ! -> str
* str.next! => str * str.next! -> str
* *
* Equivalent to <code>String#succ</code>, but modifies the receiver in * Equivalent to <code>String#succ</code>, but modifies the receiver in
* place. * place.
@ -2858,8 +2858,8 @@ rb_str_succ_bang(VALUE str)
/* /*
* call-seq: * call-seq:
* str.upto(other_str, exclusive=false) {|s| block } => str * str.upto(other_str, exclusive=false) {|s| block } -> str
* str.upto(other_str, exclusive=false) => an_enumerator * str.upto(other_str, exclusive=false) -> an_enumerator
* *
* Iterates through successive values, starting at <i>str</i> and * Iterates through successive values, starting at <i>str</i> and
* ending at <i>other_str</i> inclusive, passing each value in turn to * ending at <i>other_str</i> inclusive, passing each value in turn to
@ -2883,9 +2883,9 @@ rb_str_succ_bang(VALUE str)
* both are recognized as decimal numbers. In addition, the width of * both are recognized as decimal numbers. In addition, the width of
* string (e.g. leading zeros) is handled appropriately. * string (e.g. leading zeros) is handled appropriately.
* *
* "9".upto("11").to_a => ["9", "10", "11"] * "9".upto("11").to_a #=> ["9", "10", "11"]
* "25".upto("5").to_a => [] * "25".upto("5").to_a #=> []
* "07".upto("11").to_a => ["07", "08", "09", "10", "11"] * "07".upto("11").to_a #=> ["07", "08", "09", "10", "11"]
*/ */
static VALUE static VALUE
@ -3043,19 +3043,19 @@ rb_str_aref(VALUE str, VALUE indx)
/* /*
* call-seq: * call-seq:
* str[fixnum] => new_str or nil * str[fixnum] -> new_str or nil
* str[fixnum, fixnum] => new_str or nil * str[fixnum, fixnum] -> new_str or nil
* str[range] => new_str or nil * str[range] -> new_str or nil
* str[regexp] => new_str or nil * str[regexp] -> new_str or nil
* str[regexp, fixnum] => new_str or nil * str[regexp, fixnum] -> new_str or nil
* str[other_str] => new_str or nil * str[other_str] -> new_str or nil
* str.slice(fixnum) => new_str or nil * str.slice(fixnum) -> new_str or nil
* str.slice(fixnum, fixnum) => new_str or nil * str.slice(fixnum, fixnum) -> new_str or nil
* str.slice(range) => new_str or nil * str.slice(range) -> new_str or nil
* str.slice(regexp) => new_str or nil * str.slice(regexp) -> new_str or nil
* str.slice(regexp, fixnum) => new_str or nil * str.slice(regexp, fixnum) -> new_str or nil
* str.slice(regexp, capname) => new_str or nil * str.slice(regexp, capname) -> new_str or nil
* str.slice(other_str) => new_str or nil * str.slice(other_str) -> new_str or nil
* *
* Element Reference---If passed a single <code>Fixnum</code>, returns a * Element Reference---If passed a single <code>Fixnum</code>, returns a
* substring of one character at that position. If passed two <code>Fixnum</code> * substring of one character at that position. If passed two <code>Fixnum</code>
@ -3336,7 +3336,7 @@ rb_str_aset_m(int argc, VALUE *argv, VALUE str)
/* /*
* call-seq: * call-seq:
* str.insert(index, other_str) => str * str.insert(index, other_str) -> str
* *
* Inserts <i>other_str</i> before the character at the given * Inserts <i>other_str</i> before the character at the given
* <i>index</i>, modifying <i>str</i>. Negative indices count from the * <i>index</i>, modifying <i>str</i>. Negative indices count from the
@ -3369,11 +3369,11 @@ rb_str_insert(VALUE str, VALUE idx, VALUE str2)
/* /*
* call-seq: * call-seq:
* str.slice!(fixnum) => fixnum or nil * str.slice!(fixnum) -> fixnum or nil
* str.slice!(fixnum, fixnum) => new_str or nil * str.slice!(fixnum, fixnum) -> new_str or nil
* str.slice!(range) => new_str or nil * str.slice!(range) -> new_str or nil
* str.slice!(regexp) => new_str or nil * str.slice!(regexp) -> new_str or nil
* str.slice!(other_str) => new_str or nil * str.slice!(other_str) -> new_str or nil
* *
* Deletes the specified portion from <i>str</i>, and returns the portion * Deletes the specified portion from <i>str</i>, and returns the portion
* deleted. * deleted.
@ -3438,8 +3438,8 @@ get_pat(VALUE pat, int quote)
/* /*
* call-seq: * call-seq:
* str.sub!(pattern, replacement) => str or nil * str.sub!(pattern, replacement) -> str or nil
* str.sub!(pattern) {|match| block } => str or nil * str.sub!(pattern) {|match| block } -> str or nil
* *
* Performs the substitutions of <code>String#sub</code> in place, * Performs the substitutions of <code>String#sub</code> in place,
* returning <i>str</i>, or <code>nil</code> if no substitutions were * returning <i>str</i>, or <code>nil</code> if no substitutions were
@ -3549,9 +3549,9 @@ rb_str_sub_bang(int argc, VALUE *argv, VALUE str)
/* /*
* call-seq: * call-seq:
* str.sub(pattern, replacement) => new_str * str.sub(pattern, replacement) -> new_str
* str.sub(pattern) {|match| block } => new_str * str.sub(pattern) {|match| block } -> new_str
* str.sub(pattern) => an_enumerator * str.sub(pattern) -> an_enumerator
* *
* Returns a copy of <i>str</i> with the <em>first</em> occurrence of * Returns a copy of <i>str</i> with the <em>first</em> occurrence of
* <i>pattern</i> replaced with either <i>replacement</i> or the value of the * <i>pattern</i> replaced with either <i>replacement</i> or the value of the
@ -3703,8 +3703,8 @@ str_gsub(int argc, VALUE *argv, VALUE str, int bang)
/* /*
* call-seq: * call-seq:
* str.gsub!(pattern, replacement) => str or nil * str.gsub!(pattern, replacement) -> str or nil
* str.gsub!(pattern) {|match| block } => str or nil * str.gsub!(pattern) {|match| block } -> str or nil
* *
* Performs the substitutions of <code>String#gsub</code> in place, returning * Performs the substitutions of <code>String#gsub</code> in place, returning
* <i>str</i>, or <code>nil</code> if no substitutions were performed. * <i>str</i>, or <code>nil</code> if no substitutions were performed.
@ -3720,8 +3720,8 @@ rb_str_gsub_bang(int argc, VALUE *argv, VALUE str)
/* /*
* call-seq: * call-seq:
* str.gsub(pattern, replacement) => new_str * str.gsub(pattern, replacement) -> new_str
* str.gsub(pattern) {|match| block } => new_str * str.gsub(pattern) {|match| block } -> new_str
* *
* Returns a copy of <i>str</i> with <em>all</em> occurrences of <i>pattern</i> * Returns a copy of <i>str</i> with <em>all</em> occurrences of <i>pattern</i>
* replaced with either <i>replacement</i> or the value of the block. The * replaced with either <i>replacement</i> or the value of the block. The
@ -3760,7 +3760,7 @@ rb_str_gsub(int argc, VALUE *argv, VALUE str)
/* /*
* call-seq: * call-seq:
* str.replace(other_str) => str * str.replace(other_str) -> str
* *
* Replaces the contents and taintedness of <i>str</i> with the corresponding * Replaces the contents and taintedness of <i>str</i> with the corresponding
* values in <i>other_str</i>. * values in <i>other_str</i>.
@ -3822,7 +3822,7 @@ rb_str_chr(VALUE str)
/* /*
* call-seq: * call-seq:
* str.getbyte(index) => 0 .. 255 * str.getbyte(index) -> 0 .. 255
* *
* returns the <i>index</i>th byte as an integer. * returns the <i>index</i>th byte as an integer.
*/ */
@ -3841,7 +3841,7 @@ rb_str_getbyte(VALUE str, VALUE index)
/* /*
* call-seq: * call-seq:
* str.setbyte(index, int) => int * str.setbyte(index, int) -> int
* *
* modifies the <i>index</i>th byte as <i>int</i>. * modifies the <i>index</i>th byte as <i>int</i>.
*/ */
@ -3865,7 +3865,7 @@ rb_str_setbyte(VALUE str, VALUE index, VALUE value)
/* /*
* call-seq: * call-seq:
* str.reverse => new_str * str.reverse -> new_str
* *
* Returns a new string with the characters from <i>str</i> in reverse order. * Returns a new string with the characters from <i>str</i> in reverse order.
* *
@ -3931,7 +3931,7 @@ rb_str_reverse(VALUE str)
/* /*
* call-seq: * call-seq:
* str.reverse! => str * str.reverse! -> str
* *
* Reverses <i>str</i> in place. * Reverses <i>str</i> in place.
*/ */
@ -3965,7 +3965,7 @@ rb_str_reverse_bang(VALUE str)
/* /*
* call-seq: * call-seq:
* str.include? other_str => true or false * str.include? other_str -> true or false
* *
* Returns <code>true</code> if <i>str</i> contains the given string or * Returns <code>true</code> if <i>str</i> contains the given string or
* character. * character.
@ -3990,7 +3990,7 @@ rb_str_include(VALUE str, VALUE arg)
/* /*
* call-seq: * call-seq:
* str.to_i(base=10) => integer * str.to_i(base=10) -> integer
* *
* Returns the result of interpreting leading characters in <i>str</i> as an * Returns the result of interpreting leading characters in <i>str</i> as an
* integer base <i>base</i> (between 2 and 36). Extraneous characters past the * integer base <i>base</i> (between 2 and 36). Extraneous characters past the
@ -4030,7 +4030,7 @@ rb_str_to_i(int argc, VALUE *argv, VALUE str)
/* /*
* call-seq: * call-seq:
* str.to_f => float * str.to_f -> float
* *
* Returns the result of interpreting leading characters in <i>str</i> as a * Returns the result of interpreting leading characters in <i>str</i> as a
* floating point number. Extraneous characters past the end of a valid number * floating point number. Extraneous characters past the end of a valid number
@ -4051,8 +4051,8 @@ rb_str_to_f(VALUE str)
/* /*
* call-seq: * call-seq:
* str.to_s => str * str.to_s -> str
* str.to_str => str * str.to_str -> str
* *
* Returns the receiver. * Returns the receiver.
*/ */
@ -4080,7 +4080,7 @@ str_cat_char(VALUE str, unsigned int c, rb_encoding *enc)
/* /*
* call-seq: * call-seq:
* str.inspect => string * str.inspect -> string
* *
* Returns a printable version of _str_, surrounded by quote marks, * Returns a printable version of _str_, surrounded by quote marks,
* with special characters escaped. * with special characters escaped.
@ -4197,7 +4197,7 @@ rb_str_inspect(VALUE str)
/* /*
* call-seq: * call-seq:
* str.dump => new_str * str.dump -> new_str
* *
* Produces a version of <i>str</i> with all nonprinting characters replaced by * Produces a version of <i>str</i> with all nonprinting characters replaced by
* <code>\nnn</code> notation and all special characters escaped. * <code>\nnn</code> notation and all special characters escaped.
@ -4347,7 +4347,7 @@ rb_str_check_dummy_enc(rb_encoding *enc)
/* /*
* call-seq: * call-seq:
* str.upcase! => str or nil * str.upcase! -> str or nil
* *
* Upcases the contents of <i>str</i>, returning <code>nil</code> if no changes * Upcases the contents of <i>str</i>, returning <code>nil</code> if no changes
* were made. * were made.
@ -4409,7 +4409,7 @@ rb_str_upcase_bang(VALUE str)
/* /*
* call-seq: * call-seq:
* str.upcase => new_str * str.upcase -> new_str
* *
* Returns a copy of <i>str</i> with all lowercase letters replaced with their * Returns a copy of <i>str</i> with all lowercase letters replaced with their
* uppercase counterparts. The operation is locale insensitive---only * uppercase counterparts. The operation is locale insensitive---only
@ -4430,7 +4430,7 @@ rb_str_upcase(VALUE str)
/* /*
* call-seq: * call-seq:
* str.downcase! => str or nil * str.downcase! -> str or nil
* *
* Downcases the contents of <i>str</i>, returning <code>nil</code> if no * Downcases the contents of <i>str</i>, returning <code>nil</code> if no
* changes were made. * changes were made.
@ -4492,7 +4492,7 @@ rb_str_downcase_bang(VALUE str)
/* /*
* call-seq: * call-seq:
* str.downcase => new_str * str.downcase -> new_str
* *
* Returns a copy of <i>str</i> with all uppercase letters replaced with their * Returns a copy of <i>str</i> with all uppercase letters replaced with their
* lowercase counterparts. The operation is locale insensitive---only * lowercase counterparts. The operation is locale insensitive---only
@ -4513,7 +4513,7 @@ rb_str_downcase(VALUE str)
/* /*
* call-seq: * call-seq:
* str.capitalize! => str or nil * str.capitalize! -> str or nil
* *
* Modifies <i>str</i> by converting the first character to uppercase and the * Modifies <i>str</i> by converting the first character to uppercase and the
* remainder to lowercase. Returns <code>nil</code> if no changes are made. * remainder to lowercase. Returns <code>nil</code> if no changes are made.
@ -4562,7 +4562,7 @@ rb_str_capitalize_bang(VALUE str)
/* /*
* call-seq: * call-seq:
* str.capitalize => new_str * str.capitalize -> new_str
* *
* Returns a copy of <i>str</i> with the first character converted to uppercase * Returns a copy of <i>str</i> with the first character converted to uppercase
* and the remainder to lowercase. * and the remainder to lowercase.
@ -4584,7 +4584,7 @@ rb_str_capitalize(VALUE str)
/* /*
* call-seq: * call-seq:
* str.swapcase! => str or nil * str.swapcase! -> str or nil
* *
* Equivalent to <code>String#swapcase</code>, but modifies the receiver in * Equivalent to <code>String#swapcase</code>, but modifies the receiver in
* place, returning <i>str</i>, or <code>nil</code> if no changes were made. * place, returning <i>str</i>, or <code>nil</code> if no changes were made.
@ -4626,7 +4626,7 @@ rb_str_swapcase_bang(VALUE str)
/* /*
* call-seq: * call-seq:
* str.swapcase => new_str * str.swapcase -> new_str
* *
* Returns a copy of <i>str</i> with uppercase alphabetic characters converted * Returns a copy of <i>str</i> with uppercase alphabetic characters converted
* to lowercase and lowercase characters converted to uppercase. * to lowercase and lowercase characters converted to uppercase.
@ -4943,7 +4943,7 @@ tr_trans(VALUE str, VALUE src, VALUE repl, int sflag)
/* /*
* call-seq: * call-seq:
* str.tr!(from_str, to_str) => str or nil * str.tr!(from_str, to_str) -> str or nil
* *
* Translates <i>str</i> in place, using the same rules as * Translates <i>str</i> in place, using the same rules as
* <code>String#tr</code>. Returns <i>str</i>, or <code>nil</code> if no * <code>String#tr</code>. Returns <i>str</i>, or <code>nil</code> if no
@ -4959,7 +4959,7 @@ rb_str_tr_bang(VALUE str, VALUE src, VALUE repl)
/* /*
* call-seq: * call-seq:
* str.tr(from_str, to_str) => new_str * str.tr(from_str, to_str) -> new_str
* *
* Returns a copy of <i>str</i> with the characters in <i>from_str</i> replaced * Returns a copy of <i>str</i> with the characters in <i>from_str</i> replaced
* by the corresponding characters in <i>to_str</i>. If <i>to_str</i> is * by the corresponding characters in <i>to_str</i>. If <i>to_str</i> is
@ -5058,7 +5058,7 @@ tr_find(unsigned int c, char table[256], VALUE del, VALUE nodel)
/* /*
* call-seq: * call-seq:
* str.delete!([other_str]+) => str or nil * str.delete!([other_str]+) -> str or nil
* *
* Performs a <code>delete</code> operation in place, returning <i>str</i>, or * Performs a <code>delete</code> operation in place, returning <i>str</i>, or
* <code>nil</code> if <i>str</i> was not modified. * <code>nil</code> if <i>str</i> was not modified.
@ -5130,7 +5130,7 @@ rb_str_delete_bang(int argc, VALUE *argv, VALUE str)
/* /*
* call-seq: * call-seq:
* str.delete([other_str]+) => new_str * str.delete([other_str]+) -> new_str
* *
* Returns a copy of <i>str</i> with all characters in the intersection of its * Returns a copy of <i>str</i> with all characters in the intersection of its
* arguments deleted. Uses the same rules for building the set of characters as * arguments deleted. Uses the same rules for building the set of characters as
@ -5153,7 +5153,7 @@ rb_str_delete(int argc, VALUE *argv, VALUE str)
/* /*
* call-seq: * call-seq:
* str.squeeze!([other_str]*) => str or nil * str.squeeze!([other_str]*) -> str or nil
* *
* Squeezes <i>str</i> in place, returning either <i>str</i>, or * Squeezes <i>str</i> in place, returning either <i>str</i>, or
* <code>nil</code> if no changes were made. * <code>nil</code> if no changes were made.
@ -5236,7 +5236,7 @@ rb_str_squeeze_bang(int argc, VALUE *argv, VALUE str)
/* /*
* call-seq: * call-seq:
* str.squeeze([other_str]*) => new_str * str.squeeze([other_str]*) -> new_str
* *
* Builds a set of characters from the <i>other_str</i> parameter(s) using the * Builds a set of characters from the <i>other_str</i> parameter(s) using the
* procedure described for <code>String#count</code>. Returns a new string * procedure described for <code>String#count</code>. Returns a new string
@ -5260,7 +5260,7 @@ rb_str_squeeze(int argc, VALUE *argv, VALUE str)
/* /*
* call-seq: * call-seq:
* str.tr_s!(from_str, to_str) => str or nil * str.tr_s!(from_str, to_str) -> str or nil
* *
* Performs <code>String#tr_s</code> processing on <i>str</i> in place, * Performs <code>String#tr_s</code> processing on <i>str</i> in place,
* returning <i>str</i>, or <code>nil</code> if no changes were made. * returning <i>str</i>, or <code>nil</code> if no changes were made.
@ -5275,7 +5275,7 @@ rb_str_tr_s_bang(VALUE str, VALUE src, VALUE repl)
/* /*
* call-seq: * call-seq:
* str.tr_s(from_str, to_str) => new_str * str.tr_s(from_str, to_str) -> new_str
* *
* Processes a copy of <i>str</i> as described under <code>String#tr</code>, * Processes a copy of <i>str</i> as described under <code>String#tr</code>,
* then removes duplicate characters in regions that were affected by the * then removes duplicate characters in regions that were affected by the
@ -5297,7 +5297,7 @@ rb_str_tr_s(VALUE str, VALUE src, VALUE repl)
/* /*
* call-seq: * call-seq:
* str.count([other_str]+) => fixnum * str.count([other_str]+) -> fixnum
* *
* Each <i>other_str</i> parameter defines a set of characters to count. The * Each <i>other_str</i> parameter defines a set of characters to count. The
* intersection of these sets defines the characters to count in * intersection of these sets defines the characters to count in
@ -5396,7 +5396,7 @@ static const char isspacetable[256] = {
/* /*
* call-seq: * call-seq:
* str.split(pattern=$;, [limit]) => anArray * str.split(pattern=$;, [limit]) -> anArray
* *
* Divides <i>str</i> into substrings based on a delimiter, returning an array * Divides <i>str</i> into substrings based on a delimiter, returning an array
* of these substrings. * of these substrings.
@ -5664,11 +5664,11 @@ rb_str_split(VALUE str, const char *sep0)
/* /*
* call-seq: * call-seq:
* str.each_line(separator=$/) {|substr| block } => str * str.each_line(separator=$/) {|substr| block } -> str
* str.each_line(separator=$/) => an_enumerator * str.each_line(separator=$/) -> an_enumerator
* *
* str.lines(separator=$/) {|substr| block } => str * str.lines(separator=$/) {|substr| block } -> str
* str.lines(separator=$/) => an_enumerator * str.lines(separator=$/) -> an_enumerator
* *
* Splits <i>str</i> using the supplied parameter as the record separator * Splits <i>str</i> using the supplied parameter as the record separator
* (<code>$/</code> by default), passing each substring in turn to the supplied * (<code>$/</code> by default), passing each substring in turn to the supplied
@ -5799,11 +5799,11 @@ rb_str_each_line(int argc, VALUE *argv, VALUE str)
/* /*
* call-seq: * call-seq:
* str.bytes {|fixnum| block } => str * str.bytes {|fixnum| block } -> str
* str.bytes => an_enumerator * str.bytes -> an_enumerator
* *
* str.each_byte {|fixnum| block } => str * str.each_byte {|fixnum| block } -> str
* str.each_byte => an_enumerator * str.each_byte -> an_enumerator
* *
* Passes each byte in <i>str</i> to the given block, or returns * Passes each byte in <i>str</i> to the given block, or returns
* an enumerator if no block is given. * an enumerator if no block is given.
@ -5830,11 +5830,11 @@ rb_str_each_byte(VALUE str)
/* /*
* call-seq: * call-seq:
* str.chars {|cstr| block } => str * str.chars {|cstr| block } -> str
* str.chars => an_enumerator * str.chars -> an_enumerator
* *
* str.each_char {|cstr| block } => str * str.each_char {|cstr| block } -> str
* str.each_char => an_enumerator * str.each_char -> an_enumerator
* *
* Passes each character in <i>str</i> to the given block, or returns * Passes each character in <i>str</i> to the given block, or returns
* an enumerator if no block is given. * an enumerator if no block is given.
@ -5878,11 +5878,11 @@ rb_str_each_char(VALUE str)
/* /*
* call-seq: * call-seq:
* str.codepoints {|integer| block } => str * str.codepoints {|integer| block } -> str
* str.codepoints => an_enumerator * str.codepoints -> an_enumerator
* *
* str.each_codepoint {|integer| block } => str * str.each_codepoint {|integer| block } -> str
* str.each_codepoint => an_enumerator * str.each_codepoint -> an_enumerator
* *
* Passes the <code>Integer</code> ordinal of each character in <i>str</i>, * Passes the <code>Integer</code> ordinal of each character in <i>str</i>,
* also known as a <i>codepoint</i> when applied to Unicode strings to the * also known as a <i>codepoint</i> when applied to Unicode strings to the
@ -5942,7 +5942,7 @@ chopped_length(VALUE str)
/* /*
* call-seq: * call-seq:
* str.chop! => str or nil * str.chop! -> str or nil
* *
* Processes <i>str</i> as for <code>String#chop</code>, returning <i>str</i>, * Processes <i>str</i> as for <code>String#chop</code>, returning <i>str</i>,
* or <code>nil</code> if <i>str</i> is the empty string. See also * or <code>nil</code> if <i>str</i> is the empty string. See also
@ -5969,7 +5969,7 @@ rb_str_chop_bang(VALUE str)
/* /*
* call-seq: * call-seq:
* str.chop => new_str * str.chop -> new_str
* *
* Returns a new <code>String</code> with the last character removed. If the * Returns a new <code>String</code> with the last character removed. If the
* string ends with <code>\r\n</code>, both characters are removed. Applying * string ends with <code>\r\n</code>, both characters are removed. Applying
@ -5996,7 +5996,7 @@ rb_str_chop(VALUE str)
/* /*
* call-seq: * call-seq:
* str.chomp!(separator=$/) => str or nil * str.chomp!(separator=$/) -> str or nil
* *
* Modifies <i>str</i> in place as described for <code>String#chomp</code>, * Modifies <i>str</i> in place as described for <code>String#chomp</code>,
* returning <i>str</i>, or <code>nil</code> if no modifications were made. * returning <i>str</i>, or <code>nil</code> if no modifications were made.
@ -6105,7 +6105,7 @@ rb_str_chomp_bang(int argc, VALUE *argv, VALUE str)
/* /*
* call-seq: * call-seq:
* str.chomp(separator=$/) => new_str * str.chomp(separator=$/) -> new_str
* *
* Returns a new <code>String</code> with the given record separator removed * Returns a new <code>String</code> with the given record separator removed
* from the end of <i>str</i> (if present). If <code>$/</code> has not been * from the end of <i>str</i> (if present). If <code>$/</code> has not been
@ -6132,7 +6132,7 @@ rb_str_chomp(int argc, VALUE *argv, VALUE str)
/* /*
* call-seq: * call-seq:
* str.lstrip! => self or nil * str.lstrip! -> self or nil
* *
* Removes leading whitespace from <i>str</i>, returning <code>nil</code> if no * Removes leading whitespace from <i>str</i>, returning <code>nil</code> if no
* change was made. See also <code>String#rstrip!</code> and * change was made. See also <code>String#rstrip!</code> and
@ -6174,7 +6174,7 @@ rb_str_lstrip_bang(VALUE str)
/* /*
* call-seq: * call-seq:
* str.lstrip => new_str * str.lstrip -> new_str
* *
* Returns a copy of <i>str</i> with leading whitespace removed. See also * Returns a copy of <i>str</i> with leading whitespace removed. See also
* <code>String#rstrip</code> and <code>String#strip</code>. * <code>String#rstrip</code> and <code>String#strip</code>.
@ -6194,7 +6194,7 @@ rb_str_lstrip(VALUE str)
/* /*
* call-seq: * call-seq:
* str.rstrip! => self or nil * str.rstrip! -> self or nil
* *
* Removes trailing whitespace from <i>str</i>, returning <code>nil</code> if * Removes trailing whitespace from <i>str</i>, returning <code>nil</code> if
* no change was made. See also <code>String#lstrip!</code> and * no change was made. See also <code>String#lstrip!</code> and
@ -6244,7 +6244,7 @@ rb_str_rstrip_bang(VALUE str)
/* /*
* call-seq: * call-seq:
* str.rstrip => new_str * str.rstrip -> new_str
* *
* Returns a copy of <i>str</i> with trailing whitespace removed. See also * Returns a copy of <i>str</i> with trailing whitespace removed. See also
* <code>String#lstrip</code> and <code>String#strip</code>. * <code>String#lstrip</code> and <code>String#strip</code>.
@ -6264,7 +6264,7 @@ rb_str_rstrip(VALUE str)
/* /*
* call-seq: * call-seq:
* str.strip! => str or nil * str.strip! -> str or nil
* *
* Removes leading and trailing whitespace from <i>str</i>. Returns * Removes leading and trailing whitespace from <i>str</i>. Returns
* <code>nil</code> if <i>str</i> was not altered. * <code>nil</code> if <i>str</i> was not altered.
@ -6283,7 +6283,7 @@ rb_str_strip_bang(VALUE str)
/* /*
* call-seq: * call-seq:
* str.strip => new_str * str.strip -> new_str
* *
* Returns a copy of <i>str</i> with leading and trailing whitespace removed. * Returns a copy of <i>str</i> with leading and trailing whitespace removed.
* *
@ -6339,8 +6339,8 @@ scan_once(VALUE str, VALUE pat, long *start)
/* /*
* call-seq: * call-seq:
* str.scan(pattern) => array * str.scan(pattern) -> array
* str.scan(pattern) {|match, ...| block } => str * str.scan(pattern) {|match, ...| block } -> str
* *
* Both forms iterate through <i>str</i>, matching the pattern (which may be a * Both forms iterate through <i>str</i>, matching the pattern (which may be a
* <code>Regexp</code> or a <code>String</code>). For each match, a result is * <code>Regexp</code> or a <code>String</code>). For each match, a result is
@ -6402,7 +6402,7 @@ rb_str_scan(VALUE str, VALUE pat)
/* /*
* call-seq: * call-seq:
* str.hex => integer * str.hex -> integer
* *
* Treats leading characters from <i>str</i> as a string of hexadecimal digits * Treats leading characters from <i>str</i> as a string of hexadecimal digits
* (with an optional sign and an optional <code>0x</code>) and returns the * (with an optional sign and an optional <code>0x</code>) and returns the
@ -6428,7 +6428,7 @@ rb_str_hex(VALUE str)
/* /*
* call-seq: * call-seq:
* str.oct => integer * str.oct -> integer
* *
* Treats leading characters of <i>str</i> as a string of octal digits (with an * Treats leading characters of <i>str</i> as a string of octal digits (with an
* optional sign) and returns the corresponding number. Returns 0 if the * optional sign) and returns the corresponding number. Returns 0 if the
@ -6454,7 +6454,7 @@ rb_str_oct(VALUE str)
/* /*
* call-seq: * call-seq:
* str.crypt(other_str) => new_str * str.crypt(other_str) -> new_str
* *
* Applies a one-way cryptographic hash to <i>str</i> by invoking the standard * Applies a one-way cryptographic hash to <i>str</i> by invoking the standard
* library function <code>crypt</code>. The argument is the salt string, which * library function <code>crypt</code>. The argument is the salt string, which
@ -6496,8 +6496,8 @@ rb_str_crypt(VALUE str, VALUE salt)
/* /*
* call-seq: * call-seq:
* str.intern => symbol * str.intern -> symbol
* str.to_sym => symbol * str.to_sym -> symbol
* *
* Returns the <code>Symbol</code> corresponding to <i>str</i>, creating the * Returns the <code>Symbol</code> corresponding to <i>str</i>, creating the
* symbol if it did not previously exist. See <code>Symbol#id2name</code>. * symbol if it did not previously exist. See <code>Symbol#id2name</code>.
@ -6527,7 +6527,7 @@ rb_str_intern(VALUE s)
/* /*
* call-seq: * call-seq:
* str.ord => integer * str.ord -> integer
* *
* Return the <code>Integer</code> ordinal of a one-character string. * Return the <code>Integer</code> ordinal of a one-character string.
* *
@ -6544,7 +6544,7 @@ rb_str_ord(VALUE s)
} }
/* /*
* call-seq: * call-seq:
* str.sum(n=16) => integer * str.sum(n=16) -> integer
* *
* Returns a basic <em>n</em>-bit checksum of the characters in <i>str</i>, * Returns a basic <em>n</em>-bit checksum of the characters in <i>str</i>,
* where <em>n</em> is the optional <code>Fixnum</code> parameter, defaulting * where <em>n</em> is the optional <code>Fixnum</code> parameter, defaulting
@ -6704,7 +6704,7 @@ rb_str_justify(int argc, VALUE *argv, VALUE str, char jflag)
/* /*
* call-seq: * call-seq:
* str.ljust(integer, padstr=' ') => new_str * str.ljust(integer, padstr=' ') -> new_str
* *
* If <i>integer</i> is greater than the length of <i>str</i>, returns a new * If <i>integer</i> is greater than the length of <i>str</i>, returns a new
* <code>String</code> of length <i>integer</i> with <i>str</i> left justified * <code>String</code> of length <i>integer</i> with <i>str</i> left justified
@ -6724,7 +6724,7 @@ rb_str_ljust(int argc, VALUE *argv, VALUE str)
/* /*
* call-seq: * call-seq:
* str.rjust(integer, padstr=' ') => new_str * str.rjust(integer, padstr=' ') -> new_str
* *
* If <i>integer</i> is greater than the length of <i>str</i>, returns a new * If <i>integer</i> is greater than the length of <i>str</i>, returns a new
* <code>String</code> of length <i>integer</i> with <i>str</i> right justified * <code>String</code> of length <i>integer</i> with <i>str</i> right justified
@ -6744,7 +6744,7 @@ rb_str_rjust(int argc, VALUE *argv, VALUE str)
/* /*
* call-seq: * call-seq:
* str.center(integer, padstr) => new_str * str.center(integer, padstr) -> new_str
* *
* If <i>integer</i> is greater than the length of <i>str</i>, returns a new * If <i>integer</i> is greater than the length of <i>str</i>, returns a new
* <code>String</code> of length <i>integer</i> with <i>str</i> centered and * <code>String</code> of length <i>integer</i> with <i>str</i> centered and
@ -6763,8 +6763,8 @@ rb_str_center(int argc, VALUE *argv, VALUE str)
/* /*
* call-seq: * call-seq:
* str.partition(sep) => [head, sep, tail] * str.partition(sep) -> [head, sep, tail]
* str.partition(regexp) => [head, match, tail] * str.partition(regexp) -> [head, match, tail]
* *
* Searches <i>sep</i> or pattern (<i>regexp</i>) in the string * Searches <i>sep</i> or pattern (<i>regexp</i>) in the string
* and returns the part before it, the match, and the part * and returns the part before it, the match, and the part
@ -6813,8 +6813,8 @@ rb_str_partition(VALUE str, VALUE sep)
/* /*
* call-seq: * call-seq:
* str.rpartition(sep) => [head, sep, tail] * str.rpartition(sep) -> [head, sep, tail]
* str.rpartition(regexp) => [head, match, tail] * str.rpartition(regexp) -> [head, match, tail]
* *
* Searches <i>sep</i> or pattern (<i>regexp</i>) in the string from the end * Searches <i>sep</i> or pattern (<i>regexp</i>) in the string from the end
* of the string, and returns the part before it, the match, and the part * of the string, and returns the part before it, the match, and the part
@ -6861,7 +6861,7 @@ rb_str_rpartition(VALUE str, VALUE sep)
/* /*
* call-seq: * call-seq:
* str.start_with?([prefix]+) => true or false * str.start_with?([prefix]+) -> true or false
* *
* Returns true if <i>str</i> starts with a prefix given. * Returns true if <i>str</i> starts with a prefix given.
* *
@ -6893,7 +6893,7 @@ rb_str_start_with(int argc, VALUE *argv, VALUE str)
/* /*
* call-seq: * call-seq:
* str.end_with?([suffix]+) => true or false * str.end_with?([suffix]+) -> true or false
* *
* Returns true if <i>str</i> ends with a suffix given. * Returns true if <i>str</i> ends with a suffix given.
*/ */
@ -6933,7 +6933,7 @@ rb_str_setter(VALUE val, ID id, VALUE *var)
/* /*
* call-seq: * call-seq:
* str.force_encoding(encoding) => str * str.force_encoding(encoding) -> str
* *
* Changes the encoding to +encoding+ and returns self. * Changes the encoding to +encoding+ and returns self.
*/ */
@ -6949,13 +6949,13 @@ rb_str_force_encoding(VALUE str, VALUE enc)
/* /*
* call-seq: * call-seq:
* str.valid_encoding? => true or false * str.valid_encoding? -> true or false
* *
* Returns true for a string which encoded correctly. * Returns true for a string which encoded correctly.
* *
* "\xc2\xa1".force_encoding("UTF-8").valid_encoding? => true * "\xc2\xa1".force_encoding("UTF-8").valid_encoding? #=> true
* "\xc2".force_encoding("UTF-8").valid_encoding? => false * "\xc2".force_encoding("UTF-8").valid_encoding? #=> false
* "\x80".force_encoding("UTF-8").valid_encoding? => false * "\x80".force_encoding("UTF-8").valid_encoding? #=> false
*/ */
static VALUE static VALUE
@ -6968,12 +6968,12 @@ rb_str_valid_encoding_p(VALUE str)
/* /*
* call-seq: * call-seq:
* str.ascii_only? => true or false * str.ascii_only? -> true or false
* *
* Returns true for a string which has only ASCII characters. * Returns true for a string which has only ASCII characters.
* *
* "abc".force_encoding("UTF-8").ascii_only? => true * "abc".force_encoding("UTF-8").ascii_only? #=> true
* "abc\u{6666}".force_encoding("UTF-8").ascii_only? => false * "abc\u{6666}".force_encoding("UTF-8").ascii_only? #=> false
*/ */
static VALUE static VALUE
@ -7020,7 +7020,7 @@ rb_str_is_ascii_only_p(VALUE str)
/* /*
* call-seq: * call-seq:
* sym == obj => true or false * sym == obj -> true or false
* *
* Equality---If <i>sym</i> and <i>obj</i> are exactly the same * Equality---If <i>sym</i> and <i>obj</i> are exactly the same
* symbol, returns <code>true</code>. * symbol, returns <code>true</code>.
@ -7049,7 +7049,7 @@ sym_printable(const char *s, const char *send, rb_encoding *enc)
/* /*
* call-seq: * call-seq:
* sym.inspect => string * sym.inspect -> string
* *
* Returns the representation of <i>sym</i> as a symbol literal. * Returns the representation of <i>sym</i> as a symbol literal.
* *
@ -7080,8 +7080,8 @@ sym_inspect(VALUE sym)
/* /*
* call-seq: * call-seq:
* sym.id2name => string * sym.id2name -> string
* sym.to_s => string * sym.to_s -> string
* *
* Returns the name or string corresponding to <i>sym</i>. * Returns the name or string corresponding to <i>sym</i>.
* *
@ -7100,8 +7100,8 @@ rb_sym_to_s(VALUE sym)
/* /*
* call-seq: * call-seq:
* sym.to_sym => sym * sym.to_sym -> sym
* sym.intern => sym * sym.intern -> sym
* *
* In general, <code>to_sym</code> returns the <code>Symbol</code> corresponding * In general, <code>to_sym</code> returns the <code>Symbol</code> corresponding
* to an object. As <i>sym</i> is already a symbol, <code>self</code> is returned * to an object. As <i>sym</i> is already a symbol, <code>self</code> is returned
@ -7182,7 +7182,7 @@ sym_succ(VALUE sym)
/* /*
* call-seq: * call-seq:
* *
* str <=> other => -1, 0, +1 or nil * str <=> other -> -1, 0, +1 or nil
* *
* Compares _sym_ with _other_ in string form. * Compares _sym_ with _other_ in string form.
*/ */
@ -7199,7 +7199,7 @@ sym_cmp(VALUE sym, VALUE other)
/* /*
* call-seq: * call-seq:
* *
* sym.casecmp(other) => -1, 0, +1 or nil * sym.casecmp(other) -> -1, 0, +1 or nil
* *
* Case-insensitive version of <code>Symbol#<=></code>. * Case-insensitive version of <code>Symbol#<=></code>.
*/ */
@ -7215,7 +7215,7 @@ sym_casecmp(VALUE sym, VALUE other)
/* /*
* call-seq: * call-seq:
* sym =~ obj => fixnum or nil * sym =~ obj -> fixnum or nil
* *
* Returns <code>sym.to_s =~ obj</code>. * Returns <code>sym.to_s =~ obj</code>.
*/ */
@ -7228,8 +7228,8 @@ sym_match(VALUE sym, VALUE other)
/* /*
* call-seq: * call-seq:
* sym[idx] => char * sym[idx] -> char
* sym[b, n] => char * sym[b, n] -> char
* *
* Returns <code>sym.to_s[]</code>. * Returns <code>sym.to_s[]</code>.
*/ */
@ -7242,7 +7242,7 @@ sym_aref(int argc, VALUE *argv, VALUE sym)
/* /*
* call-seq: * call-seq:
* sym.length => integer * sym.length -> integer
* *
* Same as <code>sym.to_s.length</code>. * Same as <code>sym.to_s.length</code>.
*/ */
@ -7255,7 +7255,7 @@ sym_length(VALUE sym)
/* /*
* call-seq: * call-seq:
* sym.empty? => true or false * sym.empty? -> true or false
* *
* Returns that _sym_ is :"" or not. * Returns that _sym_ is :"" or not.
*/ */
@ -7268,7 +7268,7 @@ sym_empty(VALUE sym)
/* /*
* call-seq: * call-seq:
* sym.upcase => symbol * sym.upcase -> symbol
* *
* Same as <code>sym.to_s.upcase.intern</code>. * Same as <code>sym.to_s.upcase.intern</code>.
*/ */
@ -7281,7 +7281,7 @@ sym_upcase(VALUE sym)
/* /*
* call-seq: * call-seq:
* sym.downcase => symbol * sym.downcase -> symbol
* *
* Same as <code>sym.to_s.downcase.intern</code>. * Same as <code>sym.to_s.downcase.intern</code>.
*/ */
@ -7294,7 +7294,7 @@ sym_downcase(VALUE sym)
/* /*
* call-seq: * call-seq:
* sym.capitalize => symbol * sym.capitalize -> symbol
* *
* Same as <code>sym.to_s.capitalize.intern</code>. * Same as <code>sym.to_s.capitalize.intern</code>.
*/ */
@ -7307,7 +7307,7 @@ sym_capitalize(VALUE sym)
/* /*
* call-seq: * call-seq:
* sym.swapcase => symbol * sym.swapcase -> symbol
* *
* Same as <code>sym.to_s.swapcase.intern</code>. * Same as <code>sym.to_s.swapcase.intern</code>.
*/ */
@ -7320,7 +7320,7 @@ sym_swapcase(VALUE sym)
/* /*
* call-seq: * call-seq:
* sym.encoding => encoding * sym.encoding -> encoding
* *
* Returns the Encoding object that represents the encoding of _sym_. * Returns the Encoding object that represents the encoding of _sym_.
*/ */

View file

@ -79,7 +79,7 @@ rb_struct_s_members_m(VALUE klass)
/* /*
* call-seq: * call-seq:
* struct.members => array * struct.members -> array
* *
* Returns an array of strings representing the names of the instance * Returns an array of strings representing the names of the instance
* variables. * variables.
@ -294,9 +294,9 @@ rb_struct_define(const char *name, ...)
/* /*
* call-seq: * call-seq:
* Struct.new( [aString] [, aSym]+> ) => StructClass * Struct.new( [aString] [, aSym]+> ) -> StructClass
* StructClass.new(arg, ...) => obj * StructClass.new(arg, ...) -> obj
* StructClass[arg, ...] => obj * StructClass[arg, ...] -> obj
* *
* Creates a new class, named by <i>aString</i>, containing accessor * Creates a new class, named by <i>aString</i>, containing accessor
* methods for the given symbols. If the name <i>aString</i> is * methods for the given symbols. If the name <i>aString</i> is
@ -441,8 +441,8 @@ rb_struct_new(VALUE klass, ...)
/* /*
* call-seq: * call-seq:
* struct.each {|obj| block } => struct * struct.each {|obj| block } -> struct
* struct.each => an_enumerator * struct.each -> an_enumerator
* *
* Calls <i>block</i> once for each instance variable, passing the * Calls <i>block</i> once for each instance variable, passing the
* value as a parameter. * value as a parameter.
@ -474,8 +474,8 @@ rb_struct_each(VALUE s)
/* /*
* call-seq: * call-seq:
* struct.each_pair {|sym, obj| block } => struct * struct.each_pair {|sym, obj| block } -> struct
* struct.each_pair => an_enumerator * struct.each_pair -> an_enumerator
* *
* Calls <i>block</i> once for each instance variable, passing the name * Calls <i>block</i> once for each instance variable, passing the name
* (as a symbol) and the value as parameters. * (as a symbol) and the value as parameters.
@ -556,8 +556,8 @@ inspect_struct(VALUE s, VALUE dummy, int recur)
/* /*
* call-seq: * call-seq:
* struct.to_s => string * struct.to_s -> string
* struct.inspect => string * struct.inspect -> string
* *
* Describe the contents of this struct in a string. * Describe the contents of this struct in a string.
*/ */
@ -570,8 +570,8 @@ rb_struct_inspect(VALUE s)
/* /*
* call-seq: * call-seq:
* struct.to_a => array * struct.to_a -> array
* struct.values => array * struct.values -> array
* *
* Returns the values for this instance as an array. * Returns the values for this instance as an array.
* *
@ -624,8 +624,8 @@ rb_struct_aref_id(VALUE s, ID id)
/* /*
* call-seq: * call-seq:
* struct[symbol] => anObject * struct[symbol] -> anObject
* struct[fixnum] => anObject * struct[fixnum] -> anObject
* *
* Attribute Reference---Returns the value of the instance variable * Attribute Reference---Returns the value of the instance variable
* named by <i>symbol</i>, or indexed (0..length-1) by * named by <i>symbol</i>, or indexed (0..length-1) by
@ -687,8 +687,8 @@ rb_struct_aset_id(VALUE s, ID id, VALUE val)
/* /*
* call-seq: * call-seq:
* struct[symbol] = obj => obj * struct[symbol] = obj -> obj
* struct[fixnum] = obj => obj * struct[fixnum] = obj -> obj
* *
* Attribute Assignment---Assigns to the instance variable named by * Attribute Assignment---Assigns to the instance variable named by
* <i>symbol</i> or <i>fixnum</i> the value <i>obj</i> and * <i>symbol</i> or <i>fixnum</i> the value <i>obj</i> and
@ -737,7 +737,7 @@ struct_entry(VALUE s, long n)
/* /*
* call-seq: * call-seq:
* struct.values_at(selector,... ) => an_array * struct.values_at(selector,... ) -> an_array
* *
* Returns an array containing the elements in * Returns an array containing the elements in
* +self+ corresponding to the given selector(s). The selectors * +self+ corresponding to the given selector(s). The selectors
@ -759,8 +759,8 @@ rb_struct_values_at(int argc, VALUE *argv, VALUE s)
/* /*
* call-seq: * call-seq:
* struct.select {|i| block } => array * struct.select {|i| block } -> array
* struct.select => an_enumerator * struct.select -> an_enumerator
* *
* Invokes the block passing in successive elements from * Invokes the block passing in successive elements from
* <i>struct</i>, returning an array containing those elements * <i>struct</i>, returning an array containing those elements
@ -810,7 +810,7 @@ recursive_equal(VALUE s, VALUE s2, int recur)
/* /*
* call-seq: * call-seq:
* struct == other_struct => true or false * struct == other_struct -> true or false
* *
* Equality---Returns <code>true</code> if <i>other_struct</i> is * Equality---Returns <code>true</code> if <i>other_struct</i> is
* equal to this one: they must be of the same class as generated by * equal to this one: they must be of the same class as generated by
@ -860,7 +860,7 @@ recursive_hash(VALUE s, VALUE dummy, int recur)
/* /*
* call-seq: * call-seq:
* struct.hash => fixnum * struct.hash -> fixnum
* *
* Return a hash value based on this struct's contents. * Return a hash value based on this struct's contents.
*/ */
@ -889,7 +889,7 @@ recursive_eql(VALUE s, VALUE s2, int recur)
/* /*
* code-seq: * code-seq:
* struct.eql?(other) => true or false * struct.eql?(other) -> true or false
* *
* Two structures are equal if they are the same object, or if all their * Two structures are equal if they are the same object, or if all their
* fields are equal (using <code>eql?</code>). * fields are equal (using <code>eql?</code>).
@ -910,8 +910,8 @@ rb_struct_eql(VALUE s, VALUE s2)
/* /*
* call-seq: * call-seq:
* struct.length => fixnum * struct.length -> fixnum
* struct.size => fixnum * struct.size -> fixnum
* *
* Returns the number of instance variables. * Returns the number of instance variables.
* *

102
thread.c
View file

@ -160,7 +160,7 @@ static int rb_thread_debug_enabled;
/* /*
* call-seq: * call-seq:
* Thread.DEBUG => num * Thread.DEBUG -> num
* *
* Returns the thread debug level. Available only if compiled with * Returns the thread debug level. Available only if compiled with
* THREAD_DEBUG=-1. * THREAD_DEBUG=-1.
@ -582,8 +582,8 @@ thread_s_new(int argc, VALUE *argv, VALUE klass)
/* /*
* call-seq: * call-seq:
* Thread.start([args]*) {|args| block } => thread * Thread.start([args]*) {|args| block } -> thread
* Thread.fork([args]*) {|args| block } => thread * Thread.fork([args]*) {|args| block } -> thread
* *
* Basically the same as <code>Thread::new</code>. However, if class * Basically the same as <code>Thread::new</code>. However, if class
* <code>Thread</code> is subclassed, then calling <code>start</code> in that * <code>Thread</code> is subclassed, then calling <code>start</code> in that
@ -731,8 +731,8 @@ thread_join(rb_thread_t *target_th, double delay)
/* /*
* call-seq: * call-seq:
* thr.join => thr * thr.join -> thr
* thr.join(limit) => thr * thr.join(limit) -> thr
* *
* The calling thread will suspend execution and run <i>thr</i>. Does not * The calling thread will suspend execution and run <i>thr</i>. Does not
* return until <i>thr</i> exits or until <i>limit</i> seconds have passed. If * return until <i>thr</i> exits or until <i>limit</i> seconds have passed. If
@ -788,7 +788,7 @@ thread_join_m(int argc, VALUE *argv, VALUE self)
/* /*
* call-seq: * call-seq:
* thr.value => obj * thr.value -> obj
* *
* Waits for <i>thr</i> to complete (via <code>Thread#join</code>) and returns * Waits for <i>thr</i> to complete (via <code>Thread#join</code>) and returns
* its value. * its value.
@ -1222,7 +1222,7 @@ ruby_thread_has_gvl_p(void)
/* /*
* call-seq: * call-seq:
* Thread.pass => nil * Thread.pass -> nil
* *
* Invokes the thread scheduler to pass execution to another thread. * Invokes the thread scheduler to pass execution to another thread.
* *
@ -1454,9 +1454,9 @@ thread_raise_m(int argc, VALUE *argv, VALUE self)
/* /*
* call-seq: * call-seq:
* thr.exit => thr or nil * thr.exit -> thr or nil
* thr.kill => thr or nil * thr.kill -> thr or nil
* thr.terminate => thr or nil * thr.terminate -> thr or nil
* *
* Terminates <i>thr</i> and schedules another thread to be run. If this thread * Terminates <i>thr</i> and schedules another thread to be run. If this thread
* is already marked to be killed, <code>exit</code> returns the * is already marked to be killed, <code>exit</code> returns the
@ -1493,7 +1493,7 @@ rb_thread_kill(VALUE thread)
/* /*
* call-seq: * call-seq:
* Thread.kill(thread) => thread * Thread.kill(thread) -> thread
* *
* Causes the given <em>thread</em> to exit (see <code>Thread::exit</code>). * Causes the given <em>thread</em> to exit (see <code>Thread::exit</code>).
* *
@ -1514,7 +1514,7 @@ rb_thread_s_kill(VALUE obj, VALUE th)
/* /*
* call-seq: * call-seq:
* Thread.exit => thread * Thread.exit -> thread
* *
* Terminates the currently running thread and schedules another thread to be * Terminates the currently running thread and schedules another thread to be
* run. If this thread is already marked to be killed, <code>exit</code> * run. If this thread is already marked to be killed, <code>exit</code>
@ -1531,7 +1531,7 @@ rb_thread_exit(void)
/* /*
* call-seq: * call-seq:
* thr.wakeup => thr * thr.wakeup -> thr
* *
* Marks <i>thr</i> as eligible for scheduling (it may still remain blocked on * Marks <i>thr</i> as eligible for scheduling (it may still remain blocked on
* I/O, however). Does not invoke the scheduler (see <code>Thread#run</code>). * I/O, however). Does not invoke the scheduler (see <code>Thread#run</code>).
@ -1563,7 +1563,7 @@ rb_thread_wakeup(VALUE thread)
/* /*
* call-seq: * call-seq:
* thr.run => thr * thr.run -> thr
* *
* Wakes up <i>thr</i>, making it eligible for scheduling. * Wakes up <i>thr</i>, making it eligible for scheduling.
* *
@ -1591,7 +1591,7 @@ rb_thread_run(VALUE thread)
/* /*
* call-seq: * call-seq:
* Thread.stop => nil * Thread.stop -> nil
* *
* Stops execution of the current thread, putting it into a ``sleep'' state, * Stops execution of the current thread, putting it into a ``sleep'' state,
* and schedules execution of another thread. * and schedules execution of another thread.
@ -1641,7 +1641,7 @@ thread_list_i(st_data_t key, st_data_t val, void *data)
/* /*
* call-seq: * call-seq:
* Thread.list => array * Thread.list -> array
* *
* Returns an array of <code>Thread</code> objects for all threads that are * Returns an array of <code>Thread</code> objects for all threads that are
* either runnable or stopped. * either runnable or stopped.
@ -1675,7 +1675,7 @@ rb_thread_current(void)
/* /*
* call-seq: * call-seq:
* Thread.current => thread * Thread.current -> thread
* *
* Returns the currently executing thread. * Returns the currently executing thread.
* *
@ -1696,7 +1696,7 @@ rb_thread_main(void)
/* /*
* call-seq: * call-seq:
* Thread.main => thread * Thread.main -> thread
* *
* Returns the main thread. * Returns the main thread.
*/ */
@ -1710,7 +1710,7 @@ rb_thread_s_main(VALUE klass)
/* /*
* call-seq: * call-seq:
* Thread.abort_on_exception => true or false * Thread.abort_on_exception -> true or false
* *
* Returns the status of the global ``abort on exception'' condition. The * Returns the status of the global ``abort on exception'' condition. The
* default is <code>false</code>. When set to <code>true</code>, or if the * default is <code>false</code>. When set to <code>true</code>, or if the
@ -1729,7 +1729,7 @@ rb_thread_s_abort_exc(void)
/* /*
* call-seq: * call-seq:
* Thread.abort_on_exception= boolean => true or false * Thread.abort_on_exception= boolean -> true or false
* *
* When set to <code>true</code>, all threads will abort if an exception is * When set to <code>true</code>, all threads will abort if an exception is
* raised. Returns the new state. * raised. Returns the new state.
@ -1762,7 +1762,7 @@ rb_thread_s_abort_exc_set(VALUE self, VALUE val)
/* /*
* call-seq: * call-seq:
* thr.abort_on_exception => true or false * thr.abort_on_exception -> true or false
* *
* Returns the status of the thread-local ``abort on exception'' condition for * Returns the status of the thread-local ``abort on exception'' condition for
* <i>thr</i>. The default is <code>false</code>. See also * <i>thr</i>. The default is <code>false</code>. See also
@ -1780,7 +1780,7 @@ rb_thread_abort_exc(VALUE thread)
/* /*
* call-seq: * call-seq:
* thr.abort_on_exception= boolean => true or false * thr.abort_on_exception= boolean -> true or false
* *
* When set to <code>true</code>, causes all threads (including the main * When set to <code>true</code>, causes all threads (including the main
* program) to abort if an exception is raised in <i>thr</i>. The process will * program) to abort if an exception is raised in <i>thr</i>. The process will
@ -1801,7 +1801,7 @@ rb_thread_abort_exc_set(VALUE thread, VALUE val)
/* /*
* call-seq: * call-seq:
* thr.group => thgrp or nil * thr.group -> thgrp or nil
* *
* Returns the <code>ThreadGroup</code> which contains <i>thr</i>, or nil if * Returns the <code>ThreadGroup</code> which contains <i>thr</i>, or nil if
* the thread is not a member of any group. * the thread is not a member of any group.
@ -1850,7 +1850,7 @@ rb_threadptr_dead(rb_thread_t *th)
/* /*
* call-seq: * call-seq:
* thr.status => string, false or nil * thr.status -> string, false or nil
* *
* Returns the status of <i>thr</i>: ``<code>sleep</code>'' if <i>thr</i> is * Returns the status of <i>thr</i>: ``<code>sleep</code>'' if <i>thr</i> is
* sleeping or waiting on I/O, ``<code>run</code>'' if <i>thr</i> is executing, * sleeping or waiting on I/O, ``<code>run</code>'' if <i>thr</i> is executing,
@ -1889,7 +1889,7 @@ rb_thread_status(VALUE thread)
/* /*
* call-seq: * call-seq:
* thr.alive? => true or false * thr.alive? -> true or false
* *
* Returns <code>true</code> if <i>thr</i> is running or sleeping. * Returns <code>true</code> if <i>thr</i> is running or sleeping.
* *
@ -1912,7 +1912,7 @@ rb_thread_alive_p(VALUE thread)
/* /*
* call-seq: * call-seq:
* thr.stop? => true or false * thr.stop? -> true or false
* *
* Returns <code>true</code> if <i>thr</i> is dead or sleeping. * Returns <code>true</code> if <i>thr</i> is dead or sleeping.
* *
@ -1937,7 +1937,7 @@ rb_thread_stop_p(VALUE thread)
/* /*
* call-seq: * call-seq:
* thr.safe_level => integer * thr.safe_level -> integer
* *
* Returns the safe level in effect for <i>thr</i>. Setting thread-local safe * Returns the safe level in effect for <i>thr</i>. Setting thread-local safe
* levels can help when implementing sandboxes which run insecure code. * levels can help when implementing sandboxes which run insecure code.
@ -1958,7 +1958,7 @@ rb_thread_safe_level(VALUE thread)
/* /*
* call-seq: * call-seq:
* thr.inspect => string * thr.inspect -> string
* *
* Dump the name, id, and status of _thr_ to a string. * Dump the name, id, and status of _thr_ to a string.
*/ */
@ -2000,7 +2000,7 @@ rb_thread_local_aref(VALUE thread, ID id)
/* /*
* call-seq: * call-seq:
* thr[sym] => obj or nil * thr[sym] -> obj or nil
* *
* Attribute Reference---Returns the value of a thread-local variable, using * Attribute Reference---Returns the value of a thread-local variable, using
* either a symbol or a string name. If the specified variable does not exist, * either a symbol or a string name. If the specified variable does not exist,
@ -2050,7 +2050,7 @@ rb_thread_local_aset(VALUE thread, ID id, VALUE val)
/* /*
* call-seq: * call-seq:
* thr[sym] = obj => obj * thr[sym] = obj -> obj
* *
* Attribute Assignment---Sets or creates the value of a thread-local variable, * Attribute Assignment---Sets or creates the value of a thread-local variable,
* using either a symbol or a string. See also <code>Thread#[]</code>. * using either a symbol or a string. See also <code>Thread#[]</code>.
@ -2064,7 +2064,7 @@ rb_thread_aset(VALUE self, VALUE id, VALUE val)
/* /*
* call-seq: * call-seq:
* thr.key?(sym) => true or false * thr.key?(sym) -> true or false
* *
* Returns <code>true</code> if the given string (or symbol) exists as a * Returns <code>true</code> if the given string (or symbol) exists as a
* thread-local variable. * thread-local variable.
@ -2118,7 +2118,7 @@ rb_thread_alone(void)
/* /*
* call-seq: * call-seq:
* thr.keys => array * thr.keys -> array
* *
* Returns an an array of the names of the thread-local variables (as Symbols). * Returns an an array of the names of the thread-local variables (as Symbols).
* *
@ -2145,7 +2145,7 @@ rb_thread_keys(VALUE self)
/* /*
* call-seq: * call-seq:
* thr.priority => integer * thr.priority -> integer
* *
* Returns the priority of <i>thr</i>. Default is inherited from the * Returns the priority of <i>thr</i>. Default is inherited from the
* current thread which creating the new thread, or zero for the * current thread which creating the new thread, or zero for the
@ -2169,7 +2169,7 @@ rb_thread_priority(VALUE thread)
/* /*
* call-seq: * call-seq:
* thr.priority= integer => thr * thr.priority= integer -> thr
* *
* Sets the priority of <i>thr</i> to <i>integer</i>. Higher-priority threads * Sets the priority of <i>thr</i> to <i>integer</i>. Higher-priority threads
* will run more frequently than lower-priority threads (but lower-priority * will run more frequently than lower-priority threads (but lower-priority
@ -2862,7 +2862,7 @@ thgroup_list_i(st_data_t key, st_data_t val, st_data_t data)
/* /*
* call-seq: * call-seq:
* thgrp.list => array * thgrp.list -> array
* *
* Returns an array of all existing <code>Thread</code> objects that belong to * Returns an array of all existing <code>Thread</code> objects that belong to
* this group. * this group.
@ -2885,7 +2885,7 @@ thgroup_list(VALUE group)
/* /*
* call-seq: * call-seq:
* thgrp.enclose => thgrp * thgrp.enclose -> thgrp
* *
* Prevents threads from being added to or removed from the receiving * Prevents threads from being added to or removed from the receiving
* <code>ThreadGroup</code>. New threads can still be started in an enclosed * <code>ThreadGroup</code>. New threads can still be started in an enclosed
@ -2915,7 +2915,7 @@ thgroup_enclose(VALUE group)
/* /*
* call-seq: * call-seq:
* thgrp.enclosed? => true or false * thgrp.enclosed? -> true or false
* *
* Returns <code>true</code> if <em>thgrp</em> is enclosed. See also * Returns <code>true</code> if <em>thgrp</em> is enclosed. See also
* ThreadGroup#enclose. * ThreadGroup#enclose.
@ -2935,7 +2935,7 @@ thgroup_enclosed_p(VALUE group)
/* /*
* call-seq: * call-seq:
* thgrp.add(thread) => thgrp * thgrp.add(thread) -> thgrp
* *
* Adds the given <em>thread</em> to this group, removing it from any other * Adds the given <em>thread</em> to this group, removing it from any other
* group to which it may have previously belonged. * group to which it may have previously belonged.
@ -3067,7 +3067,7 @@ mutex_alloc(VALUE klass)
/* /*
* call-seq: * call-seq:
* Mutex.new => mutex * Mutex.new -> mutex
* *
* Creates a new Mutex * Creates a new Mutex
*/ */
@ -3085,7 +3085,7 @@ rb_mutex_new(void)
/* /*
* call-seq: * call-seq:
* mutex.locked? => true or false * mutex.locked? -> true or false
* *
* Returns +true+ if this lock is currently held by some thread. * Returns +true+ if this lock is currently held by some thread.
*/ */
@ -3111,7 +3111,7 @@ mutex_locked(rb_thread_t *th, VALUE self)
/* /*
* call-seq: * call-seq:
* mutex.try_lock => true or false * mutex.try_lock -> true or false
* *
* Attempts to obtain the lock and returns immediately. Returns +true+ if the * Attempts to obtain the lock and returns immediately. Returns +true+ if the
* lock was granted. * lock was granted.
@ -3186,7 +3186,7 @@ lock_interrupt(void *ptr)
/* /*
* call-seq: * call-seq:
* mutex.lock => self * mutex.lock -> self
* *
* Attempts to grab the lock and waits if it isn't available. * Attempts to grab the lock and waits if it isn't available.
* Raises +ThreadError+ if +mutex+ was locked by the current thread. * Raises +ThreadError+ if +mutex+ was locked by the current thread.
@ -3295,7 +3295,7 @@ mutex_unlock(mutex_t *mutex, rb_thread_t volatile *th)
/* /*
* call-seq: * call-seq:
* mutex.unlock => self * mutex.unlock -> self
* *
* Releases the lock. * Releases the lock.
* Raises +ThreadError+ if +mutex+ wasn't locked by the current thread. * Raises +ThreadError+ if +mutex+ wasn't locked by the current thread.
@ -3380,7 +3380,7 @@ rb_mutex_sleep(VALUE self, VALUE timeout)
/* /*
* call-seq: * call-seq:
* mutex.sleep(timeout = nil) => number * mutex.sleep(timeout = nil) -> number
* *
* Releases the lock and sleeps +timeout+ seconds if it is given and * Releases the lock and sleeps +timeout+ seconds if it is given and
* non-nil or forever. Raises +ThreadError+ if +mutex+ wasn't locked by * non-nil or forever. Raises +ThreadError+ if +mutex+ wasn't locked by
@ -3397,7 +3397,7 @@ mutex_sleep(int argc, VALUE *argv, VALUE self)
/* /*
* call-seq: * call-seq:
* mutex.synchronize { ... } => result of the block * mutex.synchronize { ... } -> result of the block
* *
* Obtains a lock, runs the block, and releases the lock when the block * Obtains a lock, runs the block, and releases the lock when the block
* completes. See the example under +Mutex+. * completes. See the example under +Mutex+.
@ -3883,8 +3883,8 @@ static void call_trace_func(rb_event_flag_t, VALUE data, VALUE self, ID id, VALU
/* /*
* call-seq: * call-seq:
* set_trace_func(proc) => proc * set_trace_func(proc) -> proc
* set_trace_func(nil) => nil * set_trace_func(nil) -> nil
* *
* Establishes _proc_ as the handler for tracing, or disables * Establishes _proc_ as the handler for tracing, or disables
* tracing if the parameter is +nil+. _proc_ takes up * tracing if the parameter is +nil+. _proc_ takes up
@ -3953,7 +3953,7 @@ thread_add_trace_func(rb_thread_t *th, VALUE trace)
/* /*
* call-seq: * call-seq:
* thr.add_trace_func(proc) => proc * thr.add_trace_func(proc) -> proc
* *
* Adds _proc_ as a handler for tracing. * Adds _proc_ as a handler for tracing.
* See <code>Thread#set_trace_func</code> and +set_trace_func+. * See <code>Thread#set_trace_func</code> and +set_trace_func+.
@ -3970,8 +3970,8 @@ thread_add_trace_func_m(VALUE obj, VALUE trace)
/* /*
* call-seq: * call-seq:
* thr.set_trace_func(proc) => proc * thr.set_trace_func(proc) -> proc
* thr.set_trace_func(nil) => nil * thr.set_trace_func(nil) -> nil
* *
* Establishes _proc_ on _thr_ as the handler for tracing, or * Establishes _proc_ on _thr_ as the handler for tracing, or
* disables tracing if the parameter is +nil+. * disables tracing if the parameter is +nil+.
@ -4120,7 +4120,7 @@ VALUE rb_thread_backtrace(VALUE thval);
/* /*
* call-seq: * call-seq:
* thr.backtrace => array * thr.backtrace -> array
* *
* Returns the current back trace of the _thr_. * Returns the current back trace of the _thr_.
*/ */

186
time.c
View file

@ -2371,7 +2371,7 @@ rb_time_timespec(VALUE time)
/* /*
* call-seq: * call-seq:
* Time.now => time * Time.now -> time
* *
* Creates a new time object for the current time. * Creates a new time object for the current time.
* *
@ -2386,9 +2386,9 @@ time_s_now(VALUE klass)
/* /*
* call-seq: * call-seq:
* Time.at(time) => time * Time.at(time) -> time
* Time.at(seconds_with_frac) => time * Time.at(seconds_with_frac) -> time
* Time.at(seconds, microseconds_with_frac) => time * Time.at(seconds, microseconds_with_frac) -> time
* *
* Creates a new time object with the value given by <i>time</i>, * Creates a new time object with the value given by <i>time</i>,
* the given number of <i>seconds_with_frac</i>, or * the given number of <i>seconds_with_frac</i>, or
@ -2974,22 +2974,22 @@ time_utc_or_local(int argc, VALUE *argv, int utc_p, VALUE klass)
/* /*
* call-seq: * call-seq:
* Time.utc(year) => time * Time.utc(year) -> time
* Time.utc(year, month) => time * Time.utc(year, month) -> time
* Time.utc(year, month, day) => time * Time.utc(year, month, day) -> time
* Time.utc(year, month, day, hour) => time * Time.utc(year, month, day, hour) -> time
* Time.utc(year, month, day, hour, min) => time * Time.utc(year, month, day, hour, min) -> time
* Time.utc(year, month, day, hour, min, sec_with_frac) => time * Time.utc(year, month, day, hour, min, sec_with_frac) -> time
* Time.utc(year, month, day, hour, min, sec, usec_with_frac) => time * Time.utc(year, month, day, hour, min, sec, usec_with_frac) -> time
* Time.utc(sec, min, hour, day, month, year, wday, yday, isdst, tz) => time * Time.utc(sec, min, hour, day, month, year, wday, yday, isdst, tz) -> time
* Time.gm(year) => time * Time.gm(year) -> time
* Time.gm(year, month) => time * Time.gm(year, month) -> time
* Time.gm(year, month, day) => time * Time.gm(year, month, day) -> time
* Time.gm(year, month, day, hour) => time * Time.gm(year, month, day, hour) -> time
* Time.gm(year, month, day, hour, min) => time * Time.gm(year, month, day, hour, min) -> time
* Time.gm(year, month, day, hour, min, sec_with_frac) => time * Time.gm(year, month, day, hour, min, sec_with_frac) -> time
* Time.gm(year, month, day, hour, min, sec, usec_with_frac) => time * Time.gm(year, month, day, hour, min, sec, usec_with_frac) -> time
* Time.gm(sec, min, hour, day, month, year, wday, yday, isdst, tz) => time * Time.gm(sec, min, hour, day, month, year, wday, yday, isdst, tz) -> time
* *
* Creates a time based on given values, interpreted as UTC (GMT). The * Creates a time based on given values, interpreted as UTC (GMT). The
* year must be specified. Other values default to the minimum value * year must be specified. Other values default to the minimum value
@ -3012,22 +3012,22 @@ time_s_mkutc(int argc, VALUE *argv, VALUE klass)
/* /*
* call-seq: * call-seq:
* Time.local(year) => time * Time.local(year) -> time
* Time.local(year, month) => time * Time.local(year, month) -> time
* Time.local(year, month, day) => time * Time.local(year, month, day) -> time
* Time.local(year, month, day, hour) => time * Time.local(year, month, day, hour) -> time
* Time.local(year, month, day, hour, min) => time * Time.local(year, month, day, hour, min) -> time
* Time.local(year, month, day, hour, min, sec_with_frac) => time * Time.local(year, month, day, hour, min, sec_with_frac) -> time
* Time.local(year, month, day, hour, min, sec, usec_with_frac) => time * Time.local(year, month, day, hour, min, sec, usec_with_frac) -> time
* Time.local(sec, min, hour, day, month, year, wday, yday, isdst, tz) => time * Time.local(sec, min, hour, day, month, year, wday, yday, isdst, tz) -> time
* Time.mktime(year) => time * Time.mktime(year) -> time
* Time.mktime(year, month) => time * Time.mktime(year, month) -> time
* Time.mktime(year, month, day) => time * Time.mktime(year, month, day) -> time
* Time.mktime(year, month, day, hour) => time * Time.mktime(year, month, day, hour) -> time
* Time.mktime(year, month, day, hour, min) => time * Time.mktime(year, month, day, hour, min) -> time
* Time.mktime(year, month, day, hour, min, sec_with_frac) => time * Time.mktime(year, month, day, hour, min, sec_with_frac) -> time
* Time.mktime(year, month, day, hour, min, sec, usec_with_frac) => time * Time.mktime(year, month, day, hour, min, sec, usec_with_frac) -> time
* Time.mktime(sec, min, hour, day, month, year, wday, yday, isdst, tz) => time * Time.mktime(sec, min, hour, day, month, year, wday, yday, isdst, tz) -> time
* *
* Same as <code>Time::gm</code>, but interprets the values in the * Same as <code>Time::gm</code>, but interprets the values in the
* local time zone. * local time zone.
@ -3043,8 +3043,8 @@ time_s_mktime(int argc, VALUE *argv, VALUE klass)
/* /*
* call-seq: * call-seq:
* time.to_i => int * time.to_i -> int
* time.tv_sec => int * time.tv_sec -> int
* *
* Returns the value of <i>time</i> as an integer number of seconds * Returns the value of <i>time</i> as an integer number of seconds
* since the Epoch. * since the Epoch.
@ -3065,7 +3065,7 @@ time_to_i(VALUE time)
/* /*
* call-seq: * call-seq:
* time.to_f => float * time.to_f -> float
* *
* Returns the value of <i>time</i> as a floating point number of * Returns the value of <i>time</i> as a floating point number of
* seconds since the Epoch. * seconds since the Epoch.
@ -3089,7 +3089,7 @@ time_to_f(VALUE time)
/* /*
* call-seq: * call-seq:
* time.to_r => Rational * time.to_r -> Rational
* *
* Returns the value of <i>time</i> as a rational number of seconds * Returns the value of <i>time</i> as a rational number of seconds
* since the Epoch. * since the Epoch.
@ -3118,8 +3118,8 @@ time_to_r(VALUE time)
/* /*
* call-seq: * call-seq:
* time.usec => int * time.usec -> int
* time.tv_usec => int * time.tv_usec -> int
* *
* Returns just the number of microseconds for <i>time</i>. * Returns just the number of microseconds for <i>time</i>.
* *
@ -3143,8 +3143,8 @@ time_usec(VALUE time)
/* /*
* call-seq: * call-seq:
* time.nsec => int * time.nsec -> int
* time.tv_nsec => int * time.tv_nsec -> int
* *
* Returns just the number of nanoseconds for <i>time</i>. * Returns just the number of nanoseconds for <i>time</i>.
* *
@ -3169,7 +3169,7 @@ time_nsec(VALUE time)
/* /*
* call-seq: * call-seq:
* time.subsec => number * time.subsec -> number
* *
* Returns just the fraction for <i>time</i>. * Returns just the fraction for <i>time</i>.
* *
@ -3196,7 +3196,7 @@ time_subsec(VALUE time)
/* /*
* call-seq: * call-seq:
* time <=> other_time => -1, 0, +1 or nil * time <=> other_time -> -1, 0, +1 or nil
* *
* Comparison---Compares <i>time</i> with <i>other_time</i>. * Comparison---Compares <i>time</i> with <i>other_time</i>.
* *
@ -3262,8 +3262,8 @@ time_eql(VALUE time1, VALUE time2)
/* /*
* call-seq: * call-seq:
* time.utc? => true or false * time.utc? -> true or false
* time.gmt? => true or false * time.gmt? -> true or false
* *
* Returns <code>true</code> if <i>time</i> represents a time in UTC * Returns <code>true</code> if <i>time</i> represents a time in UTC
* (GMT). * (GMT).
@ -3291,7 +3291,7 @@ time_utc_p(VALUE time)
/* /*
* call-seq: * call-seq:
* time.hash => fixnum * time.hash -> fixnum
* *
* Return a hash code for this time object. * Return a hash code for this time object.
*/ */
@ -3354,8 +3354,8 @@ time_localtime(VALUE time)
/* /*
* call-seq: * call-seq:
* time.localtime => time * time.localtime -> time
* time.localtime(utc_offset) => time * time.localtime(utc_offset) -> time
* *
* Converts <i>time</i> to local time (using the local time zone in * Converts <i>time</i> to local time (using the local time zone in
* effect for this process) modifying the receiver. * effect for this process) modifying the receiver.
@ -3391,8 +3391,8 @@ time_localtime_m(int argc, VALUE *argv, VALUE time)
/* /*
* call-seq: * call-seq:
* time.gmtime => time * time.gmtime -> time
* time.utc => time * time.utc -> time
* *
* Converts <i>time</i> to UTC (GMT), modifying the receiver. * Converts <i>time</i> to UTC (GMT), modifying the receiver.
* *
@ -3465,8 +3465,8 @@ time_fixoff(VALUE time)
/* /*
* call-seq: * call-seq:
* time.getlocal => new_time * time.getlocal -> new_time
* time.getlocal(utc_offset) => new_time * time.getlocal(utc_offset) -> new_time
* *
* Returns a new <code>new_time</code> object representing <i>time</i> in * Returns a new <code>new_time</code> object representing <i>time</i> in
* local time (using the local time zone in effect for this process). * local time (using the local time zone in effect for this process).
@ -3505,8 +3505,8 @@ time_getlocaltime(int argc, VALUE *argv, VALUE time)
/* /*
* call-seq: * call-seq:
* time.getgm => new_time * time.getgm -> new_time
* time.getutc => new_time * time.getutc -> new_time
* *
* Returns a new <code>new_time</code> object representing <i>time</i> in * Returns a new <code>new_time</code> object representing <i>time</i> in
* UTC. * UTC.
@ -3536,8 +3536,8 @@ static VALUE strftimev(const char *fmt, VALUE time);
/* /*
* call-seq: * call-seq:
* time.asctime => string * time.asctime -> string
* time.ctime => string * time.ctime -> string
* *
* Returns a canonical string representation of <i>time</i>. * Returns a canonical string representation of <i>time</i>.
* *
@ -3555,8 +3555,8 @@ time_asctime(VALUE time)
/* /*
* call-seq: * call-seq:
* time.inspect => string * time.inspect -> string
* time.to_s => string * time.to_s -> string
* *
* Returns a string representing <i>time</i>. Equivalent to calling * Returns a string representing <i>time</i>. Equivalent to calling
* <code>Time#strftime</code> with a format string of * <code>Time#strftime</code> with a format string of
@ -3604,7 +3604,7 @@ time_add(struct time_object *tobj, VALUE offset, int sign)
/* /*
* call-seq: * call-seq:
* time + numeric => time * time + numeric -> time
* *
* Addition---Adds some number of seconds (possibly fractional) to * Addition---Adds some number of seconds (possibly fractional) to
* <i>time</i> and returns that value as a new time. * <i>time</i> and returns that value as a new time.
@ -3627,8 +3627,8 @@ time_plus(VALUE time1, VALUE time2)
/* /*
* call-seq: * call-seq:
* time - other_time => float * time - other_time -> float
* time - numeric => time * time - numeric -> time
* *
* Difference---Returns a new time that represents the difference * Difference---Returns a new time that represents the difference
* between two times, or subtracts the given number of seconds in * between two times, or subtracts the given number of seconds in
@ -3657,7 +3657,7 @@ time_minus(VALUE time1, VALUE time2)
/* /*
* call-seq: * call-seq:
* time.succ => new_time * time.succ -> new_time
* *
* Return a new time object, one second later than <code>time</code>. * Return a new time object, one second later than <code>time</code>.
* Time#succ is obsolete since 1.9.2 for time is not a discrete value. * Time#succ is obsolete since 1.9.2 for time is not a discrete value.
@ -3684,7 +3684,7 @@ rb_time_succ(VALUE time)
/* /*
* call-seq: * call-seq:
* time.round([ndigits]) => new_time * time.round([ndigits]) -> new_time
* *
* Rounds sub seconds to a given precision in decimal digits (0 digits by default). * Rounds sub seconds to a given precision in decimal digits (0 digits by default).
* It returns a new time object. * It returns a new time object.
@ -3758,7 +3758,7 @@ time_round(int argc, VALUE *argv, VALUE time)
/* /*
* call-seq: * call-seq:
* time.sec => fixnum * time.sec -> fixnum
* *
* Returns the second of the minute (0..60)<em>[Yes, seconds really can * Returns the second of the minute (0..60)<em>[Yes, seconds really can
* range from zero to 60. This allows the system to inject leap seconds * range from zero to 60. This allows the system to inject leap seconds
@ -3781,7 +3781,7 @@ time_sec(VALUE time)
/* /*
* call-seq: * call-seq:
* time.min => fixnum * time.min -> fixnum
* *
* Returns the minute of the hour (0..59) for <i>time</i>. * Returns the minute of the hour (0..59) for <i>time</i>.
* *
@ -3801,7 +3801,7 @@ time_min(VALUE time)
/* /*
* call-seq: * call-seq:
* time.hour => fixnum * time.hour -> fixnum
* *
* Returns the hour of the day (0..23) for <i>time</i>. * Returns the hour of the day (0..23) for <i>time</i>.
* *
@ -3821,8 +3821,8 @@ time_hour(VALUE time)
/* /*
* call-seq: * call-seq:
* time.day => fixnum * time.day -> fixnum
* time.mday => fixnum * time.mday -> fixnum
* *
* Returns the day of the month (1..n) for <i>time</i>. * Returns the day of the month (1..n) for <i>time</i>.
* *
@ -3843,8 +3843,8 @@ time_mday(VALUE time)
/* /*
* call-seq: * call-seq:
* time.mon => fixnum * time.mon -> fixnum
* time.month => fixnum * time.month -> fixnum
* *
* Returns the month of the year (1..12) for <i>time</i>. * Returns the month of the year (1..12) for <i>time</i>.
* *
@ -3865,7 +3865,7 @@ time_mon(VALUE time)
/* /*
* call-seq: * call-seq:
* time.year => fixnum * time.year -> fixnum
* *
* Returns the year for <i>time</i> (including the century). * Returns the year for <i>time</i> (including the century).
* *
@ -3885,7 +3885,7 @@ time_year(VALUE time)
/* /*
* call-seq: * call-seq:
* time.wday => fixnum * time.wday -> fixnum
* *
* Returns an integer representing the day of the week, 0..6, with * Returns an integer representing the day of the week, 0..6, with
* Sunday == 0. * Sunday == 0.
@ -3920,7 +3920,7 @@ time_wday(VALUE time)
/* /*
* call-seq: * call-seq:
* time.sunday? => true or false * time.sunday? -> true or false
* *
* Returns <code>true</code> if <i>time</i> represents Sunday. * Returns <code>true</code> if <i>time</i> represents Sunday.
* *
@ -3936,7 +3936,7 @@ time_sunday(VALUE time)
/* /*
* call-seq: * call-seq:
* time.monday? => true or false * time.monday? -> true or false
* *
* Returns <code>true</code> if <i>time</i> represents Monday. * Returns <code>true</code> if <i>time</i> represents Monday.
* *
@ -3952,7 +3952,7 @@ time_monday(VALUE time)
/* /*
* call-seq: * call-seq:
* time.tuesday? => true or false * time.tuesday? -> true or false
* *
* Returns <code>true</code> if <i>time</i> represents Tuesday. * Returns <code>true</code> if <i>time</i> represents Tuesday.
* *
@ -3968,7 +3968,7 @@ time_tuesday(VALUE time)
/* /*
* call-seq: * call-seq:
* time.wednesday? => true or false * time.wednesday? -> true or false
* *
* Returns <code>true</code> if <i>time</i> represents Wednesday. * Returns <code>true</code> if <i>time</i> represents Wednesday.
* *
@ -3984,7 +3984,7 @@ time_wednesday(VALUE time)
/* /*
* call-seq: * call-seq:
* time.thursday? => true or false * time.thursday? -> true or false
* *
* Returns <code>true</code> if <i>time</i> represents Thursday. * Returns <code>true</code> if <i>time</i> represents Thursday.
* *
@ -4000,7 +4000,7 @@ time_thursday(VALUE time)
/* /*
* call-seq: * call-seq:
* time.friday? => true or false * time.friday? -> true or false
* *
* Returns <code>true</code> if <i>time</i> represents Friday. * Returns <code>true</code> if <i>time</i> represents Friday.
* *
@ -4016,7 +4016,7 @@ time_friday(VALUE time)
/* /*
* call-seq: * call-seq:
* time.saturday? => true or false * time.saturday? -> true or false
* *
* Returns <code>true</code> if <i>time</i> represents Saturday. * Returns <code>true</code> if <i>time</i> represents Saturday.
* *
@ -4032,7 +4032,7 @@ time_saturday(VALUE time)
/* /*
* call-seq: * call-seq:
* time.yday => fixnum * time.yday -> fixnum
* *
* Returns an integer representing the day of the year, 1..366. * Returns an integer representing the day of the year, 1..366.
* *
@ -4052,8 +4052,8 @@ time_yday(VALUE time)
/* /*
* call-seq: * call-seq:
* time.isdst => true or false * time.isdst -> true or false
* time.dst? => true or false * time.dst? -> true or false
* *
* Returns <code>true</code> if <i>time</i> occurs during Daylight * Returns <code>true</code> if <i>time</i> occurs during Daylight
* Saving Time in its time zone. * Saving Time in its time zone.
@ -4087,7 +4087,7 @@ time_isdst(VALUE time)
/* /*
* call-seq: * call-seq:
* time.zone => string * time.zone -> string
* *
* Returns the name of the time zone used for <i>time</i>. As of Ruby * Returns the name of the time zone used for <i>time</i>. As of Ruby
* 1.8, returns ``UTC'' rather than ``GMT'' for UTC times. * 1.8, returns ``UTC'' rather than ``GMT'' for UTC times.
@ -4116,9 +4116,9 @@ time_zone(VALUE time)
/* /*
* call-seq: * call-seq:
* time.gmt_offset => fixnum * time.gmt_offset -> fixnum
* time.gmtoff => fixnum * time.gmtoff -> fixnum
* time.utc_offset => fixnum * time.utc_offset -> fixnum
* *
* Returns the offset in seconds between the timezone of <i>time</i> * Returns the offset in seconds between the timezone of <i>time</i>
* and UTC. * and UTC.
@ -4147,7 +4147,7 @@ time_utc_offset(VALUE time)
/* /*
* call-seq: * call-seq:
* time.to_a => array * time.to_a -> array
* *
* Returns a ten-element <i>array</i> of values for <i>time</i>: * Returns a ten-element <i>array</i> of values for <i>time</i>:
* {<code>[ sec, min, hour, day, month, year, wday, yday, isdst, zone * {<code>[ sec, min, hour, day, month, year, wday, yday, isdst, zone
@ -4249,7 +4249,7 @@ strftimev(const char *fmt, VALUE time)
/* /*
* call-seq: * call-seq:
* time.strftime( string ) => string * time.strftime( string ) -> string
* *
* Formats <i>time</i> according to the directives in the given format * Formats <i>time</i> according to the directives in the given format
* string. Any text not listed as a directive will be passed through * string. Any text not listed as a directive will be passed through
@ -4464,7 +4464,7 @@ time_mdump(VALUE time)
/* /*
* call-seq: * call-seq:
* time._dump => string * time._dump -> string
* *
* Dump _time_ for marshaling. * Dump _time_ for marshaling.
*/ */
@ -4604,7 +4604,7 @@ end_submicro: ;
/* /*
* call-seq: * call-seq:
* Time._load(string) => time * Time._load(string) -> time
* *
* Unmarshal a dumped +Time+ object. * Unmarshal a dumped +Time+ object.
*/ */

View file

@ -2696,8 +2696,8 @@ str_encode_associate(VALUE str, int encidx)
/* /*
* call-seq: * call-seq:
* str.encode!(encoding [, options] ) => str * str.encode!(encoding [, options] ) -> str
* str.encode!(dst_encoding, src_encoding [, options] ) => str * str.encode!(dst_encoding, src_encoding [, options] ) -> str
* *
* The first form transcodes the contents of <i>str</i> from * The first form transcodes the contents of <i>str</i> from
* str.encoding to +encoding+. * str.encoding to +encoding+.
@ -2728,9 +2728,9 @@ str_encode_bang(int argc, VALUE *argv, VALUE str)
/* /*
* call-seq: * call-seq:
* str.encode(encoding [, options] ) => str * str.encode(encoding [, options] ) -> str
* str.encode(dst_encoding, src_encoding [, options] ) => str * str.encode(dst_encoding, src_encoding [, options] ) -> str
* str.encode([options]) => str * str.encode([options]) -> str
* *
* The first form returns a copy of <i>str</i> transcoded * The first form returns a copy of <i>str</i> transcoded
* to encoding +encoding+. * to encoding +encoding+.
@ -2861,8 +2861,8 @@ make_encobj(const char *name)
/* /*
* call-seq: * call-seq:
* Encoding::Converter.asciicompat_encoding(string) => encoding or nil * Encoding::Converter.asciicompat_encoding(string) -> encoding or nil
* Encoding::Converter.asciicompat_encoding(encoding) => encoding or nil * Encoding::Converter.asciicompat_encoding(encoding) -> encoding or nil
* *
* Returns the corresponding ASCII compatible encoding. * Returns the corresponding ASCII compatible encoding.
* *
@ -3907,8 +3907,8 @@ econv_insert_output(VALUE self, VALUE string)
/* /*
* call-seq * call-seq
* ec.putback => string * ec.putback -> string
* ec.putback(max_numbytes) => string * ec.putback(max_numbytes) -> string
* *
* Put back the bytes which will be converted. * Put back the bytes which will be converted.
* *

View file

@ -171,7 +171,7 @@ classname(VALUE klass)
/* /*
* call-seq: * call-seq:
* mod.name => string * mod.name -> string
* *
* Returns the name of the module <i>mod</i>. Returns nil for anonymous modules. * Returns the name of the module <i>mod</i>. Returns nil for anonymous modules.
*/ */
@ -541,8 +541,8 @@ rb_trace_eval(VALUE cmd, VALUE val)
/* /*
* call-seq: * call-seq:
* trace_var(symbol, cmd ) => nil * trace_var(symbol, cmd ) -> nil
* trace_var(symbol) {|val| block } => nil * trace_var(symbol) {|val| block } -> nil
* *
* Controls tracing of assignments to global variables. The parameter * Controls tracing of assignments to global variables. The parameter
* +symbol_ identifies the variable (as either a string name or a * +symbol_ identifies the variable (as either a string name or a
@ -614,7 +614,7 @@ remove_trace(struct global_variable *var)
/* /*
* call-seq: * call-seq:
* untrace_var(symbol [, cmd] ) => array or nil * untrace_var(symbol [, cmd] ) -> array or nil
* *
* Removes tracing for the specified command on the given global * Removes tracing for the specified command on the given global
* variable and returns +nil+. If no command is specified, * variable and returns +nil+. If no command is specified,
@ -750,7 +750,7 @@ gvar_i(ID key, struct global_entry *entry, VALUE ary)
/* /*
* call-seq: * call-seq:
* global_variables => array * global_variables -> array
* *
* Returns an array of the names of global variables. * Returns an array of the names of global variables.
* *
@ -1246,7 +1246,7 @@ ivar_i(ID key, VALUE val, VALUE ary)
/* /*
* call-seq: * call-seq:
* obj.instance_variables => array * obj.instance_variables -> array
* *
* Returns an array of instance variable names for the receiver. Note * Returns an array of instance variable names for the receiver. Note
* that simply defining an accessor does not create the corresponding * that simply defining an accessor does not create the corresponding
@ -1273,7 +1273,7 @@ rb_obj_instance_variables(VALUE obj)
/* /*
* call-seq: * call-seq:
* obj.remove_instance_variable(symbol) => obj * obj.remove_instance_variable(symbol) -> obj
* *
* Removes the named instance variable from <i>obj</i>, returning that * Removes the named instance variable from <i>obj</i>, returning that
* variable's value. * variable's value.
@ -1363,7 +1363,7 @@ const_missing(VALUE klass, ID id)
/* /*
* call-seq: * call-seq:
* mod.const_missing(sym) => obj * mod.const_missing(sym) -> obj
* *
* Invoked when a reference is made to an undefined constant in * Invoked when a reference is made to an undefined constant in
* <i>mod</i>. It is passed a symbol for the undefined constant, and * <i>mod</i>. It is passed a symbol for the undefined constant, and
@ -1622,7 +1622,7 @@ rb_const_get_at(VALUE klass, ID id)
/* /*
* call-seq: * call-seq:
* remove_const(sym) => obj * remove_const(sym) -> obj
* *
* Removes the definition of the given constant, returning that * Removes the definition of the given constant, returning that
* constant's value. Predefined classes and singleton objects (such as * constant's value. Predefined classes and singleton objects (such as
@ -1729,15 +1729,15 @@ rb_const_list(void *data)
/* /*
* call-seq: * call-seq:
* mod.constants(inherit=true) => array * mod.constants(inherit=true) -> array
* *
* Returns an array of the names of the constants accessible in * Returns an array of the names of the constants accessible in
* <i>mod</i>. This includes the names of constants in any included * <i>mod</i>. This includes the names of constants in any included
* modules (example at start of section), unless the <i>all</i> * modules (example at start of section), unless the <i>all</i>
* parameter is set to <code>false</code>. * parameter is set to <code>false</code>.
* *
* IO.constants.include?(:SYNC) => true * IO.constants.include?(:SYNC) #=> true
* IO.constants(false).include?(:SYNC) => false * IO.constants(false).include?(:SYNC) #=> false
* *
* Also see <code>Module::const_defined?</code>. * Also see <code>Module::const_defined?</code>.
*/ */
@ -2013,7 +2013,7 @@ cv_i(ID key, VALUE value, VALUE ary)
/* /*
* call-seq: * call-seq:
* mod.class_variables => array * mod.class_variables -> array
* *
* Returns an array of the names of class variables in <i>mod</i>. * Returns an array of the names of class variables in <i>mod</i>.
* *
@ -2040,7 +2040,7 @@ rb_mod_class_variables(VALUE obj)
/* /*
* call-seq: * call-seq:
* remove_class_variable(sym) => obj * remove_class_variable(sym) -> obj
* *
* Removes the definition of the <i>sym</i>, returning that * Removes the definition of the <i>sym</i>, returning that
* constant's value. * constant's value.

View file

@ -442,7 +442,7 @@ NORETURN(static void raise_method_missing(rb_thread_t *th, int argc, const VALUE
/* /*
* call-seq: * call-seq:
* obj.method_missing(symbol [, *args] ) => result * obj.method_missing(symbol [, *args] ) -> result
* *
* Invoked by Ruby when <i>obj</i> is sent a message it cannot handle. * Invoked by Ruby when <i>obj</i> is sent a message it cannot handle.
* <i>symbol</i> is the symbol for the method called, and <i>args</i> * <i>symbol</i> is the symbol for the method called, and <i>args</i>
@ -683,8 +683,8 @@ send_internal(int argc, const VALUE *argv, VALUE recv, call_type scope)
/* /*
* call-seq: * call-seq:
* obj.send(symbol [, args...]) => obj * obj.send(symbol [, args...]) -> obj
* obj.__send__(symbol [, args...]) => obj * obj.__send__(symbol [, args...]) -> obj
* *
* Invokes the method identified by _symbol_, passing it any * Invokes the method identified by _symbol_, passing it any
* arguments specified. You can use <code>__send__</code> if the name * arguments specified. You can use <code>__send__</code> if the name
@ -707,7 +707,7 @@ rb_f_send(int argc, VALUE *argv, VALUE recv)
/* /*
* call-seq: * call-seq:
* obj.public_send(symbol [, args...]) => obj * obj.public_send(symbol [, args...]) -> obj
* *
* Invokes the method identified by _symbol_, passing it any * Invokes the method identified by _symbol_, passing it any
* arguments specified. Unlike send, public_send calls public * arguments specified. Unlike send, public_send calls public
@ -1062,7 +1062,7 @@ eval_string(VALUE self, VALUE src, VALUE scope, const char *file, int line)
/* /*
* call-seq: * call-seq:
* eval(string [, binding [, filename [,lineno]]]) => obj * eval(string [, binding [, filename [,lineno]]]) -> obj
* *
* Evaluates the Ruby expression(s) in <em>string</em>. If * Evaluates the Ruby expression(s) in <em>string</em>. If
* <em>binding</em> is given, which must be a <code>Binding</code> * <em>binding</em> is given, which must be a <code>Binding</code>
@ -1267,8 +1267,8 @@ specific_eval(int argc, VALUE *argv, VALUE klass, VALUE self)
/* /*
* call-seq: * call-seq:
* obj.instance_eval(string [, filename [, lineno]] ) => obj * obj.instance_eval(string [, filename [, lineno]] ) -> obj
* obj.instance_eval {| | block } => obj * obj.instance_eval {| | block } -> obj
* *
* Evaluates a string containing Ruby source code, or the given block, * Evaluates a string containing Ruby source code, or the given block,
* within the context of the receiver (_obj_). In order to set the * within the context of the receiver (_obj_). In order to set the
@ -1304,7 +1304,7 @@ rb_obj_instance_eval(int argc, VALUE *argv, VALUE self)
/* /*
* call-seq: * call-seq:
* obj.instance_exec(arg...) {|var...| block } => obj * obj.instance_exec(arg...) {|var...| block } -> obj
* *
* Executes the given block within the context of the receiver * Executes the given block within the context of the receiver
* (_obj_). In order to set the context, the variable +self+ is set * (_obj_). In order to set the context, the variable +self+ is set
@ -1336,8 +1336,8 @@ rb_obj_instance_exec(int argc, VALUE *argv, VALUE self)
/* /*
* call-seq: * call-seq:
* mod.class_eval(string [, filename [, lineno]]) => obj * mod.class_eval(string [, filename [, lineno]]) -> obj
* mod.module_eval {|| block } => obj * mod.module_eval {|| block } -> obj
* *
* Evaluates the string or block in the context of _mod_. This can * Evaluates the string or block in the context of _mod_. This can
* be used to add methods to a class. <code>module_eval</code> returns * be used to add methods to a class. <code>module_eval</code> returns
@ -1366,8 +1366,8 @@ rb_mod_module_eval(int argc, VALUE *argv, VALUE mod)
/* /*
* call-seq: * call-seq:
* mod.module_exec(arg...) {|var...| block } => obj * mod.module_exec(arg...) {|var...| block } -> obj
* mod.class_exec(arg...) {|var...| block } => obj * mod.class_exec(arg...) {|var...| block } -> obj
* *
* Evaluates the given block in the context of the class/module. * Evaluates the given block in the context of the class/module.
* The method defined in the block will belong to the receiver. * The method defined in the block will belong to the receiver.
@ -1449,7 +1449,7 @@ catch_i(VALUE tag, VALUE data)
/* /*
* call-seq: * call-seq:
* catch([arg]) {|tag| block } => obj * catch([arg]) {|tag| block } -> obj
* *
* +catch+ executes its block. If a +throw+ is * +catch+ executes its block. If a +throw+ is
* executed, Ruby searches up its stack for a +catch+ block * executed, Ruby searches up its stack for a +catch+ block
@ -1536,7 +1536,7 @@ rb_catch_obj(VALUE tag, VALUE (*func)(), VALUE data)
/* /*
* call-seq: * call-seq:
* caller(start=1) => array * caller(start=1) -> array
* *
* Returns the current execution stack---an array containing strings in * Returns the current execution stack---an array containing strings in
* the form ``<em>file:line</em>'' or ``<em>file:line: in * the form ``<em>file:line</em>'' or ``<em>file:line: in
@ -1632,7 +1632,7 @@ rb_backtrace_each(rb_backtrace_iter_func *iter, void *arg)
/* /*
* call-seq: * call-seq:
* local_variables => array * local_variables -> array
* *
* Returns the names of the current local variables. * Returns the names of the current local variables.
* *
@ -1687,8 +1687,8 @@ rb_f_local_variables(void)
/* /*
* call-seq: * call-seq:
* block_given? => true or false * block_given? -> true or false
* iterator? => true or false * iterator? -> true or false
* *
* Returns <code>true</code> if <code>yield</code> would execute a * Returns <code>true</code> if <code>yield</code> would execute a
* block in the current context. The <code>iterator?</code> form * block in the current context. The <code>iterator?</code> form

View file

@ -498,7 +498,7 @@ rb_remove_method(VALUE klass, const char *name)
/* /*
* call-seq: * call-seq:
* remove_method(symbol) => self * remove_method(symbol) -> self
* *
* Removes the method identified by _symbol_ from the current * Removes the method identified by _symbol_ from the current
* class. For an example, see <code>Module.undef_method</code>. * class. For an example, see <code>Module.undef_method</code>.
@ -672,7 +672,7 @@ rb_undef(VALUE klass, ID id)
/* /*
* call-seq: * call-seq:
* undef_method(symbol) => self * undef_method(symbol) -> self
* *
* Prevents the current class from responding to calls to the named * Prevents the current class from responding to calls to the named
* method. Contrast this with <code>remove_method</code>, which deletes * method. Contrast this with <code>remove_method</code>, which deletes
@ -725,7 +725,7 @@ rb_mod_undef_method(int argc, VALUE *argv, VALUE mod)
/* /*
* call-seq: * call-seq:
* mod.method_defined?(symbol) => true or false * mod.method_defined?(symbol) -> true or false
* *
* Returns +true+ if the named method is defined by * Returns +true+ if the named method is defined by
* _mod_ (or its included modules and, if _mod_ is a class, * _mod_ (or its included modules and, if _mod_ is a class,
@ -775,7 +775,7 @@ check_definition(VALUE mod, ID mid, rb_method_flag_t noex)
/* /*
* call-seq: * call-seq:
* mod.public_method_defined?(symbol) => true or false * mod.public_method_defined?(symbol) -> true or false
* *
* Returns +true+ if the named public method is defined by * Returns +true+ if the named public method is defined by
* _mod_ (or its included modules and, if _mod_ is a class, * _mod_ (or its included modules and, if _mod_ is a class,
@ -807,7 +807,7 @@ rb_mod_public_method_defined(VALUE mod, VALUE mid)
/* /*
* call-seq: * call-seq:
* mod.private_method_defined?(symbol) => true or false * mod.private_method_defined?(symbol) -> true or false
* *
* Returns +true+ if the named private method is defined by * Returns +true+ if the named private method is defined by
* _ mod_ (or its included modules and, if _mod_ is a class, * _ mod_ (or its included modules and, if _mod_ is a class,
@ -839,7 +839,7 @@ rb_mod_private_method_defined(VALUE mod, VALUE mid)
/* /*
* call-seq: * call-seq:
* mod.protected_method_defined?(symbol) => true or false * mod.protected_method_defined?(symbol) -> true or false
* *
* Returns +true+ if the named protected method is defined * Returns +true+ if the named protected method is defined
* by _mod_ (or its included modules and, if _mod_ is a * by _mod_ (or its included modules and, if _mod_ is a
@ -947,7 +947,7 @@ rb_alias(VALUE klass, ID name, ID def)
/* /*
* call-seq: * call-seq:
* alias_method(new_name, old_name) => self * alias_method(new_name, old_name) -> self
* *
* Makes <i>new_name</i> a new copy of the method <i>old_name</i>. This can * Makes <i>new_name</i> a new copy of the method <i>old_name</i>. This can
* be used to retain access to methods that are overridden. * be used to retain access to methods that are overridden.
@ -996,8 +996,8 @@ set_method_visibility(VALUE self, int argc, VALUE *argv, rb_method_flag_t ex)
/* /*
* call-seq: * call-seq:
* public => self * public -> self
* public(symbol, ...) => self * public(symbol, ...) -> self
* *
* With no arguments, sets the default visibility for subsequently * With no arguments, sets the default visibility for subsequently
* defined methods to public. With arguments, sets the named methods to * defined methods to public. With arguments, sets the named methods to
@ -1019,8 +1019,8 @@ rb_mod_public(int argc, VALUE *argv, VALUE module)
/* /*
* call-seq: * call-seq:
* protected => self * protected -> self
* protected(symbol, ...) => self * protected(symbol, ...) -> self
* *
* With no arguments, sets the default visibility for subsequently * With no arguments, sets the default visibility for subsequently
* defined methods to protected. With arguments, sets the named methods * defined methods to protected. With arguments, sets the named methods
@ -1042,8 +1042,8 @@ rb_mod_protected(int argc, VALUE *argv, VALUE module)
/* /*
* call-seq: * call-seq:
* private => self * private -> self
* private(symbol, ...) => self * private(symbol, ...) -> self
* *
* With no arguments, sets the default visibility for subsequently * With no arguments, sets the default visibility for subsequently
* defined methods to private. With arguments, sets the named methods * defined methods to private. With arguments, sets the named methods
@ -1074,7 +1074,7 @@ rb_mod_private(int argc, VALUE *argv, VALUE module)
/* /*
* call-seq: * call-seq:
* mod.public_class_method(symbol, ...) => mod * mod.public_class_method(symbol, ...) -> mod
* *
* Makes a list of existing class methods public. * Makes a list of existing class methods public.
*/ */
@ -1088,7 +1088,7 @@ rb_mod_public_method(int argc, VALUE *argv, VALUE obj)
/* /*
* call-seq: * call-seq:
* mod.private_class_method(symbol, ...) => mod * mod.private_class_method(symbol, ...) -> mod
* *
* Makes existing class methods private. Often used to hide the default * Makes existing class methods private. Often used to hide the default
* constructor <code>new</code>. * constructor <code>new</code>.
@ -1133,7 +1133,7 @@ top_private(int argc, VALUE *argv)
/* /*
* call-seq: * call-seq:
* module_function(symbol, ...) => self * module_function(symbol, ...) -> self
* *
* Creates module functions for the named methods. These functions may * Creates module functions for the named methods. These functions may
* be called with the module as a receiver, and also become available * be called with the module as a receiver, and also become available
@ -1256,7 +1256,7 @@ rb_respond_to(VALUE obj, ID id)
/* /*
* call-seq: * call-seq:
* obj.respond_to?(symbol, include_private=false) => true or false * obj.respond_to?(symbol, include_private=false) -> true or false
* *
* Returns +true+ if _obj_ responds to the given * Returns +true+ if _obj_ responds to the given
* method. Private methods are included in the search only if the * method. Private methods are included in the search only if the
@ -1285,7 +1285,7 @@ obj_respond_to(int argc, VALUE *argv, VALUE obj)
/* /*
* call-seq: * call-seq:
* obj.respond_to_missing?(symbol, include_private) => true or false * obj.respond_to_missing?(symbol, include_private) -> true or false
* *
* Hook method to return whether the _obj_ can respond to _id_ method * Hook method to return whether the _obj_ can respond to _id_ method
* or not. * or not.