From b104e2524ddd8f8c34918a31dbfca54169dd0535 Mon Sep 17 00:00:00 2001 From: tenderlove Date: Wed, 9 Jan 2013 19:26:45 +0000 Subject: * ext/psych/lib/psych/scalar_scanner.rb: strip trailing dots from floats so that Float() will not raise an exception. * test/psych/test_numeric.rb: test to ensure "1." can be loaded * test/psych/test_string.rb: make sure "1." can round trip git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/psych/lib/psych/scalar_scanner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/psych/lib') diff --git a/ext/psych/lib/psych/scalar_scanner.rb b/ext/psych/lib/psych/scalar_scanner.rb index d0beee3626..575945990f 100644 --- a/ext/psych/lib/psych/scalar_scanner.rb +++ b/ext/psych/lib/psych/scalar_scanner.rb @@ -96,7 +96,7 @@ module Psych @string_cache[string] = true string else - Float(string.gsub(/[,_]/, '')) + Float(string.gsub(/[,_]|\.$/, '')) end else int = parse_int string.gsub(/[,_]/, '') -- cgit v1.2.3