Class: Smith::Commands::Start
- Inherits:
-
Smith::CommandBase
- Object
- Smith::CommandBase
- Smith::Commands::Start
- Includes:
- Common
- Defined in:
- lib/smith/commands/agency/start.rb
Instance Attribute Summary
Attributes inherited from Smith::CommandBase
Instance Method Summary collapse
Methods included from Common
Methods inherited from Smith::CommandBase
#banner, #format_help, #initialize, #parse_options
Methods included from Logger
Constructor Details
This class inherits a constructor from Smith::CommandBase
Instance Method Details
#execute ⇒ Object
11 12 13 14 15 |
# File 'lib/smith/commands/agency/start.rb', line 11 def execute start do |value| responder.succeed(value) end end |
#start(&blk) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/smith/commands/agency/start.rb', line 17 def start(&blk) #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #!!!!!!!!!!!! See note about target at end of this file !!!!!!!!!!!!! #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # Sort out any groups. If the group option is set it will override # any other specified agents. if [:group] begin agents_to_start = agent_group([:group]) if agents_to_start.empty? blk.call("Agent group is empty. No agents started: #{[:group]}") else start_agents(agents_to_start, &blk) end rescue RuntimeError => e blk.call(e.) end else start_agents(target, &blk) end end |