Module: Benny::DSL

Included in:
Benny
Defined in:
lib/benny/dsl.rb

Defined Under Namespace

Classes: Definition

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#definitionsObject (readonly)

Returns the value of attribute definitions.



67
68
69
# File 'lib/benny/dsl.rb', line 67

def definitions
  @definitions
end

#environmentsObject (readonly)

Returns the value of attribute environments.



67
68
69
# File 'lib/benny/dsl.rb', line 67

def environments
  @environments
end

Instance Method Details

#benchmarksObject



51
52
53
# File 'lib/benny/dsl.rb', line 51

def benchmarks
  definitions.flat_map(&:benchmarks)
end

#configurationObject



59
60
61
# File 'lib/benny/dsl.rb', line 59

def configuration
  @configuration ||= Configuration.new
end

#configure {|configuration| ... } ⇒ Object

Yields:



63
64
65
# File 'lib/benny/dsl.rb', line 63

def configure
  yield(configuration)
end

#define(&block) ⇒ Object



46
47
48
49
# File 'lib/benny/dsl.rb', line 46

def define(&block)
  @definitions ||= []
  @definitions << Definition.new(&block)
end

#load(path) ⇒ Object



55
56
57
# File 'lib/benny/dsl.rb', line 55

def load(path)
  instance_eval(File.read(path), path, 1)
end