Class: Pike::DSL::Pikefile

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.load(filename) ⇒ Object

Loads a Pike DSL basef file



8
9
10
11
12
# File 'lib/pike/dsl/pikefile.rb', line 8

def self.load(filename)
  dsl = new
  dsl.instance_eval File.read(filename), filename
  dsl
end

Instance Method Details

#env(name, &block) ⇒ Object

DSL Function to add a environment



46
47
48
# File 'lib/pike/dsl/pikefile.rb', line 46

def env(name, &block)
	Main.add_env name, &block
end

#get(key) ⇒ Object

DSL Function to get a variables values



28
29
30
# File 'lib/pike/dsl/pikefile.rb', line 28

def get(key)
	Main.get_var key
end

#task(name, &block) ⇒ Object

DSL Function to add a task



37
38
39
# File 'lib/pike/dsl/pikefile.rb', line 37

def task(name, &block)
	Main.add_task name, &block
end

#var(vars = {}) ⇒ Object

DSL Function to set variables



19
20
21
# File 'lib/pike/dsl/pikefile.rb', line 19

def var(vars = {})
	Main.set_var vars
end