On Wed, Feb 2, 2011 at 6:52 AM, Jeremy Bopp <jeremy / bopp.net> wrote:

> OK. =A0It's really hard to be sure here, but I think the problem is that
> you need to convert this section of your code:
>
> convert_yaml["System"]["Environmental"]["children"][2]["children"]
> << @title
>
> To this:
>
> convert_yaml["System"]["Environmental"]["children"][2]["children"] +=3D @=
title

I'd rather

convert_yaml["System"]["Environmental"]["children"][2]["children"].concat(@=
title)

> The issue is that tar is an array of hashes, but it appears that you
> actually want to append the contents of tar to the data structure you
> have from the YAML file instead of appending tar itself. =A0This code
> appends the contents of the array in tar to the existing array in that
> mess of hashes.
>
> There are other ways to handle this, but this one is the simplest
> change. =A0The downside is that you would prevent someone actually
> appending tar as-is if they actually wanted to do so. =A0Maybe that's not
> an issue for this code.

Another remark: I don't understand why indentation in a YAML file is
such an issue.  After all it's a data format and readable either way.
Typically too few indentation is more an issue than too much.  If the
formatting is that crucial it might be worthwhile to look into writing
a new YAML formatter.

Cheers

robert

--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/