Class: Chef::Knife::InventoryCookbook

Inherits:
Chef::Knife show all
Defined in:
lib/chef/knife/inventory_cookbook.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cookbook_nameObject

Returns the value of attribute cookbook_name.



39
40
41
# File 'lib/chef/knife/inventory_cookbook.rb', line 39

def cookbook_name
  @cookbook_name
end

#cookbook_versionObject

Returns the value of attribute cookbook_version.



40
41
42
# File 'lib/chef/knife/inventory_cookbook.rb', line 40

def cookbook_version
  @cookbook_version
end

Instance Method Details

#runObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/chef/knife/inventory_cookbook.rb', line 22

def run
  @cookbook_name = name_args[0]
  @cookbook_version = name_args[1]
  @show_env_constraints = config[:env_constraints]

  unless @cookbook_name
    ui.error "You need to specify a cookbook"
    exit 1
  end

  if @cookbook_version
    output_version_analysis
  else
    output_analysis
  end
end