Class: Dogfood::DSL::AuditRenderer
- Inherits:
-
Object
- Object
- Dogfood::DSL::AuditRenderer
- Defined in:
- lib/dogfood/dsl/audit_renderer.rb
Overview
Produces the --explain audit report. This is a thin facade over
AuditReport, which owns the computation (IR) and the text/markdown/json
formatters. The default render output is byte-identical to the
pre-refactor five-section report; the regression target is
EXAMPLES/explain_output.txt.
Constant Summary collapse
- MAX_PATHS =
AuditReport::MAX_PATHS
Instance Method Summary collapse
-
#initialize(ast, pack: nil) ⇒ AuditRenderer
constructor
A new instance of AuditRenderer.
- #render(format: :text) ⇒ Object
Constructor Details
#initialize(ast, pack: nil) ⇒ AuditRenderer
Returns a new instance of AuditRenderer.
13 14 15 16 |
# File 'lib/dogfood/dsl/audit_renderer.rb', line 13 def initialize(ast, pack: nil) @ast = ast @pack = pack end |
Instance Method Details
#render(format: :text) ⇒ Object
18 19 20 21 |
# File 'lib/dogfood/dsl/audit_renderer.rb', line 18 def render(format: :text) report = AuditReport.build(@ast, pack: @pack) AuditReport.render(report, format: format) end |