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
18 19 20 |
# File 'lib/mina/scp.rb', line 18 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 15 16 |
# 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? command << " -r" if [:recursively] 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] result = %x[#{command}] puts result unless result == "" end |
#scp_upload(from, to, options = {}) ⇒ Object
22 23 24 |
# File 'lib/mina/scp.rb', line 22 def scp_upload(from, to, = {}) scp_transfer(:up, from, to, ) end |