In Files

  • rubygems/resolver/molinillo/lib/molinillo/resolution.rb

Class/Module Index [+]

Quicksearch

Gem::Resolver::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 the spec 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.

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 rubygems/resolver/molinillo/lib/molinillo/resolution.rb, line 48
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 rubygems/resolver/molinillo/lib/molinillo/resolution.rb, line 63
def resolve
  start_resolution

  while state
    break unless state.requirements.any? || state.requirement
    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

  activated.freeze
ensure
  end_resolution
end