class AppArchetype::Template::OutputFile

OutputFile represents a plan action, in other words holds a reference to a source file, and what the output is likely to be

Attributes

path[R]
source_file_path[R]

Public Class Methods

new(source_file_path, path) click to toggle source

Creates an output file

@param [String] source_file_path @param [String] path

# File lib/app_archetype/template/plan.rb, line 120
def initialize(source_file_path, path)
  @source_file_path = source_file_path
  @path = path
end

Public Instance Methods

exist?() click to toggle source

Evaluates whether the source file actually exists

@return [Boolean]

# File lib/app_archetype/template/plan.rb, line 167
def exist?
  File.exist?(@path)
end
source_directory?() click to toggle source

Evaluates whether the source file is a directory

@return [Boolean]

# File lib/app_archetype/template/plan.rb, line 130
def source_directory?
  File.directory?(@source_file_path)
end
source_erb?() click to toggle source

Evaluates whether the source file is a erb template

@return [Boolean]

# File lib/app_archetype/template/plan.rb, line 139
def source_erb?
  File.extname(@source_file_path) == '.erb'
end
source_file?() click to toggle source

Evaluates whether the source file is a file as opposed to being a directory.

@return [Boolean]

# File lib/app_archetype/template/plan.rb, line 158
def source_file?
  File.file?(@source_file_path)
end
source_hbs?() click to toggle source

Evaluates whether the source file is a handlebars template

@return [Boolean]

# File lib/app_archetype/template/plan.rb, line 148
def source_hbs?
  File.extname(@source_file_path) == '.hbs'
end