Class: Bow::Commands::Exec
Instance Attribute Summary
Attributes inherited from Bow::Command
#app
Instance Method Summary
collapse
#command_name, command_name, find, inherited, #initialize, #targets
Constructor Details
This class inherits a constructor from Bow::Command
Instance Method Details
#description ⇒ Object
9
10
11
|
# File 'lib/bow/commands/exec.rb', line 9
def description
'Exec command on remote hosts.'
end
|
#run ⇒ Object
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/bow/commands/exec.rb', line 17
def run
raise ArgumentError, 'Command required!' unless @argv && !@argv&.empty?
cmd = @argv.shift
ThreadPool.new do |t|
t.from_enumerable targets do |host|
result = app.ssh_helper(host).execute(cmd)
ResponseFormatter.pretty_print(host, result)
end
end
end
|
#usage ⇒ Object
13
14
15
|
# File 'lib/bow/commands/exec.rb', line 13
def usage
"bow #{command_name} command [args] [options]"
end
|