lib/berkshelf/resolver.rb in berkshelf-2.0.0.beta vs lib/berkshelf/resolver.rb in berkshelf-2.0.0
- old
+ new
@@ -1,8 +1,11 @@
module Berkshelf
- # @author Jamie Winsor <reset@riotgames.com>
class Resolver
+ require_relative 'cookbook_source'
+ require_relative 'locations/git_location'
+ require_relative 'locations/path_location'
+
extend Forwardable
# @return [Berkshelf::Berksfile]
attr_reader :berksfile
@@ -130,11 +133,11 @@
# @param [Berkshelf::CookbookSource] source
#
# @return [Boolean]
def install_source(source)
cached_cookbook, location = downloader.download(source)
- Berkshelf.formatter.install source.name, cached_cookbook.version, location
+ Berkshelf.formatter.install(source.name, cached_cookbook.version, location)
end
# Use the given source to create a constraint solution if the source has been downloaded or can
# be satisfied by a cached cookbook that is already present in the cookbook store.
#
@@ -162,11 +165,11 @@
return false if cached.nil?
get_source(source).cached_cookbook = cached
end
- path = source.location.is_a?(PathLocation) ? "#{source.location}" : nil
- Berkshelf.formatter.use cached.cookbook_name, cached.version, path
+ path = source.location.is_a?(PathLocation) ? source.location.to_s : nil
+ Berkshelf.formatter.use(cached.cookbook_name, cached.version, path)
true
end
end
end