Class: Redmine::Installer::Step::RedmineRoot

Inherits:
Base
  • Object
show all
Defined in:
lib/redmine-installer/steps/redmine_root.rb

Instance Attribute Summary

Attributes inherited from Base

#base, #index, #ran

Instance Method Summary collapse

Methods inherited from Base

#down, #final, #initialize, #prepare, #print_footer, #print_header, #print_title, #redmine_plugins

Methods included from Utils

included

Constructor Details

This class inherits a constructor from Redmine::Installer::Step::Base

Instance Method Details

#load(configuration) ⇒ Object



24
25
26
# File 'lib/redmine-installer/steps/redmine_root.rb', line 24

def load(configuration)
  base.redmine_root = configuration['redmine_root']
end

#save(configuration) ⇒ Object



20
21
22
# File 'lib/redmine-installer/steps/redmine_root.rb', line 20

def save(configuration)
  configuration['redmine_root'] = base.redmine_root
end

#upObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/redmine-installer/steps/redmine_root.rb', line 4

def up
  # Get redmine root
  base.redmine_root ||= ask(:path_for_redmine_root, default: '.')

  # Make absolute path
  base.redmine_root = File.expand_path(base.redmine_root)

  unless Dir.exist?(base.redmine_root)
    try_create_dir(base.redmine_root)
  end

  unless File.writable?(base.redmine_root)
    error t(:dir_is_not_writeable, dir: base.redmine_root)
  end
end