aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/spec_fetcher.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-13 19:58:57 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-13 19:58:57 +0000
commit1daa0b113d853bfa57b776cc569939b61ca14292 (patch)
treef8c4acb08a551820299dff2b13966d6ac38d31e4 /lib/rubygems/spec_fetcher.rb
parent85995e88d49c442b5b113c2676456133e79f5c02 (diff)
downloadruby-1daa0b113d853bfa57b776cc569939b61ca14292.tar.gz
* lib/rubygems: Update to RubyGems 2.1.3
Fixed installing platform gems Restored concurrent requires Fixed installing gems with extensions with --install-dir Fixed `gem fetch -v` to install the latest version Fixed installing gems with "./" in their files entries * test/rubygems/test_gem_package.rb: Tests for the above. * NEWS: Updated for RubyGems 2.1.3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/spec_fetcher.rb')
-rw-r--r--lib/rubygems/spec_fetcher.rb20
1 files changed, 6 insertions, 14 deletions
diff --git a/lib/rubygems/spec_fetcher.rb b/lib/rubygems/spec_fetcher.rb
index 2ed7d4286a..3d484d1c13 100644
--- a/lib/rubygems/spec_fetcher.rb
+++ b/lib/rubygems/spec_fetcher.rb
@@ -38,6 +38,7 @@ class Gem::SpecFetcher
end
def initialize
+ @dir = File.join Gem.user_home, '.gem', 'specs'
@update_cache = File.stat(Gem.user_home).uid == Process.uid
@specs = {}
@@ -74,12 +75,6 @@ class Gem::SpecFetcher
list, errors = available_specs(type)
list.each do |source, specs|
- if dependency.name.is_a?(String) && specs.respond_to?(:bsearch)
- start_index = (0 ... specs.length).bsearch{ |i| specs[i].name >= dependency.name }
- end_index = (0 ... specs.length).bsearch{ |i| specs[i].name > dependency.name }
- specs = specs[start_index ... end_index] if start_index && end_index
- end
-
found[source] = specs.select do |tup|
if dependency.match?(tup)
if matching_platform and !Gem::Platform.match(tup.platform)
@@ -200,11 +195,8 @@ class Gem::SpecFetcher
when :released
tuples_for source, :released
when :complete
- names =
- tuples_for(source, :prerelease, true) +
+ tuples_for(source, :prerelease, true) +
tuples_for(source, :released)
-
- names.sort
when :prerelease
tuples_for(source, :prerelease)
else
@@ -223,15 +215,15 @@ class Gem::SpecFetcher
def tuples_for(source, type, gracefully_ignore=false)
cache = @caches[type]
- tuples =
+ if gracefully_ignore
begin
cache[source.uri] ||= source.load_specs(type)
rescue Gem::RemoteFetcher::FetchError
- raise unless gracefully_ignore
[]
end
-
- tuples.sort_by { |tup| tup.name }
+ else
+ cache[source.uri] ||= source.load_specs(type)
+ end
end
end