Module: Berkshelf::API::CacheBuilder::Worker

Defined in:
lib/berkshelf/api/cache_builder/worker.rb,
lib/berkshelf/api/cache_builder/worker/github.rb,
lib/berkshelf/api/cache_builder/worker/file_store.rb,
lib/berkshelf/api/cache_builder/worker/chef_server.rb,
lib/berkshelf/api/cache_builder/worker/supermarket.rb

Defined Under Namespace

Classes: Base, ChefServer, FileStore, Github, Supermarket

Class Method Summary collapse

Class Method Details

.[](name) ⇒ Worker::Base

Parameters:

  • name (#to_s)

Returns:



63
64
65
# File 'lib/berkshelf/api/cache_builder/worker.rb', line 63

def [](name)
  types[name.to_s]
end

.register(name, klass) ⇒ Object

Parameters:



69
70
71
72
73
74
75
# File 'lib/berkshelf/api/cache_builder/worker.rb', line 69

def register(name, klass)
  name = name.to_s
  if types.has_key?(name)
    raise RuntimeError, "worker already registered with the name '#{name}'"
  end
  types[name] = klass
end

.typesHash

Returns:

  • (Hash)


78
79
80
# File 'lib/berkshelf/api/cache_builder/worker.rb', line 78

def types
  @types ||= Hash.new
end