Method: LCR::LineReader#initialize
- Defined in:
- lib/long-command-runner/line_reader.rb
#initialize(streams) {|io0_new_line, io1_new_line, ...| ... } ⇒ LineReader
Initializer takes an array of IO streams. You can optionaly pass a block that will be called at each new line.
The block will be called with as must as IO stream there is to treat.
25 26 27 28 29 |
# File 'lib/long-command-runner/line_reader.rb', line 25 def initialize(streams, &on_input) @streams = streams @streams_lines = Array.new(streams.length) { [] } @on_input = on_input end |