Class: Textus::Application::Write::Materializer
- Inherits:
-
Object
- Object
- Textus::Application::Write::Materializer
- Defined in:
- lib/textus/application/write/materializer.rb
Overview
Materializes a single Derived manifest entry onto disk by running the builder pipeline (template + projection + external runner). Extracted from Application::Write::Build so that Publish can reuse it without creating a Build dependency.
Instance Method Summary collapse
-
#initialize(ctx:, caps:, rpc:, session:) ⇒ Materializer
constructor
A new instance of Materializer.
-
#run(mentry) ⇒ Object
Runs the builder pipeline for ‘mentry` and returns the on-disk target_path string.
Constructor Details
#initialize(ctx:, caps:, rpc:, session:) ⇒ Materializer
Returns a new instance of Materializer.
11 12 13 14 15 16 17 18 19 |
# File 'lib/textus/application/write/materializer.rb', line 11 def initialize(ctx:, caps:, rpc:, session:) @ctx = ctx @caps = caps @manifest = caps.manifest @file_store = caps.file_store @rpc = rpc @root = caps.root @session = session end |
Instance Method Details
#run(mentry) ⇒ Object
Runs the builder pipeline for ‘mentry` and returns the on-disk target_path string.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/textus/application/write/materializer.rb', line 23 def run(mentry) reader = Textus::Application::Read::Get::Impl.new(ctx: @ctx, caps: @caps) lister = Textus::Application::Read::List::Impl.new(caps: @caps) Builder::Pipeline.run( mentry: mentry, manifest: @manifest, reader: reader.method(:call), lister: lister.method(:call), rpc: @rpc, template_loader: ->(name) { read_template(name) }, transform_context: @caps, inject_boot: -> { Textus::Boot.run(@session) }, ) end |