Sha256: b85becfecd1c1d956964c77510871bd5434b4f9a0c59957ba9de1fe1fbcfd04b

Contents?: true

Size: 1.6 KB

Versions: 52

Compression:

Stored size: 1.6 KB

Contents

# frozen_string_literal: true
require 'rubygems/resolver/molinillo/lib/molinillo/dependency_graph'

module Gem::Resolver::Molinillo
  # This class encapsulates a dependency resolver.
  # The resolver is responsible for determining which set of dependencies to
  # activate, with feedback from the {#specification_provider}
  #
  #
  class Resolver
    require 'rubygems/resolver/molinillo/lib/molinillo/resolution'

    # @return [SpecificationProvider] the specification provider used
    #   in the resolution process
    attr_reader :specification_provider

    # @return [UI] the UI module used to communicate back to the user
    #   during the resolution process
    attr_reader :resolver_ui

    # Initializes a new resolver.
    # @param  [SpecificationProvider] specification_provider
    #   see {#specification_provider}
    # @param  [UI] resolver_ui
    #   see {#resolver_ui}
    def initialize(specification_provider, resolver_ui)
      @specification_provider = specification_provider
      @resolver_ui = resolver_ui
    end

    # Resolves the requested dependencies into a {DependencyGraph},
    # locking to the base dependency graph (if specified)
    # @param [Array] requested an array of 'requested' dependencies that the
    #   {#specification_provider} can understand
    # @param [DependencyGraph,nil] base the base dependency graph to which
    #   dependencies should be 'locked'
    def resolve(requested, base = DependencyGraph.new)
      Resolution.new(specification_provider,
                     resolver_ui,
                     requested,
                     base).
        resolve
    end
  end
end

Version data entries

52 entries across 52 versions & 2 rubygems

Version Path
rubygems-update-3.1.6 lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.1.5 lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.0.9 lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
rubygems-update-2.7.11 lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.2.0.rc.2 lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.2.0.rc.1 lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.1.4 lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.1.3 lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.0.8 lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.0.7 lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.1.2 lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.1.1 lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.1.0 lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.1.0.pre3 lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.1.0.pre2 lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.1.0.pre1 lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.0.6 lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.0.5 lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.0.4 lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb
rubygems-update-2.7.10 lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb