Class: Gem::Comparator::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/rubygems/comparator/report.rb,
lib/rubygems/comparator/report/entry.rb

Overview

Gem::Comparator::Report can nest sections and print only those that contain some messages.

Usage:

report = Gem::Comparator::Report.new
report['section1'] << "Message 1"
report['section1']['subsection1'].set_header 'Message 2 Header'
report['section1']['subsection1'] << "Message 2" if false
report['section1'].section
  nest('subsection2').section
    puts "Message 3"
  end
end
report.print

This won't print Message 2 nor its header saving a lot of if/else.

Defined Under Namespace

Modules: Signs Classes: Entry, NestedSection

Class Method Summary collapse

Class Method Details

.new(name = 'main') ⇒ Object



35
36
37
# File 'lib/rubygems/comparator/report.rb', line 35

def self.new(name = 'main')
  Gem::Comparator::Report::NestedSection.new(name)
end