From c1aa5b0e14cd4bd27a5d8bd85cf7c36fa5911830 Mon Sep 17 00:00:00 2001 From: Yehuda Katz and Carl Lerche Date: Tue, 7 Apr 2009 14:57:18 -0700 Subject: Add depends_on, use, and setup to abstract up ideas about module inheritance. --- .../lib/action_controller/abstract/renderer.rb | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'actionpack/lib/action_controller/abstract/renderer.rb') diff --git a/actionpack/lib/action_controller/abstract/renderer.rb b/actionpack/lib/action_controller/abstract/renderer.rb index 5daade6109..68c3b07b84 100644 --- a/actionpack/lib/action_controller/abstract/renderer.rb +++ b/actionpack/lib/action_controller/abstract/renderer.rb @@ -2,20 +2,16 @@ require "action_controller/abstract/logger" module AbstractController module Renderer + depends_on AbstractController::Logger - def self.included(klass) - klass.class_eval do - extend ClassMethods - - attr_internal :formats - - extlib_inheritable_accessor :_view_paths - - self._view_paths ||= ActionView::PathSet.new - include AbstractController::Logger - end + setup do + attr_internal :formats + + extlib_inheritable_accessor :_view_paths + + self._view_paths ||= ActionView::PathSet.new end - + def _action_view @_action_view ||= ActionView::Base.new(self.class.view_paths, {}, self) end -- cgit v1.2.3