class Remoting::RemoteCommander

Attributes

interactive[R]
login[R]

Public Class Methods

new(login, *args) click to toggle source
# File lib/remoting/remote_commander.rb, line 8
def initialize(login, *args)
  options = args.extract_options!
  @login = login
  @interactive = !!options[:interactive]
end

Public Instance Methods

do_exec(cmds) click to toggle source

overrides

# File lib/remoting/remote_commander.rb, line 15
def do_exec(cmds)
  remote(cmds)
end
remote(cmds) click to toggle source
# File lib/remoting/remote_commander.rb, line 19
def remote(cmds)
  user, host = login.split("@")
  
  ssh = ::Remoting::Ssh.new(
    :user => user,
    :host => host,
    :interactive => interactive
  )
  
  ssh.exec(cmds)
end