Class: PDK::CLI::SerialExecGroup
- Defined in:
- lib/pdk/cli/exec_group.rb
Overview
Executes registered blocks in serial
Instance Method Summary collapse
- #exit_code ⇒ Object
-
#initialize(message, opts = {}) ⇒ SerialExecGroup
constructor
A new instance of SerialExecGroup.
- #register(&block) ⇒ Object
Methods inherited from ExecGroup
Constructor Details
#initialize(message, opts = {}) ⇒ SerialExecGroup
Returns a new instance of SerialExecGroup.
56 57 58 59 |
# File 'lib/pdk/cli/exec_group.rb', line 56 def initialize(, opts = {}) super(, opts) @procs = [] end |
Instance Method Details
#exit_code ⇒ Object
67 68 69 70 |
# File 'lib/pdk/cli/exec_group.rb', line 67 def exit_code exit_codes = @procs.map(&:call) exit_codes.nil? ? 0 : exit_codes.max end |
#register(&block) ⇒ Object
61 62 63 64 65 |
# File 'lib/pdk/cli/exec_group.rb', line 61 def register(&block) super(&block) @procs << block end |