lib/berkshelf/formatters/json.rb in berkshelf-2.0.3 vs lib/berkshelf/formatters/json.rb in berkshelf-2.0.4

- old
+ new

@@ -39,14 +39,18 @@ # Add a Cookbook use entry to delayed output # # @param [String] cookbook # @param [String] version - # @param [String] path - def use(cookbook, version, path = nil) + # @param [~Location] location + def use(cookbook, version, location = nil) cookbooks[cookbook] ||= {} cookbooks[cookbook][:version] = version - cookbooks[cookbook][:location] = path if path + + if location && location.is_a?(PathLocation) + cookbooks[cookbook][:metadata] = true if location.metadata? + cookbooks[cookbook][:location] = location.relative_path + end end # Add a Cookbook upload entry to delayed output # # @param [String] cookbook