class Chake::Connection::Ssh
Public Instance Methods
Source
# File lib/chake/connection/ssh.rb, line 20 def command_runner [ssh_prefix, 'ssh', ssh_config, ssh_options, ssh_target].flatten.compact end
Source
# File lib/chake/connection/ssh.rb, line 12 def rsync [ssh_prefix, 'rsync', rsync_ssh].flatten.compact end
Source
# File lib/chake/connection/ssh.rb, line 16 def rsync_dest [ssh_target, "#{node.path}/"].join(':') end
Source
# File lib/chake/connection/ssh.rb, line 4 def scp ['scp', ssh_config, scp_options].flatten.compact end
Source
# File lib/chake/connection/ssh.rb, line 24 def shell_command command_runner end
Private Instance Methods
Source
# File lib/chake/connection/ssh.rb, line 30 def rsync_ssh @rsync_ssh ||= begin ssh_command = 'ssh' if File.exist?(ssh_config_file) ssh_command += " -F #{ssh_config_file}" end ssh_command += " -p #{node.port}" if node.port if ssh_command == 'ssh' [] else ['-e', ssh_command] end end end
Source
# File lib/chake/connection/ssh.rb, line 66 def scp_options (node.port && ['-P', node.port.to_s]) || [] end
Source
# File lib/chake/connection/ssh.rb, line 46 def ssh_config (File.exist?(ssh_config_file) && ['-F', ssh_config_file]) || [] end
Source
# File lib/chake/connection/ssh.rb, line 50 def ssh_config_file @ssh_config_file ||= ENV.fetch('CHAKE_SSH_CONFIG', '.ssh_config') end
Source
# File lib/chake/connection/ssh.rb, line 62 def ssh_options (node.port && ['-p', node.port.to_s]) || [] end
Source
# File lib/chake/connection/ssh.rb, line 54 def ssh_prefix @ssh_prefix ||= ENV.fetch('CHAKE_SSH_PREFIX', '').split end
Source
# File lib/chake/connection/ssh.rb, line 58 def ssh_target [node.remote_username, node.hostname].compact.join('@') end