Class: IO
- Inherits:
-
Object
- Object
- IO
- Defined in:
- lib/prcs/core_ext.rb
Instance Method Summary collapse
Instance Method Details
#readline_nonblock ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'lib/prcs/core_ext.rb', line 3 def readline_nonblock buffer = "" buffer << read_nonblock(1) while buffer[-1] != "\n" buffer rescue IO::WaitReadable => blocking raise blocking if buffer.empty? buffer end |