lib/berkshelf/api/cache_builder/worker.rb in berkshelf-api-1.1.1 vs lib/berkshelf/api/cache_builder/worker.rb in berkshelf-api-1.2.0.rc1
- old
+ new
@@ -20,10 +20,15 @@
def initialize(options = {})
@priority = options[:priority]
end
+ # @return [String]
+ def to_s
+ friendly_name
+ end
+
# @abstract
#
# @param [RemoteCookbook] remote
#
# @return [Ridley::Chef::Cookbook::Metadata]
@@ -36,9 +41,20 @@
# @return [Array<RemoteCookbook>]
# The list of cookbooks this builder can find
def cookbooks
raise RuntimeError, "must be implemented"
end
+
+ private
+
+ # @param [String] data
+ # any string to append to the worker_type
+ # @return [String]
+ def friendly_name(data = nil)
+ string = self.class.worker_type.dup
+ string << ": #{data}" if data
+ string
+ end
end
class << self
# @param [#to_s] name
#