Class: Potassium::PlatanusConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/potassium/platanus_config.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ PlatanusConfig

Returns a new instance of PlatanusConfig.



3
4
5
6
# File 'lib/potassium/platanus_config.rb', line 3

def initialize(options)
  @options = options
  @option_key_names = Potassium::CliOptions.option_names
end

Instance Method Details

#generate!Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/potassium/platanus_config.rb', line 8

def generate!
  default_options = {
    'db': 'postgresql', 'locale': 'es-CL', 'email_service': 'sendgrid', 'devise': true,
    'devise-user-model': true, 'admin': true, 'vue_admin': true, 'pundit': true,
    'api': true, 'storage': 'shrine', 'heroku': true, 'background_processor': true,
    'draper': true, 'schedule': true, 'sentry': true, 'front_end_vite': true,
    'google_tag_manager': true, 'test': true, 'spring': true
  }
  default_options = default_options.filter { |key, _| @option_key_names.include?(key) }
  @options.merge(default_options, default_options.stringify_keys)
end