class FluentMigratorCommandRunner::Rake::Task

Attributes

fig_newton_file[RW]
profile[RW]
tag[RW]

Public Class Methods

new(task_name) { |self| ... } click to toggle source
# File lib/fluent-migrator-command-runner/task.rb, line 17
def initialize(task_name)
        @task_name = task_name

        yield self if block_given?

        define_task
end

Public Instance Methods

define_task() click to toggle source
# File lib/fluent-migrator-command-runner/task.rb, line 25
def define_task
        task @task_name, [:password] do |t, params|
                FigNewton.load(@fig_newton_file) unless @fig_newton_file.nil?
                options = migration_options
                options[:db_password] = params[:password] unless params[:password].nil?
                command = CommandBuilder.build(options)
                Runner.execute(command)
        end
end
migration_options() click to toggle source
# File lib/fluent-migrator-command-runner/task.rb, line 35
def migration_options
        options = {}
        options[:profile] = profile unless profile.nil?
        options[:tag] = tag unless tag.nil?
        return options
end