Class: Fog::SSH::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/rackspace-fog/core/ssh.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ Result

Returns a new instance of Result.



119
120
121
122
123
# File 'lib/rackspace-fog/core/ssh.rb', line 119

def initialize(command)
  @command = command
  @stderr = ''
  @stdout = ''
end

Instance Attribute Details

#commandObject

Returns the value of attribute command.



104
105
106
# File 'lib/rackspace-fog/core/ssh.rb', line 104

def command
  @command
end

#statusObject

Returns the value of attribute status.



104
105
106
# File 'lib/rackspace-fog/core/ssh.rb', line 104

def status
  @status
end

#stderrObject

Returns the value of attribute stderr.



104
105
106
# File 'lib/rackspace-fog/core/ssh.rb', line 104

def stderr
  @stderr
end

#stdoutObject

Returns the value of attribute stdout.



104
105
106
# File 'lib/rackspace-fog/core/ssh.rb', line 104

def stdout
  @stdout
end

Instance Method Details

#display_stderrObject



115
116
117
# File 'lib/rackspace-fog/core/ssh.rb', line 115

def display_stderr
  Formatador.display_line(stderr.split("\r\n"))
end

#display_stdoutObject



106
107
108
109
110
111
112
113
# File 'lib/rackspace-fog/core/ssh.rb', line 106

def display_stdout
  data = stdout.split("\r\n")
  if data.is_a?(String)
    Formatador.display_line(data)
  elsif data.is_a?(Array)
    Formatador.display_lines(data)
  end
end