Class: Textus::Protocol::Manifest

Inherits:
Data
  • Object
show all
Defined in:
lib/textus/protocol/manifest.rb,
lib/textus/protocol/manifest.rb,
lib/textus/protocol/manifest/data.rb,
lib/textus/protocol/manifest/entry.rb,
lib/textus/protocol/manifest/policy.rb,
lib/textus/protocol/manifest/schema.rb,
lib/textus/protocol/manifest/resolver.rb,
lib/textus/protocol/manifest/entry/base.rb,
lib/textus/protocol/manifest/entry/leaf.rb,
lib/textus/protocol/manifest/entry/nested.rb,
lib/textus/protocol/manifest/entry/parser.rb,
lib/textus/protocol/manifest/entry/publish.rb,
lib/textus/protocol/manifest/schema/contract.rb,
lib/textus/protocol/manifest/schema/validator.rb,
lib/textus/protocol/manifest/policy/publish_target.rb

Defined Under Namespace

Modules: Schema Classes: Data, Entry, Policy, Resolver

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data

Returns:

  • (Object)

    the current value of data



5
6
7
# File 'lib/textus/protocol/manifest.rb', line 5

def data
  @data
end

#policyObject (readonly)

Returns the value of attribute policy

Returns:

  • (Object)

    the current value of policy



5
6
7
# File 'lib/textus/protocol/manifest.rb', line 5

def policy
  @policy
end

#resolverObject (readonly)

Returns the value of attribute resolver

Returns:

  • (Object)

    the current value of resolver



5
6
7
# File 'lib/textus/protocol/manifest.rb', line 5

def resolver
  @resolver
end

Class Method Details

.load(root) ⇒ Object

Raises:



24
25
26
27
28
29
30
31
# File 'lib/textus/protocol/manifest.rb', line 24

def load(root)
  manifest_path = File.join(root, "manifest.yaml")
  raise IoError.new("manifest not found: #{manifest_path}") unless File.exist?(manifest_path)

  raw = YAML.safe_load_file(manifest_path, aliases: true)
  check_version!(raw, manifest_path)
  build(raw, root)
end

.parse(yaml_text, root: ".") ⇒ Object



18
19
20
21
22
# File 'lib/textus/protocol/manifest.rb', line 18

def parse(yaml_text, root: ".")
  raw = YAML.safe_load(yaml_text, aliases: true)
  check_version!(raw, "<string>")
  build(raw, root)
end