From 1dcc59121b9f0c332f6fe93f90fb028ff3448899 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Sat, 5 Jul 2008 12:05:50 -0500 Subject: Renamed Renderer to Renderable --- actionpack/lib/action_view.rb | 2 +- actionpack/lib/action_view/inline_template.rb | 2 +- actionpack/lib/action_view/renderable.rb | 29 +++++++++++++++++++++++++++ actionpack/lib/action_view/renderer.rb | 29 --------------------------- actionpack/lib/action_view/template.rb | 2 +- 5 files changed, 32 insertions(+), 32 deletions(-) create mode 100644 actionpack/lib/action_view/renderable.rb delete mode 100644 actionpack/lib/action_view/renderer.rb (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_view.rb b/actionpack/lib/action_view.rb index 49768fe264..8f928d6fdf 100644 --- a/actionpack/lib/action_view.rb +++ b/actionpack/lib/action_view.rb @@ -25,7 +25,7 @@ require 'action_view/template_handlers' require 'action_view/template_file' require 'action_view/view_load_paths' -require 'action_view/renderer' +require 'action_view/renderable' require 'action_view/template' require 'action_view/partial_template' require 'action_view/inline_template' diff --git a/actionpack/lib/action_view/inline_template.rb b/actionpack/lib/action_view/inline_template.rb index 1ccb23a3fc..49147901a1 100644 --- a/actionpack/lib/action_view/inline_template.rb +++ b/actionpack/lib/action_view/inline_template.rb @@ -1,6 +1,6 @@ module ActionView #:nodoc: class InlineTemplate #:nodoc: - include Renderer + include Renderable def initialize(view, source, locals = {}, type = nil) @view = view diff --git a/actionpack/lib/action_view/renderable.rb b/actionpack/lib/action_view/renderable.rb new file mode 100644 index 0000000000..61bd8140fb --- /dev/null +++ b/actionpack/lib/action_view/renderable.rb @@ -0,0 +1,29 @@ +module ActionView + module Renderable + # TODO: Local assigns should not be tied to template instance + attr_accessor :locals + + # TODO: These readers should be private + attr_reader :filename, :source, :handler, :method_key, :method + + def render + prepare! + @handler.render(self) + end + + private + def prepare! + unless @prepared + @view.send(:evaluate_assigns) + @view.current_render_extension = @extension + + if @handler.compilable? + @handler.compile_template(self) # compile the given template, if necessary + @method = @view.method_names[method_key] # Set the method name for this template and run it + end + + @prepared = true + end + end + end +end diff --git a/actionpack/lib/action_view/renderer.rb b/actionpack/lib/action_view/renderer.rb deleted file mode 100644 index e6c64d2749..0000000000 --- a/actionpack/lib/action_view/renderer.rb +++ /dev/null @@ -1,29 +0,0 @@ -module ActionView - module Renderer - # TODO: Local assigns should not be tied to template instance - attr_accessor :locals - - # TODO: These readers should be private - attr_reader :filename, :source, :handler, :method_key, :method - - def render - prepare! - @handler.render(self) - end - - private - def prepare! - unless @prepared - @view.send(:evaluate_assigns) - @view.current_render_extension = @extension - - if @handler.compilable? - @handler.compile_template(self) # compile the given template, if necessary - @method = @view.method_names[method_key] # Set the method name for this template and run it - end - - @prepared = true - end - end - end -end diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb index dbc8ccdee8..f696ea366d 100644 --- a/actionpack/lib/action_view/template.rb +++ b/actionpack/lib/action_view/template.rb @@ -1,7 +1,7 @@ module ActionView #:nodoc: class Template #:nodoc: extend TemplateHandlers - include Renderer + include Renderable attr_reader :path, :extension -- cgit v1.2.3