-
-
Save BinaryMuse/a217834493ff7d727ade to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# All values should be specified in "default". Anything | |
# that is specified in any other environment--"test", "development", | |
# or "production"--will overwrite values in "default". | |
default: | |
allow_registration: false | |
facebook: | |
app_id: APP_ID_HERE | |
app_secret: APP_SECRET_HERE | |
api_key: API_KEY_HERE | |
twitter: | |
api_key: API_KEY_HERE | |
oauth_consumer_key: CONSUMER_KEY_HERE | |
oauth_consumer_secret: CONSUMER_SECRET_HERE | |
development: | |
allow_registration: true | |
test: | |
allow_registration: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yaml' | |
# ERB.new allows us to use ERB tags in the YAML | |
yaml_data = YAML::load(ERB.new(IO.read(File.join(Rails.root, 'config', 'application.yml'))).result) | |
# Merge the "default" section with the section for this environment | |
config = yaml_data["default"] | |
begin | |
config.merge! yaml_data[Rails.env] | |
rescue TypeError | |
# nothing specified for this environment; do nothing | |
end | |
# Pass to a HashWithIndifferentAccess so that we can use symbols (APP_CONFIG[:key]) | |
APP_CONFIG = HashWithIndifferentAccess.new(config) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment