Module: Canon::DiffFormatter::DiffDetailFormatterHelpers::ColorHelper
- Defined in:
- lib/canon/diff_formatter/diff_detail_formatter/color_helper.rb
Overview
Color helper for diff formatting
Provides consistent colorization for diff output.
Class Method Summary collapse
-
.colorize(text, color, use_color, bold: false) ⇒ String
Colorize text with optional bold formatting.
Class Method Details
.colorize(text, color, use_color, bold: false) ⇒ String
Colorize text with optional bold formatting
19 20 21 22 23 24 25 |
# File 'lib/canon/diff_formatter/diff_detail_formatter/color_helper.rb', line 19 def self.colorize(text, color, use_color, bold: false) return text unless use_color presenter = Rainbow(text).send(color) presenter = presenter.bright if bold presenter.to_s end |