Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 7438

Show
Ignore:
Timestamp:
09/09/07 23:12:57 (1 year ago)
Author:
david
Message:

Random hits from the style nazi

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_controller/base.rb

    r7426 r7438  
    1212  class ActionControllerError < StandardError #:nodoc: 
    1313  end 
     14 
    1415  class SessionRestoreError < ActionControllerError #:nodoc: 
    1516  end 
     17 
    1618  class MissingTemplate < ActionControllerError #:nodoc: 
    1719  end 
     20 
    1821  class RenderError < ActionControllerError #:nodoc: 
    1922  end 
     23 
    2024  class RoutingError < ActionControllerError #:nodoc: 
    2125    attr_reader :failures 
     
    2529    end 
    2630  end 
     31 
    2732  class MethodNotAllowed < ActionControllerError #:nodoc: 
    2833    attr_reader :allowed_methods 
     
    4146    end 
    4247  end 
     48 
    4349  class NotImplemented < MethodNotAllowed #:nodoc: 
    4450  end 
     51 
    4552  class UnknownController < ActionControllerError #:nodoc: 
    4653  end 
     54 
    4755  class UnknownAction < ActionControllerError #:nodoc: 
    4856  end 
     57 
    4958  class MissingFile < ActionControllerError #:nodoc: 
    5059  end 
     60 
    5161  class RenderError < ActionControllerError #:nodoc: 
    5262  end 
     63 
    5364  class SessionOverflowError < ActionControllerError #:nodoc: 
    5465    DEFAULT_MESSAGE = 'Your session data is larger than the data column in which it is to be stored. You must increase the size of your data column if you intend to store large data.' 
     
    5869    end 
    5970  end 
     71 
    6072  class DoubleRenderError < ActionControllerError #:nodoc: 
    6173    DEFAULT_MESSAGE = "Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect, and only 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\". Finally, note that to cause a before filter to halt execution of the rest of the filter chain, the filter must return false, explicitly, so \"render(...) and return false\"." 
     
    6577    end 
    6678  end 
     79 
    6780  class RedirectBackError < ActionControllerError #:nodoc: 
    6881    DEFAULT_MESSAGE = 'No HTTP_REFERER was set in the request to this action, so redirect_to :back could not be called successfully. If this is a test, make sure to specify request.env["HTTP_REFERER"].' 
     
    7285    end 
    7386  end 
     87 
    7488 
    7589  # Action Controllers are the core of a web request in Rails. They are made up of one or more actions that are executed 
     
    372386      # More methods can be hidden using <tt>hide_actions</tt>. 
    373387      def hidden_actions 
    374         write_inheritable_attribute(:hidden_actions, ActionController::Base.public_instance_methods) unless read_inheritable_attribute(:hidden_actions) 
     388        unless read_inheritable_attribute(:hidden_actions) 
     389          write_inheritable_attribute(:hidden_actions, ActionController::Base.public_instance_methods) 
     390        end 
     391 
    375392        read_inheritable_attribute(:hidden_actions) 
    376393      end 
     
    818835            partial = default_template_name if partial == true 
    819836            add_variables_to_assigns 
     837 
    820838            if collection = options[:collection] 
    821               render_for_text(@template.send(:render_partial_collection, partial, collection, options[:spacer_template], options[:locals]), 
    822                               options[:status]) 
     839              render_for_text( 
     840                @template.send(:render_partial_collection, partial, collection,  
     841                options[:spacer_template], options[:locals]), options[:status] 
     842              ) 
    823843            else 
    824               render_for_text(@template.send(:render_partial, partial, ActionView::Base::ObjectWrapper.new(options[:object]), options[:locals]),  
    825                               options[:status])               
     844              render_for_text( 
     845                @template.send(:render_partial, partial,  
     846                ActionView::Base::ObjectWrapper.new(options[:object]), options[:locals]), options[:status] 
     847              ) 
    826848            end 
    827849 
     
    10131035      end 
    10141036 
     1037 
    10151038    private 
    1016  
    10171039      def render_for_file(template_path, status = nil, use_full_path = false, locals = {}) #:nodoc: 
    10181040        add_variables_to_assigns 
     
    10361058       
    10371059      def initialize_template_class(response) 
    1038         raise "You must assign a template class through ActionController.template_class= before processing a request" unless @@template_class 
     1060        unless @@template_class 
     1061          raise "You must assign a template class through ActionController.template_class= before processing a request" 
     1062        end 
    10391063 
    10401064        response.template = ActionView::Base.new(view_paths, {}, self) 
  • trunk/actionpack/lib/action_controller/integration.rb

    r7436 r7438  
    153153      # You can also perform POST, PUT, DELETE, and HEAD requests with #post, 
    154154      # #put, #delete, and #head. 
    155       def get(path, parameters=nil, headers=nil) 
     155      def get(path, parameters = nil, headers = nil) 
    156156        process :get, path, parameters, headers 
    157157      end 
    158158 
    159159      # Performs a POST request with the given parameters. See get() for more details. 
    160       def post(path, parameters=nil, headers=nil) 
     160      def post(path, parameters = nil, headers = nil) 
    161161        process :post, path, parameters, headers 
    162162      end 
    163163 
    164164      # Performs a PUT request with the given parameters. See get() for more details. 
    165       def put(path, parameters=nil, headers=nil) 
     165      def put(path, parameters = nil, headers = nil) 
    166166        process :put, path, parameters, headers 
    167167      end 
    168168 
    169169      # Performs a DELETE request with the given parameters. See get() for more details. 
    170       def delete(path, parameters=nil, headers=nil) 
     170      def delete(path, parameters = nil, headers = nil) 
    171171        process :delete, path, parameters, headers 
    172172      end 
    173173 
    174174      # Performs a HEAD request with the given parameters. See get() for more details. 
    175       def head(path, parameters=nil, headers=nil) 
     175      def head(path, parameters = nil, headers = nil) 
    176176        process :head, path, parameters, headers 
    177177      end 
     
    221221 
    222222        # Performs the actual request. 
    223         def process(method, path, parameters=nil, headers=nil) 
     223        def process(method, path, parameters = nil, headers = nil) 
    224224          data = requestify(parameters) 
    225225          path = interpret_uri(path) if path =~ %r{://} 
     
    334334          end 
    335335        end 
    336  
    337336    end 
    338337 
  • trunk/actionpack/lib/action_controller/routing.rb

    r7421 r7438  
    14471447  end 
    14481448end 
    1449