Closed unakatsuo closed 11 years ago
@unakatsuo looks good to me. @tarcieri I'll leave the merge up to you.
Side note: should we be having shared examples for readable and writeable streams? There is a severe amount of duplication.
One minor nit, otherwise this looks great, thanks!
I am going to take down the PR since original Stream#eof? seems to work perfectly by following MRI's behavior.
r,w = IO.pipe
w << 0x00
w.flush
puts "r.eof? == false: " + (r.eof? == false).to_s
r.read(1) == 0x00
puts "r.eof? == false: " + (r.eof? == false).to_s # .eof? blocks here.
this does not show second ""r.eof? == false: " line on ruby-2.0.0-p247.
@unakatsuo ok, I will close this!
IO#eof?/eof is a blocking method according to the reference manual. so they are added to adapt the standard.
http://www.ruby-doc.org/core-2.0/IO.html#method-i-eof