Class: Fontisan::Audit::LibraryAggregator

Inherits:
Object
  • Object
show all
Defined in:
lib/fontisan/audit/library_aggregator.rb

Overview

Pure cross-face aggregation over a list of AuditReports.

No I/O, no font parsing — operates only on already-built reports. Easy to spec with synthetic reports and trivially testable. The orchestrator (LibraryAuditor) handles file discovery and per-face auditing; this class owns the rollups that span faces.

Aggregates:

- aggregate_metrics: sum of total_codepoints and total_glyphs.
- script_coverage:   one ScriptCoverageRow per Unicode script,
                    listing faces that cover it.
- duplicate_groups:  files bucketed by source_sha256 (size > 1).
- license_distribution: face counts keyed by license_url.

Instance Method Summary collapse

Instance Method Details

#aggregate(reports) ⇒ Hash{Symbol => Object}

Returns keys: :aggregate_metrics, :script_coverage, :duplicate_groups, :license_distribution.

Parameters:

Returns:

  • (Hash{Symbol => Object})

    keys: :aggregate_metrics, :script_coverage, :duplicate_groups, :license_distribution



22
23
24
25
26
27
28
29
# File 'lib/fontisan/audit/library_aggregator.rb', line 22

def aggregate(reports)
  {
    aggregate_metrics: aggregate_metrics(reports),
    script_coverage: build_script_coverage(reports),
    duplicate_groups: find_duplicates(reports),
    license_distribution: license_distribution(reports),
  }
end