Sha256: 205e7095fbb33d3aefc247956a1161d53871edad45195ce5fda0062903775ce0
Contents?: true
Size: 556 Bytes
Versions: 7
Compression:
Stored size: 556 Bytes
Contents
module Bonsai class Template @@path = "templates" class NotFound < StandardError; end class << self def path; @@path; end def path=(path) @@path = path 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 attr_reader :path def initialize(path) @path = path end end end
Version data entries
7 entries across 7 versions & 1 rubygems