In Files

  • bundler/vendor/molinillo/lib/molinillo/resolution.rb

Class/Module Index [+]

Quicksearch

Bundler::Molinillo::Resolver::Resolution

A specific resolution from a given {Resolver}

Constants

Conflict

A conflict that the resolution process encountered @attr [Object] requirement the requirement that immediately led to the conflict @attr [{String,Nil=>}] requirements the requirements that caused the conflict @attr [Object, nil] existing the existing spec that was in conflict with

the {#possibility}

@attr [Object] possibility_set the set of specs that was unable to be

activated due to a conflict.

@attr [Object] locked_requirement the relevant locking requirement. @attr [Array<Array<Object>>] requirement_trees the different requirement

trees that led to every requirement for the conflicting name.

@attr [{String=>Object}] activated_by_name the already-activated specs. @attr [Object] underlying_error an error that has occurred during resolution, and

will be raised at the end of it if no resolution is found.
PossibilitySet

A collection of possibility states that share the same dependencies @attr [Array] dependencies the dependencies for this set of possibilities @attr [Array] possibilities the possibilities

UnwindDetails

Details of the state to unwind to when a conflict occurs, and the cause of the unwind @attr [Integer] state_index the index of the state to unwind to @attr [Object] state_requirement the requirement of the state we're unwinding to @attr [Array] requirement_tree for the requirement we're relaxing @attr [Array] conflicting_requirements the requirements that combined to cause the conflict @attr [Array] requirement_trees for the conflict @attr [Array] requirements_unwound_to_instead array of unwind requirements that were chosen over this unwind

Attributes

base[R]

@return [DependencyGraph] the base dependency graph to which

dependencies should be 'locked'
original_requested[R]

@return [Array] the dependencies that were explicitly required

resolver_ui[R]

@return [UI] the UI that knows how to communicate feedback about the

resolution process back to the user
specification_provider[R]

@return [SpecificationProvider] the provider that knows about

dependencies, requirements, specifications, versions, etc.

Public Class Methods

new(specification_provider, resolver_ui, requested, base) click to toggle source

Initializes a new resolution. @param [SpecificationProvider] specification_provider

see {#specification_provider}

@param [UI] resolver_ui see {#resolver_ui} @param [Array] requested see {#original_requested} @param [DependencyGraph] base see {#base}

 
               # File bundler/vendor/molinillo/lib/molinillo/resolution.rb, line 152
def initialize(specification_provider, resolver_ui, requested, base)
  @specification_provider = specification_provider
  @resolver_ui = resolver_ui
  @original_requested = requested
  @base = base
  @states = []
  @iteration_counter = 0
  @parents_of = Hash.new { |h, k| h[k] = [] }
end
            

Public Instance Methods

resolve() click to toggle source

Resolves the {#original_requested} dependencies into a full dependency

graph

@raise [ResolverError] if successful resolution is impossible @return [DependencyGraph] the dependency graph of successfully resolved

dependencies
 
               # File bundler/vendor/molinillo/lib/molinillo/resolution.rb, line 167
def resolve
  start_resolution

  while state
    break if !state.requirement && state.requirements.empty?
    indicate_progress
    if state.respond_to?(:pop_possibility_state) # DependencyState
      debug(depth) { "Creating possibility state for #{requirement} (#{possibilities.count} remaining)" }
      state.pop_possibility_state.tap do |s|
        if s
          states.push(s)
          activated.tag(s)
        end
      end
    end
    process_topmost_state
  end

  resolve_activated_specs
ensure
  end_resolution
end