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 → site. Resumable: each step is idempotent and safe to re-run.

Resolves the version intent once at the top and threads the resolved string through every sub-command.

Instance Method Summary collapse

Instance Method Details

#call(version_intent, output_root:, site_root: nil, force_fetch: false) ⇒ 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

  • force_fetch (Boolean) (defaults to: false)

    re-download sources

Returns:

  • (Hash)

    aggregated step results



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/ucode/commands/build.rb', line 21

def call(version_intent, output_root:, site_root: nil,
         force_fetch: false)
  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[:site] = run_site(output_root, site_root) if site_root

  { version: version, steps: steps }
end