Class: Chef::Fork::Commands::Cookbook

Inherits:
Noop
  • Object
show all
Defined in:
lib/chef/fork/commands/cookbook.rb

Instance Method Summary collapse

Methods inherited from Noop

#initialize

Constructor Details

This class inherits a constructor from Chef::Fork::Commands::Noop

Instance Method Details

#run(args = []) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/chef/fork/commands/cookbook.rb', line 11

def run(args=[])
  rest = order_args(args)
  case rest.first
  when "edit"
    cookbook_edit(rest.slice(1..-1) || [])
  when "list"
    cookbook_list(rest.slice(1..-1) || [])
  when "show"
    cookbook_show(rest.slice(1..-1) || [])
  when "upload"
    cookbook_upload(rest.slice(1..-1) || [])
  else
    raise(NameError.new(rest.inspect))
  end
end