Provides a better way to configure the application than simply pulling
strings from ENV
by overriding the deprecated Config
class.
Config[:foo]
# => nil
Config.default(:foo, 'bar')
Config[:foo]
# => 'bar'
Config['FOO']
# => 'bar'
Returns nil
when undefined, otherwise casts to indicated type.
Config.int(:max_connections)
#=> 10
Add this line to your application's Gemfile:
gem 'env-conf'
And then execute:
$ bundle
Or install it yourself as:
$ gem install env-conf
require 'env-conf'
Config[:foo]
- Fork it ( https://github.com/[my-github-username]/env-conf/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