2011-09-01 13:38:53 +00:00
|
|
|
require 'coffee_script'
|
|
|
|
require 'digest/sha1'
|
|
|
|
require 'fileutils'
|
|
|
|
|
|
|
|
module Jasmine
|
|
|
|
module Headless
|
2011-09-01 14:39:29 +00:00
|
|
|
class CoffeeScriptCache < CacheableAction
|
2011-09-01 13:38:53 +00:00
|
|
|
class << self
|
2011-09-01 14:39:29 +00:00
|
|
|
def cache_type
|
|
|
|
"coffee_script"
|
2011-09-01 13:38:53 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-09-01 14:39:29 +00:00
|
|
|
def action
|
2011-09-01 13:38:53 +00:00
|
|
|
CoffeeScript.compile(File.read(file))
|
|
|
|
end
|
2013-08-26 03:02:30 +00:00
|
|
|
|
|
|
|
def relative_cache_file
|
|
|
|
super.gsub(/.coffee$/, '')
|
|
|
|
end
|
|
|
|
|
2011-09-01 13:38:53 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|