Plugins - application_configuration

StarAdd to favorites

ApplicationConfiguration

Simple means of configuring your application by placing an application.yml file into the /config folder, which is then parsed into a Config object.

It's basically Dmitro Shteflyuk's idea of using Ostruct, packaged into a plugin; see http://kpumuk.info/ruby-on-rails/flexible-application-configuration-in-ruby-on-rails/ for details.

Anything declared in application.yml YAML file is available in your application, which is very convenient when you want to give access to configuration to colleagues not familiar with Ruby.

  1. In RAILS_ROOT/config/application.yml: website_name: Rubyists Anonymous

  2. In your application (try in script/console): puts Config.website_name

  3. In your views: <%= Config.website_name =>

Plugin automatically places an example application.yml into your /config folder and provides Rake tasks for installing an uninstalling. Basic set of unit tests is provided.

Install: script/plugin install http://flake-cms.googlecode.com/svn/plugins/application_configuration/

Karel Minařík

http://flake-cms.googlecode.com/svn/plugins/application_configuration/

Rails' (MIT)

  • Currently 3.2/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Misc. Enhancements

Tags

Comments

Add a comment
tom 30 Jun 2008

Very nice. Thanks, Karel. I found, however, an even nicer plugin with better test coverage and Erb integration. Check it out here: http://www.taknado.com/2007/7/25/custom-configuration-info-in-rails

Install it via <code> script/plugin install http://tools.assembla.com/svn/railsplugins/appconfig</code>

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?