From: Guillaume Marcais Date: 2004-03-31T02:31:35+09:00 Subject: Re: YAML and initializers On Mon, 2004-03-29 at 11:29, why the lucky stiff wrote: > Hal Fulton wrote: > > > > Other questions... > > > > 1. Have you given any thought to preserving comments in yaml files? > > E.g., I read in an entire file, modify some stuff, and write it out > > again -- any practical way to keep the comments? > > Okay, yeah. It's one of those things I'd like to have, but there hasn't > been a big demand for it. Truly: I'm not too excited about coding it > in. But I could really use it as well. Let me add my name to the list of people interrested in this feature. OTOH, I do understand your lack of excitment to tackle it. Guillaume. > > > 2. I wish for a little more control over formatting. Possible? > > a. Specify order of fields instead of alphabetic > > b. Align field names and data in a "prettyprinted" way > > Specifying field order is a cinch. > > class MyClass > def to_yaml_properties > ['@gamma', '@beta', '@alpha'] > end > end > > See the 'Type Families'[1] section in the docs for the low down on > customizing loading and emitting further. > > As for 2b, give me another day and I'll 'splain about how to lay things > out with perfect daintiness. Just takes a minute to detail. > > _why > > [1] http://yaml4r.sourceforge.net/doc/page/type_families.htm > >