Class: Expectacle::Thrower
- Inherits:
-
ThrowerBase
- Object
- ThrowerBase
- Expectacle::Thrower
- Defined in:
- lib/expectacle/thrower.rb,
lib/expectacle/thrower_utils.rb,
lib/expectacle/thrower_preview.rb
Overview
Thrower logic(command list operation)
Instance Attribute Summary
Attributes inherited from ThrowerBase
Instance Method Summary collapse
-
#preview_parameter(hosts, commands) ⇒ Object
Preview all parameters for all hosts.
-
#previewed_data(hosts, commands) ⇒ Object
Preview all parameters for all hosts (for testing).
-
#run_command_for_all_hosts(hosts, commands) ⇒ Object
Run(exec) commands for all hosts.
Methods inherited from ThrowerBase
#commands_dir, #hosts_dir, #initialize, #opts_dir, #prompts_dir
Constructor Details
This class inherits a constructor from Expectacle::ThrowerBase
Instance Method Details
#preview_parameter(hosts, commands) ⇒ Object
Preview all parameters for all hosts.
11 12 13 |
# File 'lib/expectacle/thrower_preview.rb', line 11 def preview_parameter(hosts, commands) print YAML.dump(previewed_data(hosts, commands)) end |
#previewed_data(hosts, commands) ⇒ Object
Preview all parameters for all hosts (for testing)
18 19 20 21 22 23 24 |
# File 'lib/expectacle/thrower_preview.rb', line 18 def previewed_data(hosts, commands) @commands = commands hosts.map do |each| @host_param = each preview_command_for_host end end |
#run_command_for_all_hosts(hosts, commands) ⇒ Object
Run(exec) commands for all hosts.
15 16 17 18 19 20 21 22 23 |
# File 'lib/expectacle/thrower.rb', line 15 def run_command_for_all_hosts(hosts, commands) hosts.each do |each| @commands = commands.dup # Notice: @commands will be decremented. @commands_len = @commands.length @auth_count = 0 @host_param = each run_command_for_host end end |