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

ruby-changes:22032

From: marcandre <ko1@a...>
Date: Tue, 20 Dec 2011 16:07:59 +0900 (JST)
Subject: [ruby-changes:22032] marcandRe: r34081 (trunk): * io.c: Improve rdoc for {File|IO}.write

marcandre	2011-12-20 16:07:46 +0900 (Tue, 20 Dec 2011)

  New Revision: 34081

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34081

  Log:
    * io.c: Improve rdoc for {File|IO}.write

  Modified files:
    trunk/io.c

Index: io.c
===================================================================
--- io.c	(revision 34080)
+++ io.c	(revision 34081)
@@ -9186,12 +9186,14 @@
  *
  *    specifies perm argument for open().
  *
- *   open_args: array of strings
+ *   open_args: array
  *
  *    specifies arguments for open() as an array.
  *
- *     IO.write("testfile", "0123456789")      #=> "0123456789"
- *     IO.write("testfile", "0123456789", 20)  #=> "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n"
+ *     IO.write("testfile", "0123456789", 20) # => 10
+ *     # File could contain:  "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n"
+ *     IO.write("testfile", "0123456789")      #=> 10
+ *     # File would now read: "0123456789"
  */
 
 static VALUE
@@ -9204,15 +9206,17 @@
  *  call-seq:
  *     IO.binwrite(name, string, [offset] )   => fixnum
  *
- *  Opens the file, optionally seeks to the given <i>offset</i>, write
+ *  Opens the file, optionally seeks to the given <i>offset</i>, writes
  *  <i>string</i> then returns the length written.
  *  <code>binwrite</code> ensures the file is closed before returning.
  *  The open mode would be "wb:ASCII-8BIT".
  *  If <i>offset</i> is not given, the file is truncated.  Otherwise,
  *  it is not truncated.
  *
- *     IO.binwrite("testfile", "0123456789")      #=> "0123456789"
- *     IO.binwrite("testfile", "0123456789", 20)  #=> "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n"
+ *     IO.binwrite("testfile", "0123456789", 20) # => 10
+ *     # File could contain:  "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n"
+ *     IO.binwrite("testfile", "0123456789")      #=> 10
+ *     # File would now read: "0123456789"
  */
 
 static VALUE

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

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