Module: Foundationstone::Config
- Includes:
- ActiveSupport::Configurable
- Defined in:
- lib/foundationstone/config.rb
Class Method Summary collapse
-
.reset ⇒ Object
Reset all configurations to defaults.
Class Method Details
.reset ⇒ Object
Reset all configurations to defaults.
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/foundationstone/config.rb', line 33 def self.reset file = File.exist?('config/foundationstone.yml') ? 'config/foundationstone.yml' : "#{Engine.root}/lib/generators/templates/foundationstone.yml" config = YAML.load_file(file)[Rails.env].deep_symbolize_keys! config.each do |key, value| send("#{key}=", value) end raise 'Error: Application name is missing' unless app_name raise 'Error: Unique name is missing' unless unique_name raise 'Error: Domain is missing' unless domain raise 'Error: Mailer is missing' unless mailer end |