From 4f6779bac7b4e294bc473782d60cbd071f0d0f8d Mon Sep 17 00:00:00 2001 From: drbrain Date: Sun, 10 Nov 2013 17:51:40 +0000 Subject: * lib/rubygems: Update to RubyGems master 4bdc4f2. Important changes in this commit: RubyGems now chooses the test server port reliably. Patch by akr. Partial implementation of bundler's Gemfile format. Refactorings to improve the new resolver. Fixes bugs in the resolver. * test/rubygems: Tests for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rubygems/dependency_resolver/api_set.rb | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'lib/rubygems/dependency_resolver/api_set.rb') diff --git a/lib/rubygems/dependency_resolver/api_set.rb b/lib/rubygems/dependency_resolver/api_set.rb index 469c005a09..9dd34562b1 100644 --- a/lib/rubygems/dependency_resolver/api_set.rb +++ b/lib/rubygems/dependency_resolver/api_set.rb @@ -2,11 +2,21 @@ # The global rubygems pool, available via the rubygems.org API. # Returns instances of APISpecification. -class Gem::DependencyResolver::APISet +class Gem::DependencyResolver::APISet < Gem::DependencyResolver::Set - def initialize + ## + # The URI for the dependency API this APISet uses. + + attr_reader :dep_uri # :nodoc: + + ## + # Creates a new APISet that will retrieve gems from +uri+ using the RubyGems + # API described at http://guides.rubygems.org/rubygems-org-api + + def initialize uri = 'https://rubygems.org/api/v1/dependencies' + uri = URI uri unless URI === uri # for ruby 1.8 @data = Hash.new { |h,k| h[k] = [] } - @dep_uri = URI 'https://rubygems.org/api/v1/dependencies' + @dep_uri = uri end ## @@ -46,7 +56,7 @@ class Gem::DependencyResolver::APISet ## # Return data for all versions of the gem +name+. - def versions name + def versions name # :nodoc: if @data.key?(name) return @data[name] end -- cgit v1.2.3