[前][次][番号順一覧][スレッド一覧]

ruby-changes:3397

From: ko1@a...
Date: 5 Jan 2008 12:35:28 +0900
Subject: [ruby-changes:3397] akr - Ruby:r14890 (trunk): update rdoc.

akr	2008-01-05 12:35:13 +0900 (Sat, 05 Jan 2008)

  New Revision: 14890

  Modified files:
    trunk/encoding.c
    trunk/io.c
    trunk/proc.c
    trunk/string.c

  Log:
    update rdoc.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/string.c?r1=14890&r2=14889&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/io.c?r1=14890&r2=14889&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/proc.c?r1=14890&r2=14889&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/encoding.c?r1=14890&r2=14889&diff_format=u

Index: encoding.c
===================================================================
--- encoding.c	(revision 14889)
+++ encoding.c	(revision 14890)
@@ -1010,7 +1010,7 @@
 
     rb_enc_replicate("Windows-31J", rb_enc_from_index(ENCINDEX_SJIS));
     rb_enc_alias("CP932", "Windows-31J");
-    rb_enc_alias("csWindows31J", "Windows-31J"); /* IANA.  IE6 accepts csWindows31J but Windows-31J. */
+    rb_enc_alias("csWindows31J", "Windows-31J"); /* IANA.  IE6 don't accept Windows-31J but csWindows31J. */
 
     for (i = 0; i < enc_table_size; ++i) {
 	rb_encoding *enc = enc_table[i].enc;
Index: string.c
===================================================================
--- string.c	(revision 14889)
+++ string.c	(revision 14890)
@@ -103,11 +103,11 @@
     if (rb_enc_mbminlen(enc) == 1 && rb_enc_mbmaxlen(enc) == 1)
         return 1;
 
-    /* Not precise.  It may be ENC_CODERANGE_UNKNOWN. */
+    /* Conservative.  It may be ENC_CODERANGE_UNKNOWN. */
     if (ENC_CODERANGE(str) == ENC_CODERANGE_7BIT)
         return 1;
 
-    /* Not precise.  Possibly single byte.
+    /* Conservative.  Possibly single byte.
      * "\xa1" in Shift_JIS for example. */
     return 0;
 }
