Class: Gofer::SshWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/gofer/ssh_wrapper.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

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_statusObject (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_outputObject (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