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

Version Path
slight-lang-1.3.6 lib/slight/tilt.rb
slight-lang-1.3.5 lib/slight/tilt.rb
slight-lang-1.3.4 lib/slight/tilt.rb
slight-lang-1.3.3 lib/slight/tilt.rb
slight-lang-1.3.2 lib/slight/tilt.rb
slight-lang-1.3.1 lib/slight/tilt.rb
slight-lang-1.3.0 lib/slight/tilt.rb
slight-lang-1.2.3 lib/slight/tilt.rb
slight-lang-1.2.1.3 lib/slight/tilt.rb
slight-lang-1.2.1.2 lib/slight/tilt.rb
slight-lang-1.2.1.1 lib/slight/tilt.rb
slight-lang-1.1.6 lib/slight/tilt.rb
slight-lang-1.2.0 lib/slight/tilt.rb