Class: PVC::ProcessPiece::Runner
- Inherits:
-
Object
- Object
- PVC::ProcessPiece::Runner
- Defined in:
- lib/pvc/process_piece.rb
Instance Method Summary collapse
- #code ⇒ Object
- #finish ⇒ Object
-
#initialize(*args) ⇒ Runner
constructor
A new instance of Runner.
- #start(following_piece) ⇒ Object
- #stdin ⇒ Object
Constructor Details
#initialize(*args) ⇒ Runner
Returns a new instance of Runner.
5 6 7 8 |
# File 'lib/pvc/process_piece.rb', line 5 def initialize(*args) @args = args @process = ChildProcess.build(*args) end |
Instance Method Details
#code ⇒ Object
26 27 28 |
# File 'lib/pvc/process_piece.rb', line 26 def code @process.exit_code end |
#finish ⇒ Object
21 22 23 24 |
# File 'lib/pvc/process_piece.rb', line 21 def finish @process.io.stdin.close @process.wait end |
#start(following_piece) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/pvc/process_piece.rb', line 14 def start(following_piece) @process.duplex = true @process.io.stdout = following_piece.stdin @process.io.stderr = following_piece.errin if following_piece.respond_to?(:errin) @process.start end |
#stdin ⇒ Object
10 11 12 |
# File 'lib/pvc/process_piece.rb', line 10 def stdin @process.io.stdin end |