Class: SSHCommand

Inherits:
GenericCommand show all
Defined in:
lib/CommandManager.rb

Overview

Executes commands in a remote machine ussing ssh. See documentation for GenericCommand

Direct Known Subclasses

RemotesCommand

Instance Attribute Summary collapse

Attributes inherited from GenericCommand

#code, #command, #stderr, #stdout

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from GenericCommand

#get_error_message, #log, #run

Constructor Details

#initialize(command, host, logger = nil, stdin = nil) ⇒ SSHCommand

This one takes another parameter. host is the machine where the command is going to be executed



145
146
147
148
# File 'lib/CommandManager.rb', line 145

def initialize(command, host, logger=nil, stdin=nil)
    @host=host
    super(command, logger, stdin)
end

Instance Attribute Details

#hostObject

Returns the value of attribute host.



134
135
136
# File 'lib/CommandManager.rb', line 134

def host
  @host
end

Class Method Details

.run(command, host, logger = nil, stdin = nil) ⇒ Object

Creates a command and runs it



137
138
139
140
141
# File 'lib/CommandManager.rb', line 137

def self.run(command, host, logger=nil, stdin=nil)
    cmd=self.new(command, host, logger, stdin)
    cmd.run
    cmd
end