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_to, #raw, #schema, #zone

Class Method Summary collapse

Instance Method Summary collapse

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(index_filename: nil, publish_each: nil, publish_tree: nil, ignore: nil, **rest) ⇒ Nested

Returns a new instance of Nested.



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

def initialize(index_filename: nil, publish_each: nil, publish_tree: nil, ignore: nil, **rest)
  super(**rest)
  @index_filename = index_filename
  @publish_each = publish_each
  @publish_tree = publish_tree
  @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

#index_filenameObject (readonly)

Returns the value of attribute index_filename.



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

def index_filename
  @index_filename
end

#publish_eachObject (readonly)

Returns the value of attribute publish_each.



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

def publish_each
  @publish_each
end

#publish_treeObject (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



28
29
30
31
32
33
34
35
36
# File 'lib/textus/manifest/entry/nested.rb', line 28

def self.from_raw(common, raw)
  new(
    index_filename: raw["index_filename"],
    publish_each: raw["publish_each"],
    publish_tree: raw["publish_tree"],
    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)


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

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

#nested?Boolean

Returns:

  • (Boolean)


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

def nested? = true