On Fri, 19 Dec 2003, Gavin Sinclair wrote:

> Date: Fri, 19 Dec 2003 07:10:20 +0900
> From: Gavin Sinclair <gsinclair / soyabean.com.au>
> Newsgroups: comp.lang.ruby
> Subject: Re: Configuration Files
> 
> On Friday, December 19, 2003, 9:02:05 AM, Ara.T.Howard wrote:
> 
> >> I just got it :-). However it seems like cheating ;-) -- there were no
> >> tabs in Gavin's example. 
> 
> > it may seem like cheating, but i spent twenty minutes debugging something just
> > like this after advocating yaml based configs here at work and letting a real
> > live user configure something - which immeadiately broke my software!
> 
> Interesting.  Thanks for the warning.
> 
> >> There are lots of issues with TABs in yaml, we all know. The common approach
> >> is just to avoid them alltogether. I usually "untab" config files before
> >> calling YAML::load
> 
> > well - i now do too.  the question is, why doesn't yaml?  currently i'm simply
> > gsub'ing tabs for eight spaces and figure this _shouldn't_ breaky anything but
> > haven't really looked into further.  i posted something a while back wondering
> > if trailing space is _ever_ required in yaml
> 
> I guess that's up to the user.  Iff you know that no trailing spaces
> are allowed in your domain, then remove them.
> 
> As for tabs, I would simply error out and tell the user to get rid of
> that tabs.  Assigning a different number of spaces to a tab means
> you'll get different interpretations of the document, I think.
> 
> Perhaps YAML could include one or two methods to do this kind of
> common pre-processing, so we don't all duplicate the code?

__exactly__ what i'm hoping for.  it's easy enough to process tabs in a
particular way, but it makes me queasy since the YAML spec might change, etc.
now, if the methods were part of yaml4r then i can simply use them and
complain to someone else when they break! (sorry _why) ;-) 

plus - the file/string doesn't need processing twice...

my 2cents.  for now, i'm simply blowing away tabs.

-a
-- 

ATTN: please update your address books with address below!

===============================================================================
| EMAIL   :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE   :: 303.497.6469
| ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
| STP     :: http://www.ngdc.noaa.gov/stp/
| NGDC    :: http://www.ngdc.noaa.gov/
| NESDIS  :: http://www.nesdis.noaa.gov/
| NOAA    :: http://www.noaa.gov/
| US DOC  :: http://www.commerce.gov/
|
| The difference between art and science is that science is what we
| understand well enough to explain to a computer.  
| Art is everything else.  
|   -- Donald Knuth, "Discover"
|
| /bin/sh -c 'for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done' 
===============================================================================