Class: Librarian::Resolver::Implementation

Inherits:
Object
  • Object
show all
Defined in:
lib/librarian/resolver/implementation.rb

Defined Under Namespace

Classes: MultiSource

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resolver, spec) ⇒ Implementation

Returns a new instance of Implementation.



23
24
25
26
27
# File 'lib/librarian/resolver/implementation.rb', line 23

def initialize(resolver, spec)
  self.resolver = resolver
  self.spec = spec
  @level = 0
end

Instance Attribute Details

#resolverObject

Returns the value of attribute resolver.



20
21
22
# File 'lib/librarian/resolver/implementation.rb', line 20

def resolver
  @resolver
end

#specObject

Returns the value of attribute spec.



20
21
22
# File 'lib/librarian/resolver/implementation.rb', line 20

def spec
  @spec
end

Instance Method Details

#resolve(manifests) ⇒ Object



29
30
31
32
33
# File 'lib/librarian/resolver/implementation.rb', line 29

def resolve(manifests)
  manifests = index_by(manifests, &:name) if manifests.kind_of?(Array)
  addtl = spec.dependencies + sourced_dependencies_for_manifests(manifests)
  recursive_resolve([], manifests, [], addtl)
end