Index: io.c
===================================================================
--- io.c	(revision 14889)
+++ io.c	(revision 14890)
@@ -3873,33 +3873,39 @@
 
 /*
  *  call-seq:
- *     open(path [, mode [, perm]] )                => io or nil
- *     open(path [, mode [, perm]] ) {|io| block }  => obj
+ *     open(path [, mode_enc [, perm]] )                => io or nil
+ *     open(path [, mode_enc [, perm]] ) {|io| block }  => obj
  *
  *  Creates an <code>IO</code> object connected to the given stream,
  *  file, or subprocess.
  *
  *  If <i>path</i> does not start with a pipe character
  *  (``<code>|</code>''), treat it as the name of a file to open using
- *  the specified mode (defaulting to ``<code>r</code>'').  The mode is
+ *  the specified mode (defaulting to ``<code>r</code>'').
+ *
+ *  The mode_enc is
  *  either a string or an integer.  If it is an integer, it must be 
  *  bitwise-or of open(2) flags, such as File::RDWR or File::EXCL.
- *  If it is a string, it is either "mode", "mode:encoding", or
- *  "mode:encoding:encoding".  "mode" is one of the following:
+ *  If it is a string, it is either "mode", "mode:ext_enc", or
+ *  "mode:ext_enc:int_enc".
+ *  The mode is one of the following:
  *
  *   r: read (default)
  *   w: write
  *   a: append
  *
  *  The mode can be followed by "b" (means binary-mode), or "+"
- *  (means both reading and writing allowed) or both.  If one
- *  encoding is specified, read string will be tagged by the
- *  encoding in reading, and output string will be converted
- *  to the specified encoding in writing.  If two encoding names
- *  are specified, the read string is converted from the former
- *  encoding to the latter encoding then tagged with the latter
- *  in read mode, and in write mode, the output string will be
- *  converted from the latter to the former before writing.
+ *  (means both reading and writing allowed) or both.
+ *  If ext_enc (external encoding) is specified,
+ *  read string will be tagged by the encoding in reading,
+ *  and output string will be converted
+ *  to the specified encoding in writing.
+ *  If two encoding names,
+ *  ext_enc and int_enc (external encoding and internal encoding),
+ *  are specified, the read string is converted from ext_enc
+ *  to int_enc then tagged with the int_enc in read mode,
+ *  and in write mode, the output string will be
+ *  converted from int_enc to ext_enc before writing.
  *  
  *  If a file is being created, its initial permissions may be
  *  set using the integer third parameter.
@@ -5640,22 +5646,25 @@
 
 /*
  *  call-seq:
- *     IO.pipe                       -> array
- *     IO.pipe(encoding)             -> array
- *     IO.pipe(encoding1, encoding2) -> array
+ *     IO.pipe                    -> [read_io, write_io]
+ *     IO.pipe(ext_enc)           -> [read_io, write_io]
+ *     IO.pipe("ext_enc:int_enc") -> [read_io, write_io]
+ *     IO.pipe(ext_enc, int_enc)  -> [read_io, write_io]
  *
  *  Creates a pair of pipe endpoints (connected to each other) and
  *  returns them as a two-element array of <code>IO</code> objects:
- *  <code>[</code> <i>read_file</i>, <i>write_file</i> <code>]</code>. Not
+ *  <code>[</code> <i>read_io</i>, <i>write_io</i> <code>]</code>. Not
  *  available on all platforms.
  *
- *  If an optional argument is specified, read string from pipe is tagged
- *  with the encoding specified.  If encoding is a comma separated two
- *  encoding names "A:B", the read string is converted from encoding A
- *  (external encoding) to encoding B (internal encoding), then tagged
- *  with B.  If two optional arguments are specified, those must be
- *  encoding objects, and the first one is the external encoding, and the
- *  second one is the internal encoding.
+ *  If an encoding (encoding name or encoding object) is specified as an optional argument,
+ *  read string from pipe is tagged with the encoding specified.
+ *  If the argument is a colon separated two encoding names "A:B",
+ *  the read string is converted from encoding A (external encoding)
+ *  to encoding B (internal encoding), then tagged with B.
+ *  If two optional arguments are specified, those must be
+ *  encoding objects or encoding names,
+ *  and the first one is the external encoding,
+ *  and the second one is the internal encoding.
  *
  *  In the example below, the two processes close the ends of the pipe
  *  that they are not using. This is not just a cosmetic nicety. The
@@ -5975,15 +5984,16 @@
 
 /*
  *  call-seq:
- *     io.set_encoding(enc)        => io
- *     io.set_encoding(enc1, enc2) => io
+ *     io.set_encoding(ext_enc)           => io
+ *     io.set_encoding("ext_enc:int_enc") => io
+ *     io.set_encoding(ext_enc, int_enc)  => io
  *
- *  If single argument is specified, read string from pipe is tagged
- *  with the encoding specified.  If encoding is a comma separated two
+ *  If single argument is specified, read string from io is tagged
+ *  with the encoding specified.  If encoding is a colon separated two
  *  encoding names "A:B", the read string is converted from encoding A
  *  (external encoding) to encoding B (internal encoding), then tagged
  *  with B.  If two arguments are specified, those must be encoding
- *  objects, and the first one is the external encoding, and the
+ *  objects or encoding names, and the first one is the external encoding, and the
  *  second one is the internal encoding.
  */
 
Index: proc.c
===================================================================
--- proc.c	(revision 14889)
+++ proc.c	(revision 14890)
@@ -184,7 +184,7 @@
  *
  * define_method always defines a method without the tricks,
  * even if a non-lambda Proc object is given.
- * This is only the exception which the tricks is changed.
+ * This is the only exception which the tricks are not preserved.
  *
  *   class C
  *     define_method(:e, &proc {})

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧]