Sha256: 3c17a48bed70b310682d78fe0a178c3d755c4bcd1909ed57856035c389af4250

Contents?: true

Size: 1.53 KB

Versions: 17

Compression:

Stored size: 1.53 KB

Contents

# frozen_string_literal: true

require_relative 'dependency_graph'

module Gem::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_relative '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

17 entries across 17 versions & 1 rubygems

Version Path
rubygems-update-3.5.23 lib/rubygems/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.5.22 lib/rubygems/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.5.21 lib/rubygems/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.5.20 lib/rubygems/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.5.19 lib/rubygems/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.5.18 lib/rubygems/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.5.17 lib/rubygems/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.5.16 lib/rubygems/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.5.15 lib/rubygems/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.5.14 lib/rubygems/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.5.13 lib/rubygems/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.5.12 lib/rubygems/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.5.10 lib/rubygems/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.5.9 lib/rubygems/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.5.8 lib/rubygems/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.5.7 lib/rubygems/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.5.6 lib/rubygems/vendor/molinillo/lib/molinillo/resolver.rb