diff options
4 files changed, 28 insertions, 18 deletions
diff --git a/actionpack/lib/abstract_controller/layouts.rb b/actionpack/lib/abstract_controller/layouts.rb index 12da273af9..73799e8085 100644 --- a/actionpack/lib/abstract_controller/layouts.rb +++ b/actionpack/lib/abstract_controller/layouts.rb @@ -212,21 +212,23 @@ module AbstractController delegate :_layout_conditions, :to => "self.class" module ClassMethods - def inherited(klass) + def inherited(klass) # :nodoc: super klass._write_layout_method end # This module is mixed in if layout conditions are provided. This means # that if no layout conditions are used, this method is not used - module LayoutConditions - # Determines whether the current action has a layout by checking the - # action name against the :only and :except conditions set on the - # layout. + module LayoutConditions # :nodoc: + private + + # Determines whether the current action has a layout definition by + # checking the action name against the :only and :except conditions + # set by the <tt>layout</tt> method. # # ==== Returns - # * <tt> Boolean</tt> - True if the action has a layout, false otherwise. - def conditional_layout? + # * <tt> Boolean</tt> - True if the action has a layout definition, false otherwise. + def _conditional_layout? return unless super conditions = _layout_conditions @@ -271,7 +273,7 @@ module AbstractController # # ==== Returns # * <tt>String</tt> - A template name - def _implied_layout_name + def _implied_layout_name # :nodoc: controller_path end @@ -279,7 +281,7 @@ module AbstractController # # If a layout is not explicitly mentioned then look for a layout with the controller's name. # if nothing is found then try same procedure to find super class's layout. - def _write_layout_method + def _write_layout_method # :nodoc: remove_possible_method(:_layout) prefixes = _implied_layout_name =~ /\blayouts/ ? [] : ["layouts"] @@ -318,7 +320,7 @@ module AbstractController self.class_eval <<-RUBY, __FILE__, __LINE__ + 1 def _layout - if conditional_layout? + if _conditional_layout? #{layout_definition} else #{name_clause} @@ -329,7 +331,7 @@ module AbstractController end end - def _normalize_options(options) + def _normalize_options(options) # :nodoc: super if _include_layout?(options) @@ -340,21 +342,27 @@ module AbstractController attr_internal_writer :action_has_layout - def initialize(*) + def initialize(*) # :nodoc: @_action_has_layout = true super end + # Controls whether an action should be rendered using a layout. + # If you want to disable any <tt>layout</tt> settings for the + # current action so that it is rendered without a layout then + # either override this method in your controller to return false + # for that action or set the <tt>action_has_layout</tt> attribute + # to false before rendering. def action_has_layout? @_action_has_layout end - def conditional_layout? + private + + def _conditional_layout? true end - private - # This will be overwritten by _write_layout_method def _layout; end diff --git a/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb b/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb index 0f0589a844..f356c2a85c 100644 --- a/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb +++ b/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb @@ -7,7 +7,7 @@ module ActionDispatch # This middleware is responsible for logging exceptions and # showing a debugging page in case the request is local. class DebugExceptions - RESCUES_TEMPLATE_PATH = File.join(File.dirname(__FILE__), 'templates') + RESCUES_TEMPLATE_PATH = File.expand_path('../templates', __FILE__) def initialize(app, routes_app = nil) @app = app diff --git a/activesupport/lib/active_support/basic_object.rb b/activesupport/lib/active_support/basic_object.rb index d4d06b2aa4..91aac6db64 100644 --- a/activesupport/lib/active_support/basic_object.rb +++ b/activesupport/lib/active_support/basic_object.rb @@ -2,8 +2,7 @@ require 'active_support/deprecation' require 'active_support/proxy_object' module ActiveSupport - # :nodoc: - class BasicObject < ProxyObject + class BasicObject < ProxyObject # :nodoc: def self.inherited(*) ::ActiveSupport::Deprecation.warn 'ActiveSupport::BasicObject is deprecated! Use ActiveSupport::ProxyObject instead.' super diff --git a/activesupport/lib/active_support/core_ext/integer/time.rb b/activesupport/lib/active_support/core_ext/integer/time.rb index 9fb4f6b73a..82080ffe51 100644 --- a/activesupport/lib/active_support/core_ext/integer/time.rb +++ b/activesupport/lib/active_support/core_ext/integer/time.rb @@ -1,3 +1,6 @@ +require 'active_support/duration' +require 'active_support/core_ext/numeric/time' + class Integer # Enables the use of time calculations and declarations, like <tt>45.minutes + # 2.hours + 4.years</tt>. |