Class: Pike::SSH::Process
- Inherits:
-
Object
- Object
- Pike::SSH::Process
- Defined in:
- lib/pike/ssh/process.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#exit_code ⇒ Object
Returns the value of attribute exit_code.
-
#stderr ⇒ Object
Returns the value of attribute stderr.
-
#stdout ⇒ Object
Returns the value of attribute stdout.
Instance Method Summary collapse
-
#initialize(command) ⇒ Process
constructor
A new instance of Process.
- #on_exit_status(channel, data) ⇒ Object
- #on_stderr(channel, type, data) ⇒ Object
- #on_stdout(channel, data) ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(command) ⇒ Process
Returns a new instance of Process.
10 11 12 13 14 15 |
# File 'lib/pike/ssh/process.rb', line 10 def initialize(command) @stdout = '' @stderr = '' @exit_code = 0 @command = command end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
7 8 9 |
# File 'lib/pike/ssh/process.rb', line 7 def command @command end |
#exit_code ⇒ Object
Returns the value of attribute exit_code.
6 7 8 |
# File 'lib/pike/ssh/process.rb', line 6 def exit_code @exit_code end |
#stderr ⇒ Object
Returns the value of attribute stderr.
5 6 7 |
# File 'lib/pike/ssh/process.rb', line 5 def stderr @stderr end |
#stdout ⇒ Object
Returns the value of attribute stdout.
4 5 6 |
# File 'lib/pike/ssh/process.rb', line 4 def stdout @stdout end |
Instance Method Details
#on_exit_status(channel, data) ⇒ Object
17 18 19 |
# File 'lib/pike/ssh/process.rb', line 17 def on_exit_status(channel, data) @exit_code = data.read_long end |
#on_stderr(channel, type, data) ⇒ Object
21 22 23 |
# File 'lib/pike/ssh/process.rb', line 21 def on_stderr(channel, type, data) @stderr << data end |
#on_stdout(channel, data) ⇒ Object
25 26 27 |
# File 'lib/pike/ssh/process.rb', line 25 def on_stdout(channel, data) @stdout << data end |
#success? ⇒ Boolean
29 30 31 |
# File 'lib/pike/ssh/process.rb', line 29 def success? exit_code == 0 end |