Class: GemChangelogDiff::Formatters::Text
- Defined in:
- lib/gem_changelog_diff/formatters/text.rb
Overview
Plain text formatter with optional ANSI color output.
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
- #format(gem_reports) ⇒ Object
-
#initialize(color: default_color?) ) ⇒ Text
constructor
A new instance of Text.
Constructor Details
#initialize(color: default_color?) ) ⇒ Text
Returns a new instance of Text.
16 17 18 |
# File 'lib/gem_changelog_diff/formatters/text.rb', line 16 def initialize(color: default_color?) super end |
Instance Method Details
#format(gem_reports) ⇒ Object
20 21 22 23 |
# File 'lib/gem_changelog_diff/formatters/text.rb', line 20 def format(gem_reports) output = gem_reports.map { |report| format_gem(report) }.join("\n") output + summary(gem_reports) end |