ConfigatronRails is a plugin born out of a want for environment-specific
variables using a gem I’ve grown to appreciate:
Make sure you have configatron (2.0 or higher) installed before following these steps!
> sudo gem install configatron
- Or toss this in your environment.rb (preferred method)
cd vendor/plugins git clone git://github.com/cmaggard/configatron-rails.git configatron_rails cd configatron_rails git checkout 0.4 cd .. rm -rf configatron_rails/.git cd ../.. script/generate config
If upgrading, run
script/generate config again, as this will copy the necessary
initializer file over. Just don’t overwrite your config.yml. ;)
development: &local site_address: http://localhost:3000/ test: <<: *local production: site_address: http://www.thebestappev.er/
In ‘script/console development’ and ‘script/console test’
>> configatron.site_address # => "http://localhost:3000/"
In ‘script/console production’
>> configatron.site_address # => "http://www.thebestappev.er/"
- 0.4 – Updated for configatron 2.1.1, changed to initializer script
- 0.3 – Updated for configatron 2.0
- 0.2.1 – Minor tweaks to template file
- 0.2 – Environment seeding of config.yml based upon database.yml
- 0.1 – First Release
Copyright © 2008 Cody Maggard, released under the MIT license