Class: Textus::Manifest::Entry::Produced

Inherits:
Base show all
Defined in:
lib/textus/manifest/entry/produced.rb

Overview

A produced entry — ‘kind: produced` with an optional `source:` block. When `source:` is present it must be `from: external` (out-of-band generator; textus detects drift but never runs it). When absent the entry is produced by a workflow file in .textus/workflows/.

Constant Summary collapse

KIND =
:produced

Constants inherited from Textus::Manifest::Entry

REGISTRY

Instance Attribute Summary collapse

Attributes inherited from Base

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#derived?, #events, #ignore, #ignored?, #in_proposal_lane?, #intake?, #lane_writers, #leaf?, #projection?, #publish_mode, #publish_to, #publish_tree, #tracked?

Constructor Details

#initialize(source:, **rest) ⇒ Produced

Returns a new instance of Produced.



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

def initialize(source:, **rest)
  super(**rest)
  @source = source
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



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

def source
  @source
end

Class Method Details

.from_raw(common, raw) ⇒ Object



28
29
30
# File 'lib/textus/manifest/entry/produced.rb', line 28

def self.from_raw(common, raw)
  new(source: Parser.parse_source(raw, common[:key]), **common)
end

Instance Method Details

#external?Boolean

Returns:

  • (Boolean)


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

def external? = @source&.external? || false

#nested?Boolean

Returns:

  • (Boolean)


17
# File 'lib/textus/manifest/entry/produced.rb', line 17

def nested?   = !!@raw["nested"]

#publish_via(pctx, prefix: nil) ⇒ Object

Publish existing store bytes via the shared publish mode (Publish::ToPaths or Publish::None). Workflow runners handle the produce step; this method only publishes whatever bytes are already on disk.



24
25
26
# File 'lib/textus/manifest/entry/produced.rb', line 24

def publish_via(pctx, prefix: nil)
  publish_mode.publish(pctx, prefix: prefix)
end