* ext/psych/lib/psych/scalar_scanner.rb: Only consider strings
with fewer than 2 dots to be numbers. [ruby-core:38915] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e8b3d0decf
commit
b5f05971f5
@ -1,3 +1,8 @@
|
||||
Sat Aug 13 08:55:38 2011 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||
|
||||
* ext/psych/lib/psych/scalar_scanner.rb: Only consider strings
|
||||
with fewer than 2 dots to be numbers. [ruby-core:38915]
|
||||
|
||||
Sat Aug 13 08:47:20 2011 Tadayoshi Funaba <tadf@dotrb.org>
|
||||
|
||||
* ext/date/date_core.c: [ruby-core:38855].
|
||||
|
@ -68,8 +68,11 @@ module Psych
|
||||
end
|
||||
i
|
||||
else
|
||||
return Integer(string.gsub(/[,_]/, '')) rescue ArgumentError
|
||||
return Float(string.gsub(/[,_]/, '')) rescue ArgumentError
|
||||
if string.count('.') < 2
|
||||
return Integer(string.gsub(/[,_]/, '')) rescue ArgumentError
|
||||
return Float(string.gsub(/[,_]/, '')) rescue ArgumentError
|
||||
end
|
||||
|
||||
@string_cache[string] = true
|
||||
string
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user