Sha256: efe8561ae33488efe1293be85bb430e49e947e1213f29e50eb8a3f9dacb249bc
Contents?: true
Size: 565 Bytes
Versions: 15
Compression:
Stored size: 565 Bytes
Contents
module Bonsai class Template class NotFound < StandardError; end # Class methods class << self attr_accessor :path def path @path || "templates" end def find(name) disk_path = Dir["#{path}/#{name}.*"] if disk_path.any? new disk_path.first else raise NotFound, "template '#{name}' not found at #{path}" end end end # Instance methods attr_reader :path def initialize(path) @path = path end end end
Version data entries
15 entries across 15 versions & 1 rubygems