lib/pieces/tilt_extension.rb in pieces-0.3.2 vs lib/pieces/tilt_extension.rb in pieces-0.3.3
- old
+ new
@@ -1,6 +1,16 @@
require 'tilt'
module Tilt
- register_lazy :MustacheTemplate, 'tilt/mustache', 'mustache', 'ms'
- register_lazy :CssTemplate, 'tilt/css', 'css'
+ if respond_to?(:register_lazy)
+ register_lazy :MustacheTemplate, 'tilt/mustache', 'mustache', 'ms'
+ register_lazy :CssTemplate, 'tilt/css', 'css'
+ elsif defined?(Rails)
+ # Register these yourself
+ else # support tilt v1
+ require 'tilt/mustache'
+ register MustacheTemplate, 'mustache', 'ms'
+
+ require 'tilt/css'
+ register CssTemplate, 'css'
+ end
end