Class: SSHCommand
- Inherits:
-
GenericCommand
- Object
- GenericCommand
- SSHCommand
- Defined in:
- lib/CommandManager.rb
Overview
Executes commands in a remote machine ussing ssh. See documentation for GenericCommand
Direct Known Subclasses
Constant Summary
Constants inherited from GenericCommand
GenericCommand::ERROR_CLOSE, GenericCommand::ERROR_OPEN
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
Attributes inherited from GenericCommand
#code, #command, #stderr, #stdout
Class Method Summary collapse
-
.run(command, host, logger = nil, stdin = nil, timeout = nil) ⇒ Object
Creates a command and runs it.
Instance Method Summary collapse
-
#initialize(command, host, logger = nil, stdin = nil, timeout = nil) ⇒ SSHCommand
constructor
This one takes another parameter.
Methods inherited from GenericCommand
#get_error_message, #kill, #log, #run
Constructor Details
#initialize(command, host, logger = nil, stdin = nil, timeout = nil) ⇒ SSHCommand
This one takes another parameter. host
is the machine where the command is going to be executed
183 184 185 186 |
# File 'lib/CommandManager.rb', line 183 def initialize(command, host, logger=nil, stdin=nil, timeout=nil) @host=host super(command, logger, stdin, timeout) end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
172 173 174 |
# File 'lib/CommandManager.rb', line 172 def host @host end |
Class Method Details
.run(command, host, logger = nil, stdin = nil, timeout = nil) ⇒ Object
Creates a command and runs it
175 176 177 178 179 |
# File 'lib/CommandManager.rb', line 175 def self.run(command, host, logger=nil, stdin=nil, timeout=nil) cmd=self.new(command, host, logger, stdin, timeout) cmd.run cmd end |