class FileTemplateSource

Public Class Methods

new() click to toggle source
Calls superclass method Tiller::TemplateSource::new
# File lib/tiller/template/file.rb, line 5
def initialize
  super
  @template_dir = File.join(Tiller::config[:tiller_base], 'templates/')
end

Public Instance Methods

template(template_name) click to toggle source

Just open and return the file

# File lib/tiller/template/file.rb, line 19
def template(template_name)
  open(File.join(@template_dir, template_name)).read
end
templates() click to toggle source

Simply return a list of all the templates in the $tiller_base/templates directory with the preceeding directory path stripped off

# File lib/tiller/template/file.rb, line 12
def templates
  Dir.glob(File.join(@template_dir, '**', '*.erb')).each do |t|
    t.sub!(@template_dir, '')
  end
end