Actions
Bug #6205
closedYAML Regexp in anchor gets converted to String
Description
I'll try to illustrate with code:
YAML:¶
hello: &allow-float
!ruby/regexp '/hello/'
bla: *allow-float
RUBY:
require 'yaml'
config = YAML.load_file('config.yaml')
puts config.inspect
puts config['hello'].class
puts config['bla'].class
OUTPUT:
{"hello"=>/hello/, "bla"=>"/hello/"}
Regexp
String
The Regexp has become a string. This only seems to happen if the Regexp is at the root of the anchor.
This happens with Ruby 1.9.3p0, but not with 1.9.2p290.
Updated by tenderlovemaking (Aaron Patterson) about 13 years ago
- Status changed from Open to Closed
- Assignee set to tenderlovemaking (Aaron Patterson)
- % Done changed from 0 to 100
Thanks for the bug report!
This was fixed in r33679. I'll make a request to backport the fix to the 1.9.3 branch.
Actions
Like0
Like0