------ art_15110_23247470.1191447612872
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Config files should be plain Ruby (written of the top of my head). Why parse
for yourself when Ruby has a perfectly fine one?
config.ini
param1 alue1
param2 alue2
...
parser.rb
def method_missing(method_name, *args)
if method_name.match(/
@config[method_name] rgs[0]
end
end
require "config.ini"
@config["param1"] # value1
This of course, or YAML, because that's just so bloody easy.
Jason
On 10/3/07, Terry Poulin <bigboss64 / ippimail.com> wrote:
>
> BJ Dierkes wrote:
> > I prefer using standard *nix style configuration files in the form of
> > 'param alue'. I wrote a class to read this type of configuration
> > file called ParseConfig.
> >
> > http://rubyforge.org/projects/parseconfig/
> >
> >
>
> Ooo, thank you.. I've been meaning to look for some thing like that :-)
>
>
>
>
> I have actually never needed to deal with config files from this
> perspective.
> Personally from the point of view of Joe Blow. I prefer a syntax like most
> unix style config files.
>
> # Comment
> parm alue
>
> Along with the ini file, it makes for a very easy to edit file. It's just
> a
> matter of figuring out what does what for the end user. (IMHO)
>
>
> TerryP.
>
>
> --
>
> Email and shopping with the feelgood factor!
> 55% of income to good causes. http://www.ippimail.com
>
>
>
------ art_15110_23247470.1191447612872--