* lib/rubygems/package/old.rb: Fix loading old format gems on ruby

1.8.  This commit is only so trunk and rubygems master have the same
  code.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2013-02-07 23:58:42 +00:00
Родитель 1c836f811c
Коммит f79876e194
2 изменённых файлов: 19 добавлений и 3 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Fri Feb 8 08:58:26 2013 Eric Hodel <drbrain@segment7.net>
* lib/rubygems/package/old.rb: Fix loading old format gems on ruby
1.8. This commit is only so trunk and rubygems master have the same
code.
Fri Feb 8 08:53:27 2013 Aaron Patterson <aaron@tenderlovemaking.com>
* ext/psych/lib/psych/visitors/yaml_tree.rb: fixing string quotation

Просмотреть файл

@ -142,9 +142,19 @@ class Gem::Package::Old < Gem::Package
end
end
@spec = Gem::Specification.from_yaml yaml
rescue YAML::SyntaxError => e
raise Gem::Exception, "Failed to parse gem specification out of gem file"
yaml_error = if RUBY_VERSION < '1.8' then
YAML::ParseError
elsif YAML::ENGINE.yamler == 'syck' then
YAML::ParseError
else
YAML::SyntaxError
end
begin
@spec = Gem::Specification.from_yaml yaml
rescue yaml_error => e
raise Gem::Exception, "Failed to parse gem specification out of gem file"
end
rescue ArgumentError => e
raise Gem::Exception, "Failed to parse gem specification out of gem file"
end