Class: Fauxpaas::PassthroughRunner
- Inherits:
-
Object
- Object
- Fauxpaas::PassthroughRunner
- Defined in:
- lib/fauxpaas/passthrough_runner.rb
Instance Attribute Summary collapse
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
Instance Method Summary collapse
-
#initialize(stream) ⇒ PassthroughRunner
constructor
A new instance of PassthroughRunner.
- #run(command) ⇒ Object
Constructor Details
#initialize(stream) ⇒ PassthroughRunner
Returns a new instance of PassthroughRunner.
9 10 11 |
# File 'lib/fauxpaas/passthrough_runner.rb', line 9 def initialize(stream) @stream = stream end |
Instance Attribute Details
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
7 8 9 |
# File 'lib/fauxpaas/passthrough_runner.rb', line 7 def stream @stream end |
Instance Method Details
#run(command) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/fauxpaas/passthrough_runner.rb', line 13 def run(command) Open3.popen2e(command) do |_stdin, output, thread| while line = output.gets stream.puts line end exit_status = thread.value end end |