vendor/rails/actionpack/lib/action_view/template_handler.rb in radiant-0.7.2 vs vendor/rails/actionpack/lib/action_view/template_handler.rb in radiant-0.8.0

- old
+ new

@@ -1,34 +1,34 @@ +# Legacy TemplateHandler stub module ActionView - class TemplateHandler + module TemplateHandlers #:nodoc: + module Compilable + def self.included(base) + base.extend(ClassMethods) + end - def self.line_offset - 0 + module ClassMethods + def call(template) + new.compile(template) + end + end + + def compile(template) + raise "Need to implement #{self.class.name}#compile(template)" + end end + end - def self.compilable? - false + class TemplateHandler + def self.call(template) + "#{name}.new(self).render(template, local_assigns)" end - def initialize(view) + def initialize(view = nil) @view = view end - def render(template) - end - - def compile(template) - end - - def compilable? - self.class.compilable? - end - - def line_offset - self.class.line_offset - end - - # Called by CacheHelper#cache - def cache_fragment(block, name = {}, options = nil) + def render(template, local_assigns) + raise "Need to implement #{self.class.name}#render(template, local_assigns)" end end end