Class: GitCompound::DSL::ManifestDSL

Inherits:
Object
  • Object
show all
Defined in:
lib/git_compound/dsl/manifest_dsl.rb

Overview

DSL for Manifest

Instance Method Summary collapse

Constructor Details

#initialize(manifest, contents) ⇒ ManifestDSL

Returns a new instance of ManifestDSL.



8
9
10
11
# File 'lib/git_compound/dsl/manifest_dsl.rb', line 8

def initialize(manifest, contents)
  @manifest = manifest
  instance_eval(contents)
end

Instance Method Details

#component(name, &block) ⇒ Object



21
22
23
# File 'lib/git_compound/dsl/manifest_dsl.rb', line 21

def component(name, &block)
  @manifest.components.store(name.to_sym, Component.new(name, @manifest, &block))
end

#maintainer(*component_maintainer) ⇒ Object



17
18
19
# File 'lib/git_compound/dsl/manifest_dsl.rb', line 17

def maintainer(*component_maintainer)
  @manifest.maintainer = component_maintainer
end

#name(component_name) ⇒ Object



13
14
15
# File 'lib/git_compound/dsl/manifest_dsl.rb', line 13

def name(component_name)
  @manifest.name = component_name.to_sym
end

#task(name, type = nil, &block) ⇒ Object



25
26
27
28
# File 'lib/git_compound/dsl/manifest_dsl.rb', line 25

def task(name, type = nil, &block)
  new_task = Task.factory(name, type, @manifest, &block)
  @manifest.tasks.store(name.to_sym, new_task) if new_task
end