Class Tilt::CoffeeScriptTemplate
In: lib/tilt/coffee.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/coffee.rb, line 13
13:     def self.default_bare
14:       @@default_bare
15:     end

[Source]

    # File lib/tilt/coffee.rb, line 17
17:     def self.default_bare=(value)
18:       @@default_bare = value
19:     end

DEPRECATED

[Source]

    # File lib/tilt/coffee.rb, line 22
22:     def self.default_no_wrap
23:       @@default_bare
24:     end

DEPRECATED

[Source]

    # File lib/tilt/coffee.rb, line 27
27:     def self.default_no_wrap=(value)
28:       @@default_bare = value
29:     end

[Source]

    # File lib/tilt/coffee.rb, line 31
31:     def self.engine_initialized?
32:       defined? ::CoffeeScript
33:     end

Public Instance methods

[Source]

    # File lib/tilt/coffee.rb, line 45
45:     def evaluate(scope, locals, &block)
46:       @output ||= CoffeeScript.compile(data, options)
47:     end

[Source]

    # File lib/tilt/coffee.rb, line 35
35:     def initialize_engine
36:       require_template_library 'coffee_script'
37:     end

[Source]

    # File lib/tilt/coffee.rb, line 39
39:     def prepare
40:       if !options.key?(:bare) and !options.key?(:no_wrap)
41:         options[:bare] = self.class.default_bare
42:       end
43:     end

[Validate]