class ChefCLI::IdDumper

def chefignore

def chefignore
  @chefignore ||= Chef::Cookbook::Chefignore.new(File.join(cookbook_path, "chefignore"))
end

def cookbook_loader

def cookbook_loader
  @cookbook_loader ||=
    begin
      loader = Chef::Cookbook::CookbookVersionLoader.new(cookbook_path, chefignore)
      loader.load!
      loader
    end
end

def cookbook_path

def cookbook_path
  File.expand_path(cb_path)
end

def cookbook_version

def cookbook_version
  @cookbook_version ||= cookbook_loader.cookbook_version
end

def initialize(ui, cb_relpath)

def initialize(ui, cb_relpath)
  @ui = ui
  @cb_path = cb_relpath
end

def run

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