class Pantograph::ErbTemplateHelper

Public Class Methods

load(template_name) click to toggle source
# File pantograph/lib/pantograph/erb_template_helper.rb, line 4
def self.load(template_name)
  path = "#{Pantograph::ROOT}/lib/assets/#{template_name}.erb"
  load_from_path(path)
end
load_from_path(template_filepath) click to toggle source
# File pantograph/lib/pantograph/erb_template_helper.rb, line 9
def self.load_from_path(template_filepath)
  unless File.exist?(template_filepath)
    UI.user_error!("Could not find template at path '#{template_filepath}'")
  end
  File.read(template_filepath)
end
render(template, template_vars_hash, trim_mode = nil) click to toggle source
# File pantograph/lib/pantograph/erb_template_helper.rb, line 16
def self.render(template, template_vars_hash, trim_mode = nil)
  Pantograph::ErbalT.new(template_vars_hash, trim_mode).render(template)
end