Parent

Files

Class/Module Index [+]

Quicksearch

Chef::Formatters::ErrorDescription

Formatters::ErrorDescription

Class for displaying errors on STDOUT.

Attributes

sections[R]

Public Class Methods

new(title) click to toggle source
# File lib/chef/formatters/error_descriptor.rb, line 28
def initialize(title)
  @title = title
  @sections = []
end

Public Instance Methods

display(out) click to toggle source
# File lib/chef/formatters/error_descriptor.rb, line 37
def display(out)
  out.puts "=" * 80
  out.puts @title, :red
  out.puts "=" * 80
  out.puts "\n"
  sections.each do |section|
    display_section(section, out)
  end
end
for_json() click to toggle source
# File lib/chef/formatters/error_descriptor.rb, line 47
def for_json()
  {
    'title' => @title,
    'sections' => @sections
  }
end
section(heading, text) click to toggle source
# File lib/chef/formatters/error_descriptor.rb, line 33
def section(heading, text)
  @sections << [heading, text]
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.