Sha256: 436d78378d6cdccdb46873403d52a75dbcc7490cad2af4932ed6b6638c56c385

Contents?: true

Size: 1.53 KB

Versions: 151

Compression:

Stored size: 1.53 KB

Contents

# frozen_string_literal: true

require_relative 'dependency_graph'

module Bundler::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

151 entries across 151 versions & 4 rubygems

Version Path
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/bundler-2.3.5/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
bundler-2.3.27 lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.3.27 bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/bundler-2.3.5/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.2.34 bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
bundler-2.2.34 lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/bundler-2.3.7/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.3.26 bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
bundler-2.3.26 lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.3.25 bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
bundler-2.3.25 lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.3.24 bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
bundler-2.3.24 lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.3.23 bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
bundler-2.3.23 lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.3.22 bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
bundler-2.3.22 lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.3.21 bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
bundler-2.3.21 lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb
rubygems-update-3.3.20 bundler/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb