class ChefDK::Policyfile::Reports::Install
Attributes
policyfile_compiler[R]
ui[R]
Public Class Methods
new(ui: nil, policyfile_compiler: nil)
click to toggle source
# File lib/chef-dk/policyfile/reports/install.rb, line 29 def initialize(ui: nil, policyfile_compiler: nil) @ui = ui @policyfile_compiler = policyfile_compiler @fixed_version_install_table = nil @install_table = nil end
Public Instance Methods
installing_cookbook(cookbook_spec)
click to toggle source
# File lib/chef-dk/policyfile/reports/install.rb, line 42 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
installing_fixed_version_cookbook(cookbook_spec)
click to toggle source
# File lib/chef-dk/policyfile/reports/install.rb, line 37 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
Private Instance Methods
fixed_version_install_table()
click to toggle source
# File lib/chef-dk/policyfile/reports/install.rb, line 49 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
install_table()
click to toggle source
# File lib/chef-dk/policyfile/reports/install.rb, line 58 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