Class: Molinillo::Resolver::Resolution
- Inherits:
-
Object
- Object
- Molinillo::Resolver::Resolution
- Defined in:
- lib/molinillo/resolution.rb
Overview
A specific resolution from a given Molinillo::Resolver
Defined Under Namespace
Classes: Conflict
Instance Attribute Summary collapse
-
#base ⇒ DependencyGraph
readonly
The base dependency graph to which dependencies should be ‘locked’.
-
#original_requested ⇒ Array
readonly
The dependencies that were explicitly required.
-
#resolver_ui ⇒ UI
readonly
The UI that knows how to communicate feedback about the resolution process back to the user.
-
#specification_provider ⇒ SpecificationProvider
readonly
The provider that knows about dependencies, requirements, specifications, versions, etc.
Instance Method Summary collapse
-
#initialize(specification_provider, resolver_ui, requested, base) ⇒ Resolution
constructor
A new instance of Resolution.
-
#resolve ⇒ DependencyGraph
Resolves the #original_requested dependencies into a full dependency graph.
Constructor Details
#initialize(specification_provider, resolver_ui, requested, base) ⇒ Resolution
Returns a new instance of Resolution.
37 38 39 40 41 42 43 44 |
# File 'lib/molinillo/resolution.rb', line 37 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 end |
Instance Attribute Details
#base ⇒ DependencyGraph (readonly)
Returns the base dependency graph to which dependencies should be ‘locked’.
27 28 29 |
# File 'lib/molinillo/resolution.rb', line 27 def base @base end |
#original_requested ⇒ Array (readonly)
Returns the dependencies that were explicitly required.
30 31 32 |
# File 'lib/molinillo/resolution.rb', line 30 def original_requested @original_requested end |
#resolver_ui ⇒ UI (readonly)
Returns the UI that knows how to communicate feedback about the resolution process back to the user.
23 24 25 |
# File 'lib/molinillo/resolution.rb', line 23 def resolver_ui @resolver_ui end |
#specification_provider ⇒ SpecificationProvider (readonly)
Returns the provider that knows about dependencies, requirements, specifications, versions, etc.
19 20 21 |
# File 'lib/molinillo/resolution.rb', line 19 def specification_provider @specification_provider end |
Instance Method Details
#resolve ⇒ DependencyGraph
Resolves the #original_requested dependencies into a full dependency
graph
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/molinillo/resolution.rb', line 51 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 (#{possibilities.count} remaining)" } state.pop_possibility_state.tap { |s| states.push(s) if s } end process_topmost_state end activated.freeze ensure end_resolution end |