Class: A4Tools::StandardInput

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

Instance Method Summary collapse

Instance Method Details

#readObject



100
101
102
103
104
105
106
107
108
# File 'lib/net_shell/io.rb', line 100

def read
  begin
    STDIN.read_nonblock(256)
  rescue IO::WaitReadable
    ""
  rescue EOFError
    nil
  end
end

#read_allObject



110
111
112
113
114
115
116
# File 'lib/net_shell/io.rb', line 110

def read_all
  buffer = ""
  while (line = read) != nil
    buffer += line
  end
  buffer.chomp
end