Class: R10K::Util::Subprocess::Runner Private
- Inherits:
-
Object
- Object
- R10K::Util::Subprocess::Runner
- Defined in:
- lib/r10k/util/subprocess/runner.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #cwd ⇒ Object private
- #io ⇒ Object readonly private
- #pid ⇒ Object readonly private
- #status ⇒ Object readonly private
Instance Method Summary collapse
- #crashed? ⇒ Boolean private
- #exit_code ⇒ Object private
-
#initialize(argv) ⇒ Runner
constructor
private
A new instance of Runner.
- #start ⇒ Object private
- #wait ⇒ Object private
Constructor Details
#initialize(argv) ⇒ Runner
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Runner.
14 15 16 17 18 |
# File 'lib/r10k/util/subprocess/runner.rb', line 14 def initialize(argv) @argv = argv @io = R10K::Util::Subprocess::IO.new end |
Instance Attribute Details
#cwd ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
6 7 8 |
# File 'lib/r10k/util/subprocess/runner.rb', line 6 def cwd @cwd end |
#io ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 |
# File 'lib/r10k/util/subprocess/runner.rb', line 8 def io @io end |
#pid ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/r10k/util/subprocess/runner.rb', line 10 def pid @pid end |
#status ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 |
# File 'lib/r10k/util/subprocess/runner.rb', line 12 def status @status end |
Instance Method Details
#crashed? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
38 39 40 |
# File 'lib/r10k/util/subprocess/runner.rb', line 38 def crashed? exit_code != 0 end |
#exit_code ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
42 43 44 |
# File 'lib/r10k/util/subprocess/runner.rb', line 42 def exit_code @status.exitstatus end |
#start ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/r10k/util/subprocess/runner.rb', line 20 def start exec_r, exec_w = status_pipe() @pid = fork do exec_r.close execute_child(exec_w) end exec_w.close execute_parent(exec_r) end |
#wait ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
32 33 34 35 36 |
# File 'lib/r10k/util/subprocess/runner.rb', line 32 def wait if @pid _, @status = Process.waitpid2(@pid) end end |