jasmine-headless-webkit/lib/jasmine/headless/coffee_script_cache.rb

26 lines
407 B
Ruby
Raw Normal View History

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