123456789_123456789_123456789_123456789_123456789_

Class: Gem::Resolver::Molinillo::Resolver

Relationships & Source Files
Namespace Children
Classes:
Inherits: Object
Defined in: lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb,
lib/rubygems/resolver/molinillo/lib/molinillo/resolution.rb

Overview

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 Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(specification_provider, resolver_ui) ⇒ Resolver

Initializes a new resolver.

Parameters:

[ GitHub ]

  
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb', line 26

def initialize(specification_provider, resolver_ui)
  @specification_provider = specification_provider
  @resolver_ui = resolver_ui
end

Instance Attribute Details

#resolver_uiUI (readonly)

Returns:

  • (UI)

    the UI module used to communicate back to the user during the resolution process

[ GitHub ]

  
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb', line 19

attr_reader :resolver_ui

#specification_providerSpecificationProvider (readonly)

Returns:

[ GitHub ]

  
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb', line 15

attr_reader :specification_provider

Instance Method Details

#resolve(requested, base = DependencyGraph.new) ⇒ DependencyGraph

Resolves the requested dependencies into a DependencyGraph, locking to the base dependency graph (if specified)

Parameters:

  • requested (Array)

    an array of ‘requested’ dependencies that the #specification_provider can understand

  • base (DependencyGraph, nil) (defaults to: DependencyGraph.new)

    the base dependency graph to which dependencies should be ‘locked’

[ GitHub ]

  
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/resolver.rb', line 38

def resolve(requested, base = DependencyGraph.new)
  Resolution.new(specification_provider,
                 resolver_ui,
                 requested,
                 base).
    resolve
end