Class: Alchemy::Upgrader

Inherits:
Seeder
  • Object
show all
Extended by:
ThreePointFour, ThreePointOne, ThreePointThree, ThreePointTwo, ThreePointZero
Defined in:
lib/alchemy/upgrader.rb

Defined Under Namespace

Modules: Tasks, ThreePointFour, ThreePointOne, ThreePointThree, ThreePointTwo, ThreePointZero

Class Method Summary collapse

Methods inherited from Seeder

seed!

Methods included from Shell

#add_todo, #desc, #display_todos, #log, silence!, silenced?, #todo, #todos, verbose!

Class Method Details

.all_upgrade_tasksObject

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|
    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_tasksObject

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