Class: Mina::Backend::Remote

Inherits:
Object
  • Object
show all
Defined in:
lib/mina/extras/extra.rb

Instance Method Summary collapse

Instance Method Details

#sshObject



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/mina/extras/extra.rb', line 109

def ssh
  ensure!(:domain)
  args = fetch(:domain)
  if fetch(:sudo) && fetch(:sudoer)
    args = "#{fetch(:sudoer)}@#{fetch(:domain)}" if set?(:user)
  else
    args = "#{fetch(:user)}@#{fetch(:domain)}" if set?(:user)
  end
  args += " -i #{fetch(:identity_file)}" if set?(:identity_file)
  args += " -p #{fetch(:port)}" if set?(:port)
  args += ' -A' if set?(:forward_agent)
  args += " #{fetch(:ssh_options)}" if set?(:ssh_options)
  args += ' -tt'
  "ssh #{args}"
end