Class: Terrapin::CommandLine::MultiPipe
- Inherits:
-
Object
- Object
- Terrapin::CommandLine::MultiPipe
- Defined in:
- lib/terrapin/command_line/multi_pipe.rb
Instance Method Summary collapse
-
#initialize ⇒ MultiPipe
constructor
A new instance of MultiPipe.
- #output ⇒ Object
- #pipe_options ⇒ Object
- #read_and_then(&block) ⇒ Object
Constructor Details
#initialize ⇒ MultiPipe
Returns a new instance of MultiPipe.
4 5 6 7 |
# File 'lib/terrapin/command_line/multi_pipe.rb', line 4 def initialize @stdout_in, @stdout_out = IO.pipe @stderr_in, @stderr_out = IO.pipe end |
Instance Method Details
#output ⇒ Object
13 14 15 |
# File 'lib/terrapin/command_line/multi_pipe.rb', line 13 def output Output.new(@stdout_output, @stderr_output) end |
#pipe_options ⇒ Object
9 10 11 |
# File 'lib/terrapin/command_line/multi_pipe.rb', line 9 def { out: @stdout_out, err: @stderr_out } end |
#read_and_then(&block) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/terrapin/command_line/multi_pipe.rb', line 17 def read_and_then(&block) close_write read block.call close_read end |