Method: Scmd::Command::ChildProcess#read

Defined in:
lib/scmd/command.rb

#read(size) ⇒ Object



213
214
215
216
217
218
219
220
221
222
# File 'lib/scmd/command.rb', line 213

def read(size)
  ios, _, _ =
    IO.select([@stdout, @stderr], nil, nil, READ_CHECK_TIMEOUT)
  if ios && block_given?
    yield(
      read_if_ready(ios, @stdout, size),
      read_if_ready(ios, @stderr, size)
    )
  end
end