Class: Librarian::Resolution
- Inherits:
-
Object
- Object
- Librarian::Resolution
- Defined in:
- lib/librarian/resolution.rb
Overview
Represents the output of the resolution process. Captures the declared dependencies plus the full set of resolved manifests. The sources are already known by the dependencies and by the resolved manifests, so they do not need to be captured explicitly.
This representation may be produced by the resolver, may be serialized into a lockfile, and may be deserialized from a lockfile. It is expected that the lockfile is a direct representation in text of this representation, so that the serialization-deserialization process is just the identity function.
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#manifests ⇒ Object
readonly
Returns the value of attribute manifests.
-
#manifests_index ⇒ Object
readonly
Returns the value of attribute manifests_index.
Instance Method Summary collapse
- #correct? ⇒ Boolean
-
#initialize(dependencies, manifests) ⇒ Resolution
constructor
A new instance of Resolution.
- #sources ⇒ Object
Constructor Details
#initialize(dependencies, manifests) ⇒ Resolution
Returns a new instance of Resolution.
17 18 19 20 21 |
# File 'lib/librarian/resolution.rb', line 17 def initialize(dependencies, manifests) self.dependencies = dependencies self.manifests = manifests self.manifests_index = build_manifests_index(manifests) end |
Instance Attribute Details
#dependencies ⇒ Object
Returns the value of attribute dependencies.
14 15 16 |
# File 'lib/librarian/resolution.rb', line 14 def dependencies @dependencies end |
#manifests ⇒ Object
Returns the value of attribute manifests.
14 15 16 |
# File 'lib/librarian/resolution.rb', line 14 def manifests @manifests end |
#manifests_index ⇒ Object
Returns the value of attribute manifests_index.
14 15 16 |
# File 'lib/librarian/resolution.rb', line 14 def manifests_index @manifests_index end |
Instance Method Details
#correct? ⇒ Boolean
23 24 25 |
# File 'lib/librarian/resolution.rb', line 23 def correct? manifests && manifests_consistent_with_dependencies? && manifests_internally_consistent? end |
#sources ⇒ Object
27 28 29 |
# File 'lib/librarian/resolution.rb', line 27 def sources manifests.map(&:source).uniq end |