From: "Hal E. Fulton" Date: 2003-01-26T15:52:46+09:00 Subject: Re: datafiles as Ruby source musings ----- Original Message ----- From: "Daniel Carrera" To: "ruby-talk ML" Sent: Saturday, January 25, 2003 9:37 PM Subject: Re: datafiles as Ruby source musings > On Sun, Jan 26, 2003 at 12:12:31PM +0900, ahoward wrote: > > > Does anybody have a nice hint or better trick to create data- or config files > > > readable with Ruby without having to write parsers in ruby? I recently helped someone write code to do something similar... it basically did a split on the = sign, used the lefthand side as a hash key; then we used the hash keys to make a Struct and stored the values in the struct. If your righthand side is other than a simple string, you might want to eval. Unless you consider eval evil. :) Hal