Class: Textus::Application::Writes::Build
- Inherits:
-
Object
- Object
- Textus::Application::Writes::Build
- Defined in:
- lib/textus/application/writes/build.rb
Overview
Materializes generator-zone entries (template + projection) onto disk and copies the result to any configured ‘publish_to:` targets. Fires `:build_completed` and `:file_published` events.
For ‘publish_each:` (per-leaf publishing of nested entries), see `Application::Writes::Publish`. The CLI verb `textus build` calls both classes and merges the results.
Instance Method Summary collapse
- #call(prefix: nil) ⇒ Object
-
#initialize(ctx:, bus:) ⇒ Build
constructor
A new instance of Build.
Constructor Details
#initialize(ctx:, bus:) ⇒ Build
Returns a new instance of Build.
14 15 16 17 |
# File 'lib/textus/application/writes/build.rb', line 14 def initialize(ctx:, bus:) @ctx = ctx @bus = bus end |
Instance Method Details
#call(prefix: nil) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/textus/application/writes/build.rb', line 19 def call(prefix: nil) built = manifest.entries.filter_map do |mentry| next unless mentry.in_generator_zone? next unless mentry.projection || mentry.template next if prefix && !mentry.key.start_with?(prefix) materialize(mentry) end { "protocol" => Textus::PROTOCOL, "built" => built } end |