class Glim::LocalFileSystem
Public Class Methods
new(*paths)
click to toggle source
# File lib/liquid_ext.rb, line 233 def initialize(*paths) @paths = paths.reject { |path| path.nil? } end
Public Instance Methods
read_template_file(name)
click to toggle source
# File lib/liquid_ext.rb, line 237 def read_template_file(name) @cache ||= {} unless @cache[name] paths = @paths.map { |path| File.join(path, name) } if file = paths.find { |path| File.exist?(path) } @cache[name] = Glim.preprocess_template(File.read(file)) end end @cache[name] end