Class: Ucode::Commands::BuildCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/ucode/commands/build.rb

Overview

‘ucode build` — full pipeline: fetch (ucd + unihan + charts) →parse → (optional) glyphs → (optional) site. Resumable: each step is idempotent and safe to re-run.

**Glyph step is opt-in as of v0.1** because the SVG cell extractor is still experimental. Pass ‘include_glyphs: true` to enable it; otherwise the glyphs step is recorded as skipped.

Instance Method Summary collapse

Instance Method Details

#call(version_intent, output_root:, site_root: nil, monolith_path: nil, force_fetch: false, include_glyphs: false, warn: nil) ⇒ Hash

Returns aggregated step results.

Parameters:

  • version_intent (nil, :default, :latest, String)
  • output_root (String, Pathname)
  • site_root (String, Pathname, nil) (defaults to: nil)

    if nil, skip site build

  • monolith_path (String, Pathname, nil) (defaults to: nil)

    CodeCharts.pdf fallback

  • force_fetch (Boolean) (defaults to: false)

    re-download sources

  • include_glyphs (Boolean) (defaults to: false)

    opt into the experimental glyph step (default false)

  • warn (IO, nil) (defaults to: nil)

    forwarded to GlyphsCommand when enabled

Returns:

  • (Hash)

    aggregated step results



27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/ucode/commands/build.rb', line 27

def call(version_intent, output_root:, site_root: nil,
         monolith_path: nil, force_fetch: false,
         include_glyphs: false, warn: nil)
  version = VersionResolver.resolve(version_intent)
  steps = {}

  steps[:fetch] = run_fetch(version, force: force_fetch)
  steps[:parse] = ParseCommand.new.call(version, output_root: output_root)
  steps[:glyphs] = run_glyphs(version, output_root, monolith_path,
                               include_glyphs: include_glyphs, warn: warn)
  steps[:site] = run_site(output_root, site_root) if site_root

  { version: version, steps: steps }
end