Issue #822 has been updated by Brian Candler.


Maybe this is a documentation error then. ri IO.gets only says: "two successive newlines in the input separate paragraphs". Perhaps it should say "a sequence of two or more successive newlines"? And also mention that such a sequence is replaced with two newlines?

r,w = IO.pipe
w.write("some text\n\n\n\n\nsome text\n\n\n\n\n")
w.close
puts r.gets("").inspect   # => "some text\n\n"
puts r.gets("").inspect   # => "some text\n\n"

----------------------------------------
http://redmine.ruby-lang.org/issues/show/822

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