Class: Textus::Manifest::Entry::Nested

Inherits:
Base show all
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

REGISTRY

Instance Attribute Summary collapse

Attributes inherited from Base

#format, #key, #owner, #path, #publish_targets, #raw, #schema, #zone

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#derived?, #events, #external?, #in_proposal_zone?, #intake?, #leaf?, #projection?, #publish_mode, #publish_to, #publish_tree, #publish_via, #tracked?, #zone_writers

Constructor Details

#initialize(ignore: nil, **rest) ⇒ Nested

Returns a new instance of Nested.



11
12
13
14
# File 'lib/textus/manifest/entry/nested.rb', line 11

def initialize(ignore: nil, **rest)
  super(**rest)
  @ignore = Array(ignore)
end

Instance Attribute Details

#ignoreObject (readonly)

Returns the value of attribute ignore.



9
10
11
# File 'lib/textus/manifest/entry/nested.rb', line 9

def ignore
  @ignore
end

Class Method Details

.from_raw(common, raw) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/textus/manifest/entry/nested.rb', line 25

def self.from_raw(common, raw)
  # publish_tree is derived from publish_targets (ADR 0094) via Base#publish_tree
  new(
    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.

Returns:

  • (Boolean)


21
# File 'lib/textus/manifest/entry/nested.rb', line 21

def ignored?(rel_path) = IgnoreMatcher.match?(@ignore, rel_path)

#nested?Boolean

Returns:

  • (Boolean)


16
# File 'lib/textus/manifest/entry/nested.rb', line 16

def nested? = true