Class: Ace::Retro::Molecules::RetroDoctorReporter
- Inherits:
-
Object
- Object
- Ace::Retro::Molecules::RetroDoctorReporter
- Defined in:
- lib/ace/retro/molecules/retro_doctor_reporter.rb
Overview
Formats doctor diagnosis results for terminal, JSON, or summary output.
Constant Summary collapse
- COLORS =
{ red: "\e[31m", yellow: "\e[33m", green: "\e[32m", blue: "\e[34m", cyan: "\e[36m", reset: "\e[0m", bold: "\e[1m" }.freeze
- ICONS =
{ error: "❌", warning: "⚠️", info: "ℹ️", success: "✅", doctor: "🏥", stats: "📊", fix: "🔧", score: "📈" }.freeze
Class Method Summary collapse
-
.format_fix_results(fix_results, colors: true) ⇒ String
Format auto-fix results.
-
.format_results(results, format: :terminal, verbose: false, colors: true) ⇒ String
Format diagnosis results.
Class Method Details
.format_fix_results(fix_results, colors: true) ⇒ String
Format auto-fix results
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/ace/retro/molecules/retro_doctor_reporter.rb', line 52 def self.format_fix_results(fix_results, colors: true) output = [] output << if fix_results[:dry_run] "\n#{colorize("#{ICONS[:stats]} DRY RUN MODE", :cyan, colors)} - No changes applied" else "\n#{colorize("#{ICONS[:fix]} Auto-Fix Applied", :green, colors)}" end if fix_results[:fixed] > 0 output << "#{colorize("Fixed:", :green, colors)} #{fix_results[:fixed]} issues" if fix_results[:fixes_applied]&.any? output << "\nFixes applied:" fix_results[:fixes_applied].each do |fix| output << " #{colorize("✓", :green, colors)} #{fix[:description]}" output << " #{colorize(fix[:file], :blue, colors)}" if fix[:file] end end end if fix_results[:skipped] > 0 output << "#{colorize("Skipped:", :yellow, colors)} #{fix_results[:skipped]} issues (manual fix required)" end output.join("\n") end |
.format_results(results, format: :terminal, verbose: false, colors: true) ⇒ String
Format diagnosis results
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/ace/retro/molecules/retro_doctor_reporter.rb', line 37 def self.format_results(results, format: :terminal, verbose: false, colors: true) case format.to_sym when :json format_json(results) when :summary format_summary(results, colors: colors) else format_terminal(results, verbose: verbose, colors: colors) end end |