ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:92539] [Ruby trunk Bug#15823] ARGF.lineno behavior and documentation disagree
       [not found] <redmine.issue-15823.20190504165422@ruby-lang.org>
@ 2019-05-04 16:54 ` jonny
  2019-05-05  5:29 ` [ruby-core:92545] " nobu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: jonny @ 2019-05-04 16:54 UTC (permalink / raw)
  To: ruby-core

Issue #15823 has been reported by plujon (Jon Wilkes).

----------------------------------------
Bug #15823: ARGF.lineno behavior and documentation disagree
https://bugs.ruby-lang.org/issues/15823

* Author: plujon (Jon Wilkes)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
The documentation for ARGF.each at http://ruby-doc.org/core-2.6.3/ARGF.html#method-i-each
describes ARGF.lineno as if it behaved like ARGF.file.lineno, when it behaves for me like $.

Here's the sample code from the documentation:

ARGF.each_line do |line|
  puts ARGF.filename if ARGF.lineno == 1
  puts "#{ARGF.lineno}: #{line}"
end

A shell one-liner demonstration:

for i in a b; do echo $i>$i; done; ruby -e 'ARGF.each_line do print " #{ARGF.filename} #{ARGF.lineno}"; end; puts' a b
 a 1 b 2

The documents indicate that should be a 1 b 1'

Are the documents correct or the implementation?



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:92545] [Ruby trunk Bug#15823] ARGF.lineno behavior and documentation disagree
       [not found] <redmine.issue-15823.20190504165422@ruby-lang.org>
  2019-05-04 16:54 ` [ruby-core:92539] [Ruby trunk Bug#15823] ARGF.lineno behavior and documentation disagree jonny
@ 2019-05-05  5:29 ` nobu
  2019-07-31 14:15 ` [ruby-core:94075] [Ruby master " nagachika00
  2019-07-31 14:58 ` [ruby-core:94078] " usa
  3 siblings, 0 replies; 4+ messages in thread
From: nobu @ 2019-05-05  5:29 UTC (permalink / raw)
  To: ruby-core

Issue #15823 has been updated by nobu (Nobuyoshi Nakada).

Backport changed from 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN to 2.4: REQUIRED, 2.5: REQUIRED, 2.6: REQUIRED

Thank you, that document is wrong.

----------------------------------------
Bug #15823: ARGF.lineno behavior and documentation disagree
https://bugs.ruby-lang.org/issues/15823#change-77903

* Author: plujon (Jon Wilkes)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
* Backport: 2.4: REQUIRED, 2.5: REQUIRED, 2.6: REQUIRED
----------------------------------------
The documentation for ARGF.each at http://ruby-doc.org/core-2.6.3/ARGF.html#method-i-each
describes ARGF.lineno as if it behaved like ARGF.file.lineno, when it behaves for me like $.

Here's the sample code from the documentation:

ARGF.each_line do |line|
  puts ARGF.filename if ARGF.lineno == 1
  puts "#{ARGF.lineno}: #{line}"
end

A shell one-liner demonstration:

for i in a b; do echo $i>$i; done; ruby -e 'ARGF.each_line do print " #{ARGF.filename} #{ARGF.lineno}"; end; puts' a b
 a 1 b 2

The documents indicate that should be a 1 b 1'

Are the documents correct or the implementation?



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:94075] [Ruby master Bug#15823] ARGF.lineno behavior and documentation disagree
       [not found] <redmine.issue-15823.20190504165422@ruby-lang.org>
  2019-05-04 16:54 ` [ruby-core:92539] [Ruby trunk Bug#15823] ARGF.lineno behavior and documentation disagree jonny
  2019-05-05  5:29 ` [ruby-core:92545] " nobu
@ 2019-07-31 14:15 ` nagachika00
  2019-07-31 14:58 ` [ruby-core:94078] " usa
  3 siblings, 0 replies; 4+ messages in thread
From: nagachika00 @ 2019-07-31 14:15 UTC (permalink / raw)
  To: ruby-core

Issue #15823 has been updated by nagachika (Tomoyuki Chikanaga).

Backport changed from 2.4: REQUIRED, 2.5: REQUIRED, 2.6: REQUIRED to 2.4: REQUIRED, 2.5: REQUIRED, 2.6: DONE

ruby_2_6 r67719 merged revision(s) 374c8f4ebab1a740990330c732b9de965c5e8d10.

----------------------------------------
Bug #15823: ARGF.lineno behavior and documentation disagree
https://bugs.ruby-lang.org/issues/15823#change-80305

* Author: plujon (Jon Wilkes)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
* Backport: 2.4: REQUIRED, 2.5: REQUIRED, 2.6: DONE
----------------------------------------
The documentation for `ARGF.each` at http://ruby-doc.org/core-2.6.3/ARGF.html#method-i-each
describes `ARGF.lineno` as if it behaved like `ARGF.file.lineno`, when it behaves for me like `$.`

Here's the sample code from the documentation:

```ruby
ARGF.each_line do |line|
  puts ARGF.filename if ARGF.lineno == 1
  puts "#{ARGF.lineno}: #{line}"
end
```

A shell one-liner demonstration:

```
for i in a b; do echo $i>$i; done; ruby -e 'ARGF.each_line do print " #{ARGF.filename} #{ARGF.lineno}"; end; puts' a b
 a 1 b 2
```

The documents indicate that should be a 1 b 1'

Are the documents correct or the implementation?



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ruby-core:94078] [Ruby master Bug#15823] ARGF.lineno behavior and documentation disagree
       [not found] <redmine.issue-15823.20190504165422@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2019-07-31 14:15 ` [ruby-core:94075] [Ruby master " nagachika00
@ 2019-07-31 14:58 ` usa
  3 siblings, 0 replies; 4+ messages in thread
From: usa @ 2019-07-31 14:58 UTC (permalink / raw)
  To: ruby-core

Issue #15823 has been updated by usa (Usaku NAKAMURA).

Backport changed from 2.4: REQUIRED, 2.5: REQUIRED, 2.6: DONE to 2.4: REQUIRED, 2.5: DONE, 2.6: DONE

ruby_2_5 r67722 merged revision(s) 374c8f4ebab1a740990330c732b9de965c5e8d10.

----------------------------------------
Bug #15823: ARGF.lineno behavior and documentation disagree
https://bugs.ruby-lang.org/issues/15823#change-80308

* Author: plujon (Jon Wilkes)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
* Backport: 2.4: REQUIRED, 2.5: DONE, 2.6: DONE
----------------------------------------
The documentation for `ARGF.each` at http://ruby-doc.org/core-2.6.3/ARGF.html#method-i-each
describes `ARGF.lineno` as if it behaved like `ARGF.file.lineno`, when it behaves for me like `$.`

Here's the sample code from the documentation:

```ruby
ARGF.each_line do |line|
  puts ARGF.filename if ARGF.lineno == 1
  puts "#{ARGF.lineno}: #{line}"
end
```

A shell one-liner demonstration:

```
for i in a b; do echo $i>$i; done; ruby -e 'ARGF.each_line do print " #{ARGF.filename} #{ARGF.lineno}"; end; puts' a b
 a 1 b 2
```

The documents indicate that should be a 1 b 1'

Are the documents correct or the implementation?



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-31 14:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-15823.20190504165422@ruby-lang.org>
2019-05-04 16:54 ` [ruby-core:92539] [Ruby trunk Bug#15823] ARGF.lineno behavior and documentation disagree jonny
2019-05-05  5:29 ` [ruby-core:92545] " nobu
2019-07-31 14:15 ` [ruby-core:94075] [Ruby master " nagachika00
2019-07-31 14:58 ` [ruby-core:94078] " usa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).