Class: RedmineInstaller::Install
- Defined in:
- lib/redmine-installer/install.rb
Direct Known Subclasses
Constant Summary
Constants included from Utils
Instance Attribute Summary collapse
-
#package_config ⇒ Object
readonly
Returns the value of attribute package_config.
Attributes inherited from Task
Instance Method Summary collapse
- #down ⇒ Object
-
#initialize(package, redmine_root, **options) ⇒ Install
constructor
A new instance of Install.
- #up ⇒ Object
Methods inherited from Task
Methods included from Utils
#class_name, #create_dir, #env_user, #error, #logger, #ok, #pastel, #print_title, #prompt, #run_command
Constructor Details
#initialize(package, redmine_root, **options) ⇒ Install
Returns a new instance of Install.
6 7 8 9 10 11 12 13 14 |
# File 'lib/redmine-installer/install.rb', line 6 def initialize(package, redmine_root, **) super(**) @environment = Environment.new(self) @package = Package.new(self, package) @target_redmine = Redmine.new(self, redmine_root) @temp_redmine = Redmine.new(self) @package_config = PackageConfig.new(@temp_redmine) end |
Instance Attribute Details
#package_config ⇒ Object (readonly)
Returns the value of attribute package_config.
4 5 6 |
# File 'lib/redmine-installer/install.rb', line 4 def package_config @package_config end |
Instance Method Details
#down ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/redmine-installer/install.rb', line 43 def down @temp_redmine.clean_up @package.clean_up puts puts "(Log is located on #{pastel.bold(logger.path)})" end |
#up ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/redmine-installer/install.rb', line 16 def up @temp_redmine. @environment.check @target_redmine.ensure_and_valid_root @package.ensure_and_valid_package @package.extract @temp_redmine.root = @package.redmine_root @package_config.check_version @temp_redmine.validate @temp_redmine.create_database_yml @temp_redmine.create_configuration_yml @temp_redmine.install print_title('Finishing installation') ok('Cleaning root'){ @target_redmine.delete_root } ok('Moving redmine to target directory'){ @target_redmine.move_from(@temp_redmine) } ok('Cleanning up'){ @package.clean_up } ok('Moving installer log'){ logger.move_to(@target_redmine, suffix: 'install') } puts puts pastel.bold('Redmine was installed') logger.info('Redmine was installed') end |