Class: Milestoner::Tags::Manifest
- Inherits:
-
Object
- Object
- Milestoner::Tags::Manifest
- Defined in:
- lib/milestoner/tags/manifest.rb
Overview
Manages build manifest.
Instance Method Summary collapse
- #build_path ⇒ Object
- #diff(path = build_path) ⇒ Object
-
#initialize(name: "manifest.json") ⇒ Manifest
constructor
A new instance of Manifest.
- #read(path = build_path) ⇒ Object
- #write(path = build_path) ⇒ Object
Constructor Details
#initialize(name: "manifest.json") ⇒ Manifest
Returns a new instance of Manifest.
17 18 19 20 |
# File 'lib/milestoner/tags/manifest.rb', line 17 def initialize(name: "manifest.json", **) super(**) @name = name end |
Instance Method Details
#build_path ⇒ Object
22 |
# File 'lib/milestoner/tags/manifest.rb', line 22 def build_path = settings.build_output.join name |
#diff(path = build_path) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/milestoner/tags/manifest.rb', line 24 def diff path = build_path git..value_or(Core::EMPTY_ARRAY).then do || return Core::EMPTY_HASH if .empty? content_for().diff read(path) end end |
#read(path = build_path) ⇒ Object
32 |
# File 'lib/milestoner/tags/manifest.rb', line 32 def read(path = build_path) = JSON(path.read, {symbolize_names: true}) |
#write(path = build_path) ⇒ Object
34 35 36 |
# File 'lib/milestoner/tags/manifest.rb', line 34 def write(path = build_path, **) path.make_ancestors.write JSON.pretty_generate(generator.deep_merge(**)) end |