f



YAML on Ruby 1.8.1 and Ruby 1.8.2

I've written several programs that use YAML to store their
configuration files, and I generally run them on Ruby 1.8.2.
Occasionally we have a setup with a Ruby 1.8.1 or older version around
and noticed that the YAML module on these older versions of Ruby
behaves differently from that of 1.8.2. In particular, this YAML
string:

"--- :abc"

produces different results from 1.8.1 and 1.8.2.  Under 1.8.2, I get
the expected behavior, and

YAML::load("--- :abc")  => :abc

However, under 1.8.1:

YAML:load("--- :abc") => ":abc"

This totally breaks my config file scheme and is incredibly annoying.
Apparently, copying the YAML module from 1.8.2 to 1.8.1 doesn't fix
this behavior. I've had to write a short function to fix this brain
damage, but I wonder if there is a better way.


0
4/11/2005 9:48:39 AM
comp.lang.ruby 48886 articles. 0 followers. Post Follow

1 Replies
1086 Views

Similar Articles

[PageSpeed] 40

Dido Sevilla a �crit :
> I've written several programs that use YAML to store their
> configuration files, and I generally run them on Ruby 1.8.2.
> Occasionally we have a setup with a Ruby 1.8.1 or older version around
> and noticed that the YAML module on these older versions of Ruby
> behaves differently from that of 1.8.2. In particular, this YAML
> string:
> 
> "--- :abc"
> 
> produces different results from 1.8.1 and 1.8.2.  Under 1.8.2, I get
> the expected behavior, and
> 
> YAML::load("--- :abc")  => :abc
> 
> However, under 1.8.1:
> 
> YAML:load("--- :abc") => ":abc"
> 
> This totally breaks my config file scheme and is incredibly annoying.
> Apparently, copying the YAML module from 1.8.2 to 1.8.1 doesn't fix
> this behavior. I've had to write a short function to fix this brain
> damage, but I wonder if there is a better way.
> 
> 

I've already answered, but my post doesn't appear in newsgroup. I retry:

YAML::load( "--- !ruby/sym abc" ) => :abc

--
Lionel Thiry
0
4/11/2005 4:37:38 PM
Reply: