settingslogic
settingslogic copied to clipboard
Ability to override settings with ENV variables
I implemented my own Settings without knowing about Settingslogic, and the api is almost exactly the same except that I have ENV-overrides built in for misc things like the google maps api keys, some external service creds, etc. With the popularity of heroku and pow, certain settings get messy unless your settings object has a concept of env variable overrides.
I'd love to switch the app to Settingslogic and contribute a patch with the ENV feature, but would it be accepted (assuming it wasn't a huge hack :)?
This capability is built into settingslogic - just define something like this in your settings.yml:
api_key: <%= ENV['APPLICATION_API_KEY'] || 'defaultkey' %>