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.
Actions
Like0
Like0