From 57c468a5f8bd3ffc1cb93b07db6b823872316a18 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 7 Oct 2009 15:51:21 -0700 Subject: fixing float parsing --- lib/psych/visitors/to_ruby.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/psych/visitors/to_ruby.rb b/lib/psych/visitors/to_ruby.rb index bb80ad6..c757d25 100644 --- a/lib/psych/visitors/to_ruby.rb +++ b/lib/psych/visitors/to_ruby.rb @@ -22,6 +22,8 @@ module Psych Complex(o.value) when "!ruby/object:Rational" Rational(o.value) + when "tag:yaml.org,2002:float", "!float" + Float(ScalarScanner.new(o.value).tokenize.last) when "!ruby/regexp" o.value =~ /^\/(.*)\/([mix]*)$/ source = $1 -- cgit v1.2.3