Module: ArchUnit::Metrics::Reporting::MetricsExporter
- Defined in:
- lib/archunit/metrics/reporting/metrics_exporter.rb
Overview
Renders caller-supplied metric data as a complete offline HTML document.
Constant Summary collapse
- DEFAULT_CSS =
<<~CSS :root { color-scheme: light dark; font-family: system-ui, sans-serif; } body { max-width: 960px; margin: 0 auto; padding: 2rem; } h1 { margin-bottom: .25rem; } .timestamp { color: #666; margin-top: 0; } table { border-collapse: collapse; margin-top: 1.5rem; width: 100%; } th, td { border: 1px solid #bbb; padding: .6rem .8rem; text-align: left; } th { background: rgba(127, 127, 127, .14); } tr:nth-child(even) { background: rgba(127, 127, 127, .07); } footer { color: #666; font-size: .85rem; margin-top: 2rem; } CSS
Class Method Summary collapse
Class Method Details
.export_as_html(data, options = nil) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/archunit/metrics/reporting/metrics_exporter.rb', line 28 def export_as_html(data, = nil) raise ArgumentError, 'data must be a Hash' unless data.is_a?(Hash) = MetricsExportOptions.resolve() html = render(data, ).freeze write(.output_path, html) if .output_path html end |