Class: Hydra::SyncTask

Inherits:
Task
  • Object
show all
Defined in:
lib/hydra/tasks.rb

Overview

Define a sync task that uses hydra to rsync the source tree under test to remote workers.

This task is very useful to run before a remote db:reset task to make sure the db/schema.rb file is up to date on the remote workers.

Hydra::SyncTask.new('hydra:sync') do |t|
  t.verbose = false # optionally set to true for lots of debug messages
end

Instance Attribute Summary

Attributes inherited from Task

#autosort, #config, #environment, #files, #listeners, #name, #runner_log_file, #serial, #show_time, #verbose

Instance Method Summary collapse

Methods inherited from Task

#add_files, #find_config_file

Constructor Details

#initialize(name = :sync) {|_self| ... } ⇒ SyncTask

Create a new SyncTestTask

Yields:

  • (_self)

Yield Parameters:



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/hydra/tasks.rb', line 225

def initialize(name = :sync)
  @name = name
  @verbose = false

  yield self if block_given?

  @config = find_config_file

  @opts = {
    :verbose => @verbose
  }
  @opts.merge!(:config => @config) if @config

  define
end