Class: TheRunner::Runner::SSH

Inherits:
Base
  • Object
show all
Defined in:
lib/the_runner/runner/ssh.rb

Constant Summary collapse

@@default_options =
{
    debug: false,
    disable_key_checking: false,
    user: nil,
}

Instance Method Summary collapse

Methods inherited from Base

#initialize, #log

Constructor Details

This class inherits a constructor from TheRunner::Runner::Base

Instance Method Details

#run(command) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/the_runner/runner/ssh.rb', line 11

def run(command)
  system_args = build_system_args(command)
  command = system_args.join(' ')
  log(sprintf('Running [%s]', command))

  Open3.popen2e(command) { |stdin, output|
    output.each_line { |line|
      log(line.chomp)
    }
  }
end