summaryrefslogtreecommitdiff
path: root/ext/psych/lib/psych
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-07 03:16:15 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-07 03:16:15 +0000
commita9f63f98ff44d8cf031f2d8e79c691b208b7afb5 (patch)
treeff8be4e00bba47e42a7b2978e274bf3ca29fe7ff /ext/psych/lib/psych
parent2861d8b164a28ce1d2b115f311b11614637fa261 (diff)
* ext/psych/*, test/psych/*: Update psych-2.1.1
This version fixed following pull requests. https://github.com/tenderlove/psych/pull/284 https://github.com/tenderlove/psych/pull/276 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/psych/lib/psych')
-rw-r--r--ext/psych/lib/psych/scalar_scanner.rb2
-rw-r--r--ext/psych/lib/psych/visitors/to_ruby.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/ext/psych/lib/psych/scalar_scanner.rb b/ext/psych/lib/psych/scalar_scanner.rb
index f519da1..a849359 100644
--- a/ext/psych/lib/psych/scalar_scanner.rb
+++ b/ext/psych/lib/psych/scalar_scanner.rb
@@ -100,7 +100,7 @@ module Psych
@string_cache[string] = true
string
else
- Float(string.gsub(/[,_]|\.$/, ''))
+ Float(string.gsub(/[,_]|\.([Ee]|$)/, '\1'))
end
else
int = parse_int string.gsub(/[,_]/, '')
diff --git a/ext/psych/lib/psych/visitors/to_ruby.rb b/ext/psych/lib/psych/visitors/to_ruby.rb
index c061da2..fd1c8e6 100644
--- a/ext/psych/lib/psych/visitors/to_ruby.rb
+++ b/ext/psych/lib/psych/visitors/to_ruby.rb
@@ -70,11 +70,11 @@ module Psych
o.value
end
when '!ruby/object:BigDecimal'
- require 'bigdecimal'
+ require 'bigdecimal' unless defined? BigDecimal
class_loader.big_decimal._load o.value
when "!ruby/object:DateTime"
class_loader.date_time
- require 'date'
+ require 'date' unless defined? DateTime
@ss.parse_time(o.value).to_datetime
when '!ruby/encoding'
::Encoding.find o.value