Sha256: 145f3a097c3d04e06ec2317aeb5ad38a097790088434f6c194308b32bf845f1c
Contents?: true
Size: 576 Bytes
Versions: 20
Compression:
Stored size: 576 Bytes
Contents
# encoding: utf-8 module TestServer class TemplateRepository private attr_reader :root_directory, :creator public def initialize(root_directory = ::File.expand_path('../../../files', __FILE__), creator = TemplateFile) @root_directory = ::File.expand_path(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
20 entries across 20 versions & 1 rubygems