Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
From d35bd09c4efda2c46059f81fb3e6fc2b6a9e4c12 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Fri, 9 Dec 2011 18:41:36 +0100
Subject: [PATCH] Try to activate only inactive gems.
---
lib/rubygems.rb | 2 +-
lib/rubygems/specification.rb | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 0da8862..e90e786 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -202,7 +202,7 @@ module Gem
# TODO: use find_all and bork if ambiguous
- spec = Gem::Specification.find_by_path path
+ spec = Gem::Specification.find_inactive_by_path path
return false unless spec
begin
diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb
index 099d978..0e7a27a 100644
--- a/lib/rubygems/specification.rb
+++ b/lib/rubygems/specification.rb
@@ -800,6 +800,16 @@ class Gem::Specification
end
##
+ # Return the best specification of inactive gems that contains the file
+ # matching +path+.
+
+ def self.find_inactive_by_path path
+ self.find { |spec|
+ spec.contains_requirable_file? path unless spec.activated?
+ }
+ end
+
+ ##
# Return currently unresolved specs that contain the file matching +path+.
def self.find_in_unresolved path
--
1.7.7.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.