Class: Conjure::Service::RemoteShell::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/conjure/service/remote_shell.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(channel) ⇒ Result

Returns a new instance of Result.



60
61
62
63
64
65
66
67
68
# File 'lib/conjure/service/remote_shell.rb', line 60

def initialize(channel)
  @stdout, @stderr = "", ""
  channel.on_data do |c, data|
    yield data if block_given?
    @stdout << data
  end
  channel.on_extended_data { |c, type, data| @stderr << data }
  channel.on_request("exit-status") { |c, data| @status = data.read_long }
end

Instance Attribute Details

#statusObject

Returns the value of attribute status.



59
60
61
# File 'lib/conjure/service/remote_shell.rb', line 59

def status
  @status
end

#stderrObject

Returns the value of attribute stderr.



59
60
61
# File 'lib/conjure/service/remote_shell.rb', line 59

def stderr
  @stderr
end

#stdoutObject

Returns the value of attribute stdout.



59
60
61
# File 'lib/conjure/service/remote_shell.rb', line 59

def stdout
  @stdout
end