Class: Decidim::Cdtb::Upgrades::UpgradeModulesTask

Inherits:
Task
  • Object
show all
Defined in:
lib/decidim/cdtb/upgrades/upgrade_modules_task.rb

Overview

Upgrades the gems with engines in them. All, Decidim modules and standard Rails engines.

Instance Attribute Summary

Attributes inherited from Task

#num_applied, #title

Instance Method Summary collapse

Methods inherited from Task

#execute!, #finish, #init

Methods included from TasksUtils

#do_log_error, #do_log_info, #log_task_end, #log_task_failure, #log_task_info, #log_task_step, #log_task_title, #logger

Constructor Details

#initializeUpgradeModulesTask

Returns a new instance of UpgradeModulesTask.



9
10
11
12
# File 'lib/decidim/cdtb/upgrades/upgrade_modules_task.rb', line 9

def initialize
  progress_bar= { title: "Modules" }
  super("UPGRADE MODULES", progress_bar:)
end

Instance Method Details

#do_execution(context) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/decidim/cdtb/upgrades/upgrade_modules_task.rb', line 28

def do_execution(context)
  # progress_bar= context[:progress_bar]

  # system("bundle update decidim")
  # system("bin/rails decidim:upgrade")
  # system("bin/rails db:migrate")
end

#end_execution(_ctx) ⇒ Object



36
37
38
# File 'lib/decidim/cdtb/upgrades/upgrade_modules_task.rb', line 36

def end_execution(_ctx)
  log_task_step("#{@num_applied} users nicknamized")
end

#prepare_execution(_ctx) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/decidim/cdtb/upgrades/upgrade_modules_task.rb', line 14

def prepare_execution(_ctx)
  log_task_info("Have you updated the versions of your modules in the Gemfile (y/n)?")
  response= $stdin.gets
  if response&.downcase == "y"
    get the number of modules
  else
    @exit= true
  end
end

#total_itemsObject



24
25
26
# File 'lib/decidim/cdtb/upgrades/upgrade_modules_task.rb', line 24

def total_items
  @num_users
end