Class: Textus::Manifest::Policy::Source

Inherits:
Object
  • Object
show all
Defined in:
lib/textus/manifest/policy/source.rb

Overview

An entry’s external-generator declaration. ‘source:` now means ONLY `from: external` — out-of-band runner; textus never invokes it, only detects drift (doctor generator_drift check). `from: fetch` and `from: derive` are removed; those concerns now live in workflow files under .textus/workflows/.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ Source

Returns a new instance of Source.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/textus/manifest/policy/source.rb', line 12

def initialize(raw)
  from = raw["from"].to_s
  unless from == "external"
    raise Textus::BadManifest.new(
      "from: #{from} is removed — use a workflow file under .textus/workflows/ instead",
    )
  end

  @command = raw["command"] or
    raise Textus::BadManifest.new("source (from: external) requires a `command:` field")
  @sources = raw["sources"] || []
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



10
11
12
# File 'lib/textus/manifest/policy/source.rb', line 10

def command
  @command
end

#sourcesObject (readonly)

Returns the value of attribute sources.



10
11
12
# File 'lib/textus/manifest/policy/source.rb', line 10

def sources
  @sources
end

Instance Method Details

#external?Boolean

Returns:

  • (Boolean)


25
# File 'lib/textus/manifest/policy/source.rb', line 25

def external? = true

#kindObject



26
# File 'lib/textus/manifest/policy/source.rb', line 26

def kind      = :external