Issue #3022 has been updated by Yusuke Endoh.

Assigned to set to Marc-Andre Lafortune

Hi,

2010/3/27 Marc-Andre Lafortune <redmine / ruby-lang.org>:
> This is not true in trunk, as demonstrated by:
>
>  $ rubydev -e "
>      ARGF.gets
>      File.open('/etc/passwd'){|f| f.gets; f.gets}
>      p $., ARGF.lineno
>    " /etc/hosts
>  2
>  1

This can be fixed easily, but I guess it will cause compatibility
issue.  In fact, by the fix, rubyspec and make test-all reports
some errors.  So I think we should consider the current behavior
as spec:

  Returns the number of the last line read by Kernel#gets, IO#gets
  or ARGF#gets.  This variable has global scope, and can be assigned
  an integer manually.


> 2) I suggest the documentation of ARGF.lineno be changed to:
>
>  Returns the current line number of ARGF as a whole. This value
>  can be set manually with ARGF.lineno=.

Looks good.  Could you commit it with the doc I wrote together?

-- 
Yusuke Endoh <mame / tsg.ne.jp>
----------------------------------------
http://redmine.ruby-lang.org/issues/show/3022

----------------------------------------
http://redmine.ruby-lang.org