Class: Ucode::Commands::Audit::BrowserCommand
- Inherits:
-
Object
- Object
- Ucode::Commands::Audit::BrowserCommand
- Defined in:
- lib/ucode/commands/audit/browser_command.rb
Overview
ucode audit browser — regenerate HTML browsers from existing
JSON audits, without re-running extractors.
Walks the audit root and rewrites only .html files. Useful
when the audit ran without --browse, or after a CSS/JS
template tweak. No JSON is rewritten.
Scopes:
- default: regenerate both library-level + all face pages.
- `faces_only: true` — only per-face pages.
- `library_only: true` — only the library-level page.
Defined Under Namespace
Instance Method Summary collapse
Instance Method Details
#call(input:, faces_only: false, library_only: false) ⇒ Result
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/ucode/commands/audit/browser_command.rb', line 38 def call(input:, faces_only: false, library_only: false) audit_root = Pathname.new(input) library_html = library_only || !faces_only ? write_library(audit_root) : nil faces = faces_only || !library_only ? write_faces(audit_root) : [] Result.new(input: audit_root.to_s, library_html: library_html&.to_s, faces: faces) rescue StandardError => e Result.new(input: input.to_s, error: "#{e.class}: #{e.}") end |