Class: Ember::ES6Template::CoffeeScript

Inherits:
ES6
  • Object
show all
Includes:
CoffeeScriptHelper
Defined in:
lib/ember/es6_template/sprockets2/coffee_script.rb,
lib/ember/es6_template/sprockets3/coffee_script.rb

Instance Method Summary collapse

Methods included from CoffeeScriptHelper

#call

Methods inherited from ES6

call, #call, default_mime_type, instance, #prepare

Instance Method Details

#evaluate(scope, locals, &block) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/ember/es6_template/sprockets2/coffee_script.rb', line 4

def evaluate(scope, locals, &block)
  filename = scope.pathname.to_s

  if es6?(filename)
    ::CoffeeScript.compile(data, bare: true)
  else
    super
  end
end