Sha256: 7a93217f0b59c32457fd557fb684413323738e3148cabbcd73e72b50a2e51243
Contents?: true
Size: 550 Bytes
Versions: 11
Compression:
Stored size: 550 Bytes
Contents
# encoding: utf-8 module LocalPac class TemplateRepository private attr_reader :root_directory, :creator public def initialize(root_directory = File.expand_path('../../../files', __FILE__), creator = TemplateFile) @root_directory = root_directory @creator = creator end def find(name) path = File.join(root_directory, "#{name.to_s}.erb") fail Exceptions::ErbTemplateIsUnknown, "Template \"#{name}\" could not be found!" unless ::File.exist? path creator.new(path) end end end
Version data entries
11 entries across 11 versions & 1 rubygems