Class: SSHKit::Command
- Inherits:
-
Object
- Object
- SSHKit::Command
- Defined in:
- lib/opswalrus/sshkit_ext.rb
Overview
module Runner
class Sequential < Abstract
def run_backend(host, &block)
backend(host, &block).run
# rescue ::StandardError => e
# e2 = ExecuteError.new e
# raise e2, "Exception while executing #{host.user ? "as #{host.user}@" : "on host "}#{host}: #{e.message}"
end
end
end
Instance Method Summary collapse
-
#initialize(*args) ⇒ Command
constructor
Initialize a new Command object.
Constructor Details
#initialize(*args) ⇒ Command
Initialize a new Command object
command name, with optional variadaric args nothing in stdin or stdout
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/opswalrus/sshkit_ext.rb', line 50 def initialize(*args) raise ArgumentError, "Must pass arguments to Command.new" if args.empty? @options = .merge(args.) # @command = sanitize_command(args.shift) @command = args.shift @args = args @options.symbolize_keys! # @options.transform_keys!(&:to_sym) @stdout, @stderr, @full_stdout, @full_stderr = String.new, String.new, String.new, String.new @uuid = Digest::SHA1.hexdigest(SecureRandom.random_bytes(10))[0..7] end |