lib/hobo/dryml.rb in hobo-0.8.5 vs lib/hobo/dryml.rb in hobo-0.8.6
- old
+ new
@@ -36,10 +36,11 @@
attr_accessor :last_if
def enable
ActionView::Template.register_template_handler("dryml", Hobo::Dryml::TemplateHandler)
+ DrymlGenerator.enable
end
def clear_cache
@renderer_classes = {}
@@ -76,11 +77,17 @@
# DELETE ME: controller_class = controller_class_for(page)
controller_class = view.controller.class
@tag_page_renderer_classes[controller_class.name] ||=
make_renderer_class("", page, local_names, DEFAULT_IMPORTS, included_taglibs)
@tag_page_renderer_classes[controller_class.name].new(page, view)
- else
- filename ||= view._pick_template(page + ".dryml").filename
+ else
+ filename ||= if view.view_paths.respond_to? :find_template
+ # Rails 2.3
+ view.view_paths.find_template(page + ".dryml").filename
+ else
+ # Rails 2.2
+ view._pick_template(page + ".dryml").filename
+ end
mtime = File.mtime(filename)
renderer_class = @renderer_classes[page]
# do we need to recompile?
if (!renderer_class || # nothing cached?