Class: BigBang::DSL

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDSL

Returns a new instance of DSL.



10
11
12
13
# File 'lib/bigbang/dsl.rb', line 10

def initialize
	@instances = []
	@runs = []
end

Instance Attribute Details

#confObject

Returns the value of attribute conf.



8
9
10
# File 'lib/bigbang/dsl.rb', line 8

def conf
  @conf
end

#instancesObject

Returns the value of attribute instances.



8
9
10
# File 'lib/bigbang/dsl.rb', line 8

def instances
  @instances
end

#runsObject

Returns the value of attribute runs.



8
9
10
# File 'lib/bigbang/dsl.rb', line 8

def runs
  @runs
end

Instance Method Details

#config(&block) ⇒ Object



21
22
23
24
25
# File 'lib/bigbang/dsl.rb', line 21

def config(&block)
	@conf = Config.new.tap do |c|
		c.instance_eval(&block)
	end
end

#instance(name, &block) ⇒ Object



15
16
17
18
19
# File 'lib/bigbang/dsl.rb', line 15

def instance(name, &block)
	@instances << Instance.new(name).tap do |i|
		i.instance_eval(&block)
	end
end

#run_cluster(name, &block) ⇒ Object



33
34
35
36
37
# File 'lib/bigbang/dsl.rb', line 33

def run_cluster(name, &block)
	@runs << ClusterRun.new(name, @instances).tap do |r|
		r.instance_eval(&block)
	end
end

#run_single_instance(name, &block) ⇒ Object



27
28
29
30
31
# File 'lib/bigbang/dsl.rb', line 27

def run_single_instance(name, &block)
	@runs << Run.new(name, @instances).tap do |r|
		r.instance_eval(&block)
	end
end