Class: Textus::Protocol::Manifest::Entry::Base::PublishContext

Inherits:
Data
  • Object
show all
Defined in:
lib/textus/protocol/manifest/entry/base.rb

Overview

Minimal context object passed into entry publish_via hooks. Everything beyond the three primitives is derived.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#containerObject (readonly)

Returns the value of attribute container

Returns:

  • (Object)

    the current value of container



52
53
54
# File 'lib/textus/protocol/manifest/entry/base.rb', line 52

def container
  @container
end

#readerObject (readonly)

Returns the value of attribute reader

Returns:

  • (Object)

    the current value of reader



52
53
54
# File 'lib/textus/protocol/manifest/entry/base.rb', line 52

def reader
  @reader
end

Instance Method Details

#emit(_event, **_payload) ⇒ Object

No-op: event bus removed in workflow redesign; callers that fire :entry_published / :entry_produced remain unchanged in the source.



60
# File 'lib/textus/protocol/manifest/entry/base.rb', line 60

def emit(_event, **_payload) = nil

#manifestObject



53
# File 'lib/textus/protocol/manifest/entry/base.rb', line 53

def manifest   = container.manifest

#read_template(name) ⇒ Object

Read a named template from the store's templates/ directory. Raises TemplateError when the file doesn't exist.



64
65
66
67
68
69
70
71
72
73
# File 'lib/textus/protocol/manifest/entry/base.rb', line 64

def read_template(name)
  path = container.layout.template_path(name)
  unless File.exist?(path)
    raise Textus::TemplateError.new(
      "template '#{name}' not found",
      template_name: name,
    )
  end
  File.read(path)
end

#repo_rootObject



55
# File 'lib/textus/protocol/manifest/entry/base.rb', line 55

def repo_root  = File.dirname(container.root)

#rootObject



54
# File 'lib/textus/protocol/manifest/entry/base.rb', line 54

def root       = container.root

#store_rootObject



56
# File 'lib/textus/protocol/manifest/entry/base.rb', line 56

def store_root = container.root