class ChefCLI::Policyfile::Reports::Install
def fixed_version_install_table
def fixed_version_install_table @fixed_version_install_table ||= TablePrinter.new(ui) do |t| t.column(%w{Using Installing}) t.column(policyfile_compiler.fixed_version_cookbooks_specs.keys) t.column t.column end end
def initialize(ui: nil, policyfile_compiler: nil)
def initialize(ui: nil, policyfile_compiler: nil) @ui = ui @policyfile_compiler = policyfile_compiler @fixed_version_install_table = nil @install_table = nil end
def install_table
def install_table @install_table ||= TablePrinter.new(ui) do |t| t.column(%w{Using Installing}) t.column(policyfile_compiler.graph_solution.keys) t.column(policyfile_compiler.graph_solution.values) end end
def installing_cookbook(cookbook_spec)
def installing_cookbook(cookbook_spec) verb = cookbook_spec.installed? ? "Using " : "Installing" install_table.print_row(verb, cookbook_spec.name, cookbook_spec.version_constraint.version) end
def installing_fixed_version_cookbook(cookbook_spec)
def installing_fixed_version_cookbook(cookbook_spec) verb = cookbook_spec.installed? ? "Using " : "Installing" fixed_version_install_table.print_row(verb, cookbook_spec.name, cookbook_spec.version_constraint.to_s, "from #{cookbook_spec.source_type}") end