Lightweight app configuration for Rails >= 3.0
Add this line to your application's Gemfile:
gem 'app_konfig'
And then execute:
$ bundle
In config/config.yml
:
development:
value: 1
proxy:
ip: 127.0.0.1
port: 8080
secret_key: DEV_TOKEN
test:
value: 2
proxy:
ip: 127.0.0.1
port: 8080
secret_key: TEST_TOKEN
production:
value: 3
proxy:
ip: 10.0.0.10
port: 8080
In config/secrets.yml
: (optional, not included in version control)
production:
secret_key: PRODUCTION_TOKEN
Anywhere in the app:
AppConfig.value
AppConfig.proxy.ip
AppConfig.secret_key
or
AppConfig.get('value')
AppConfig.get('proxy.ip')
AppConfig.get('secret_key')
- Fork it ( https://github.com/netguru/app_konfig/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request