Module: CredsEnv

Defined in:
lib/creds_env.rb,
lib/creds_env/rails.rb,
lib/creds_env/version.rb

Defined Under Namespace

Classes: Error, Railtie

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.load(rails_application = nil) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/creds_env.rb', line 9

def self.load(rails_application = nil)
  application = rails_application || Rails.application
  # turn credentials that are IN_CAPS to be ENV["IN_CAPS"] env var
  config = application.credentials.config
  config.keys.grep(/[A-Z]/).each do |var|
    ENV[var.to_s] = config[var].to_s
  end
end