Class: FluentMigratorCommandRunner::Rake::Task
- Inherits:
-
Object
- Object
- FluentMigratorCommandRunner::Rake::Task
- Includes:
- Rake::DSL
- Defined in:
- lib/fluent-migrator-command-runner/task.rb
Instance Attribute Summary collapse
-
#fig_newton_file ⇒ Object
Returns the value of attribute fig_newton_file.
-
#profile ⇒ Object
Returns the value of attribute profile.
-
#tag ⇒ Object
Returns the value of attribute tag.
Instance Method Summary collapse
- #define_task ⇒ Object
-
#initialize(task_name) {|_self| ... } ⇒ Task
constructor
A new instance of Task.
- #migration_options ⇒ Object
Constructor Details
#initialize(task_name) {|_self| ... } ⇒ Task
Returns a new instance of Task.
17 18 19 20 21 22 23 |
# 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 |
Instance Attribute Details
#fig_newton_file ⇒ Object
Returns the value of attribute fig_newton_file.
13 14 15 |
# File 'lib/fluent-migrator-command-runner/task.rb', line 13 def fig_newton_file @fig_newton_file end |
#profile ⇒ Object
Returns the value of attribute profile.
14 15 16 |
# File 'lib/fluent-migrator-command-runner/task.rb', line 14 def profile @profile end |
#tag ⇒ Object
Returns the value of attribute tag.
15 16 17 |
# File 'lib/fluent-migrator-command-runner/task.rb', line 15 def tag @tag end |
Instance Method Details
#define_task ⇒ Object
25 26 27 28 29 30 31 32 33 |
# 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? = [:db_password] = params[:password] unless params[:password].nil? command = CommandBuilder.build() Runner.execute(command) end end |
#migration_options ⇒ Object
35 36 37 38 39 40 |
# File 'lib/fluent-migrator-command-runner/task.rb', line 35 def = {} [:profile] = profile unless profile.nil? [:tag] = tag unless tag.nil? return end |