Class: IO

Inherits:
Object
  • Object
show all
Defined in:
lib/enginevib/io.rb

Overview

Non-blocking patch. I’m a terrible person.

Instance Method Summary collapse

Instance Method Details

#readline_nonblockObject



3
4
5
6
7
8
9
10
11
12
# File 'lib/enginevib/io.rb', line 3

def readline_nonblock
  rlnb_buffer = ''
  until (ch = read_nonblock(1)).nil?
    rlnb_buffer << ch
    if ch == "\n"
      result = rlnb_buffer
      return result
    end
  end
end