Class Tilt::CoffeeScriptTemplate
In: lib/tilt.rb
Parent: Template

CoffeeScript template implementation. See: coffeescript.org/

CoffeeScript templates do not support object scopes, locals, or yield.

Methods

Public Class methods

[Source]

     # File lib/tilt.rb, line 595
595:     def self.default_no_wrap
596:       @@default_no_wrap
597:     end

[Source]

     # File lib/tilt.rb, line 599
599:     def self.default_no_wrap=(value)
600:       @@default_no_wrap = value
601:     end

Public Instance methods

[Source]

     # File lib/tilt.rb, line 613
613:     def evaluate(scope, locals, &block)
614:       @output ||= CoffeeScript.compile(data, :no_wrap => @no_wrap)
615:     end

[Source]

     # File lib/tilt.rb, line 603
603:     def initialize_engine
604:       return if defined? ::CoffeeScript
605:       require_template_library 'coffee_script'
606:     end

[Source]

     # File lib/tilt.rb, line 608
608:     def prepare
609:       @no_wrap = options.key?(:no_wrap) ? options[:no_wrap] :
610:         self.class.default_no_wrap
611:     end

[Validate]