Skip to content
Provides a way to manage environment specific configuration settings.
Ruby
Find file
Pull request Compare This branch is 1 commit ahead, 16 commits behind UnderpantsGnome:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
spec
.gitignore
History.txt
License.txt
README.rdoc
Rakefile
VERSION
config_reader.gemspec

README.rdoc

ConfigReader

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: CHANGE-ME.com
  mail_from: noreply@CHANGE_ME.com
  site_name: CHANGE-ME
  admin_email: admin@CHANGE-ME.com
  blackbird: true

production:
  site_url: http://CHANGE-ME.com
  blackbird: false

test:
  blackbird: false

Example class:

class MyConfig < ConfigReader
  self.config_file = 'config/my_config.yml'
end

Usage:

MyConfig.mail_from   #=> noreply@CHANGE_ME.com
MyConfig[:mail_from] #=> noreply@CHANGE_ME.com

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

Copyright © 2008 Michael Moen. See LICENSE for details.

Something went wrong with that request. Please try again.