Class: Textus::Manifest::Entry::Publish::Mode

Inherits:
Object
  • Object
show all
Defined in:
lib/textus/manifest/entry/publish/mode.rb

Overview

Base for every publish mode: wraps the resolved entry and owns the one repo-root escape guard the writing modes share (ADR 0049). Subclasses implement ‘#publish(pctx, prefix:)` returning the existing `{ kind:, value:, pruned: }` shape (or nil), and `#validate!` for the per-mode shape rules reached because this mode resolved.

Direct Known Subclasses

None, ToPaths, Tree

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entry) ⇒ Mode

Returns a new instance of Mode.



11
12
13
# File 'lib/textus/manifest/entry/publish/mode.rb', line 11

def initialize(entry)
  @entry = entry
end

Instance Attribute Details

#entryObject (readonly)

Returns the value of attribute entry.



15
16
17
# File 'lib/textus/manifest/entry/publish/mode.rb', line 15

def entry
  @entry
end

Instance Method Details

#keyless?Boolean

Whether this entry’s subtree files are opaque payload that must never be enumerated as keys. Only Tree (publish_tree, ADR 0047) overrides to true; doctor’s IllegalKeys and the resolver consult this so they stop key-walking a keyless mirror’s files.

Returns:

  • (Boolean)


24
# File 'lib/textus/manifest/entry/publish/mode.rb', line 24

def keyless? = false

#validate!Object

No shape rules by default — ToPaths/None publish without templating.



18
# File 'lib/textus/manifest/entry/publish/mode.rb', line 18

def validate!; end