lib/linner/template.rb in linner-0.2.0 vs lib/linner/template.rb in linner-0.3.0
- old
+ new
@@ -1,7 +1,8 @@
require "tilt"
require "sass"
+require "compass"
require "coffee_script"
module Tilt
class JavascriptTemplate < PlainTemplate
self.default_mime_type = 'application/javascript'
@@ -9,23 +10,32 @@
class CSSTemplate < PlainTemplate
self.default_mime_type = 'text/css'
end
- Tilt.register Tilt::CSSTemplate, "css"
- Tilt.register Tilt::JavascriptTemplate, "js"
-end
+ class CompassSassTemplate < SassTemplate
+ self.default_mime_type = 'text/css'
-module Linner
- class Template
+ private
+ def sass_options
+ super.merge(Linner.sass_engine_options)
+ end
+ end
- class << self
- def template_for_script?(path)
- Tilt[path].default_mime_type == "application/javascript"
- end
+ class CompassScssTemplate < CompassSassTemplate
+ self.default_mime_type = 'text/css'
- def template_for_style?(path)
- Tilt[path].default_mime_type == "text/css"
- end
+ private
+ def sass_options
+ super.merge(:syntax => :scss)
end
end
+
+ register CSSTemplate, "css"
+ register JavascriptTemplate, "js"
+
+ register CompassSassTemplate, "sass"
+ prefer CompassSassTemplate
+
+ register CompassScssTemplate, "scss"
+ prefer CompassScssTemplate
end