class Fulmar::Infrastructure::Service::CopyService
Provides access to composer
Public Class Methods
download(shell, remote_host, remote_file, local_dir = '.')
click to toggle source
Downloads a file from a remote server @param [Fulmar::Shell] shell @param [String] remote_host SSH hostname @param [String] remote_file remote directory @param [String] local_dir local filename, should be absolute
# File lib/fulmar/infrastructure/service/copy_service.rb, line 22 def self.download(shell, remote_host, remote_file, local_dir = '.') if shell.run "scp -Cr #{remote_host}:#{remote_file} #{local_dir.chomp('/')}/" "#{local_dir.chomp('/')}/#{File.basename(remote_file)}" end end
upload(shell, local_file, remote_host, remote_dir)
click to toggle source
Copies a file to a remote server @param [Fulmar::Shell] shell @param [String] local_file local filename, should be absolute @param [String] remote_host SSH hostname @param [String] remote_dir remote directory
# File lib/fulmar/infrastructure/service/copy_service.rb, line 11 def self.upload(shell, local_file, remote_host, remote_dir) if shell.run "scp -Cr #{local_file} #{remote_host}:#{remote_dir.chomp('/')}/" "#{remote_dir.chomp('/')}/#{File.basename(local_file)}" end end