Class: RedmineInstaller::RestoreDB

Inherits:
Task show all
Defined in:
lib/redmine-installer/restore_db.rb

Constant Summary

Constants included from Utils

Utils::PROGRESSBAR_FORMAT

Instance Attribute Summary

Attributes inherited from Task

#options

Instance Method Summary collapse

Methods inherited from Task

#down, #run

Methods included from Utils

#class_name, #create_dir, #env_user, #error, #logger, #ok, #pastel, #print_title, #prompt, #run_command

Constructor Details

#initialize(database_dump, redmine_root) ⇒ RestoreDB

Returns a new instance of RestoreDB.



4
5
6
7
8
9
# File 'lib/redmine-installer/restore_db.rb', line 4

def initialize(database_dump, redmine_root)
  super(database_dump: database_dump.to_s)

  @environment = Environment.new(self)
  @redmine = Redmine.new(self, redmine_root)
end

Instance Method Details

#upObject



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/redmine-installer/restore_db.rb', line 11

def up
  @environment.check

  @redmine.valid_options
  @redmine.ensure_and_valid_root
  @redmine.validate
  @redmine.check_running_state
  @redmine.restore_db

  puts
  puts pastel.bold('Database was restored')
  logger.info('Database was restored')
end