class Object

Public Instance Methods

ssh_connect(server) click to toggle source
# File lib/sushi/ssh.rb, line 21
def ssh_connect(server)
  Capistrano::SSH.connection_strategy(server, self) do |host, user, options|
    params =  "#{user}@#{host}"
    params += " -p #{options[:port]}" unless options[:port].nil?
    logger.debug "connecting to #{host}"
    logger.info "password: #{password}" if self.variables[:password].kind_of?(String)
    params += %{ -t "cd #{fetch(:sushi_default_dir)} && bash"} if self[:sushi_default_dir]
    exec "ssh #{params}"
  end
end