From 1ad0b378cc081937c117577ab628f2160fcc448d Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Wed, 23 May 2012 22:43:08 +0530 Subject: Revert "Remove blank trailing comments" This reverts commit fa6d921e11363e9b8c4bc10f7aed0b9faffdc33a. Reason: Not a fan of such massive changes. We usually close such changes if made to Rails master as a pull request. Following the same principle here and reverting. [ci skip] --- actionpack/lib/action_controller/base.rb | 1 + actionpack/lib/action_controller/metal.rb | 2 ++ actionpack/lib/action_controller/metal/helpers.rb | 1 + actionpack/lib/action_controller/metal/mime_responds.rb | 1 + actionpack/lib/action_controller/metal/responder.rb | 10 ++++++++++ actionpack/lib/action_controller/metal/streaming.rb | 1 + 6 files changed, 16 insertions(+) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 90058245f5..71425cd542 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -167,6 +167,7 @@ module ActionController # redirect_to(:action => "elsewhere") and return if monkeys.nil? # render :action => "overthere" # won't be called if monkeys is nil # end + # class Base < Metal abstract! diff --git a/actionpack/lib/action_controller/metal.rb b/actionpack/lib/action_controller/metal.rb index 720c0f2258..92433ab462 100644 --- a/actionpack/lib/action_controller/metal.rb +++ b/actionpack/lib/action_controller/metal.rb @@ -9,6 +9,7 @@ module ActionController # class PostsController < ApplicationController # use AuthenticationMiddleware, :except => [:index, :show] # end + # class MiddlewareStack < ActionDispatch::MiddlewareStack #:nodoc: class Middleware < ActionDispatch::MiddlewareStack::Middleware #:nodoc: def initialize(klass, *args, &block) @@ -96,6 +97,7 @@ module ActionController # # You can refer to the modules included in ActionController::Base to see # other features you can bring into your metal controller. + # class Metal < AbstractController::Base abstract! diff --git a/actionpack/lib/action_controller/metal/helpers.rb b/actionpack/lib/action_controller/metal/helpers.rb index 598bc6c5cb..86d061e3b7 100644 --- a/actionpack/lib/action_controller/metal/helpers.rb +++ b/actionpack/lib/action_controller/metal/helpers.rb @@ -47,6 +47,7 @@ module ActionController # # 23 Aug 11:30 | Carolina Railhawks Soccer Match # N/A | Carolina Railhaws Training Workshop + # module Helpers extend ActiveSupport::Concern diff --git a/actionpack/lib/action_controller/metal/mime_responds.rb b/actionpack/lib/action_controller/metal/mime_responds.rb index d9fc777250..0b800c3c62 100644 --- a/actionpack/lib/action_controller/metal/mime_responds.rb +++ b/actionpack/lib/action_controller/metal/mime_responds.rb @@ -52,6 +52,7 @@ module ActionController #:nodoc: end # Clear all mime types in respond_to. + # def clear_respond_to self.mimes_for_respond_to = Hash.new.freeze end diff --git a/actionpack/lib/action_controller/metal/responder.rb b/actionpack/lib/action_controller/metal/responder.rb index 5aa3b2ca15..83407846dc 100644 --- a/actionpack/lib/action_controller/metal/responder.rb +++ b/actionpack/lib/action_controller/metal/responder.rb @@ -142,11 +142,13 @@ module ActionController #:nodoc: # Initializes a new responder an invoke the proper format. If the format is # not defined, call to_format. + # def self.call(*args) new(*args).respond end # Main entry point for responder responsible to dispatch to the proper format. + # def respond method = "to_#{format}" respond_to?(method) ? send(method) : to_format @@ -154,6 +156,7 @@ module ActionController #:nodoc: # HTML format does not render the resource, it always attempt to render a # template. + # def to_html default_render rescue ActionView::MissingTemplate => e @@ -168,6 +171,7 @@ module ActionController #:nodoc: # All other formats follow the procedure below. First we try to render a # template, if the template is not available, we verify if the resource # responds to :to_format and display it. + # def to_format if get? || !has_errors? || response_overridden? default_render @@ -205,12 +209,14 @@ module ActionController #:nodoc: end # Checks whether the resource responds to the current format or not. + # def resourceful? resource.respond_to?("to_#{format}") end # Returns the resource location by retrieving it from the options or # returning the resources array. + # def resource_location options[:location] || resources end @@ -219,6 +225,7 @@ module ActionController #:nodoc: # If a response block was given, use it, otherwise call render on # controller. + # def default_render if @default_response @default_response.call(options) @@ -243,6 +250,7 @@ module ActionController #:nodoc: # Results in: # # render :xml => @user, :status => :created + # def display(resource, given_options={}) controller.render given_options.merge!(options).merge!(format => resource) end @@ -252,12 +260,14 @@ module ActionController #:nodoc: end # Check whether the resource has errors. + # def has_errors? resource.respond_to?(:errors) && !resource.errors.empty? end # By default, render the :edit action for HTML requests with errors, unless # the verb was POST. + # def default_action @action ||= DEFAULT_ACTIONS_FOR_VERBS[request.request_method_symbol] end diff --git a/actionpack/lib/action_controller/metal/streaming.rb b/actionpack/lib/action_controller/metal/streaming.rb index 0c3caa9514..eeb37db2e7 100644 --- a/actionpack/lib/action_controller/metal/streaming.rb +++ b/actionpack/lib/action_controller/metal/streaming.rb @@ -194,6 +194,7 @@ module ActionController #:nodoc: # ==== Passenger # # To be described. + # module Streaming extend ActiveSupport::Concern -- cgit v1.2.3