Class: Ucode::Audit::Emitter::CollectionEmitter

Inherits:
Object
  • Object
show all
Includes:
Repo::AtomicWrites
Defined in:
lib/ucode/audit/emitter/collection_emitter.rb

Overview

Writes the per-collection layout for TTC/OTC inputs.

For a collection with N faces, produces:

output/font_audit/<source_label>/
├── index.json                  # collection-level summary
├── 00-<face_ps>/index.json
├── 00-<face_ps>/blocks/…
├── 01-<face_ps>/index.json
└── …

Per-face chunks are delegated to FaceDirectory via the emit_collection_face hook; this class owns only the collection-level summary that points at each sibling face directory.

Instance Method Summary collapse

Methods included from Repo::AtomicWrites

#same_content?, #to_pretty_json, #write_atomic

Instance Method Details

#emit(output_root, source_label, reports, face_directory:) ⇒ Array<String>

Returns the per-face subdirectory names written.

Parameters:

  • output_root (String, Pathname)
  • source_label (String)

    sanitized collection label

  • reports (Array<Models::Audit::AuditReport>)

    one per face

  • face_directory (FaceDirectory)

    per-face emitter

Returns:

  • (Array<String>)

    the per-face subdirectory names written



34
35
36
37
38
39
40
41
42
43
# File 'lib/ucode/audit/emitter/collection_emitter.rb', line 34

def emit(output_root, source_label, reports, face_directory:)
  face_dirs = reports.each_with_index.map do |report, index|
    face_directory.emit_collection_face(
      source_label: source_label, face_index: index, report: report,
    )
  end

  emit_collection_index(output_root, source_label, reports, face_dirs)
  face_dirs
end