class ChefCLI::PolicyfileLock::InstallReport
def cookbook_name_width
def cookbook_name_width policyfile_lock.cookbook_locks.map { |name, _| name.size }.max end
def cookbook_version_width
def cookbook_version_width policyfile_lock.cookbook_locks.map { |_, lock| lock.version.size }.max end
def format_cookbook(cookbook_lock)
def format_cookbook(cookbook_lock) "#{cookbook_lock.name.ljust(cookbook_name_width)} #{cookbook_lock.version.to_s.ljust(cookbook_version_width)}" end
def initialize(ui: nil, policyfile_lock: nil)
def initialize(ui: nil, policyfile_lock: nil) @ui = ui @policyfile_lock = policyfile_lock @cookbook_name_width = nil @cookbook_version_width = nil end
def installing_cookbook(cookbook_lock)
def installing_cookbook(cookbook_lock) verb = cookbook_lock.installed? ? "Using " : "Installing" ui.msg("#{verb} #{format_cookbook(cookbook_lock)}") end
def installing_fixed_version_cookbook(cookbook_spec)
def installing_fixed_version_cookbook(cookbook_spec) verb = cookbook_spec.installed? ? "Using " : "Installing" ui.msg("#{verb} #{format_fixed_version_cookbook(cookbook_spec)}") end