Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to override settings with ENV variables #34

Open
woahdae opened this issue Feb 15, 2012 · 1 comment
Open

Ability to override settings with ENV variables #34

woahdae opened this issue Feb 15, 2012 · 1 comment

Comments

@woahdae
Copy link

woahdae commented Feb 15, 2012

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 :)?

@aripollak
Copy link

This capability is built into settingslogic - just define something like this in your settings.yml:

api_key: <%= ENV['APPLICATION_API_KEY'] || 'defaultkey' %>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants