Module: Ucode::Audit::Emitter::Paths

Defined in:
lib/ucode/audit/emitter/paths.rb

Overview

Pure path conventions for the Mode 2 audit output tree.

The only code that knows the on-disk layout of the audit output. Distinct from Repo::Paths (Mode 1 canonical UCD dataset): Mode 2 output lives under output/font_audit/<label>/ and carries a different chunk layout (planes/, blocks/, scripts/, codepoints/, glyphs/, missing/, plus collection-face subdirs).

All methods are pure: no I/O, no global state. Returns Pathname instances so callers can compose further. Block names are passed through verbatim — never slugified (per 03-directory-output-spec.md §"Block filename encoding").

Class Method Summary collapse

Class Method Details

.block_path(output_root, label, block_name) ⇒ Pathname

output/font_audit/<label>/blocks/<NAME>.json. Block name is verbatim — Unicode block names contain no path separators.

Parameters:

  • output_root (String, Pathname)
  • label (String)
  • block_name (String)

Returns:

  • (Pathname)


87
88
89
# File 'lib/ucode/audit/emitter/paths.rb', line 87

def block_path(output_root, label, block_name)
  face_dir(output_root, label).join(BLOCKS_DIR, "#{block_name}.json")
end

.block_under(face_dir, block_name) ⇒ Pathname

Parameters:

  • face_dir (String, Pathname)
  • block_name (String)

Returns:

  • (Pathname)


190
191
192
# File 'lib/ucode/audit/emitter/paths.rb', line 190

def block_under(face_dir, block_name)
  Pathname(face_dir).join(BLOCKS_DIR, "#{block_name}.json")
end

.codepoints_path(output_root, label, block_name) ⇒ Pathname

output/font_audit/<label>/codepoints/<NAME>.json — verbose per-block codepoint detail.

Parameters:

  • output_root (String, Pathname)
  • label (String)
  • block_name (String)

Returns:

  • (Pathname)


116
117
118
# File 'lib/ucode/audit/emitter/paths.rb', line 116

def codepoints_path(output_root, label, block_name)
  face_dir(output_root, label).join(CODEPOINTS_DIR, "#{block_name}.json")
end

.codepoints_under(face_dir, block_name) ⇒ Pathname

Parameters:

  • face_dir (String, Pathname)
  • block_name (String)

Returns:

  • (Pathname)


211
212
213
# File 'lib/ucode/audit/emitter/paths.rb', line 211

def codepoints_under(face_dir, block_name)
  Pathname(face_dir).join(CODEPOINTS_DIR, "#{block_name}.json")
end

.collection_face_dir(output_root, source_label, face_index, face_label) ⇒ Pathname

Collection-face subdirectory: 00-<face>/, 01-<face>/, ... The 2-digit zero-padded prefix preserves source order and disambiguates faces that share a PostScript name.

Parameters:

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

    0-based face index

  • face_label (String)

    sanitized postscript_name

Returns:

  • (Pathname)


157
158
159
160
# File 'lib/ucode/audit/emitter/paths.rb', line 157

def collection_face_dir(output_root, source_label, face_index, face_label)
  face_dir(output_root, source_label).join(format("%<idx>02d-%<label>s",
                                                  idx: face_index, label: face_label))
end

.face_dir(output_root, label) ⇒ Pathname

Per-label directory (one face, or one TTC source).

Parameters:

  • output_root (String, Pathname)
  • label (String)

    safe filename (caller-sanitized)

Returns:

  • (Pathname)


60
61
62
# File 'lib/ucode/audit/emitter/paths.rb', line 60

def face_dir(output_root, label)
  library_root(output_root).join(label)
end

.face_html_path(output_root, label) ⇒ Pathname

output/font_audit/<label>/index.html — per-face browser (added in TODO 14).

Parameters:

  • output_root (String, Pathname)
  • label (String)

Returns:

  • (Pathname)


77
78
79
# File 'lib/ucode/audit/emitter/paths.rb', line 77

def face_html_path(output_root, label)
  face_dir(output_root, label).join(HTML_FILENAME)
end

.face_index_path(output_root, label) ⇒ Pathname

output/font_audit/<label>/index.json — per-face compact index.

Parameters:

  • output_root (String, Pathname)
  • label (String)

Returns:

  • (Pathname)


68
69
70
# File 'lib/ucode/audit/emitter/paths.rb', line 68

def face_index_path(output_root, label)
  face_dir(output_root, label).join(INDEX_FILENAME)
end

.glyph_path(output_root, label, cp_id) ⇒ Pathname

output/font_audit/<label>/glyphs/U+XXXX.svg.

Parameters:

  • output_root (String, Pathname)
  • label (String)
  • cp_id (String)

    e.g. "U+0041"

Returns:

  • (Pathname)


125
126
127
# File 'lib/ucode/audit/emitter/paths.rb', line 125

def glyph_path(output_root, label, cp_id)
  face_dir(output_root, label).join(GLYPHS_DIR, "#{cp_id}.svg")
end

.glyph_under(face_dir, cp_id) ⇒ Pathname

Parameters:

  • face_dir (String, Pathname)
  • cp_id (String)

    e.g. "U+0041"

Returns:

  • (Pathname)


218
219
220
# File 'lib/ucode/audit/emitter/paths.rb', line 218

def glyph_under(face_dir, cp_id)
  Pathname(face_dir).join(GLYPHS_DIR, "#{cp_id}.svg")
end

.index_under(face_dir) ⇒ Pathname

Parameters:

  • face_dir (String, Pathname)

Returns:

  • (Pathname)


183
184
185
# File 'lib/ucode/audit/emitter/paths.rb', line 183

def index_under(face_dir)
  Pathname(face_dir).join(INDEX_FILENAME)
end

.library_html_path(output_root) ⇒ Pathname

output/font_audit/index.html — library browser (TODO 15).

Parameters:

  • output_root (String, Pathname)

Returns:

  • (Pathname)


172
173
174
# File 'lib/ucode/audit/emitter/paths.rb', line 172

def library_html_path(output_root)
  library_root(output_root).join(HTML_FILENAME)
end

.library_index_path(output_root) ⇒ Pathname

output/font_audit/index.json — library-mode top-level index.

Parameters:

  • output_root (String, Pathname)

Returns:

  • (Pathname)


165
166
167
# File 'lib/ucode/audit/emitter/paths.rb', line 165

def library_index_path(output_root)
  library_root(output_root).join(INDEX_FILENAME)
end

.library_root(output_root) ⇒ Pathname

Library-mode root: one level above the per-label directories.

Parameters:

  • output_root (String, Pathname)

Returns:

  • (Pathname)


52
53
54
# File 'lib/ucode/audit/emitter/paths.rb', line 52

def library_root(output_root)
  Pathname(output_root).join(FONT_AUDIT_ROOT)
end

.missing_dir(output_root, label) ⇒ Pathname

output/font_audit/<label>/missing/ — per-block missing-glyph gallery directory (TODO 26). Each touched block with missing codepoints gets one <BLOCK>.html plus a paginated <BLOCK>.json companion for large blocks.

Parameters:

  • output_root (String, Pathname)
  • label (String)

Returns:

  • (Pathname)


136
137
138
# File 'lib/ucode/audit/emitter/paths.rb', line 136

def missing_dir(output_root, label)
  face_dir(output_root, label).join(MISSING_DIR)
end

.missing_dir_under(face_dir) ⇒ Pathname

Parameters:

  • face_dir (String, Pathname)

Returns:

  • (Pathname)


224
225
226
# File 'lib/ucode/audit/emitter/paths.rb', line 224

def missing_dir_under(face_dir)
  Pathname(face_dir).join(MISSING_DIR)
end

.missing_glyph_page_path(output_root, label, block_name) ⇒ Pathname

output/font_audit/<label>/missing/<BLOCK>.html.

Parameters:

  • output_root (String, Pathname)
  • label (String)
  • block_name (String)

Returns:

  • (Pathname)


145
146
147
# File 'lib/ucode/audit/emitter/paths.rb', line 145

def missing_glyph_page_path(output_root, label, block_name)
  missing_dir(output_root, label).join("#{block_name}.html")
end

.missing_glyph_page_under(face_dir, block_name) ⇒ Pathname

Parameters:

  • face_dir (String, Pathname)
  • block_name (String)

Returns:

  • (Pathname)


231
232
233
# File 'lib/ucode/audit/emitter/paths.rb', line 231

def missing_glyph_page_under(face_dir, block_name)
  missing_dir_under(face_dir).join("#{block_name}.html")
end

.plane_path(output_root, label, plane) ⇒ Pathname

output/font_audit/<label>/planes/<N>.json.

Parameters:

  • output_root (String, Pathname)
  • label (String)
  • plane (Integer)

Returns:

  • (Pathname)


96
97
98
# File 'lib/ucode/audit/emitter/paths.rb', line 96

def plane_path(output_root, label, plane)
  face_dir(output_root, label).join(PLANES_DIR, "#{plane}.json")
end

.plane_under(face_dir, plane) ⇒ Pathname

Parameters:

  • face_dir (String, Pathname)
  • plane (Integer)

Returns:

  • (Pathname)


197
198
199
# File 'lib/ucode/audit/emitter/paths.rb', line 197

def plane_under(face_dir, plane)
  Pathname(face_dir).join(PLANES_DIR, "#{plane}.json")
end

.release_audit_root(release_root) ⇒ Pathname

<release_root>/audit/ — top-level audit subtree.

Parameters:

  • release_root (String, Pathname)

Returns:

  • (Pathname)


255
256
257
# File 'lib/ucode/audit/emitter/paths.rb', line 255

def release_audit_root(release_root)
  Pathname(release_root).join(RELEASE_AUDIT_DIR)
end

.release_face_dir(release_root, slug, face_label) ⇒ Pathname

<release_root>/audit/<slug>/<face_label>/ — one face.

Parameters:

  • release_root (String, Pathname)
  • slug (String)

    sanitized formula slug

  • face_label (String)

    sanitized face label

Returns:

  • (Pathname)


274
275
276
# File 'lib/ucode/audit/emitter/paths.rb', line 274

def release_face_dir(release_root, slug, face_label)
  release_formula_dir(release_root, slug).join(face_label)
end

.release_formula_dir(release_root, slug) ⇒ Pathname

<release_root>/audit/<slug>/ — one formula's audit subtree. Per-face directories live under here. The slug is a caller-sanitized formula identifier (fontist formula slug).

Parameters:

  • release_root (String, Pathname)
  • slug (String)

    sanitized formula slug

Returns:

  • (Pathname)


265
266
267
# File 'lib/ucode/audit/emitter/paths.rb', line 265

def release_formula_dir(release_root, slug)
  release_audit_root(release_root).join(slug)
end

.release_library_index_path(release_root) ⇒ Pathname

<release_root>/library.json — release-level library index aggregating every formula + face card.

Parameters:

  • release_root (String, Pathname)

Returns:

  • (Pathname)


282
283
284
# File 'lib/ucode/audit/emitter/paths.rb', line 282

def release_library_index_path(release_root)
  Pathname(release_root).join(RELEASE_LIBRARY_INDEX)
end

.release_manifest_path(release_root) ⇒ Pathname

<release_root>/manifest.json — release manifest (versions, sha256s, totals).

Parameters:

  • release_root (String, Pathname)

Returns:

  • (Pathname)


290
291
292
# File 'lib/ucode/audit/emitter/paths.rb', line 290

def release_manifest_path(release_root)
  Pathname(release_root).join(RELEASE_MANIFEST)
end

.release_root(output_root) ⇒ Pathname

<output_root>/font_audit_release/.

Parameters:

  • output_root (String, Pathname)

    parent of the release root

Returns:

  • (Pathname)


248
249
250
# File 'lib/ucode/audit/emitter/paths.rb', line 248

def release_root(output_root)
  Pathname(output_root).join(RELEASE_ROOT_DIR)
end

.release_universal_set_manifest_path(release_root) ⇒ Pathname

<release_root>/universal_glyph_set/manifest.json.

Parameters:

  • release_root (String, Pathname)

Returns:

  • (Pathname)


306
307
308
# File 'lib/ucode/audit/emitter/paths.rb', line 306

def release_universal_set_manifest_path(release_root)
  release_universal_set_root(release_root).join(RELEASE_MANIFEST_ENTRY)
end

.release_universal_set_root(release_root) ⇒ Pathname

<release_root>/universal_glyph_set/ — the universal-set reference directory (built separately by TODO 24 and copied or symlinked into the release tree by the CI collector).

Parameters:

  • release_root (String, Pathname)

Returns:

  • (Pathname)


299
300
301
# File 'lib/ucode/audit/emitter/paths.rb', line 299

def release_universal_set_root(release_root)
  Pathname(release_root).join(RELEASE_UNIVERSAL_SET_DIR)
end

.script_path(output_root, label, script_code) ⇒ Pathname

output/font_audit/<label>/scripts/<CODE>.json. Script code is the ISO 15924 short form (Latn, Grek, …).

Parameters:

  • output_root (String, Pathname)
  • label (String)
  • script_code (String)

Returns:

  • (Pathname)


106
107
108
# File 'lib/ucode/audit/emitter/paths.rb', line 106

def script_path(output_root, label, script_code)
  face_dir(output_root, label).join(SCRIPTS_DIR, "#{script_code}.json")
end

.script_under(face_dir, script_code) ⇒ Pathname

Parameters:

  • face_dir (String, Pathname)
  • script_code (String)

Returns:

  • (Pathname)


204
205
206
# File 'lib/ucode/audit/emitter/paths.rb', line 204

def script_under(face_dir, script_code)
  Pathname(face_dir).join(SCRIPTS_DIR, "#{script_code}.json")
end