class ChefCLI::PolicyfileServices::ShowPolicy::ReportPrinter
Attributes
ui[R]
Public Class Methods
new(ui)
click to toggle source
# File lib/chef-cli/policyfile_services/show_policy.rb, line 29 def initialize(ui) @ui = ui end
Public Instance Methods
h1(heading)
click to toggle source
# File lib/chef-cli/policyfile_services/show_policy.rb, line 33 def h1(heading) ui.msg(heading) ui.msg("=" * heading.size) ui.msg("") end
h2(heading)
click to toggle source
# File lib/chef-cli/policyfile_services/show_policy.rb, line 39 def h2(heading) ui.msg(heading) ui.msg("-" * heading.size) ui.msg("") end
list(items)
click to toggle source
# File lib/chef-cli/policyfile_services/show_policy.rb, line 55 def list(items) items.each { |item| ui.msg("* #{item}") } ui.msg("") end
table_list(items)
click to toggle source
# File lib/chef-cli/policyfile_services/show_policy.rb, line 45 def table_list(items) left_justify_size = items.keys.map(&:size).max.to_i + 2 items.each do |name, value| justified_name = "#{name}:".ljust(left_justify_size) ui.msg("* #{justified_name} #{value}") end ui.msg("") end