Provides a way to manage environment specific configuration settings. It will use the defaults for any environment and override any values you specify for an environment.
Example config file:
defaults: site_url: http://localhost:3000 host_name: example.com mail_from: email@example.com site_name: example admin_email: firstname.lastname@example.org blackbird: true production: site_url: http://example.com blackbird: false test: blackbird: false
class MyConfig < ConfigReader self.config_file = 'config/my_config.yml' end
Now also includes Sekrets integration. github.com/ahoward/sekrets
The format of the sekrets file is the same as the regular file.
Example class with Sekrets:
class MyConfig < ConfigReader self.config_file = 'config/my_config.yml' self.sekrets_file = 'config/my_config.yml.enc' end
MyConfig.mail_from #=> email@example.com MyConfig[:mail_from] #=> firstname.lastname@example.org
Note on Patches/Pull Requests
Fork the project.
Make your feature addition or bug fix.
Add tests for it. This is important so I don't break it in a future version unintentionally.
Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
Send me a pull request. Bonus points for topic branches.
Copyright © 2008 Michael Moen. See LICENSE for details.