Class: Bosh::Director::PackageDependenciesManager

Inherits:
Object
  • Object
show all
Defined in:
lib/bosh/director/package_dependencies_manager.rb

Instance Method Summary collapse

Constructor Details

#initialize(release_version) ⇒ PackageDependenciesManager

Returns a new instance of PackageDependenciesManager.



4
5
6
# File 'lib/bosh/director/package_dependencies_manager.rb', line 4

def initialize(release_version)
  @release_version = release_version
end

Instance Method Details

#dependencies(package) ⇒ Object



17
18
19
# File 'lib/bosh/director/package_dependencies_manager.rb', line 17

def dependencies(package)
  package.dependency_set.map { |package_name| @release_version.package_by_name(package_name) }.to_set
end

#transitive_dependencies(package) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/bosh/director/package_dependencies_manager.rb', line 8

def transitive_dependencies(package)
  dependency_set = Set.new
  dependencies(package).each do |dependency|
    dependency_set << dependency
    dependency_set.merge(transitive_dependencies(dependency))
  end
  dependency_set
end