Class: Ucode::Audit::LibraryAggregator

Inherits:
Object
  • Object
show all
Defined in:
lib/ucode/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. The orchestrator (LibraryAuditor) handles file discovery and per-face auditing; this class owns the rollups that span faces.

ucode deltas vs fontisan:

  • build_script_coverage reads report.scripts (ScriptSummary) rather than fontisan's unicode_scripts (String). The script identifier is script_code (ISO 15924), and only scripts with non-zero coverage are surfaced.
  • aggregate_metrics sums total_codepoints and total_glyphs. ucode reports both as Integer (never nil) per the schema.

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



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

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