Class: Rake::SshFilePublisher
- Inherits:
-
Object
- Object
- Rake::SshFilePublisher
- Defined in:
- lib/rake/contrib/sshpublisher.rb
Overview
Publish a list of files to an existing remote directory.
Instance Method Summary collapse
-
#initialize(host, remote_dir, local_dir, *files) ⇒ SshFilePublisher
constructor
Create a publisher using the give host information.
-
#upload ⇒ Object
Upload the local directory to the remote directory.
Constructor Details
#initialize(host, remote_dir, local_dir, *files) ⇒ SshFilePublisher
Create a publisher using the give host information.
31 32 33 34 35 36 |
# File 'lib/rake/contrib/sshpublisher.rb', line 31 def initialize(host, remote_dir, local_dir, *files) @host = host @remote_dir = remote_dir @local_dir = local_dir @files = files end |
Instance Method Details
#upload ⇒ Object
Upload the local directory to the remote directory.
39 40 41 42 43 |
# File 'lib/rake/contrib/sshpublisher.rb', line 39 def upload @files.each do |fn| sh %{scp -q #{@local_dir}/#{fn} #{@host}:#{@remote_dir}} end end |