mirror of
https://github.com/ruby/ruby.git
synced 2025-09-20 11:03:58 +02:00
* 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
2 changed files with 10 additions and 2 deletions
|
@ -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>
|
Sat Aug 13 08:47:20 2011 Tadayoshi Funaba <tadf@dotrb.org>
|
||||||
|
|
||||||
* ext/date/date_core.c: [ruby-core:38855].
|
* ext/date/date_core.c: [ruby-core:38855].
|
||||||
|
|
|
@ -68,8 +68,11 @@ module Psych
|
||||||
end
|
end
|
||||||
i
|
i
|
||||||
else
|
else
|
||||||
return Integer(string.gsub(/[,_]/, '')) rescue ArgumentError
|
if string.count('.') < 2
|
||||||
return Float(string.gsub(/[,_]/, '')) rescue ArgumentError
|
return Integer(string.gsub(/[,_]/, '')) rescue ArgumentError
|
||||||
|
return Float(string.gsub(/[,_]/, '')) rescue ArgumentError
|
||||||
|
end
|
||||||
|
|
||||||
@string_cache[string] = true
|
@string_cache[string] = true
|
||||||
string
|
string
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue