Module: Sprockets::CoffeeScriptProcessor

Defined in:
lib/sprockets/coffee_script_processor.rb

Overview

Processor engine class for the CoffeeScript compiler. Depends on the `coffee-script` and `coffee-script-source` gems.

For more infomation see:

https://github.com/josh/ruby-coffee-script

Constant Summary collapse

VERSION =
'1'
SOURCE_VERSION =
::CoffeeScript::Source.version

Class Method Summary collapse

Class Method Details

.call(input) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/sprockets/coffee_script_processor.rb', line 15

def self.call(input)
  data = input[:data]
  key  = [self.name, SOURCE_VERSION, VERSION, data]
  input[:cache].fetch(key) do
    ::CoffeeScript.compile(data)
  end
end