Sha256: d733635a0b24330b7a24333e62506b014be27d95395574c78f21decfddb9026c

Contents?: true

Size: 586 Bytes

Versions: 1

Compression:

Stored size: 586 Bytes

Contents

config_yml         = "#{Rails.root}/config/astrochimp.yml"
config_example_yml = File.expand_path '../../astrochimp.example.yml', __FILE__

# Copy example config if there is not already one present
FileUtils.cp config_example_yml, config_yml if !File.exists?(config_yml)

# Load the current environmnts astrochimp configuration
config = YAML.load(File.read(config_yml))[Rails.env]

# Set environment variables based on config (not overiding already set ENVs)
config.each do |key, value|
  key = 'AC_' + key.upcase
  ENV[key] = value.to_s if !value.kind_of?(Hash) && ENV[key].blank?
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
astrochimp-0.1.0 config/initializers/settings.rb