jasmine-headless-webkit/lib/jasmine/headless/coffee_script_cache.rb
David Beveridge 6b2055f642 remove .coffee extension on compiled version of CoffeeScript files
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.
2013-08-25 20:02:30 -07:00

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