Class: Rigor::CLI::FusedProtectionRenderer
- Inherits:
-
Object
- Object
- Rigor::CLI::FusedProtectionRenderer
- 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
-
#initialize(out:) ⇒ FusedProtectionRenderer
constructor
A new instance of FusedProtectionRenderer.
- #render(report, format:) ⇒ Object
Constructor Details
#initialize(out:) ⇒ FusedProtectionRenderer
Returns a new instance of FusedProtectionRenderer.
16 17 18 |
# File 'lib/rigor/cli/fused_protection_renderer.rb', line 16 def initialize(out:) @out = out end |
Instance Method Details
#render(report, format:) ⇒ Object
20 21 22 |
# File 'lib/rigor/cli/fused_protection_renderer.rb', line 20 def render(report, format:) format == "json" ? render_json(report) : render_text(report) end |