File: rake_remote_task.rb

# rake_remote_task.rb

Path: | lib/rake_remote_task.rb
Last Update: | Sun Mar 08 19:51:33 -0600 2009

### Required files

rubygems open4 rake vlad

### Methods

host put remote_task role rsync run set target_host

### Public Instance methods

host(host_name, *roles)

Declare a remote host and its roles. Equivalent to `role`, but shorter for multiple roles.

put(remote_path, base_name = 'vlad.unknown') {|| ...}

Copy a (usually generated) file to `remote_path`. Contents of block are copied to `remote_path` and you may specify an optional base_name for the tempfile (aids in debugging).

remote_task(name, options = {})

Declare a Vlad task that will execute on all hosts by default. To limit that task to specific roles, use:

        remote_task :example, :roles => [:app, :web] do

role(role_name, host, args = {})

Declare a role and assign a remote host to it. Equivalent to the `host` method; provided for capistrano compatibility.

rsync(local, remote)

rsync the given files to `target_host`.

run(*args, &b)

Execute the given command on the `target_host` for the current task.

set(name, val = nil, &b)

Declare a variable called `name` and assign it a value. A globally-visible method with the name of the variable is defined. If a block is given, it will be called when the variable is first accessed. Subsequent references to the variable will always return the same value. Raises `ArgumentError` if the `name` would conflict with an existing method.

target_host()

Returns the name of the host that the current task is executing on. `target_host` can uniquely identify a particular task/host combination.

[Validate]