Class: Batali::Manifest
- Includes:
- Bogo::Memoization
- Defined in:
- lib/batali/manifest.rb
Overview
Collection of resolved units
Class Method Summary collapse
-
.build(path) ⇒ Manifest
Build manifest from given path.
Instance Method Summary collapse
-
#include?(unit) ⇒ TrueClass, FalseClass
Check for unit within manifest.
Class Method Details
.build(path) ⇒ Manifest
Build manifest from given path. If no file exists, empty manifest will be provided.
18 19 20 21 22 23 24 |
# File 'lib/batali/manifest.rb', line 18 def self.build(path) if(File.exist?(path)) new(Bogo::Config.new(path).data.merge(:path => path)) else new(:path => path) end end |
Instance Method Details
#include?(unit) ⇒ TrueClass, FalseClass
Check for unit within manifest
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/batali/manifest.rb', line 30 def include?(unit) memoize(unit.inspect) do if(cookbook) !!cookbook.detect do |ckbk| ckbk.name == unit.name && ckbk.version == unit.version end else false end end end |