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
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
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.
44 45 46 47 48 49 50 51 |
# File 'lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb', line 44 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’.
34 35 36 |
# File 'lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb', line 34 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.
78 79 80 |
# File 'lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb', line 78 def iteration_rate=(value) @iteration_rate = value end |
#original_requested ⇒ Array (readonly)
Returns the dependencies that were explicitly required.
37 38 39 |
# File 'lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb', line 37 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.
30 31 32 |
# File 'lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb', line 30 def resolver_ui @resolver_ui end |
#specification_provider ⇒ SpecificationProvider (readonly)
Returns the provider that knows about dependencies, requirements, specifications, versions, etc.
26 27 28 |
# File 'lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb', line 26 def specification_provider @specification_provider end |
#started_at=(value) ⇒ Time
Returns the time at which resolution began.
82 83 84 |
# File 'lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb', line 82 def started_at=(value) @started_at = value end |
#states=(value) ⇒ Array<ResolutionState>
Returns the stack of states for the resolution.
86 87 88 |
# File 'lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb', line 86 def states=(value) @states = value end |
Instance Method Details
#resolve ⇒ DependencyGraph
Resolves the #original_requested dependencies into a full dependency
graph
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb', line 58 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 { |s| states.push(s) if s } end process_topmost_state end activated.freeze ensure end_resolution end |