Class: Rake::TaskMigration::Migrator
- Inherits:
-
Object
- Object
- Rake::TaskMigration::Migrator
- Defined in:
- lib/rake/task_migration/migrator.rb
Instance Attribute Summary collapse
-
#tasks ⇒ Object
readonly
Returns the value of attribute tasks.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(tasks) ⇒ Migrator
constructor
A new instance of Migrator.
- #migrate ⇒ Object
Constructor Details
#initialize(tasks) ⇒ Migrator
Returns a new instance of Migrator.
16 17 18 |
# File 'lib/rake/task_migration/migrator.rb', line 16 def initialize(tasks) @tasks = Array(tasks) end |
Instance Attribute Details
#tasks ⇒ Object (readonly)
Returns the value of attribute tasks.
14 15 16 |
# File 'lib/rake/task_migration/migrator.rb', line 14 def tasks @tasks end |
Class Method Details
.get_all_tasks ⇒ Object
9 10 11 |
# File 'lib/rake/task_migration/migrator.rb', line 9 def get_all_tasks RakeTaskMigration.all.map { |x| x.version.to_s }.sort end |
.migrate(tasks) ⇒ Object
5 6 7 |
# File 'lib/rake/task_migration/migrator.rb', line 5 def migrate(tasks) new(tasks).migrate end |
Instance Method Details
#migrate ⇒ Object
20 21 22 |
# File 'lib/rake/task_migration/migrator.rb', line 20 def migrate pending_tasks.each { |task| migrate_task(task.name.to_s) } end |