Class: Textus::Manifest::Entry::Nested
- Inherits:
-
Base
- Object
- Textus::Manifest::Entry
- Base
- Textus::Manifest::Entry::Nested
- Defined in:
- lib/textus/manifest/entry/nested.rb
Overview
A directory entry: enumerates a tree of leaves and resolves to one publish mode (ADR 0049). The publish algorithms themselves live in Entry::Publish::* — Nested is just the value (attributes + ignore predicate) those modes read.
Constant Summary collapse
- KIND =
:nested
Constants inherited from Textus::Manifest::Entry
Instance Attribute Summary collapse
-
#ignore ⇒ Object
readonly
Returns the value of attribute ignore.
-
#publish_tree ⇒ Object
readonly
Returns the value of attribute publish_tree.
Attributes inherited from Base
#format, #key, #owner, #path, #publish_to, #raw, #schema, #zone
Class Method Summary collapse
Instance Method Summary collapse
-
#ignored?(rel_path) ⇒ Boolean
True when ‘rel_path` (slash-joined, relative to the entry base) matches any configured ignore glob.
-
#initialize(publish_tree: nil, ignore: nil, **rest) ⇒ Nested
constructor
A new instance of Nested.
- #nested? ⇒ Boolean
Methods inherited from Base
#derived?, #events, #in_generator_zone?, #in_proposal_zone?, #inject_boot, #intake?, #leaf?, #publish_mode, #publish_via, #template, #tracked?, #zone_writers
Constructor Details
#initialize(publish_tree: nil, ignore: nil, **rest) ⇒ Nested
Returns a new instance of Nested.
11 12 13 14 15 |
# File 'lib/textus/manifest/entry/nested.rb', line 11 def initialize(publish_tree: nil, ignore: nil, **rest) super(**rest) @publish_tree = publish_tree @ignore = Array(ignore) end |
Instance Attribute Details
#ignore ⇒ Object (readonly)
Returns the value of attribute ignore.
9 10 11 |
# File 'lib/textus/manifest/entry/nested.rb', line 9 def ignore @ignore end |
#publish_tree ⇒ Object (readonly)
Returns the value of attribute publish_tree.
9 10 11 |
# File 'lib/textus/manifest/entry/nested.rb', line 9 def publish_tree @publish_tree end |
Class Method Details
.from_raw(common, raw) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/textus/manifest/entry/nested.rb', line 26 def self.from_raw(common, raw) new( publish_tree: raw.dig("publish", "tree"), # ADR 0052: typed publish block ignore: raw["ignore"], **common, ) end |
Instance Method Details
#ignored?(rel_path) ⇒ Boolean
True when ‘rel_path` (slash-joined, relative to the entry base) matches any configured ignore glob. Evaluated ABOVE key-legality (ADR 0042): an ignored path is excluded, never judged.
22 |
# File 'lib/textus/manifest/entry/nested.rb', line 22 def ignored?(rel_path) = IgnoreMatcher.match?(@ignore, rel_path) |
#nested? ⇒ Boolean
17 |
# File 'lib/textus/manifest/entry/nested.rb', line 17 def nested? = true |