2011-11-22 15:36:42 +00:00
|
|
|
require 'tilt/template'
|
|
|
|
|
|
|
|
module Jasmine::Headless
|
|
|
|
class CSSTemplate < Tilt::Template
|
2011-12-05 23:49:52 +00:00
|
|
|
include Jasmine::Headless::FileChecker
|
2011-11-22 15:36:42 +00:00
|
|
|
self.default_mime_type = 'text/css'
|
|
|
|
|
|
|
|
def prepare ; end
|
|
|
|
|
|
|
|
def evaluate(scope, locals, &block)
|
2011-12-05 23:49:52 +00:00
|
|
|
if bad_format?(file)
|
|
|
|
alert_bad_format(file)
|
|
|
|
return ''
|
|
|
|
end
|
2011-11-22 15:36:42 +00:00
|
|
|
file ? %{<link rel="stylesheet" href="#{file}" type="text/css" />} : data
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|