Class: Mysqlknife::SSH
- Inherits:
-
Object
- Object
- Mysqlknife::SSH
- Defined in:
- lib/mysqlknife/ssh.rb
Instance Method Summary collapse
- #execute(command) ⇒ Object
-
#initialize ⇒ SSH
constructor
A new instance of SSH.
Constructor Details
#initialize ⇒ SSH
Returns a new instance of SSH.
5 6 7 |
# File 'lib/mysqlknife/ssh.rb', line 5 def initialize @cnf = 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 #{@cnf.ssh_user} -i #{@cnf.ssh_key} #{@cnf.ssh_host} "#{command}"].join(' ') end |