Class: Alchemy::Upgrader
- Extended by:
- ThreePointOne, ThreePointTwo, ThreePointZero
- Defined in:
- lib/alchemy/upgrader.rb
Defined Under Namespace
Modules: ThreePointOne, ThreePointTwo, ThreePointZero Classes: ThreePointTwoTask
Class Method Summary collapse
-
.all_upgrade_tasks ⇒ Object
All available upgrade tasks.
-
.run! ⇒ Object
Runs ugrades.
-
.upgrade_tasks ⇒ Object
Tasks that should run.
Methods inherited from Seeder
Methods included from Shell
#add_todo, #desc, #display_todos, #log, silence!, silenced?, #todo, #todos, verbose!
Class Method Details
.all_upgrade_tasks ⇒ Object
All available upgrade tasks
48 49 50 |
# File 'lib/alchemy/upgrader.rb', line 48 def all_upgrade_tasks private_methods - Object.private_methods - superclass.private_methods end |
.run! ⇒ Object
Runs ugrades
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/alchemy/upgrader.rb', line 16 def run! upgrade_tasks.each do |task| self.send(task) end puts "\n" log "Upgrade done!" if todos.any? display_todos log "\nThere are some follow ups to do", :message log '-------------------------------', :message log "\nPlease follow the TODOs above.", :message else log "\nThat's it.", :message end end |
.upgrade_tasks ⇒ Object
Tasks that should run.
Set UPGRADE env variable to only run a specific task.
Run rake alchemy:upgrade:list for all available tasks
38 39 40 41 42 43 44 |
# File 'lib/alchemy/upgrader.rb', line 38 def upgrade_tasks if ENV['UPGRADE'].present? ENV['UPGRADE'].split(',') else all_upgrade_tasks end end |