summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-09 19:26:45 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-09 19:26:45 +0000
commitb104e2524ddd8f8c34918a31dbfca54169dd0535 (patch)
tree47d1c761f052d29ef1bb248530a3e8b10e9cfbf1 /ext
parentac8b1869c0b80fd948a6a50d2a737123b5fa5bd2 (diff)
* 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
Diffstat (limited to 'ext')
-rw-r--r--ext/psych/lib/psych/scalar_scanner.rb2
1 files changed, 1 insertions, 1 deletions
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(/[,_]/, '')