Permalink
Browse files

Cope with deprecations in rubygems 1.8.x.

  • Loading branch information...
1 parent ff7abe9 commit ae5c907227c8026f7da7473d1a2468756e2fbb5d @sakuro committed May 7, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/rubygems/commands/orphan_command.rb
@@ -8,8 +8,12 @@ def initialize
end
def execute
- index = Gem::SourceIndex.from_installed_gems
- specs = index.map {|name, spec| spec }
+ if Gem::Specification.respond_to?(:all)
+ specs = Gem::Specification.all
+ else
+ index = Gem::SourceIndex.from_installed_gems
+ specs = index.map {|name, spec| spec }
+ end
dependencies = specs.map(&:dependencies).flatten.uniq
runtime_dependencies = dependencies.select {|dep| dep.type == :runtime }

0 comments on commit ae5c907

Please sign in to comment.