Class: DebDeploy::Scp
- Inherits:
-
Object
- Object
- DebDeploy::Scp
- Defined in:
- lib/deb_deploy/scp.rb
Class Method Summary collapse
- .command(from, to, options = {}) ⇒ Object
- .remote_address(user, host, path) ⇒ Object
- .ssh_options(options) ⇒ Object
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, ={}) flags = ['-q'] flags << '-r' if [:recurse] flags << ([:ssh]) if .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 () %[-o "#{options.join(' ')}"] unless .empty? end |