From: Joel VanderWerf Date: 2003-01-27T19:56:32+09:00 Subject: Re: cascading configuration variables Gavin Sinclair wrote: > On Monday, January 27, 2003, 2:15:38 AM, Wilbert wrote: > > >>a little follow-up on loading config data as Ruby source files. I >>want my project to load some full system defaults from a file, and >>then some user-specified overrides from another file, and finally >>some special overrides that are set on the commandline or from the >>calling environment. > > > I think there's an RAA package called PseudoHash or something that > allows chaining hashes to retrieve different values (system, user, > default, etc.). PseudoHash appears to be an ordered hash. SuperHash allows chains of hashes which inherit key-value pairs. This might be useful if you need to reuse, say, the system defaults several times during the program (maybe for different users). But Hash#update might serve just as well. The main difference is that SuperHash is dynamic (changing system options would affect all users, existing and future) whereas Hash#update is static (changing system options would only affect users generated after the change).