summaryrefslogtreecommitdiff
path: root/ext/psych/lib
diff options
context:
space:
mode:
Diffstat (limited to 'ext/psych/lib')
-rw-r--r--ext/psych/lib/psych.rb2
-rw-r--r--ext/psych/lib/psych/scalar_scanner.rb2
-rw-r--r--ext/psych/lib/psych/visitors/to_ruby.rb4
3 files changed, 4 insertions, 4 deletions
diff --git a/ext/psych/lib/psych.rb b/ext/psych/lib/psych.rb
index 4e678deedc..ecef46c024 100644
--- a/ext/psych/lib/psych.rb
+++ b/ext/psych/lib/psych.rb
@@ -224,7 +224,7 @@ require 'psych/class_loader'
module Psych
# The version is Psych you're using
- VERSION = '2.1.0'
+ VERSION = '2.1.1'
# The version of libyaml Psych is using
LIBYAML_VERSION = Psych.libyaml_version.join '.'
diff --git a/ext/psych/lib/psych/scalar_scanner.rb b/ext/psych/lib/psych/scalar_scanner.rb
index f519da1465..a849359d18 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 c061da25f1..fd1c8e6caf 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