Module: Redmine::Installer

Defined in:
lib/redmine-installer/exec.rb,
lib/redmine-installer.rb,
lib/redmine-installer/cli.rb,
lib/redmine-installer/git.rb,
lib/redmine-installer/step.rb,
lib/redmine-installer/task.rb,
lib/redmine-installer/error.rb,
lib/redmine-installer/utils.rb,
lib/redmine-installer/backup.rb,
lib/redmine-installer/helper.rb,
lib/redmine-installer/plugin.rb,
lib/redmine-installer/command.rb,
lib/redmine-installer/install.rb,
lib/redmine-installer/profile.rb,
lib/redmine-installer/upgrade.rb,
lib/redmine-installer/version.rb,
lib/redmine-installer/config_param.rb

Overview

Class for easyier handle configuration parameters

Examples:

params = Redmine::Installer::ConfigParams.new
params.add('database')
params.add('host').note('this is a host').default('localhost')

Defined Under Namespace

Modules: Helper, Plugin, Step, Utils Classes: Backup, CLI, Command, ConfigParam, ConfigParams, Error, Exec, Git, Install, Profile, Task, Upgrade

Constant Summary collapse

VERSION =
'1.0.5'

Class Method Summary collapse

Class Method Details

.localesObject

Locales for I18n



26
27
28
# File 'lib/redmine-installer.rb', line 26

def self.locales
  @locales ||= Dir.glob(File.join(locales_path, '*.yml'))
end

.locales_pathObject

Path to locales dir



21
22
23
# File 'lib/redmine-installer.rb', line 21

def self.locales_path
  @locales_path ||= File.join(root_path, 'lib', 'redmine-installer', 'locales')
end


38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/redmine-installer.rb', line 38

def self.
  $stdout.puts <<-PRINT
              __      _
  _______ ___/ /_ _  (_)__  ___
 / __/ -_) _  /  ' \\/ / _ \\/ -_)
/_/  \\__/\\_,_/_/_/_/_/_//_/\\__/


#{I18n.translate(:powered_by)}

  PRINT
end

.root_pathObject

Root of the gem



16
17
18
# File 'lib/redmine-installer.rb', line 16

def self.root_path
  @root_path ||= File.expand_path('..', File.dirname(__FILE__))
end

.set_i18nObject

Default configurations fo I18n gem



31
32
33
34
35
36
# File 'lib/redmine-installer.rb', line 31

def self.set_i18n
  I18n.enforce_available_locales = false
  I18n.load_path = Redmine::Installer.locales
  I18n.locale = :en
  I18n.default_locale = :en
end