Class: DebDeploy::Scp

Inherits:
Object
  • Object
show all
Defined in:
lib/deb_deploy/scp.rb

Class Method Summary collapse

Class Method Details

.command(from, to, options = {}) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/deb_deploy/scp.rb', line 4

def command(from, to, options={})
  flags = ['-q']
  flags << '-r' if options[:recurse]
  flags << ssh_options(options[:ssh]) if options.has_key?(:ssh)

  "scp #{flags.compact.join(' ')} #{from} #{to}"
end

.remote_address(user, host, path) ⇒ Object



12
13
14
15
# File 'lib/deb_deploy/scp.rb', line 12

def remote_address(user, host, path)
  user_with_host = [user, host].compact.join('@')
  [user_with_host, path].join(':')
end

.ssh_options(options) ⇒ Object



17
18
19
# File 'lib/deb_deploy/scp.rb', line 17

def ssh_options(options)
  %[-o "#{options.join(' ')}"] unless options.empty?
end