Class: Fontisan::Commands::AuditCompareCommand
- Inherits:
-
Object
- Object
- Fontisan::Commands::AuditCompareCommand
- Defined in:
- lib/fontisan/commands/audit_compare_command.rb
Overview
Diffs two faces or two saved audit reports.
Each input is one of:
- A path to a `.yaml`/`.json` file previously written by
`fontisan audit -o`. Loaded as an AuditReport.
- A path to a font file. Audited on-the-fly via AuditCommand.
Returns an Models::Audit::AuditDiff. The CLI renders it as YAML/JSON (text formatter lands in TODO 25).
Mixed inputs are allowed (font vs. saved report), which is useful for tracking a font's evolution against a checked-in baseline.
Instance Method Summary collapse
-
#initialize(left_path, right_path, options = {}) ⇒ AuditCompareCommand
constructor
A new instance of AuditCompareCommand.
- #run ⇒ Models::Audit::AuditDiff
Constructor Details
#initialize(left_path, right_path, options = {}) ⇒ AuditCompareCommand
Returns a new instance of AuditCompareCommand.
22 23 24 25 26 |
# File 'lib/fontisan/commands/audit_compare_command.rb', line 22 def initialize(left_path, right_path, = {}) @left_path = left_path @right_path = right_path @options = end |
Instance Method Details
#run ⇒ Models::Audit::AuditDiff
29 30 31 32 33 |
# File 'lib/fontisan/commands/audit_compare_command.rb', line 29 def run left_report = load_report(@left_path) right_report = load_report(@right_path) Audit::Differ.new(left_report, right_report).diff end |