Class: GemChangelogDiff::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/gem_changelog_diff/formatter.rb

Constant Summary collapse

BOLD =
"\e[1m"
CYAN =
"\e[36m"
GREEN =
"\e[32m"
YELLOW =
"\e[33m"
RED =
"\e[31m"
RESET =
"\e[0m"

Instance Method Summary collapse

Constructor Details

#initialize(color: default_color?) ) ⇒ Formatter

Returns a new instance of Formatter.



14
15
16
# File 'lib/gem_changelog_diff/formatter.rb', line 14

def initialize(color: default_color?)
  @color = color
end

Instance Method Details

#format(gem_reports) ⇒ Object



18
19
20
21
# File 'lib/gem_changelog_diff/formatter.rb', line 18

def format(gem_reports)
  output = gem_reports.map { |report| format_gem(report) }.join("\n")
  output + summary(gem_reports)
end