Permalink
Browse files

Rakefile: Gem.source_index is also deperecated, use Gem::Specificatio…

…n but be backward-compatible with older versions of rubygems.
  • Loading branch information...
kalbasit committed Nov 2, 2011
1 parent 4887cba commit baad78a081b2ed6037a74cf994a8e20eb3c70ac5
Showing with 3 additions and 1 deletion.
  1. +3 −1 Rakefile
View
@@ -15,7 +15,9 @@ end
def find_gem(gem_name)
begin
require 'rubygems'
- if Gem.respond_to?(:source_index)
+ if Gem.const_defined?(:Specification)
+ Gem::Specification.find_all_by_name(gem_name)
+ elsif Gem.respond_to?(:source_index)
Gem.source_index.find_name(gem_name)
else
Gem.cache.find_name(gem_name)

0 comments on commit baad78a

Please sign in to comment.