aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/new_base
diff options
context:
space:
mode:
authorYehuda Katz and Carl Lerche <wycats@gmail.com>2009-04-07 14:57:18 -0700
committerYehuda Katz and Carl Lerche <wycats@gmail.com>2009-04-07 14:57:18 -0700
commitc1aa5b0e14cd4bd27a5d8bd85cf7c36fa5911830 (patch)
treec4d08a6227e5a39cb65726fa40c2c54516068d24 /actionpack/lib/action_controller/new_base
parent9c8eaf8e254cf8ccaa6ecae3fdf1f468fbb60db8 (diff)
downloadrails-c1aa5b0e14cd4bd27a5d8bd85cf7c36fa5911830.tar.gz
rails-c1aa5b0e14cd4bd27a5d8bd85cf7c36fa5911830.tar.bz2
rails-c1aa5b0e14cd4bd27a5d8bd85cf7c36fa5911830.zip
Add depends_on, use, and setup to abstract up ideas about module inheritance.
Diffstat (limited to 'actionpack/lib/action_controller/new_base')
-rw-r--r--actionpack/lib/action_controller/new_base/hide_actions.rb9
-rw-r--r--actionpack/lib/action_controller/new_base/layouts.rb3
-rw-r--r--actionpack/lib/action_controller/new_base/renderer.rb11
3 files changed, 7 insertions, 16 deletions
diff --git a/actionpack/lib/action_controller/new_base/hide_actions.rb b/actionpack/lib/action_controller/new_base/hide_actions.rb
index b3777c3c1e..473a8ea72b 100644
--- a/actionpack/lib/action_controller/new_base/hide_actions.rb
+++ b/actionpack/lib/action_controller/new_base/hide_actions.rb
@@ -1,11 +1,8 @@
module ActionController
module HideActions
- def self.included(klass)
- klass.class_eval do
- extend ClassMethods
- extlib_inheritable_accessor :hidden_actions
- self.hidden_actions ||= Set.new
- end
+ setup do
+ extlib_inheritable_accessor :hidden_actions
+ self.hidden_actions ||= Set.new
end
def action_methods() self.class.action_names end
diff --git a/actionpack/lib/action_controller/new_base/layouts.rb b/actionpack/lib/action_controller/new_base/layouts.rb
index c0efb669b2..2351472dad 100644
--- a/actionpack/lib/action_controller/new_base/layouts.rb
+++ b/actionpack/lib/action_controller/new_base/layouts.rb
@@ -1,5 +1,8 @@
module ActionController
module Layouts
+ depends_on ActionController::Renderer
+ depends_on AbstractController::Layouts
+
def render_to_string(options)
if !options.key?(:text) || options.key?(:layout)
options[:_layout] = options.key?(:layout) ? _layout_for_option(options[:layout]) : _default_layout
diff --git a/actionpack/lib/action_controller/new_base/renderer.rb b/actionpack/lib/action_controller/new_base/renderer.rb
index 24ca9be077..044c15f409 100644
--- a/actionpack/lib/action_controller/new_base/renderer.rb
+++ b/actionpack/lib/action_controller/new_base/renderer.rb
@@ -1,15 +1,6 @@
module ActionController
module Renderer
-
- # def self.included(klass)
- # klass.extend ClassMethods
- # end
- #
- # module ClassMethods
- # def prefix
- # @prefix ||= name.underscore
- # end
- # end
+ depends_on AbstractController::Renderer
def initialize(*)
self.formats = [:html]