Class: BigBang::DSL::Universe

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Universe

Returns a new instance of Universe.



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

def initialize(&block)
	@instances = []
	@runs = []
	self.instance_eval(&block)
end

Instance Attribute Details

#confObject

Returns the value of attribute conf.



4
5
6
# File 'lib/bigbang/dsl/universe.rb', line 4

def conf
  @conf
end

#instancesObject

Returns the value of attribute instances.



4
5
6
# File 'lib/bigbang/dsl/universe.rb', line 4

def instances
  @instances
end

#runsObject

Returns the value of attribute runs.



4
5
6
# File 'lib/bigbang/dsl/universe.rb', line 4

def runs
  @runs
end

Instance Method Details

#config(&block) ⇒ Object



18
19
20
21
22
# File 'lib/bigbang/dsl/universe.rb', line 18

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

#instance(name, &block) ⇒ Object



12
13
14
15
16
# File 'lib/bigbang/dsl/universe.rb', line 12

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

#run_cluster(name, &block) ⇒ Object



30
31
32
33
34
# File 'lib/bigbang/dsl/universe.rb', line 30

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



24
25
26
27
28
# File 'lib/bigbang/dsl/universe.rb', line 24

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