summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/rubygems/specification.rb9
-rw-r--r--test/rubygems/data/null-type.gemspec.rzbin504 -> 433 bytes
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
index aaf11ebd98..b0045ba511 100644
--- a/lib/rubygems/specification.rb
+++ b/lib/rubygems/specification.rb
@@ -1270,7 +1270,14 @@ class Gem::Specification < Gem::BasicSpecification
def self._load(str)
Gem.load_yaml
- array = Marshal.load str
+ array = begin
+ Marshal.load str
+ rescue ArgumentError => e
+ raise unless e.message.include?("YAML")
+
+ Object.const_set "YAML", Psych
+ Marshal.load str
+ end
spec = Gem::Specification.new
spec.instance_variable_set :@specification_version, array[1]
diff --git a/test/rubygems/data/null-type.gemspec.rz b/test/rubygems/data/null-type.gemspec.rz
index 2134fcde29..58fc1ed8a0 100644
--- a/test/rubygems/data/null-type.gemspec.rz
+++ b/test/rubygems/data/null-type.gemspec.rz
Binary files differ