Class Templater::Actions::Template
In: lib/templater/actions/template.rb
Parent: Action

Methods

exists?   identical?   invoke!   new   render   revoke!  

Public Class methods

Builds a new template.

Parameters

generator<Object>:Context for rendering
name<Symbol>:The name of this template
source<String>:Full path to the source of this template
destination<String>:Full path to the destination of this template
options<Hash{Symbol=>Symbol}:Options, including callbacks.

Public Instance methods

Checks if the destination file already exists.

Returns

Boolean:true if the file exists, false otherwise.

Checks if the content of the file at the destination is identical to the rendered result.

Returns

Boolean:true if it is identical, false otherwise.

Renders the template and copies it to the destination.

Renders the template using ERB and returns the result as a String.

Returns

String:The rendered template.

removes the destination file

[Validate]