module Meroku::Sshable

Mix in to objects that can be sshed in to

Attributes

connection[R]

Public Instance Methods

close_ssh() click to toggle source
# File lib/meroku/sshable.rb, line 18
def close_ssh
  @connection.close
end
execute(command) click to toggle source
# File lib/meroku/sshable.rb, line 8
def execute(command)
  @connection.exec(command) { |_ch, _stream, data| puts data }
  @connection.loop
end
execute_script(script) click to toggle source
# File lib/meroku/sshable.rb, line 22
def execute_script(script)
  script.each_line do |line|
    puts line
    execute(line)
  end
end
sshopts() click to toggle source
# File lib/meroku/sshable.rb, line 13
def sshopts
  { verify_host_key: false, key_data: Meroku::Shared.secrets.private_key, \
    timeout: 60 }
end