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

Inherits:
Data
  • Object
show all
Defined in:
lib/textus/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

#callObject (readonly)

Returns the value of attribute call

Returns:

  • (Object)

    the current value of call



66
67
68
# File 'lib/textus/manifest/entry/base.rb', line 66

def call
  @call
end

#containerObject (readonly)

Returns the value of attribute container

Returns:

  • (Object)

    the current value of container



66
67
68
# File 'lib/textus/manifest/entry/base.rb', line 66

def container
  @container
end

#readerObject (readonly)

Returns the value of attribute reader

Returns:

  • (Object)

    the current value of reader



66
67
68
# File 'lib/textus/manifest/entry/base.rb', line 66

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.



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

def emit(_event, **_payload) = nil

#manifestObject



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

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.



77
78
79
80
81
82
83
84
85
86
# File 'lib/textus/manifest/entry/base.rb', line 77

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

#repo_rootObject



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

def repo_root  = File.dirname(container.root)

#rootObject



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

def root       = container.root