Class: RedmineInstaller::Configuration

Inherits:
Object
  • Object
show all
Extended by:
Utils
Defined in:
lib/redmine-installer/configuration.rb

Overview

RedmineInstaller::Configuration

For now, email is only configured.

Defined Under Namespace

Classes: Base, CustomConfiguration, Gmail, Nothing, SendMail

Constant Summary

Constants included from Utils

Utils::PROGRESSBAR_FORMAT

Class Method Summary collapse

Methods included from Utils

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

Class Method Details

.create_config(redmine) ⇒ Object



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

def self.create_config(redmine)
  # Maybe: enum_select
  klass = prompt.select('Which service to use for email sending?') do |menu|
    menu.default 4

    menu.choice 'Custom configuration (SMTP)', CustomConfiguration
    menu.choice 'Gmail', Gmail
    menu.choice 'SendMail', SendMail
    menu.choice 'Nothing', Nothing
  end

  # Get parameters and create configuration
  database = klass.new(redmine)
  database.get_parameters
  database.make_config
  database
end