Class: Templater::Actions::File

Class | Templater::Actions::File
In: | lib/templater/actions/file.rb
Parent: | Action

### Methods

exists? identical? invoke! new render revoke!

### Public Class methods

new(generator, name, source, destination, options={})

Builds a new file.

### Parameters

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

### Public Instance methods

exists?()

Checks if the destination file already exists.

### Returns

Boolean: | true if the file exists, false otherwise.

identical?()

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.

invoke!()

Renders the template and copies it to the destination.

render()

Returns the contents of the source file as a String

### Returns

String: | The source file.

revoke!()

removes the destination file

[Validate]