Class: Rigor::CLI::FusedProtectionRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/rigor/cli/fused_protection_renderer.rb

Overview

Renders a FusedProtectionReport (ADR-70) as text or JSON. The text form leads with the fused protected ratio (caught by either a type or a test), splits it into the two axes, then lists the unprotected breakages ("add a type or a test here") and the least-protected files. The framing is always where to add protection, never "your code is broken".

Constant Summary collapse

TOP_CALLS =
15
TOP_FILES =
10

Instance Method Summary collapse

Constructor Details

#initialize(out:) ⇒ FusedProtectionRenderer

Returns a new instance of FusedProtectionRenderer.



15
16
17
# File 'lib/rigor/cli/fused_protection_renderer.rb', line 15

def initialize(out:)
  @out = out
end

Instance Method Details

#render(report, format:) ⇒ Object



19
20
21
# File 'lib/rigor/cli/fused_protection_renderer.rb', line 19

def render(report, format:)
  format == "json" ? render_json(report) : render_text(report)
end