Class: Gofer::SshWrapper
- Inherits:
-
Object
- Object
- Gofer::SshWrapper
- Defined in:
- lib/gofer/ssh_wrapper.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#last_exit_status ⇒ Object
readonly
Returns the value of attribute last_exit_status.
-
#last_output ⇒ Object
readonly
Returns the value of attribute last_output.
Instance Method Summary collapse
- #download(from, to, opts = {}) ⇒ Object
-
#initialize(*args) ⇒ SshWrapper
constructor
A new instance of SshWrapper.
- #read_file(path) ⇒ Object
- #run(command, opts = {}) ⇒ Object
- #upload(from, to, opts = {}) ⇒ Object
Constructor Details
#initialize(*args) ⇒ SshWrapper
Returns a new instance of SshWrapper.
9 10 11 12 |
# File 'lib/gofer/ssh_wrapper.rb', line 9 def initialize *args @net_ssh_args = args @at_start_of_line = true end |
Instance Attribute Details
#last_exit_status ⇒ Object (readonly)
Returns the value of attribute last_exit_status.
7 8 9 |
# File 'lib/gofer/ssh_wrapper.rb', line 7 def last_exit_status @last_exit_status end |
#last_output ⇒ Object (readonly)
Returns the value of attribute last_output.
7 8 9 |
# File 'lib/gofer/ssh_wrapper.rb', line 7 def last_output @last_output end |
Instance Method Details
#download(from, to, opts = {}) ⇒ Object
22 23 24 |
# File 'lib/gofer/ssh_wrapper.rb', line 22 def download from, to, opts={} scp.download! from, to, opts end |
#read_file(path) ⇒ Object
18 19 20 |
# File 'lib/gofer/ssh_wrapper.rb', line 18 def read_file path scp.download! path end |
#run(command, opts = {}) ⇒ Object
14 15 16 |
# File 'lib/gofer/ssh_wrapper.rb', line 14 def run command, opts={} ssh_execute(ssh, command, opts) end |
#upload(from, to, opts = {}) ⇒ Object
26 27 28 |
# File 'lib/gofer/ssh_wrapper.rb', line 26 def upload from, to, opts={} scp.upload! from, to, opts end |