Skip to content

Instantly share code, notes, and snippets.

@jxpx777
Created January 31, 2011 15:33
Show Gist options
  • Save jxpx777/804195 to your computer and use it in GitHub Desktop.
Save jxpx777/804195 to your computer and use it in GitHub Desktop.
Initializer file that loads a YML file for config information for the current environment.
production:
site_url: http://mywebsite.com
ssl_site_url: https://mywebsite.com
licenses_folder: /path/to/shared/licenses
ferret_index_path: /path/to/shared/ferret/index
test:
development:
# encoding: UTF-8
agile_config_file = Rails.root.join('config', 'ag_constants.yml')
raise "#{agile_config_file} is missing!" unless File.exists?(agile_config_file)
agile_config = YAML.load_file(agile_config_file)[Rails.env].symbolize_keys rescue {}
SITE_URL = agile_config[:site_url]
SSL_SITE_URL = agile_config[:ssl_site_url]
LICENSES_FOLDER = agile_config[:licenses_folder]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment