From de203245afd2bbf7f93f3241fcf3a71a88101d47 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Thu, 28 May 2009 09:49:02 -0500 Subject: Revert "Revert "Whitespace!"" This reverts commit 0cac68d3bed3e6bf8ec2eb994858e4a179046941. --- actionpack/lib/action_controller/abstract/base.rb | 34 +++++++++++------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'actionpack/lib/action_controller/abstract/base.rb') diff --git a/actionpack/lib/action_controller/abstract/base.rb b/actionpack/lib/action_controller/abstract/base.rb index bbd42623d3..87083a4d79 100644 --- a/actionpack/lib/action_controller/abstract/base.rb +++ b/actionpack/lib/action_controller/abstract/base.rb @@ -2,28 +2,27 @@ require 'active_support/core_ext/module/attr_internal' module AbstractController class Error < StandardError; end - + class DoubleRenderError < Error DEFAULT_MESSAGE = "Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect, and at most once per action. Also note that neither redirect nor render terminate execution of the action, so if you want to exit an action after redirecting, you need to do something like \"redirect_to(...) and return\"." def initialize(message = nil) super(message || DEFAULT_MESSAGE) end - end - + end + class Base - attr_internal :response_body attr_internal :response_obj attr_internal :action_name class << self - attr_reader :abstract - + attr_reader :abstract + def abstract! @abstract = true end - + alias_method :abstract?, :abstract def inherited(klass) @@ -34,13 +33,13 @@ module AbstractController def subclasses @subclasses ||= [] end - + def internal_methods controller = self controller = controller.superclass until controller.abstract? controller.public_instance_methods(true) end - + def process(action) new.process(action.to_s) end @@ -48,7 +47,7 @@ module AbstractController def hidden_actions [] end - + def action_methods @action_methods ||= # All public instance methods of this class, including ancestors @@ -61,13 +60,13 @@ module AbstractController hidden_actions end end - + abstract! - + def initialize self.response_obj = {} end - + def process(action) @_action_name = action_name = action.to_s @@ -78,17 +77,16 @@ module AbstractController process_action(action_name) self end - + private - def action_methods self.class.action_methods end - + def action_method?(action) action_methods.include?(action) end - + # It is possible for respond_to?(action_name) to be false and # respond_to?(:action_missing) to be false if respond_to_action? # is overridden in a subclass. For instance, ActionController::Base @@ -114,4 +112,4 @@ module AbstractController end end end -end \ No newline at end of file +end -- cgit v1.2.3