Module: Babushka::DSL

Defined in:
lib/babushka/dsl.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) Dep(spec, opts = {})

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.



7
8
9
# File 'lib/babushka/dsl.rb', line 7

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

- (Object) dep(name, *params, &block)

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.



15
16
17
# File 'lib/babushka/dsl.rb', line 15

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

- (Object) meta(name, opts = {}, &block)

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.



22
23
24
# File 'lib/babushka/dsl.rb', line 22

def meta name, opts = {}, &block
  Base.sources.current_load_source.templates.add_template name, opts, block
end