Class: Rake::SshFilePublisher
- Inherits:
-
Object
- Object
- Rake::SshFilePublisher
- Includes:
- DSL
- Defined in:
- lib/rake/contrib/sshpublisher.rb
Overview
Publish a list of files to an existing remote directory.
Constant Summary
Constants included from FileUtilsExt
Constants included from FileUtils
FileUtils::LN_SUPPORTED, FileUtils::RUBY
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.
Methods included from FileUtilsExt
#nowrite, #rake_check_options, #rake_merge_option, #rake_output_message, #verbose, #when_writing
Methods included from FileUtils
#ruby, #safe_ln, #sh, #split_all
Constructor Details
#initialize(host, remote_dir, local_dir, *files) ⇒ SshFilePublisher
Create a publisher using the give host information.
36 37 38 39 40 41 |
# File 'lib/rake/contrib/sshpublisher.rb', line 36 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.
44 45 46 47 48 |
# File 'lib/rake/contrib/sshpublisher.rb', line 44 def upload @files.each do |fn| sh %{scp -q #{@local_dir}/#{fn} #{@host}:#{@remote_dir}} end end |