Module: Mattock::TemplateHost Deprecated

Included in:
TemplateTaskLib
Defined in:
lib/mattock/template-host.rb

Overview

Deprecated.

Use Valise::Set#templates instead

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#valiseObject

Returns the value of attribute valise.



19
20
21
# File 'lib/mattock/template-host.rb', line 19

def valise
  @valise
end

Instance Method Details

#find_template(path) ⇒ Object

XXX Better to let clients stem or subset



26
27
28
# File 'lib/mattock/template-host.rb', line 26

def find_template(path)
  valise.find(path)
end

#render(path) ⇒ Object



38
39
40
41
42
43
44
45
# File 'lib/mattock/template-host.rb', line 38

def render(path)
  locals = {}
  if block_given?
    yield locals
  end

  template(path).render(self, locals)
end

#template(path) ⇒ Object



30
31
32
# File 'lib/mattock/template-host.rb', line 30

def template(path)
  find_template(path).contents
end

#template_path(path) ⇒ Object



34
35
36
# File 'lib/mattock/template-host.rb', line 34

def template_path(path)
  find_template(path).full_path
end

#templates_are_in(valise) ⇒ Object



21
22
23
# File 'lib/mattock/template-host.rb', line 21

def templates_are_in(valise)
  self.valise = valise.templates
end