class 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/publisher.rb
56 def initialize(host, remote_dir, local_dir, *files)
57   @host = host
58   @remote_dir = remote_dir
59   @local_dir = local_dir
60   @files = files
61 end

Public Instance Methods

upload() click to toggle source

Upload the local directory to the remote directory.

   # File lib/rake/contrib/publisher.rb
64 def upload
65   @files.each do |fn|
66     run %{scp -q #{@local_dir}/#{fn} #{@host}:#{@remote_dir}}
67   end
68 end