class Bow::Commands::Exec

Public Instance Methods

description() click to toggle source
# File lib/bow/commands/exec.rb, line 6
def description
  'Exec command on remote hosts.'
end
run() click to toggle source
# File lib/bow/commands/exec.rb, line 14
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() click to toggle source
# File lib/bow/commands/exec.rb, line 10
def usage
  "bow #{command_name} command [args] [options]"
end