Top Level Namespace
Defined Under Namespace
Modules: Mina
Instance Method Summary collapse
- #scp_download(from, to, options = {}) ⇒ Object
- #scp_transfer(direction, from, to, options = {}) ⇒ Object
- #scp_upload(from, to, options = {}) ⇒ Object
Instance Method Details
#scp_download(from, to, options = {}) ⇒ Object
16 17 18 |
# File 'lib/mina/scp.rb', line 16 def scp_download(from, to, = {}) scp_transfer(:down, from, to, ) end |
#scp_transfer(direction, from, to, options = {}) ⇒ Object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/mina/scp.rb', line 1 def scp_transfer(direction, from, to, = {}) remote_prefix = "#{domain!}:" remote_prefix = "#{user}@#{remote_prefix}" if user? command = "scp" command << " -i #{identity_file}" if identity_file? command << " -P #{port}" if port? case direction when :up then to = remote_prefix + to when :down then from = remote_prefix + from end command << " #{from} #{to}" print_command command if [:verbose] exec command end |
#scp_upload(from, to, options = {}) ⇒ Object
20 21 22 |
# File 'lib/mina/scp.rb', line 20 def scp_upload(from, to, = {}) scp_transfer(:up, from, to, ) end |