On Wed, 25 Oct 2006, Nate Wiger wrote:

> I'm writing an app in Rails, but some modules need to work outside of Rails. 
> In these classes, I'd like to have a common way to access configuration data. 
> Two approaches I though of:
>
> 1. Use a Singleton class ala the Logger concept, and have
>   a "conf" object floating around that can provide the
>   "conf.root_dir" or whatever
>
> 2. Mixin a module that provides a conf() routine, so that
>   classes would call conf('root_dir') / etc

In IOWA apps, there is a method, Iowa.config, that has a reference to the 
config object for the application.

This lets that config object be accessed by any code anywhere, similar to 
your option #1.


Kirk Haines