require 'sprockets/jst_processor'
module Jasmine::Headless
class JSTTemplate < Sprockets::JstProcessor
include Jasmine::Headless::FileChecker
def evaluate(*args)
if bad_format?(file)
alert_bad_format(file)
return ''
end
begin
data = super
cache = Jasmine::Headless::JSTTemplateCache.new(file, data)
source = cache.handle
if cache.cached?
%{
}
else
%{}
end
rescue StandardError => e
puts "[%s] Error in compiling file: %s" % [ 'jst'.color(:red), file.color(:yellow) ]
raise e
end
end
end
end