Class: Bundler::Molinillo::Resolver::Resolution
- Inherits:
-
Object
- Object
- Bundler::Molinillo::Resolver::Resolution
- Defined in:
- lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb
Overview
A specific resolution from a given Bundler::Molinillo::Resolver
Defined Under Namespace
Classes: Conflict, PossibilitySet, UnwindDetails
Instance Attribute Summary collapse
-
#base ⇒ DependencyGraph
readonly
The base dependency graph to which dependencies should be ‘locked’.
-
#iteration_rate ⇒ Integer
writeonly
The number of resolver iterations in between calls to #resolver_ui‘s UI#indicate_progress method.
-
#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.
-
#started_at ⇒ Time
writeonly
The time at which resolution began.
-
#states ⇒ Array<ResolutionState>
writeonly
The stack of states for the resolution.
Instance Method Summary collapse
-
#initialize(specification_provider, resolver_ui, requested, base) ⇒ Resolution
constructor
Initializes a new resolution.
-
#resolve ⇒ DependencyGraph
Resolves the #original_requested dependencies into a full dependency graph.
Methods included from Delegates::SpecificationProvider
#allow_missing?, #dependencies_for, #name_for, #name_for_explicit_dependency_source, #name_for_locking_dependency_source, #requirement_satisfied_by?, #search_for, #sort_dependencies
Methods included from Delegates::ResolutionState
#activated, #conflicts, #depth, #name, #possibilities, #requirement, #requirements, #unused_unwind_options
Constructor Details
#initialize(specification_provider, resolver_ui, requested, base) ⇒ Resolution
Initializes a new resolution.
152 153 154 155 156 157 158 159 160 |
# File 'lib/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 |
Instance Attribute Details
#base ⇒ DependencyGraph (readonly)
Returns the base dependency graph to which dependencies should be ‘locked’.
141 142 143 |
# File 'lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb', line 141 def base @base end |
#iteration_rate=(value) ⇒ Integer
Returns the number of resolver iterations in between calls to #resolver_ui‘s UI#indicate_progress method.
192 193 194 |
# File 'lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb', line 192 def iteration_rate=(value) @iteration_rate = value end |
#original_requested ⇒ Array (readonly)
Returns the dependencies that were explicitly required.
144 145 146 |
# File 'lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb', line 144 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.
137 138 139 |
# File 'lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb', line 137 def resolver_ui @resolver_ui end |
#specification_provider ⇒ SpecificationProvider (readonly)
Returns the provider that knows about dependencies, requirements, specifications, versions, etc.
133 134 135 |
# File 'lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb', line 133 def specification_provider @specification_provider end |
#started_at=(value) ⇒ Time
Returns the time at which resolution began.
196 197 198 |
# File 'lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb', line 196 def started_at=(value) @started_at = value end |
#states=(value) ⇒ Array<ResolutionState>
Returns the stack of states for the resolution.
200 201 202 |
# File 'lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb', line 200 def states=(value) @states = value end |
Instance Method Details
#resolve ⇒ DependencyGraph
Resolves the #original_requested dependencies into a full dependency
graph
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/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 |