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

ruby-changes:33910

From: nobu <ko1@a...>
Date: Sun, 18 May 2014 12:16:07 +0900 (JST)
Subject: [ruby-changes:33910] nobu:r45991 (trunk): io.c: update ARGF examples

nobu	2014-05-18 12:15:57 +0900 (Sun, 18 May 2014)

  New Revision: 45991

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

  Log:
    io.c: update ARGF examples
    
    * io.c (argf_each_line, argf_inplace_mode_set): [DOC] Update ARGF
      documentation examples.  `ARGF.lines` has been deprecated in
      favor of `ARGF.each_line`.  [Fixes GH-615]

  Modified files:
    trunk/ChangeLog
    trunk/io.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45990)
+++ ChangeLog	(revision 45991)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun May 18 12:15:54 2014  Jonathan Mukai-Heidt  <johnnymukai@g...>
+
+	* io.c (argf_each_line, argf_inplace_mode_set): [DOC] Update ARGF
+	  documentation examples.  `ARGF.lines` has been deprecated in
+	  favor of `ARGF.each_line`.  [Fixes GH-615]
+
 Sun May 18 11:59:25 2014  Tanaka Akira  <akr@f...>
 
 	* missing/nextafter.c: Include ruby/missing.h.
Index: io.c
===================================================================
--- io.c	(revision 45990)
+++ io.c	(revision 45991)
@@ -11264,7 +11264,7 @@ argf_block_call(ID mid, int argc, VALUE https://github.com/ruby/ruby/blob/trunk/io.c#L11264
  *  For example, the following code prints out each line of each named file
  *  prefixed with its line number, displaying the filename once per file:
  *
- *     ARGF.lines do |line|
+ *     ARGF.each_line do |line|
  *       puts ARGF.filename if ARGF.lineno == 1
  *       puts "#{ARGF.lineno}: #{line}"
  *     end
@@ -11632,7 +11632,7 @@ opt_i_get(ID id, VALUE *var) https://github.com/ruby/ruby/blob/trunk/io.c#L11632
  *      $ ruby argf.rb file.txt
  *
  *      ARGF.inplace_mode = '.bak'
- *      ARGF.lines do |line|
+ *      ARGF.each_line do |line|
  *        print line.sub("foo","bar")
  *      end
  *

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

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