lib/berkshelf/resolver/graph.rb in berkshelf-3.0.0.beta8 vs lib/berkshelf/resolver/graph.rb in berkshelf-3.0.0.beta9
- old
+ new
@@ -4,14 +4,15 @@
# @param [Berkshelf::CookbookStore] store
def populate_store(store = nil)
store ||= Berkshelf::CookbookStore.instance
store.cookbooks.each do |cookbook|
- artifacts(cookbook.cookbook_name, cookbook.version)
+ artifact(cookbook.cookbook_name, cookbook.version)
cookbook.dependencies.each do |dependency, constraint|
- artifacts(cookbook.cookbook_name, cookbook.version).depends(dependency, constraint)
+ constraint = nil if constraint.empty?
+ artifact(cookbook.cookbook_name, cookbook.version).depends(dependency, constraint)
end
end
end
# Add dependencies of a locally cached cookbook to the graph
@@ -21,24 +22,26 @@
# @return [Hash]
def populate_local(cookbook)
name = cookbook.cookbook_name
version = cookbook.version
- artifacts(name, version)
+ artifact(name, version)
cookbook.dependencies.each do |dependency, constraint|
- artifacts(name, version).depends(dependency, constraint)
+ constraint = nil if constraint.empty?
+ artifact(name, version).depends(dependency, constraint)
end
end
# @param [Array<Berkshelf::Source>, Berkshelf::Source] sources
def populate(sources)
universe(sources).each do |cookbook|
next if has_artifact?(cookbook.name, cookbook.version)
- artifacts(cookbook.name, cookbook.version)
+ artifact(cookbook.name, cookbook.version)
cookbook.dependencies.each do |dependency, constraint|
- artifacts(cookbook.name, cookbook.version).depends(dependency, constraint)
+ constraint = nil if constraint.empty?
+ artifact(cookbook.name, cookbook.version).depends(dependency, constraint)
end
end
end
# @param [Array<Berkshelf::Source>, Berkshelf::Source] sources