[ANN] YAML.rb 0.38 -- Objects in plain text

Pleased to announce the latest YAML.rb product.

For newcomers: YAML.rb is a Ruby module which can serialize objects into
plain text. The following is a YAML document containing a simple Hash:

#YAML:1.0
color: brown
number: 21
soft drink: Coca-Cola

The following is a simple Array:

#YAML:1.0

  • The Minority Report
  • The Little Black Box
  • A Terran Odyssey

YAML.rb allows you to store Hash, Array, Struct, Regexp, Range, and a plethra
of other objects in YAML. To convert any object to YAML, use the Object#to_yaml
method. For example, to convert an Array to YAML:

[ 1, 2, 3 ].to_yaml

YAML.rb has many more features which I won’t go into here. I have a new YAML Cookbook
up which will simply describe how to represent various data structures in YAML. The
Cookbook is generated from our testing suite and is quite readable:

http://yaml4r.sf.net/cookbook/

The 0.38 release adds Unicode support and a new Emitter class, which assists in making
the project threadsafe. Thanks to Tobias Peters and Ned Konz for their ideas and input.

I’ve also changed the name from YAML4r to YAML.rb. You can still find the site at
http://yaml4r.sf.net/ but I’ve changed the name in most every other place. The home
page for the whole umbrella YAML project is at http://www.yaml.org/.

Dats it.

_why

Thanks a lot for the YAML work.
YAML looks very promising.

I highly recommend that the XML users
have a look at YAML if they have not yet done so.
http://www.yaml.org/

Thanks,

Armin.

···

Armin Roehrl, http://www.approximity.com

Rubybuch: http://approximity.com/rubybuch/
Nächstes Rubyseminar: 9/9-11/9 in Hamburg.

Agile Entwicklerkonferenz: 22. und 23.10 in Nürnberg.
http://www.approximity.com/public/conferences/AgileConf.html

Thanks a lot for the YAML work.
YAML looks very promising.

I highly recommend that the XML users
have a look at YAML if they have not yet done so.
http://www.yaml.org/

I’ve added it to my to do list - it’s interesting to me because I originally
started my XmlSerialization project primarily because I wanted some sort of
quick and easy .conf file, with an emphasis on clean, clear xml (which
doesn’t always happen).

Does YAML.rb currently handle circular obj references? This is one thing my
module lacks that I’d like to support, but it’s going to require an id
system within the XML to keep it straight, which means more ‘clutter’ in the
xml.

Chris
http://clabs.org

At this time, circular object references are supported by the
YAML.rb parser, but not the emitter. As I have just restructured
the Emitter into its own class, you will see references supported
in the emitter by version 0.40, which should release by next week.

For a somewhat dated discussion of how this will work, browse here:

http://wiki.yaml.org/yamlwiki/AnchorsAndAliases

You can see living examples of anchors and aliases in the Cookbook:

http://yaml4r.sourceforge.net/cookbook/#aliases%20and%20anchors

I really like the XmlSerialization class, BTW. I like that it’s
so straightforward. Many of the ideas in the XmlSerialization
module are also expressed in YAML. For example, you allow simple scalars to
go untyped. If a scalar isn’t an Integer or a Float, it is assumed
to be a String. Similiar logic is used in YAML (though the
specification does detail specific grammar for what constitutes an unquoted
string).

If you have any recommendations for YAML, Chris, I’m sure all the guys
on the Yaml-core list would appreciate your experience. The entire team
is very practical, focusing on actual use cases to weigh decisions.

_why

···

Chris Morris (chrismo@clabs.org) wrote:

Does YAML.rb currently handle circular obj references? This is one thing my
module lacks that I’d like to support, but it’s going to require an id
system within the XML to keep it straight, which means more ‘clutter’ in the
xml.

At this time, circular object references are supported by the
YAML.rb parser, but not the emitter.

You can see living examples of anchors and aliases in the Cookbook:

http://yaml4r.sourceforge.net/cookbook/#aliases%20and%20anchors

Great - thanks.

I really like the XmlSerialization class, BTW. I like that it’s
so straightforward. Many of the ideas in the XmlSerialization
module are also expressed in YAML.

Thanks! Obviously, the two projects (at least mine in the beginning) have
similar goals.

If you have any recommendations for YAML, Chris, I’m sure all the guys
on the Yaml-core list would appreciate your experience. The entire team
is very practical, focusing on actual use cases to weigh decisions.

Well, my experience may only be half a handful of nothing, but if I get time
(which I won’t, I fear :), I’ll pop over sometime.

Chris
http://clabs.org