aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/source_index.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-11 20:57:02 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-11 20:57:02 +0000
commite72b71d56a1f369cb7eb3892c61715460bac8109 (patch)
tree6f55131cbd153845e71dadc91f08636aa6707423 /lib/rubygems/source_index.rb
parent0ae6c7f816cbc3ba0cdd97f609b9ffcbf49bf9bb (diff)
downloadruby-e72b71d56a1f369cb7eb3892c61715460bac8109.tar.gz
Update to RubyGems 1.1.1 r1701.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/source_index.rb')
-rw-r--r--lib/rubygems/source_index.rb32
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/rubygems/source_index.rb b/lib/rubygems/source_index.rb
index 61f5324a95..8057fd1d0f 100644
--- a/lib/rubygems/source_index.rb
+++ b/lib/rubygems/source_index.rb
@@ -25,6 +25,8 @@ class Gem::SourceIndex
include Gem::UserInteraction
+ attr_reader :gems # :nodoc:
+
class << self
include Gem::UserInteraction
@@ -50,14 +52,10 @@ class Gem::SourceIndex
end
##
- # Return a list of directories in the current gem path that
- # contain specifications.
- #
- # return::
- # List of directory paths (all ending in "../specifications").
+ # Returns a list of directories from Gem.path that contain specifications.
def installed_spec_directories
- Gem.path.collect { |dir| File.join(dir, "specifications") }
+ Gem.path.collect { |dir| File.join(dir, "specifications") }
end
##
@@ -272,12 +270,11 @@ class Gem::SourceIndex
end
##
- # Refresh the source index from the local file system.
- #
- # return:: Returns a pointer to itself.
+ # Replaces the gems in the source index from specifications in the
+ # installed_spec_directories,
def refresh!
- load_gems_in(self.class.installed_spec_directories)
+ load_gems_in(*self.class.installed_spec_directories)
end
##
@@ -347,10 +344,6 @@ class Gem::SourceIndex
Marshal.dump(self)
end
- protected
-
- attr_reader :gems
-
private
def fetcher
@@ -430,15 +423,22 @@ class Gem::SourceIndex
# Make a list of full names for all the missing gemspecs.
def find_missing(spec_names)
+ unless defined? @originals then
+ @originals = {}
+ each do |full_name, spec|
+ @originals[spec.original_name] = spec
+ end
+ end
+
spec_names.find_all { |full_name|
- specification(full_name).nil?
+ @originals[full_name].nil?
}
end
def remove_extra(spec_names)
dictionary = spec_names.inject({}) { |h, k| h[k] = true; h }
each do |name, spec|
- remove_spec name unless dictionary.include? name
+ remove_spec name unless dictionary.include? spec.original_name
end
end