summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika00@gmail.com>2011-10-04 12:18:01 +0900
committernagachika <nagachika00@gmail.com>2011-10-04 12:18:01 +0900
commit152d22b1e4b74f79766fe1a3867da8e818ebcf10 (patch)
treee0b4fa3a3cd11b25ef6c11651d184e57f501a755
parente7d236cf42be4c88ffb4f0fbc8c5a731972c47f7 (diff)
downloadpsych-152d22b1e4b74f79766fe1a3867da8e818ebcf10.zip
postfix rescue statement cannot receive Exception class specification.
-rw-r--r--lib/psych/scalar_scanner.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/psych/scalar_scanner.rb b/lib/psych/scalar_scanner.rb
index 3e8acbb..e390cbb 100644
--- a/lib/psych/scalar_scanner.rb
+++ b/lib/psych/scalar_scanner.rb
@@ -74,13 +74,19 @@ module Psych
end
i
when FLOAT
- return Float(string.gsub(/[,_]/, '')) rescue ArgumentError
+ begin
+ return Float(string.gsub(/[,_]/, ''))
+ rescue ArgumentError
+ end
@string_cache[string] = true
string
else
if string.count('.') < 2
- return Integer(string.gsub(/[,_]/, '')) rescue ArgumentError
+ begin
+ return Integer(string.gsub(/[,_]/, ''))
+ rescue ArgumentError
+ end
end
@string_cache[string] = true