Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix compatibility with rubygems 2.0.x

  • Loading branch information...
commit 7518da10958c3a98d337ba0d8b8b7a53fb55a7a4 1 parent 4a8b322
Tom Lea cwninja authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 lib/geminabox/incoming_gem.rb
11 lib/geminabox/incoming_gem.rb
View
@@ -33,12 +33,17 @@ def valid?
end
def spec
- unless @spec
+ @spec ||= extract_spec
+ end
+
+ def extract_spec
+ if Gem::Package.respond_to? :open
Gem::Package.open(gem_data, "r", nil) do |pkg|
- @spec = pkg.metadata
+ return pkg.metadata
end
+ else
+ Gem::Package.new(@tempfile.path).spec
end
- @spec
end
def name
Please sign in to comment.
Something went wrong with that request. Please try again.