Module: Ucode::Glyphs::ResolverFactory
- Defined in:
- lib/ucode/glyphs/resolver_factory.rb
Overview
Single injection point for the 4-tier Resolver.
Both CanonicalBuildCommand and UniversalSet::BuildCommand need the same shape: open a Database, load the SourceConfig, run a SourceBuilder, wrap the resulting tier-1 sources in a Resolver. Extracting it here gives tests one seam to mock (or bypass) and prevents drift between the two call sites.
Class Method Summary collapse
Class Method Details
.build(version:, source_config_path: nil, install: DEFAULT_INSTALL, database: nil) ⇒ Ucode::Glyphs::Resolver
27 28 29 30 31 32 33 |
# File 'lib/ucode/glyphs/resolver_factory.rb', line 27 def self.build(version:, source_config_path: nil, install: DEFAULT_INSTALL, database: nil) db = database || Ucode::Database.open(version) config = SourceConfig.new(path: resolve_config_path(source_config_path)) builder = SourceBuilder.new(config: config, database: db) Resolver.new(sources: builder.tier1_sources(install: install)) end |