I have encountered what appears to be a bug with the YAML parser. Take this simple yaml file for example:
new account:
- FLEETBOSTON
- 011001742
If you parse it using this ruby line of code:
INPUT_DATA = YAML.load_file("test.yml")
Then I get this back:
{"new account"=>["FLEETBOSTON", 2360290]}
Am I doing something wrong? Because I’m pretty sure this is never supposed to happen.
It is supposed to happen. Numbers starting with
0are in octal notation. Unless the next character isx, in which case they’re hexadecimal.Go into
irband just type in011001742.PEBKAC. 🙂
Your number is a number, so it’s treated as a number. If you want to make it explictly a string, enclose it into quotes, so YAML will not try to make it a number.