class Chef::Knife::PinningsLocalCookbook

This class implements knife pinnings get local METADATA_ITEM

Public Instance Methods

run() click to toggle source
# File lib/chef/knife/pinnings_local_cookbook.rb, line 23
def run
  @metadata = Chef::Cookbook::Metadata.new
  @metadata.from_file(File.join(Dir.pwd, 'metadata.rb'))

  result = ''
  name_args.each do |name|
    if @metadata.respond_to?(name)
      result += @metadata.send(name).to_s + ' '
    else
      result += '_undefined_ '
    end
  end
  ui.info result.chomp
end