Module: Mattock::TemplateTaskLib Deprecated

Includes:
TemplateHost
Defined in:
lib/mattock/template-host.rb

Overview

Deprecated.

Use Valise::Set#templates instead

Instance Attribute Summary

Attributes included from TemplateHost

#valise

Instance Method Summary collapse

Methods included from TemplateHost

#find_template, #render, #template, #template_path, #templates_are_in

Instance Method Details

#template_task(template_source, destination_path, template_options = nil) ⇒ Object

Deprecated.

Use Valise::Set#templates instead



53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/mattock/template-host.rb', line 53

def template_task(template_source, destination_path, template_options = nil)
  unless template_options.nil?
    valise.add_serialization_handler(template_source, :tilt, :template_options => template_options)
  end

  file template_path(template_source)
  file destination_path => template_path(template_source) do
    File::open(destination_path, "w") do |file|
      file.write(render(template_source))
    end
  end
end