Actions
Bug #1632
closedARGF's Iterators Return nill Instead of self
    Bug #1632:
    ARGF's Iterators Return nill Instead of self
  
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2dev (2009-06-14 trunk 23689) [i686-linux]
Backport:
Description
=begin
ARGF#each_char, ARGF#each_byte, ARGF#bytes, and ARGF#chars now return nil when passed a block. On 1.8 they returned self. self is preferable because:
- 
The documentation for IO#each_char and IO#each_byte promises that self will be returned.
 - 
It allows method chaining.
 - 
It's backward compatiable.
$ cd /tmp
$ echo 'a' > file
$ ruby -ve 'p ARGF.chars {}' file
ruby 1.9.2dev (2009-06-14 trunk 23689) [i686-linux]
nil
$ ruby1.8 -ve 'p ARGF.chars {}' file
ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
ARGF
$ ruby86 -ve 'p ARGF.each_byte {}' file
ruby 1.8.6 (2009-03-31 patchlevel 368) [i686-linux]
ARGF
=end 
Actions