Sha256: 71282a6b30ec7facb5e72bef88a03f41ce8626c1ad5b2c06e91fe54bcf0ccb05
Contents?: true
Size: 693 Bytes
Versions: 13
Compression:
Stored size: 693 Bytes
Contents
require 'tilt' require 'tilt/template' require 'slight' module Tilt class SlightTemplate < Template self.default_mime_type = 'text/html' def prepare @engine = ::Slight::Engine.new #@engine = ::ERB.new(data, options[:safe], options[:trim], @outvar) end def evaluate(scope, locals, &block) #scope_vars = scope.instance_variables #scope_vars.each do |var| # @engine.instance_variable_set(var, scope.instance_variable_get(var)) #end locals[:__scope] = scope @output ||= @engine.render(file, data, locals) end end register_lazy "SlightTemplate", 'slight/tilt', 'slight', 'rb' end
Version data entries
13 entries across 13 versions & 1 rubygems