diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-01-09 11:28:15 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-01-09 11:28:15 -0800 |
commit | cf82e485d1511330c0607612c24712255739df49 (patch) | |
tree | 1313b052aaabb9824016390d5ac5bbfd6b285e8a /lib | |
parent | 4f403bc0f1176e56854f4d994bf622dafaec5ea0 (diff) | |
download | psych-cf82e485d1511330c0607612c24712255739df49.tar.gz |
* 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
fixes #109
Diffstat (limited to 'lib')
-rw-r--r-- | lib/psych/scalar_scanner.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/psych/scalar_scanner.rb b/lib/psych/scalar_scanner.rb index d0beee3..5759459 100644 --- a/lib/psych/scalar_scanner.rb +++ b/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(/[,_]/, '') |