Class: PDK::CLI::SerialExecGroup

Inherits:
ExecGroup show all
Defined in:
lib/pdk/cli/exec_group.rb

Overview

Executes registered blocks in serial

See Also:

Instance Method Summary collapse

Methods inherited from ExecGroup

create

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(message, opts = {})
  super(message, opts)
  @procs = []
end

Instance Method Details

#exit_codeObject



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