class ChefCLI::IdDumper

Attributes

cb_path[R]
ui[R]

Public Class Methods

new(ui, cb_relpath) click to toggle source
# File lib/chef-cli/command/describe_cookbook.rb, line 29
def initialize(ui, cb_relpath)
  @ui = ui
  @cb_path = cb_relpath
end

Public Instance Methods

chefignore() click to toggle source
# File lib/chef-cli/command/describe_cookbook.rb, line 60
def chefignore
  @chefignore ||= Chef::Cookbook::Chefignore.new(File.join(cookbook_path, "chefignore"))
end
cookbook_loader() click to toggle source
# File lib/chef-cli/command/describe_cookbook.rb, line 51
def cookbook_loader
  @cookbook_loader ||=
    begin
      loader = Chef::Cookbook::CookbookVersionLoader.new(cookbook_path, chefignore)
      loader.load!
      loader
    end
end
cookbook_path() click to toggle source
# File lib/chef-cli/command/describe_cookbook.rb, line 47
def cookbook_path
  File.expand_path(cb_path)
end
cookbook_version() click to toggle source
# File lib/chef-cli/command/describe_cookbook.rb, line 43
def cookbook_version
  @cookbook_version ||= cookbook_loader.cookbook_version
end
run() click to toggle source
# File lib/chef-cli/command/describe_cookbook.rb, line 34
def run
  id = ChefCLI::CookbookProfiler::Identifiers.new(cookbook_version)
  ui.msg "Path: #{cookbook_path}"
  ui.msg "SemVer version: #{id.semver_version}"
  ui.msg "Identifier: #{id.content_identifier}"
  ui.msg "File fingerprints:"
  ui.msg id.fingerprint_text
end