From: Nate Wiger Date: 2006-10-25T05:55:43+09:00 Subject: Re: How to maintain App config data? poopdeville@gmail.com wrote: > 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 > > The first option is most like the Perl solution. It's pretty > straightforward. Something along these lines might work for you, > though it's not a singleton class by design: > > http://groups.google.com/group/comp.lang.ruby/msg/aba4124d4d16d6b0 Awesome, that looks great. I think I'll tweak it into a Singleton w/o the global vars (just method accessors). I'll post a follow-up if I come up with something semi-portable. -Nate