Class: Rake::SshDirPublisher

Inherits:
Object
  • Object
show all
Defined in:
lib/rake/contrib/sshpublisher.rb

Overview

Publish an entire directory to an existing remote directory using SSH.

Instance Method Summary (collapse)

Constructor Details

- (SshDirPublisher) initialize(host, remote_dir, local_dir)

A new instance of SshDirPublisher



8
9
10
11
12
# File 'lib/rake/contrib/sshpublisher.rb', line 8

def initialize(host, remote_dir, local_dir)
  @host = host
  @remote_dir = remote_dir
  @local_dir = local_dir
end

Instance Method Details

- (Object) upload



14
15
16
# File 'lib/rake/contrib/sshpublisher.rb', line 14

def upload
  sh %{scp -rq #{@local_dir}/* #{@host}:#{@remote_dir}}
end