Module: DocOpsLab::Dev::Manifest

Defined in:
lib/docopslab/dev/manifest.rb

Overview

Thin wrapper around the project manifest (.config/docopslab-dev.yml). Shared by tools, sync, and library operations that need manifest data.

Class Method Summary collapse

Class Method Details

.load(path = Dev::MANIFEST_PATH) ⇒ Object

Load a project manifest YAML file. Returns the parsed hash or nil if the file is absent or unreadable.



13
14
15
16
17
18
19
# File 'lib/docopslab/dev/manifest.rb', line 13

def load path=Dev::MANIFEST_PATH
  return nil unless File.exist?(path)

  YAML.load_file(path)
rescue StandardError
  nil
end

.valid?(data) ⇒ Boolean

True if data is a non-empty Hash.

Returns:

  • (Boolean)


22
23
24
# File 'lib/docopslab/dev/manifest.rb', line 22

def valid? data
  data.is_a?(Hash) && !data.empty?
end