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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8d236c317f
commit
3b8b470c8e
@ -1,3 +1,9 @@
|
|||||||
|
Sun May 18 12:15:54 2014 Jonathan Mukai-Heidt <johnnymukai@gmail.com>
|
||||||
|
|
||||||
|
* 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@fsij.org>
|
Sun May 18 11:59:25 2014 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* missing/nextafter.c: Include ruby/missing.h.
|
* missing/nextafter.c: Include ruby/missing.h.
|
||||||
|
4
io.c
4
io.c
@ -11264,7 +11264,7 @@ argf_block_call(ID mid, int argc, VALUE *argv, VALUE argf)
|
|||||||
* For example, the following code prints out each line of each named file
|
* For example, the following code prints out each line of each named file
|
||||||
* prefixed with its line number, displaying the filename once per 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.filename if ARGF.lineno == 1
|
||||||
* puts "#{ARGF.lineno}: #{line}"
|
* puts "#{ARGF.lineno}: #{line}"
|
||||||
* end
|
* end
|
||||||
@ -11632,7 +11632,7 @@ opt_i_get(ID id, VALUE *var)
|
|||||||
* $ ruby argf.rb file.txt
|
* $ ruby argf.rb file.txt
|
||||||
*
|
*
|
||||||
* ARGF.inplace_mode = '.bak'
|
* ARGF.inplace_mode = '.bak'
|
||||||
* ARGF.lines do |line|
|
* ARGF.each_line do |line|
|
||||||
* print line.sub("foo","bar")
|
* print line.sub("foo","bar")
|
||||||
* end
|
* end
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user