Class: Mysqlknife::SSH

Inherits:
Object
  • Object
show all
Defined in:
lib/mysqlknife/ssh.rb

Instance Method Summary collapse

Constructor Details

#initializeSSH

Returns a new instance of SSH.



5
6
7
# File 'lib/mysqlknife/ssh.rb', line 5

def initialize
  @config = Configs.instance
end

Instance Method Details

#execute(command) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/mysqlknife/ssh.rb', line 9

def execute(command)
  %W[ssh
     -t
     -l #{@config.ssh[:user]}
     -i #{@config.ssh[:key]}
     #{@config.ssh[:host]}
     "#{command}"].join(' ')
end