Project

General

Profile

Actions

Bug #12998

closed

paragraph mode inconsistency between `IO#each_line` and `String#each_line`

Added by nobu (Nobuyoshi Nakada) over 7 years ago. Updated about 7 years ago.

Status:
Closed
Target version:
-
[ruby-core:78463]

Description

With this lines.rb:

lines = "abc\n\n\n\ndef\n"
p IO.pipe{|r,w|w.print lines; w.close; r.each_line("").to_a}
p lines.each_line("").to_a
$ ./ruby -v lines.rb
ruby 2.4.0dev (2016-12-02 trunk 56965) [x86_64-darwin15]
["abc\n\n", "def\n"]
["abc\n\n\n\n", "def\n"]

I think these methods should be consistent and the behavior of IO would be desirable.
https://github.com/ruby/ruby/compare/trunk...nobu:bug/string-paragraph-mode

Updated by nobu (Nobuyoshi Nakada) over 7 years ago

  • Status changed from Open to Assigned
  • Assignee set to matz (Yukihiro Matsumoto)

Updated by nobu (Nobuyoshi Nakada) over 7 years ago

Scheduled for 2.5.

Updated by naruse (Yui NARUSE) about 7 years ago

  • Status changed from Assigned to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0