• Download Gist
0001-Try-to-activate-only-inactive-gems.patch
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.