class Rake::SshFilePublisher

Publish a list of files to an existing remote directory.

Public Class Methods

new(host, remote_dir, local_dir, *files) click to toggle source

Create a publisher using the give host information.

   # File lib/rake/contrib/sshpublisher.rb
31 def initialize(host, remote_dir, local_dir, *files)
32   @host = host
33   @remote_dir = remote_dir
34   @local_dir = local_dir
35   @files = files
36 end

Public Instance Methods

upload() click to toggle source

Upload the local directory to the remote directory.

   # File lib/rake/contrib/sshpublisher.rb
39 def upload
40   @files.each do |fn|
41     sh %{scp -q #{@local_dir}/#{fn} #{@host}:#{@remote_dir}}
42   end
43 end