class Backup::Performer

Public Class Methods

new(storages) click to toggle source
# File lib/backup-agent/performer.rb, line 6
def initialize(storages)
  @storages = storages
end

Public Instance Methods

directory(path, options = {}) click to toggle source
# File lib/backup-agent/performer.rb, line 25
def directory(path, options = {})
  task Backup::Tasks::Directory => [path, options]
end
mysql(options) click to toggle source
# File lib/backup-agent/performer.rb, line 18
def mysql(options)
  if Symbol === options[:credentials]
    options[:credentials] = credentials(mysql: options[:credentials])
  end
  task Backup::Tasks::MySQL => [options]
end
task(arg) click to toggle source

task Task => [:foo, :bar, :baz]

# File lib/backup-agent/performer.rb, line 11
def task(arg)
  arg.each do |klass, args|
    @storages.each { |storage| klass.new(*args).perform(storage) }
  end
  nil
end