Class: Textus::Manifest::Entry::Publish::EachFile
- Defined in:
- lib/textus/manifest/entry/publish/each_file.rb
Overview
publish_each over file leaves (no index_filename): one stored leaf file copied to one templated repo path. No prune — each leaf is a single file, not a subtree.
Instance Attribute Summary
Attributes inherited from Mode
Instance Method Summary collapse
Methods inherited from Each
Methods inherited from Mode
Constructor Details
This class inherits a constructor from Textus::Manifest::Entry::Publish::Mode
Instance Method Details
#publish_leaf(row, target_abs, pctx) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/textus/manifest/entry/publish/each_file.rb', line 9 def publish_leaf(row, target_abs, pctx) Textus::Ports::Publisher.publish(source: row[:path], target: target_abs, store_root: pctx.root) pctx.emit(:file_published, key: row[:key], envelope: pctx.reader.call(row[:key]), source: row[:path], target: target_abs) { written: [{ "source" => row[:path], "target" => target_abs }], pruned: [] } end |
#validate! ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/textus/manifest/entry/publish/each_file.rb', line 16 def validate! used_vars = validate_template_basics return if used_vars.intersect?(Template::REQUIRED_DISCRIMINATOR_VARS) raise UsageError.new( "entry '#{entry.key}': publish_each must reference at least one of {leaf}, {basename}, or {key} " \ "(else every leaf would clobber the same target).", ) end |