Class: GitCompound::Manifest
Overview
Manifest
Constant Summary collapse
- FILENAMES =
%w(Compoundfile .gitcompound)
Instance Attribute Summary collapse
-
#components ⇒ Object
Returns the value of attribute components.
-
#maintainer ⇒ Object
Returns the value of attribute maintainer.
-
#name ⇒ Object
Returns the value of attribute name.
-
#tasks ⇒ Object
Returns the value of attribute tasks.
Attributes inherited from Node
Instance Method Summary collapse
- #==(other) ⇒ Object
- #exists? ⇒ Boolean
-
#initialize(contents, parent = nil) ⇒ Manifest
constructor
A new instance of Manifest.
- #md5sum ⇒ Object
- #process(*workers) ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(contents, parent = nil) ⇒ Manifest
Returns a new instance of Manifest.
11 12 13 14 15 16 17 18 19 |
# File 'lib/git_compound/manifest.rb', line 11 def initialize(contents, parent = nil) @contents = contents @parent = parent @name = '' @maintainer = [] @components = {} @tasks = {} DSL::ManifestDSL.new(self, contents) if contents end |
Instance Attribute Details
#components ⇒ Object
Returns the value of attribute components.
7 8 9 |
# File 'lib/git_compound/manifest.rb', line 7 def components @components end |
#maintainer ⇒ Object
Returns the value of attribute maintainer.
7 8 9 |
# File 'lib/git_compound/manifest.rb', line 7 def maintainer @maintainer end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/git_compound/manifest.rb', line 7 def name @name end |
#tasks ⇒ Object
Returns the value of attribute tasks.
7 8 9 |
# File 'lib/git_compound/manifest.rb', line 7 def tasks @tasks end |
Instance Method Details
#==(other) ⇒ Object
27 28 29 30 |
# File 'lib/git_compound/manifest.rb', line 27 def ==(other) return false unless other.instance_of? Manifest md5sum == other.md5sum end |
#exists? ⇒ Boolean
32 33 34 |
# File 'lib/git_compound/manifest.rb', line 32 def exists? @contents ? true : false end |
#md5sum ⇒ Object
36 37 38 |
# File 'lib/git_compound/manifest.rb', line 36 def md5sum Digest::MD5.hexdigest(@contents) if exists? end |
#process(*workers) ⇒ Object
21 22 23 24 25 |
# File 'lib/git_compound/manifest.rb', line 21 def process(*workers) workers.each { |worker| worker.visit_manifest(self) } components.each_value { |component| component.process(*workers) } tasks.each_value { |task| workers.each { |worker| worker.visit_task(task) } } end |