Last active
May 13, 2017 09:59
-
-
Save sai92messy/40f1cd6ca1bd1d1c70871dfcde446499 to your computer and use it in GitHub Desktop.
Mina-0.3.4 ssh helpers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /mina-0.3.4/lib/mina/ssh_helpers.rb | |
# ### ssh_command | |
# Returns the SSH command to be executed. | |
# | |
# set :domain, 'foo.com' | |
# set :user, 'diggity' | |
# | |
# puts ssh_command | |
# #=> 'ssh diggity@foo.com' | |
def ssh_command | |
args = domain!.dup | |
args = "#{user}@#{args}" if user? | |
args << " -i #{identity_file}" if identity_file? | |
args << " -p #{port}" if port? | |
args << " -A" if forward_agent? | |
args << " #{ssh_options}" if ssh_options? | |
args << " -t" | |
"ssh #{args}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment