6b2055f642
When compiled, CoffeeScript files had names like "my_lib.coffee.js". This broke compatibility with RequireJS. Changing the naming convention to use only the .js extension allows files to be used as RequireJS modules.
26 lines
407 B
Ruby
26 lines
407 B
Ruby
require 'coffee_script'
|
|
require 'digest/sha1'
|
|
require 'fileutils'
|
|
|
|
module Jasmine
|
|
module Headless
|
|
class CoffeeScriptCache < CacheableAction
|
|
class << self
|
|
def cache_type
|
|
"coffee_script"
|
|
end
|
|
end
|
|
|
|
def action
|
|
CoffeeScript.compile(File.read(file))
|
|
end
|
|
|
|
def relative_cache_file
|
|
super.gsub(/.coffee$/, '')
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|
|
|