Module: KirguduBase::ConfigurationHelper

Defined in:
app/helpers/kirgudu_base/configuration_helper.rb

Class Method Summary collapse

Class Method Details

.load_environment_variables(config, file_name) ⇒ Object



3
4
5
6
7
8
9
10
# File 'app/helpers/kirgudu_base/configuration_helper.rb', line 3

def self.load_environment_variables(config, file_name)
  config.before_configuration do
    env_file = Rails.root.join("config", file_name).to_s
    YAML.load_file(env_file)[Rails.env].each do |key, value|
      ENV[key.to_s] = value
    end if File.exists?(env_file)
  end # end config.before_configuration
end