aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/dependency_resolver
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-19 00:34:13 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-19 00:34:13 +0000
commita7fa4d5d9aab150ad4b0c3f3217fe444df69f527 (patch)
tree88ab96d22f7228b556337aa7c34042d4fd279394 /lib/rubygems/dependency_resolver
parente7ec3dad907f2c77f17faddb40a98b2ef4523222 (diff)
downloadruby-a7fa4d5d9aab150ad4b0c3f3217fe444df69f527.tar.gz
* lib/rubygems: Update to RubyGems master 6a3d9f9. Changes include:
Compatibly renamed Gem::DependencyResolver to Gem::Resolver. Added support for git gems in gem.deps.rb and Gemfile. Fixed resolver bugs. * test/rubygems: ditto. * lib/rubygems/LICENSE.txt: Updated to license from RubyGems trunk. [ruby-trunk - Bug #9086] * lib/rubygems/commands/which_command.rb: RubyGems now indicates failure when any file is missing. [ruby-trunk - Bug #9004] * lib/rubygems/ext/builder: Extensions are now installed into the extension install directory and the first directory in the require path from the gem. This allows backwards compatibility with msgpack and other gems that calculate full require paths. [ruby-trunk - Bug #9106] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/dependency_resolver')
-rw-r--r--lib/rubygems/dependency_resolver/activation_request.rb138
-rw-r--r--lib/rubygems/dependency_resolver/api_set.rb75
-rw-r--r--lib/rubygems/dependency_resolver/api_specification.rb38
-rw-r--r--lib/rubygems/dependency_resolver/best_set.rb21
-rw-r--r--lib/rubygems/dependency_resolver/composed_set.rb20
-rw-r--r--lib/rubygems/dependency_resolver/current_set.rb13
-rw-r--r--lib/rubygems/dependency_resolver/dependency_conflict.rb96
-rw-r--r--lib/rubygems/dependency_resolver/dependency_request.rb71
-rw-r--r--lib/rubygems/dependency_resolver/index_set.rb50
-rw-r--r--lib/rubygems/dependency_resolver/index_specification.rb69
-rw-r--r--lib/rubygems/dependency_resolver/installed_specification.rb34
-rw-r--r--lib/rubygems/dependency_resolver/installer_set.rb152
-rw-r--r--lib/rubygems/dependency_resolver/lock_set.rb60
-rw-r--r--lib/rubygems/dependency_resolver/set.rb28
-rw-r--r--lib/rubygems/dependency_resolver/spec_specification.rb58
-rw-r--r--lib/rubygems/dependency_resolver/specification.rb60
-rw-r--r--lib/rubygems/dependency_resolver/vendor_set.rb66
-rw-r--r--lib/rubygems/dependency_resolver/vendor_specification.rb16
18 files changed, 0 insertions, 1065 deletions
diff --git a/lib/rubygems/dependency_resolver/activation_request.rb b/lib/rubygems/dependency_resolver/activation_request.rb
deleted file mode 100644
index c5d1e24d85..0000000000
--- a/lib/rubygems/dependency_resolver/activation_request.rb
+++ /dev/null
@@ -1,138 +0,0 @@
-##
-# Specifies a Specification object that should be activated.
-# Also contains a dependency that was used to introduce this
-# activation.
-
-class Gem::DependencyResolver::ActivationRequest
-
- attr_reader :request
-
- attr_reader :spec
-
- def initialize spec, req, others_possible = true
- @spec = spec
- @request = req
- @others_possible = others_possible
- end
-
- def == other
- case other
- when Gem::Specification
- @spec == other
- when Gem::DependencyResolver::ActivationRequest
- @spec == other.spec && @request == other.request
- else
- false
- end
- end
-
- def download path
- if @spec.respond_to? :source
- source = @spec.source
- else
- source = Gem.sources.first
- end
-
- Gem.ensure_gem_subdirectories path
-
- source.download full_spec, path
- end
-
- def full_name
- @spec.full_name
- end
-
- def full_spec
- Gem::Specification === @spec ? @spec : @spec.spec
- end
-
- def inspect # :nodoc:
- others =
- case @others_possible
- when true then # TODO remove at RubyGems 3
- ' (others possible)'
- when false then # TODO remove at RubyGems 3
- nil
- else
- unless @others_possible.empty? then
- others = @others_possible.map { |s| s.full_name }
- " (others possible: #{others.join ', '})"
- end
- end
-
- '#<%s for %p from %s%s>' % [
- self.class, @spec, @request, others
- ]
- end
-
- ##
- # Indicates if the requested gem has already been installed.
-
- def installed?
- case @spec
- when Gem::DependencyResolver::VendorSpecification then
- true
- else
- this_spec = full_spec
-
- Gem::Specification.any? do |s|
- s == this_spec
- end
- end
- end
-
- def name
- @spec.name
- end
-
- ##
- # Indicate if this activation is one of a set of possible
- # requests for the same Dependency request.
-
- def others_possible?
- case @others_possible
- when true, false then
- @others_possible
- else
- not @others_possible.empty?
- end
- end
-
- ##
- # Return the ActivationRequest that contained the dependency
- # that we were activated for.
-
- def parent
- @request.requester
- end
-
- def pretty_print q # :nodoc:
- q.group 2, '[Activation request', ']' do
- q.breakable
- q.pp @spec
-
- q.breakable
- q.text ' for '
- q.pp @request
-
- case @others_possible
- when false then
- when true then
- q.breakable
- q.text 'others possible'
- else
- unless @others_possible.empty? then
- q.breakable
- q.text 'others '
- q.pp @others_possible.map { |s| s.full_name }
- end
- end
- end
- end
-
- def version
- @spec.version
- end
-
-end
-
diff --git a/lib/rubygems/dependency_resolver/api_set.rb b/lib/rubygems/dependency_resolver/api_set.rb
deleted file mode 100644
index 9dd34562b1..0000000000
--- a/lib/rubygems/dependency_resolver/api_set.rb
+++ /dev/null
@@ -1,75 +0,0 @@
-##
-# The global rubygems pool, available via the rubygems.org API.
-# Returns instances of APISpecification.
-
-class Gem::DependencyResolver::APISet < Gem::DependencyResolver::Set
-
- ##
- # 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
- end
-
- ##
- # Return an array of APISpecification objects matching
- # DependencyRequest +req+.
-
- def find_all req
- res = []
-
- versions(req.name).each do |ver|
- if req.dependency.match? req.name, ver[:number]
- res << Gem::DependencyResolver::APISpecification.new(self, ver)
- end
- end
-
- res
- end
-
- ##
- # A hint run by the resolver to allow the Set to fetch
- # data for DependencyRequests +reqs+.
-
- def prefetch reqs
- names = reqs.map { |r| r.dependency.name }
- needed = names.find_all { |d| !@data.key?(d) }
-
- return if needed.empty?
-
- uri = @dep_uri + "?gems=#{needed.sort.join ','}"
- str = Gem::RemoteFetcher.fetcher.fetch_path uri
-
- Marshal.load(str).each do |ver|
- @data[ver[:name]] << ver
- end
- end
-
- ##
- # Return data for all versions of the gem +name+.
-
- def versions name # :nodoc:
- if @data.key?(name)
- return @data[name]
- end
-
- uri = @dep_uri + "?gems=#{name}"
- str = Gem::RemoteFetcher.fetcher.fetch_path uri
-
- Marshal.load(str).each do |ver|
- @data[ver[:name]] << ver
- end
-
- @data[name]
- end
-
-end
-
diff --git a/lib/rubygems/dependency_resolver/api_specification.rb b/lib/rubygems/dependency_resolver/api_specification.rb
deleted file mode 100644
index 5178d7c28e..0000000000
--- a/lib/rubygems/dependency_resolver/api_specification.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-##
-# Represents a specification retrieved via the rubygems.org API.
-#
-# This is used to avoid loading the full Specification object when all we need
-# is the name, version, and dependencies.
-
-class Gem::DependencyResolver::APISpecification < Gem::DependencyResolver::Specification
-
- ##
- # Creates an APISpecification for the given +set+ from the rubygems.org
- # +api_data+.
- #
- # See http://guides.rubygems.org/rubygems-org-api/#misc_methods for the
- # format of the +api_data+.
-
- def initialize(set, api_data)
- super()
-
- @set = set
- @name = api_data[:name]
- @version = Gem::Version.new api_data[:number]
- @platform = api_data[:platform]
- @dependencies = api_data[:dependencies].map do |name, ver|
- Gem::Dependency.new name, ver.split(/\s*,\s*/)
- end
- end
-
- def == other # :nodoc:
- self.class === other and
- @set == other.set and
- @name == other.name and
- @version == other.version and
- @platform == other.platform and
- @dependencies == other.dependencies
- end
-
-end
-
diff --git a/lib/rubygems/dependency_resolver/best_set.rb b/lib/rubygems/dependency_resolver/best_set.rb
deleted file mode 100644
index 987eea552e..0000000000
--- a/lib/rubygems/dependency_resolver/best_set.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-##
-# The BestSet chooses the best available method to query a remote index.
-#
-# It combines IndexSet and APISet
-
-class Gem::DependencyResolver::BestSet < Gem::DependencyResolver::ComposedSet
-
- ##
- # Creates a BestSet for the given +sources+ or Gem::sources if none are
- # specified. +sources+ must be a Gem::SourceList.
-
- def initialize sources = Gem.sources
- super()
-
- sources.each_source do |source|
- @sets << source.dependency_resolver_set
- end
- end
-
-end
-
diff --git a/lib/rubygems/dependency_resolver/composed_set.rb b/lib/rubygems/dependency_resolver/composed_set.rb
deleted file mode 100644
index aeecf047b8..0000000000
--- a/lib/rubygems/dependency_resolver/composed_set.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-class Gem::DependencyResolver::ComposedSet < Gem::DependencyResolver::Set
-
- attr_reader :sets # :nodoc:
-
- def initialize *sets
- @sets = sets
- end
-
- def find_all req
- res = []
- @sets.each { |s| res += s.find_all(req) }
- res
- end
-
- def prefetch reqs
- @sets.each { |s| s.prefetch(reqs) }
- end
-
-end
-
diff --git a/lib/rubygems/dependency_resolver/current_set.rb b/lib/rubygems/dependency_resolver/current_set.rb
deleted file mode 100644
index ef15c9d7f3..0000000000
--- a/lib/rubygems/dependency_resolver/current_set.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-##
-# A set which represents the installed gems. Respects
-# all the normal settings that control where to look
-# for installed gems.
-
-class Gem::DependencyResolver::CurrentSet < Gem::DependencyResolver::Set
-
- def find_all req
- req.dependency.matching_specs
- end
-
-end
-
diff --git a/lib/rubygems/dependency_resolver/dependency_conflict.rb b/lib/rubygems/dependency_resolver/dependency_conflict.rb
deleted file mode 100644
index 092f000cdb..0000000000
--- a/lib/rubygems/dependency_resolver/dependency_conflict.rb
+++ /dev/null
@@ -1,96 +0,0 @@
-##
-# Used internally to indicate that a dependency conflicted
-# with a spec that would be activated.
-
-class Gem::DependencyResolver::DependencyConflict
-
- attr_reader :activated
-
- attr_reader :dependency
-
- attr_reader :failed_dep # :nodoc:
-
- def initialize(dependency, activated, failed_dep=dependency)
- @dependency = dependency
- @activated = activated
- @failed_dep = failed_dep
- end
-
- def == other
- self.class === other and
- @dependency == other.dependency and
- @activated == other.activated and
- @failed_dep == other.failed_dep
- end
-
- ##
- # Return the 2 dependency objects that conflicted
-
- def conflicting_dependencies
- [@failed_dep.dependency, @activated.request.dependency]
- end
-
- ##
- # Explanation of the conflict used by exceptions to print useful messages
-
- def explanation
- activated = @activated.spec.full_name
- requirement = @failed_dep.dependency.requirement
-
- " Activated %s instead of (%s) via:\n %s\n" % [
- activated, requirement, request_path.join(', ')
- ]
- end
-
- def for_spec?(spec)
- @dependency.name == spec.name
- end
-
- def pretty_print q # :nodoc:
- q.group 2, '[Dependency conflict: ', ']' do
- q.breakable
-
- q.text 'activated '
- q.pp @activated
-
- q.breakable
- q.text ' dependency '
- q.pp @dependency
-
- q.breakable
- if @dependency == @failed_dep then
- q.text ' failed'
- else
- q.text ' failed dependency '
- q.pp @failed_dep
- end
- end
- end
-
- ##
- # Path of specifications that requested this dependency
-
- def request_path
- current = requester
- path = []
-
- while current do
- path << current.spec.full_name
-
- current = current.request.requester
- end
-
- path = ['user request (gem command or Gemfile)'] if path.empty?
-
- path
- end
-
- ##
- # Return the Specification that listed the dependency
-
- def requester
- @failed_dep.requester
- end
-
-end
-
diff --git a/lib/rubygems/dependency_resolver/dependency_request.rb b/lib/rubygems/dependency_resolver/dependency_request.rb
deleted file mode 100644
index 36b77ab558..0000000000
--- a/lib/rubygems/dependency_resolver/dependency_request.rb
+++ /dev/null
@@ -1,71 +0,0 @@
-##
-# Used Internally. Wraps a Dependency object to also track which spec
-# contained the Dependency.
-
-class Gem::DependencyResolver::DependencyRequest
-
- attr_reader :dependency
-
- attr_reader :requester
-
- def initialize(dep, act)
- @dependency = dep
- @requester = act
- end
-
- def ==(other)
- case other
- when Gem::Dependency
- @dependency == other
- when Gem::DependencyResolver::DependencyRequest
- @dependency == other.dependency && @requester == other.requester
- else
- false
- end
- end
-
- def matches_spec?(spec)
- @dependency.matches_spec? spec
- end
-
- def name
- @dependency.name
- end
-
- # Indicate that the request is for a gem explicitly requested by the user
- def explicit?
- @requester.nil?
- end
-
- # Indicate that the requset is for a gem requested as a dependency of another gem
- def implicit?
- !explicit?
- end
-
- # Return a String indicating who caused this request to be added (only
- # valid for implicit requests)
- def request_context
- @requester ? @requester.request : "(unknown)"
- end
-
- def pretty_print q # :nodoc:
- q.group 2, '[Dependency request ', ']' do
- q.breakable
- q.text @dependency.to_s
-
- q.breakable
- q.text ' requested by '
- q.pp @requester
- end
- end
-
- def requirement
- @dependency.requirement
- end
-
- def to_s # :nodoc:
- @dependency.to_s
- end
-
-end
-
diff --git a/lib/rubygems/dependency_resolver/index_set.rb b/lib/rubygems/dependency_resolver/index_set.rb
deleted file mode 100644
index 04d6ec816f..0000000000
--- a/lib/rubygems/dependency_resolver/index_set.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-##
-# The global rubygems pool represented via the traditional
-# source index.
-
-class Gem::DependencyResolver::IndexSet < Gem::DependencyResolver::Set
-
- def initialize source = nil # :nodoc:
- @f =
- if source then
- sources = Gem::SourceList.from [source]
-
- Gem::SpecFetcher.new sources
- else
- Gem::SpecFetcher.fetcher
- end
-
- @all = Hash.new { |h,k| h[k] = [] }
-
- list, = @f.available_specs :released
-
- list.each do |uri, specs|
- specs.each do |n|
- @all[n.name] << [uri, n]
- end
- end
-
- @specs = {}
- end
-
- ##
- # Return an array of IndexSpecification objects matching
- # DependencyRequest +req+.
-
- def find_all req
- res = []
-
- name = req.dependency.name
-
- @all[name].each do |uri, n|
- if req.dependency.match? n then
- res << Gem::DependencyResolver::IndexSpecification.new(
- self, n.name, n.version, uri, n.platform)
- end
- end
-
- res
- end
-
-end
-
diff --git a/lib/rubygems/dependency_resolver/index_specification.rb b/lib/rubygems/dependency_resolver/index_specification.rb
deleted file mode 100644
index 9b4057f0c8..0000000000
--- a/lib/rubygems/dependency_resolver/index_specification.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-##
-# Represents a possible Specification object returned from IndexSet. Used to
-# delay needed to download full Specification objects when only the +name+
-# and +version+ are needed.
-
-class Gem::DependencyResolver::IndexSpecification < Gem::DependencyResolver::Specification
-
- ##
- # An IndexSpecification is created from the index format described in `gem
- # help generate_index`.
- #
- # The +set+ contains other specifications for this (URL) +source+.
- #
- # The +name+, +version+ and +platform+ are the name, version and platform of
- # the gem.
-
- def initialize set, name, version, source, platform
- super()
-
- @set = set
- @name = name
- @version = version
- @source = source
- @platform = platform.to_s
-
- @spec = nil
- end
-
- ##
- # The dependencies of the gem for this specification
-
- def dependencies
- spec.dependencies
- end
-
- def inspect # :nodoc:
- '#<%s %s source %s>' % [self.class, full_name, @source]
- end
-
- def pretty_print q # :nodoc:
- q.group 2, '[Index specification', ']' do
- q.breakable
- q.text full_name
-
- unless Gem::Platform::RUBY == @platform then
- q.breakable
- q.text @platform.to_s
- end
-
- q.breakable
- q.text 'source '
- q.pp @source
- end
- end
-
- ##
- # Fetches a Gem::Specification for this IndexSpecification from the #source.
-
- def spec # :nodoc:
- @spec ||=
- begin
- tuple = Gem::NameTuple.new @name, @version, @platform
-
- @source.fetch_spec tuple
- end
- end
-
-end
-
diff --git a/lib/rubygems/dependency_resolver/installed_specification.rb b/lib/rubygems/dependency_resolver/installed_specification.rb
deleted file mode 100644
index 4b591661a8..0000000000
--- a/lib/rubygems/dependency_resolver/installed_specification.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-##
-# An InstalledSpecification represents a gem that is already installed
-# locally.
-
-class Gem::DependencyResolver::InstalledSpecification < Gem::DependencyResolver::SpecSpecification
-
- def == other # :nodoc:
- self.class === other and
- @set == other.set and
- @spec == other.spec
- end
-
- ##
- # Returns +true+ if this gem is installable for the current platform.
-
- def installable_platform?
- # BACKCOMPAT If the file is coming out of a specified file, then we
- # ignore the platform. This code can be removed in RG 3.0.
- if @source.kind_of? Gem::Source::SpecificFile
- return true
- else
- Gem::Platform.match @spec.platform
- end
- end
-
- ##
- # The source for this specification
-
- def source
- @source ||= Gem::Source::Installed.new
- end
-
-end
-
diff --git a/lib/rubygems/dependency_resolver/installer_set.rb b/lib/rubygems/dependency_resolver/installer_set.rb
deleted file mode 100644
index 801b60a8bb..0000000000
--- a/lib/rubygems/dependency_resolver/installer_set.rb
+++ /dev/null
@@ -1,152 +0,0 @@
-##
-# A set of gems for installation sourced from remote sources and local .gem
-# files
-
-class Gem::DependencyResolver::InstallerSet < Gem::DependencyResolver::Set
-
- ##
- # List of Gem::Specification objects that must always be installed.
-
- attr_reader :always_install # :nodoc:
-
- ##
- # Only install gems in the always_install list
-
- attr_accessor :ignore_dependencies # :nodoc:
-
- ##
- # Do not look in the installed set when finding specifications. This is
- # used by the --install-dir option to `gem install`
-
- attr_accessor :ignore_installed # :nodoc:
-
- def initialize domain
- @domain = domain
-
- @f = Gem::SpecFetcher.fetcher
-
- @all = Hash.new { |h,k| h[k] = [] }
- @always_install = []
- @ignore_dependencies = false
- @ignore_installed = false
- @loaded_remote_specs = []
- @specs = {}
- end
-
- ##
- # Should local gems should be considered?
-
- def consider_local? # :nodoc:
- @domain == :both or @domain == :local
- end
-
- ##
- # Should remote gems should be considered?
-
- def consider_remote? # :nodoc:
- @domain == :both or @domain == :remote
- end
-
- ##
- # Returns an array of IndexSpecification objects matching DependencyRequest
- # +req+.
-
- def find_all req
- res = []
-
- dep = req.dependency
-
- return res if @ignore_dependencies and
- @always_install.none? { |spec| dep.matches_spec? spec }
-
- name = dep.name
-
- dep.matching_specs.each do |gemspec|
- next if @always_install.include? gemspec
-
- res << Gem::DependencyResolver::InstalledSpecification.new(self, gemspec)
- end unless @ignore_installed
-
- if consider_local? then
- local_source = Gem::Source::Local.new
-
- if spec = local_source.find_gem(name, dep.requirement) then
- res << Gem::DependencyResolver::IndexSpecification.new(
- self, spec.name, spec.version, local_source, spec.platform)
- end
- end
-
- if consider_remote? then
- load_remote_specs dep
-
- @all[name].each do |remote_source, n|
- if dep.match? n then
- res << Gem::DependencyResolver::IndexSpecification.new(
- self, n.name, n.version, remote_source, n.platform)
- end
- end
- end
-
- res
- end
-
- def inspect # :nodoc:
- always_install = @always_install.map { |s| s.full_name }
-
- '#<%s domain: %s specs: %p always install: %p>' % [
- self.class, @domain, @specs.keys, always_install,
- ]
- end
-
- ##
- # Loads remote prerelease specs if +dep+ is a prerelease dependency
-
- def load_remote_specs dep # :nodoc:
- types = [:released]
- types << :prerelease if dep.prerelease?
-
- types.each do |type|
- next if @loaded_remote_specs.include? type
- @loaded_remote_specs << type
-
- list, = @f.available_specs type
-
- list.each do |uri, specs|
- specs.each do |n|
- @all[n.name] << [uri, n]
- end
- end
- end
- end
-
- ##
- # Called from IndexSpecification to get a true Specification
- # object.
-
- def load_spec name, ver, platform, source # :nodoc:
- key = "#{name}-#{ver}-#{platform}"
-
- @specs.fetch key do
- tuple = Gem::NameTuple.new name, ver, platform
-
- @specs[key] = source.fetch_spec tuple
- end
- end
-
- def pretty_print q # :nodoc:
- q.group 2, '[InstallerSet', ']' do
- q.breakable
- q.text "domain: #{@domain}"
-
- q.breakable
- q.text 'specs: '
- q.pp @specs.keys
-
- q.breakable
- q.text 'always install: '
- q.pp @always_install
- end
- end
-
-end
-
diff --git a/lib/rubygems/dependency_resolver/lock_set.rb b/lib/rubygems/dependency_resolver/lock_set.rb
deleted file mode 100644
index f95c7f0fd6..0000000000
--- a/lib/rubygems/dependency_resolver/lock_set.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-##
-# A set of gems from a gem dependencies lockfile.
-
-class Gem::DependencyResolver::LockSet < Gem::DependencyResolver::Set
-
- attr_reader :specs # :nodoc:
-
- ##
- # Creates a new LockSet from the given +source+
-
- def initialize source
- @source = source
- @specs = []
- end
-
- ##
- # Creates a new IndexSpecification in this set using the given +name+,
- # +version+ and +platform+.
- #
- # The specification's set will be the current set, and the source will be
- # the current set's source.
-
- def add name, version, platform # :nodoc:
- version = Gem::Version.new version
-
- spec =
- Gem::DependencyResolver::IndexSpecification.new self, name, version,
- @source, platform
-
- @specs << spec
- end
-
- ##
- # Returns an Array of IndexSpecification objects matching the
- # DependencyRequest +req+.
-
- def find_all req
- @specs.select do |spec|
- req.matches_spec? spec
- end
- end
-
- ##
- # Loads a Gem::Specification with the given +name+, +version+ and
- # +platform+. +source+ is ignored.
-
- def load_spec name, version, platform, source # :nodoc:
- dep = Gem::Dependency.new name, version
-
- found = @specs.find do |spec|
- dep.matches_spec? spec and spec.platform == platform
- end
-
- tuple = Gem::NameTuple.new found.name, found.version, found.platform
-
- found.source.fetch_spec tuple
- end
-
-end
-
diff --git a/lib/rubygems/dependency_resolver/set.rb b/lib/rubygems/dependency_resolver/set.rb
deleted file mode 100644
index 65801871ac..0000000000
--- a/lib/rubygems/dependency_resolver/set.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-##
-# DependencyResolver sets are used to look up specifications (and their
-# dependencies) used in resolution. This set is abstract.
-
-class Gem::DependencyResolver::Set
-
- ##
- # The find_all method must be implemented. It returns all
- # DependencyResolver Specification objects matching the given
- # DependencyRequest +req+.
-
- def find_all req
- raise NotImplementedError
- end
-
- ##
- # The #prefetch method may be overridden, but this is not necessary. This
- # default implementation does nothing, which is suitable for sets where
- # looking up a specification is cheap (such as installed gems).
- #
- # When overridden, the #prefetch method should look up specifications
- # matching +reqs+.
-
- def prefetch reqs
- end
-
-end
-
diff --git a/lib/rubygems/dependency_resolver/spec_specification.rb b/lib/rubygems/dependency_resolver/spec_specification.rb
deleted file mode 100644
index cca1d58b9f..0000000000
--- a/lib/rubygems/dependency_resolver/spec_specification.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-##
-# The DependencyResolver::SpecSpecification contains common functionality for
-# DependencyResolver specifications that are backed by a Gem::Specification.
-
-class Gem::DependencyResolver::SpecSpecification < Gem::DependencyResolver::Specification
-
- attr_reader :spec # :nodoc:
-
- ##
- # A SpecSpecification is created for a +set+ for a Gem::Specification in
- # +spec+. The +source+ is either where the +spec+ came from, or should be
- # loaded from.
-
- def initialize set, spec, source = nil
- @set = set
- @source = source
- @spec = spec
- end
-
- ##
- # The dependencies of the gem for this specification
-
- def dependencies
- spec.dependencies
- end
-
- ##
- # The name and version of the specification.
- #
- # Unlike Gem::Specification#full_name, the platform is not included.
-
- def full_name
- "#{spec.name}-#{spec.version}"
- end
-
- ##
- # The name of the gem for this specification
-
- def name
- spec.name
- end
-
- ##
- # The platform this gem works on.
-
- def platform
- spec.platform
- end
-
- ##
- # The version of the gem for this specification.
-
- def version
- spec.version
- end
-
-end
-
diff --git a/lib/rubygems/dependency_resolver/specification.rb b/lib/rubygems/dependency_resolver/specification.rb
deleted file mode 100644
index 6fbd241316..0000000000
--- a/lib/rubygems/dependency_resolver/specification.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-##
-# A DependencyResolver::Specification contains a subset of the information
-# contained in a Gem::Specification. Only the information necessary for
-# dependency resolution in the resolver is included.
-
-class Gem::DependencyResolver::Specification
-
- ##
- # The dependencies of the gem for this specification
-
- attr_reader :dependencies
-
- ##
- # The name of the gem for this specification
-
- attr_reader :name
-
- ##
- # The platform this gem works on.
-
- attr_reader :platform
-
- ##
- # The set this specification came from.
-
- attr_reader :set
-
- ##
- # The source for this specification
-
- attr_reader :source
-
- ##
- # The version of the gem for this specification.
-
- attr_reader :version
-
- ##
- # Sets default instance variables for the specification.
-
- def initialize
- @dependencies = nil
- @name = nil
- @platform = nil
- @set = nil
- @source = nil
- @version = nil
- end
-
- ##
- # The name and version of the specification.
- #
- # Unlike Gem::Specification#full_name, the platform is not included.
-
- def full_name
- "#{@name}-#{@version}"
- end
-
-end
-
diff --git a/lib/rubygems/dependency_resolver/vendor_set.rb b/lib/rubygems/dependency_resolver/vendor_set.rb
deleted file mode 100644
index 87eb6fd818..0000000000
--- a/lib/rubygems/dependency_resolver/vendor_set.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-##
-# A VendorSet represents gems that have been unpacked into a specific
-# directory that contains a gemspec.
-#
-# This is used for gem dependency file support.
-#
-# Example:
-#
-# set = Gem::DependencyResolver::VendorSet.new
-#
-# set.add_vendor_gem 'rake', 'vendor/rake'
-#
-# The directory vendor/rake must contain an unpacked rake gem along with a
-# rake.gemspec (watching the given name).
-
-class Gem::DependencyResolver::VendorSet < Gem::DependencyResolver::Set
-
- def initialize # :nodoc:
- @directories = {}
- @specs = {}
- end
-
- ##
- # Adds a specification to the set with the given +name+ which has been
- # unpacked into the given +directory+.
-
- def add_vendor_gem name, directory # :nodoc:
- gemspec = File.join directory, "#{name}.gemspec"
-
- spec = Gem::Specification.load gemspec
-
- raise Gem::GemNotFoundException,
- "unable to find #{gemspec} for gem #{name}" unless spec
-
- key = "#{spec.name}-#{spec.version}-#{spec.platform}"
-
- @specs[key] = spec
- @directories[spec] = directory
- end
-
- ##
- # Returns an Array of VendorSpecification objects matching the
- # DependencyRequest +req+.
-
- def find_all req
- @specs.values.select do |spec|
- req.matches_spec? spec
- end.map do |spec|
- source = Gem::Source::Vendor.new @directories[spec]
- Gem::DependencyResolver::VendorSpecification.new self, spec, source
- end
- end
-
- ##
- # Loads a spec with the given +name+, +version+ and +platform+. Since the
- # +source+ is defined when the specification was added to index it is not
- # used.
-
- def load_spec name, version, platform, source # :nodoc:
- key = "#{name}-#{version}-#{platform}"
-
- @specs.fetch key
- end
-
-end
-
diff --git a/lib/rubygems/dependency_resolver/vendor_specification.rb b/lib/rubygems/dependency_resolver/vendor_specification.rb
deleted file mode 100644
index 27b2fd6df2..0000000000
--- a/lib/rubygems/dependency_resolver/vendor_specification.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-##
-# A VendorSpecification represents a gem that has been unpacked into a project
-# and is being loaded through a gem dependencies file through the +path:+
-# option.
-
-class Gem::DependencyResolver::VendorSpecification < Gem::DependencyResolver::SpecSpecification
-
- def == other # :nodoc:
- self.class === other and
- @set == other.set and
- @spec == other.spec and
- @source == other.source
- end
-
-end
-