vagrant/lib/hobo/ssh.rb

29 lines
609 B
Ruby
Raw Normal View History

2010-01-26 08:01:17 +00:00
module Hobo
class SSH
SCRIPT = File.join(File.dirname(__FILE__), '..', '..', 'bin', 'hobo-ssh-expect.sh')
class << self
def connect(opts={})
Kernel.exec "#{SCRIPT} #{opts[:uname] || uname_default} #{opts[:pass] || pass_default} #{opts[:host] || host_default}".strip
end
private
def port_default
Hobo.config[:ssh][:port]
end
def host_default
Hobo.config[:ssh][:host]
end
def pass_default
Hobo.config[:ssh][:pass]
end
def uname_default
Hobo.config[:ssh][:uname]
end
end
end
end