On Apr 16, 2010, at 05:33 , Martin Hansen wrote:

>  # Reads the next 'record' from the I/O stream. The records are
> separated by
>  # lines of "---" and each record consists of a varying number of =
lines
> with a
>  # key/value pair separated by ": ". The record is returned as a hash.
>  def get_record

I'm not sure why nobody bothered to point this out, or maybe I'm missing =
something...

> require "yaml"
> s =3D "---
> a: b
> c: d
> "
>=20
> p YAML.load(s)
> # =3D> {"a"=3D>"b", "c"=3D>"d"}

Also:=20

> % =1Bri YAML.load_documents=1B
>=20
> (from ruby core)
> =
--------------------------------------------------------------------------=
----
>   load_documents( io, &doc_proc )
>=20
> =
--------------------------------------------------------------------------=
----
>=20
> Calls =1Bblock with each consecutive document in the YAML stream =
contained
> in =1Bio=1B.
>=20
>   File.open( 'many-docs.yaml' ) do |yf|
>     YAML.load_documents( yf ) do |ydoc|
>       ## ydoc contains the single object
>       ## from the YAML document
>     end
>   end