Module: Babushka::DSL

Defined in:
lib/babushka/dsl.rb

Class Method Summary collapse

Class Method Details

.Dep(spec, opts = {}) ⇒ Object

Use spec to look up a dep. Because spec might include a source prefix, the dep this method returns could be from any of the currently known sources. If no dep matching spec is found, nil is returned.


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

def Dep spec, opts = {}
  Base.sources.dep_for(spec, opts)
end

.dep(name, *params, &block) ⇒ Object

Define and return a dep named name, and whose implementation is found in block. This is the usual top-level entry point of the babushka DSL (along with meta); templated or not, this is how deps are defined.


18
19
20
# File 'lib/babushka/dsl.rb', line 18

def dep name, *params, &block
  Base.sources.current_load_source.deps.add_dep(name, params, block)
end

.meta(name, &block) ⇒ Object

Define and return a meta dep named name, and whose implementation is found in block. This method, along with +dep, together are the top level of babushka's DSL.


25
26
27
# File 'lib/babushka/dsl.rb', line 25

def meta name, &block
  Base.sources.current_load_source.templates.add_template(name, block)
end