Class: Ucode::Cli
- Inherits:
-
Thor
show all
- Defined in:
- lib/ucode/cli.rb
Overview
Top-level CLI entry.
Thin Thor: every method delegates to a Commands::*Command
class and only formats the result. The Command classes are pure
and testable in-process — Thor never holds business logic.
Version resolution lives here — each top-level command resolves
the user-supplied intent (nil / :default / :latest / explicit string)
exactly once via VersionResolver.resolve and threads the resolved
string into the dispatched Command. Sub-commands never re-resolve.
See Candidate 4 of the 2026-06-29 architecture review.
Defined Under Namespace
Classes: Audit, Cache, Fetch, Lookup, Site, UniversalSetCmd
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
23
24
25
|
# File 'lib/ucode/cli.rb', line 23
def self.exit_on_failure?
true
end
|
Instance Method Details
#block_feed ⇒ Object
578
579
580
581
582
583
584
585
|
# File 'lib/ucode/cli.rb', line 578
def block_feed
result = Commands::BlockFeedCommand.new.call(
ucode_output_root: options[:ucode_output],
block_feed_output_root: options[:target],
unicode_version: options[:unicode_version],
)
puts JSON.pretty_generate(result.to_h)
end
|
#build(version = nil) ⇒ Object
254
255
256
257
258
259
260
261
262
263
264
265
|
# File 'lib/ucode/cli.rb', line 254
def build(version = nil)
result = Commands::BuildCommand.new.call(
version,
output_root: options[:to],
site_root: options[:site],
monolith_path: options[:monolith],
force_fetch: options[:force_fetch],
include_glyphs: options[:include_glyphs],
warn: $stderr,
)
puts JSON.pretty_generate(result)
end
|
#glyphs(version = nil) ⇒ Object
126
127
128
129
130
131
132
133
134
135
136
137
|
# File 'lib/ucode/cli.rb', line 126
def glyphs(version = nil)
result = Commands::GlyphsCommand.new.call(
VersionResolver.resolve(version),
output_root: options[:to],
block_filter: options[:block],
force: options[:force],
monolith_path: options[:monolith],
include_glyphs: options[:include_glyphs],
warn: $stderr,
)
puts JSON.pretty_generate(result)
end
|
#parse(version = nil) ⇒ Object
#release ⇒ Object
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
|
# File 'lib/ucode/cli.rb', line 539
def release
reference = Ucode::Audit::ReferenceFactory.build_from_cli(
flag: options[:reference_universal_set],
version: options[:unicode_version],
)
result = Commands::ReleaseCommand.new.call(
from: options[:from],
output_root: options[:output],
universal_set_root: options[:universal_set],
unicode_version: options[:unicode_version],
brief: options[:brief],
browse: options[:browse],
source_config_sha256: options[:source_config_sha256],
reference: reference,
)
puts JSON.pretty_generate(result_to_h(result))
end
|
#version ⇒ Object
29
30
31
|
# File 'lib/ucode/cli.rb', line 29
def version
puts "ucode #{Ucode::VERSION}"
end
|