Class: Rake::SshDirPublisher
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
|
Subclasses:
Rake::RubyForgePublisher, SshFreshDirPublisher
|
|
| Super Chains via Extension / Inclusion / Inheritance | |
|
Instance Chain:
|
|
| Inherits: | Object |
| Defined in: | lib/rake/contrib/sshpublisher.rb |
Overview
Publish an entire directory to an existing remote directory using SSH.
Constant Summary
Class Method Summary
-
.new(host, remote_dir, local_dir) ⇒ SshDirPublisher
constructor
Creates an SSH publisher which will scp all files in
local_dirtoremote_dironhost
Instance Method Summary
-
#upload
Uploads the files.
DSL - Included
| #desc | Describes the next rake task. |
| #directory | Declare a set of files tasks to create the given directories on demand. |
| #file | Declare a file task. |
| #file_create | Declare a file creation task. |
| #import | Import the partial Rakefiles |
| #multitask | Declare a task that performs its prerequisites in parallel. |
| #namespace | Create a new rake namespace and use it for evaluating the given block. |
| #rule | Declare a rule for auto-tasks. |
| #task | Declare a basic task. |
FileUtilsExt - Included
| #nowrite | Get/set the nowrite flag controlling output from the ::FileUtils utilities. |
| #rake_check_options | Check that the options do not contain options not listed in |
| #rake_merge_option | Merge the given options with the default values. |
| #rake_output_message | Send the message to the default rake output (which is $stderr). |
| #verbose | Get/set the verbose flag controlling output from the ::FileUtils utilities. |
| #when_writing | Use this function to prevent potentially destructive ruby code from running when the |
::FileUtils - Included
| #ruby | Run a Ruby interpreter with the given arguments. |
| #safe_ln | Attempt to do a normal file link, but fall back to a copy if the link fails. |
| #sh | Run the system command |
| #split_all | Split a file path into individual directory names. |
Constructor Details
.new(host, remote_dir, local_dir) ⇒ SshDirPublisher
Creates an SSH publisher which will scp all files in local_dir to remote_dir on host
# File 'lib/rake/contrib/sshpublisher.rb', line 14
def initialize(host, remote_dir, local_dir) @host = host @remote_dir = remote_dir @local_dir = local_dir end
Instance Method Details
#upload
Uploads the files
# File 'lib/rake/contrib/sshpublisher.rb', line 22
def upload sh "scp", "-rq", "#{@local_dir}/*", "#{@host}:#{@remote_dir}" end