class Hydra::GlobalTask

A Hydra global task is a task that is run both locally and remotely.

For example:

Hydra::GlobalTask.new('db:reset')

Allows you to run:

rake hydra:db:reset

Then, db:reset will be run locally and on all remote workers. This makes it easy to setup your workers and run tasks all in a row.

For example:

rake hydra:db:reset hydra:factories hydra:tests

Assuming you setup hydra:db:reset and hydra:db:factories as global tasks and hydra:tests as a Hydra::TestTask for all your tests

Public Class Methods

new(name) click to toggle source
# File lib/hydra/tasks.rb, line 363
def initialize(name)
  @name = name
  define
end

Private Instance Methods

define() click to toggle source
# File lib/hydra/tasks.rb, line 369
def define
  Hydra::RemoteTask.new(@name)
  desc "Run #{@name.to_s} Locally and Remotely across all Workers"
  task "hydra:#{@name.to_s}" => [@name.to_s, "hydra:remote:#{@name.to_s}"]
end