<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>actionpack/test/fixtures/functional_caching/formatted_fragment_cached.html.erb</filename>
    </added>
    <added>
      <filename>actionpack/test/fixtures/functional_caching/formatted_fragment_cached.js.rjs</filename>
    </added>
    <added>
      <filename>actionpack/test/fixtures/functional_caching/formatted_fragment_cached.xml.builder</filename>
    </added>
    <added>
      <filename>actionpack/test/template/compiled_templates_test.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/hash/deep_merge.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/object/metaclass.rb</filename>
    </added>
    <added>
      <filename>railties/config.ru</filename>
    </added>
    <added>
      <filename>railties/doc/guides/actionview/helpers.markdown</filename>
    </added>
    <added>
      <filename>railties/doc/guides/actionview/partials.markdown</filename>
    </added>
    <added>
      <filename>railties/doc/guides/activerecord/basics.markdown</filename>
    </added>
    <added>
      <filename>railties/doc/guides/creating_plugins/basics.markdown</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -59,7 +59,7 @@ module TMail
       #
       # This is because a mailbox doesn't have the : after the From that designates the
       # beginning of the envelope sender (which can be different to the from address of 
-      # the emial)
+      # the email)
       #
       # Other fields can be passed as normal, &quot;Reply-To&quot;, &quot;Received&quot; etc.
       #</diff>
      <filename>actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/header.rb</filename>
    </modified>
    <modified>
      <diff>@@ -42,7 +42,7 @@ module TMail
     # Allows you to query the mail object with a string to get the contents
     # of the field you want.
     # 
-    # Returns a string of the exact contnts of the field
+    # Returns a string of the exact contents of the field
     # 
     #  mail.from = &quot;mikel &lt;mikel@lindsaar.net&gt;&quot;
     #  mail.header_string(&quot;From&quot;) #=&gt; &quot;mikel &lt;mikel@lindsaar.net&gt;&quot;</diff>
      <filename>actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/interface.rb</filename>
    </modified>
    <modified>
      <diff>@@ -255,7 +255,7 @@ module TMail
     alias fetch []
 
     # Allows you to set or delete TMail header objects at will.
-    # Eamples:
+    # Examples:
     #  @mail = TMail::Mail.new
     #  @mail['to'].to_s       # =&gt; 'mikel@test.com.au'
     #  @mail['to'] = 'mikel@elsewhere.org'
@@ -265,7 +265,7 @@ module TMail
     #  @mail['to'].to_s       # =&gt; nil
     #  @mail.encoded          # =&gt; &quot;\r\n&quot;
     # 
-    # Note: setting mail[] = nil actualy deletes the header field in question from the object,
+    # Note: setting mail[] = nil actually deletes the header field in question from the object,
     # it does not just set the value of the hash to nil
     def []=( key, val )
       dkey = key.downcase</diff>
      <filename>actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/mail.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,11 @@
 *Edge*
 
+* All 2xx requests are considered successful [Josh Peek]
+
+* Fixed that AssetTagHelper#compute_public_path shouldn't cache the asset_host along with the source or per-request proc's won't run [DHH]
+
+* Removed config.action_view.cache_template_loading, use config.cache_classes instead [Josh Peek]
+
 * Get buffer for fragment cache from template's @output_buffer [Josh Peek]
 
 * Set config.action_view.warn_cache_misses = true to receive a warning if you perform an action that results in an expensive disk operation that could be cached [Josh Peek]</diff>
      <filename>actionpack/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -31,7 +31,7 @@ http://www.rubyonrails.org.
 A short rundown of the major features:
 
 * Actions grouped in controller as methods instead of separate command objects
-  and can therefore share helper methods.
+  and can therefore share helper methods
 
     BlogController &lt; ActionController::Base
       def show
@@ -168,7 +168,7 @@ A short rundown of the major features:
   {Learn more}[link:classes/ActionController/Base.html]
 
 
-* Javascript and Ajax integration.
+* Javascript and Ajax integration
 
     link_to_function &quot;Greeting&quot;, &quot;alert('Hello world!')&quot;
     link_to_remote &quot;Delete this post&quot;, :update =&gt; &quot;posts&quot;, 
@@ -177,7 +177,7 @@ A short rundown of the major features:
   {Learn more}[link:classes/ActionView/Helpers/JavaScriptHelper.html]
 
 
-* Pagination for navigating lists of results.
+* Pagination for navigating lists of results
 
     # controller
     def list
@@ -192,15 +192,9 @@ A short rundown of the major features:
   {Learn more}[link:classes/ActionController/Pagination.html]
 
 
-* Easy testing of both controller and template result through TestRequest/Response
-
-    class LoginControllerTest &lt; Test::Unit::TestCase
-      def setup
-        @controller = LoginController.new
-        @request    = ActionController::TestRequest.new
-        @response   = ActionController::TestResponse.new
-      end
+* Easy testing of both controller and rendered template through ActionController::TestCase
 
+    class LoginControllerTest &lt; ActionController::TestCase
       def test_failing_authenticate
         process :authenticate, :user_name =&gt; &quot;nop&quot;, :password =&gt; &quot;&quot;
         assert flash.has_key?(:alert)
@@ -208,7 +202,7 @@ A short rundown of the major features:
       end
     end
 
-  {Learn more}[link:classes/ActionController/TestRequest.html]
+  {Learn more}[link:classes/ActionController/TestCase.html]
 
 
 * Automated benchmarking and integrated logging</diff>
      <filename>actionpack/README</filename>
    </modified>
    <modified>
      <diff>@@ -21,10 +21,8 @@ module ActionController
     # from the response HTML or elements selected by the enclosing assertion.
     # 
     # In addition to HTML responses, you can make the following assertions:
-    # * +assert_select_rjs+ - Assertions on HTML content of RJS update and
-    #     insertion operations.
-    # * +assert_select_encoded+ - Assertions on HTML encoded inside XML,
-    #     for example for dealing with feed item descriptions.
+    # * +assert_select_rjs+ - Assertions on HTML content of RJS update and insertion operations.
+    # * +assert_select_encoded+ - Assertions on HTML encoded inside XML, for example for dealing with feed item descriptions.
     # * +assert_select_email+ - Assertions on the HTML body of an e-mail.
     #
     # Also see HTML::Selector to learn how to use selectors.</diff>
      <filename>actionpack/lib/action_controller/assertions/selector_assertions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1155,7 +1155,7 @@ module ActionController #:nodoc:
 
       def log_processing
         if logger &amp;&amp; logger.info?
-          logger.info &quot;\n\nProcessing #{controller_class_name}\##{action_name} (for #{request_origin}) [#{request.method.to_s.upcase}]&quot;
+          logger.info &quot;\n\nProcessing #{self.class.name}\##{action_name} (for #{request_origin}) [#{request.method.to_s.upcase}]&quot;
           logger.info &quot;  Session ID: #{@_session.session_id}&quot; if @_session and @_session.respond_to?(:session_id)
           logger.info &quot;  Parameters: #{respond_to?(:filter_parameters) ? filter_parameters(params).inspect : params.inspect}&quot;
         end</diff>
      <filename>actionpack/lib/action_controller/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ module ActionController #:nodoc:
   module Caching
     # Fragment caching is used for caching various blocks within templates without caching the entire action as a whole. This is useful when
     # certain elements of an action change frequently or depend on complicated state while other parts rarely change or can be shared amongst multiple
-    # parties. The caching is doing using the cache helper available in the Action View. A template with caching might look something like:
+    # parties. The caching is done using the cache helper available in the Action View. A template with caching might look something like:
     #
     #   &lt;b&gt;Hello &lt;%= @name %&gt;&lt;/b&gt;
     #   &lt;% cache do %&gt;</diff>
      <filename>actionpack/lib/action_controller/caching/fragments.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,6 +22,16 @@ module ActionController #:nodoc:
   #
   #   cookies.delete :user_name
   #
+  # Please note that if you specify a :domain when setting a cookie, you must also specify the domain when deleting the cookie:
+  #
+  #  cookies[:key] = {
+  #    :value =&gt; 'a yummy cookie',
+  #    :expires =&gt; 1.year.from_now,
+  #    :domain =&gt; 'domain.com'
+  #  }
+  #
+  #  cookies.delete(:key, :domain =&gt; 'domain.com')
+  #
   # The option symbols for setting cookies are:
   #
   # * &lt;tt&gt;:value&lt;/tt&gt; - The cookie's value or list of values (as an array).</diff>
      <filename>actionpack/lib/action_controller/cookies.rb</filename>
    </modified>
    <modified>
      <diff>@@ -101,7 +101,7 @@ module ActionController
         @https = flag
       end
 
-      # Return +true+ if the session is mimicing a secure HTTPS request.
+      # Return +true+ if the session is mimicking a secure HTTPS request.
       #
       #   if session.https?
       #     ...</diff>
      <filename>actionpack/lib/action_controller/integration.rb</filename>
    </modified>
    <modified>
      <diff>@@ -24,7 +24,7 @@ module ActionController #:nodoc:
       super()
     end
 
-    %w[ AUTH_TYPE CONTENT_TYPE GATEWAY_INTERFACE PATH_INFO
+    %w[ AUTH_TYPE GATEWAY_INTERFACE PATH_INFO
         PATH_TRANSLATED QUERY_STRING REMOTE_HOST
         REMOTE_IDENT REMOTE_USER SCRIPT_NAME
         SERVER_NAME SERVER_PROTOCOL
@@ -98,10 +98,6 @@ module ActionController #:nodoc:
       @env['REMOTE_ADDR']
     end
 
-    def request_method
-      @env['REQUEST_METHOD'].downcase.to_sym
-    end
-
     def server_port
       @env['SERVER_PORT'].to_i
     end
@@ -250,11 +246,11 @@ end_msg
           headers['Content-Language'] = options.delete('language') if options['language']
           headers['Expires']          = options.delete('expires') if options['expires']
 
-          @status = options['Status'] || &quot;200 OK&quot;
+          @status = options.delete('Status') || &quot;200 OK&quot;
 
           # Convert 'cookie' header to 'Set-Cookie' headers.
           # Because Set-Cookie header can appear more the once in the response body,
-          # we store it in a line break seperated string that will be translated to
+          # we store it in a line break separated string that will be translated to
           # multiple Set-Cookie header by the handler.
           if cookie = options.delete('cookie')
             cookies = []</diff>
      <filename>actionpack/lib/action_controller/rack_process.rb</filename>
    </modified>
    <modified>
      <diff>@@ -61,7 +61,7 @@ module ActionController
       request_method == :head
     end
 
-    # Provides acccess to the request's HTTP headers, for example:
+    # Provides access to the request's HTTP headers, for example:
     #  request.headers[&quot;Content-Type&quot;] # =&gt; &quot;text/plain&quot;
     def headers
       @headers ||= ActionController::Http::Headers.new(@env)
@@ -265,7 +265,7 @@ EOM
       parts[0..-(tld_length+2)]
     end
 
-    # Return the query string, accounting for server idiosyncracies.
+    # Return the query string, accounting for server idiosyncrasies.
     def query_string
       if uri = @env['REQUEST_URI']
         uri.split('?', 2)[1] || ''
@@ -274,7 +274,7 @@ EOM
       end
     end
 
-    # Return the request URI, accounting for server idiosyncracies.
+    # Return the request URI, accounting for server idiosyncrasies.
     # WEBrick includes the full URL. IIS leaves REQUEST_URI blank.
     def request_uri
       if uri = @env['REQUEST_URI']</diff>
      <filename>actionpack/lib/action_controller/request.rb</filename>
    </modified>
    <modified>
      <diff>@@ -17,7 +17,7 @@ module ActionController #:nodoc:
     # forged link from another site, is done by embedding a token based on the session (which an attacker wouldn't know) in all
     # forms and Ajax requests generated by Rails and then verifying the authenticity of that token in the controller.  Only
     # HTML/JavaScript requests are checked, so this will not protect your XML API (presumably you'll have a different authentication
-    # scheme there anyway).  Also, GET requests are not protected as these should be indempotent anyway.
+    # scheme there anyway).  Also, GET requests are not protected as these should be idempotent anyway.
     #
     # This is turned on with the &lt;tt&gt;protect_from_forgery&lt;/tt&gt; method, which will check the token and raise an
     # ActionController::InvalidAuthenticityToken if it doesn't match what was expected. You can customize the error message in</diff>
      <filename>actionpack/lib/action_controller/request_forgery_protection.rb</filename>
    </modified>
    <modified>
      <diff>@@ -112,19 +112,23 @@ module ActionController #:nodoc:
     protected
       # Exception handler called when the performance of an action raises an exception.
       def rescue_action(exception)
-        log_error(exception) if logger
-        erase_results if performed?
+        if handler_for_rescue(exception)
+          rescue_action_with_handler(exception)
+        else
+          log_error(exception) if logger
+          erase_results if performed?
 
-        # Let the exception alter the response if it wants.
-        # For example, MethodNotAllowed sets the Allow header.
-        if exception.respond_to?(:handle_response!)
-          exception.handle_response!(response)
-        end
+          # Let the exception alter the response if it wants.
+          # For example, MethodNotAllowed sets the Allow header.
+          if exception.respond_to?(:handle_response!)
+            exception.handle_response!(response)
+          end
 
-        if consider_all_requests_local || local_request?
-          rescue_action_locally(exception)
-        else
-          rescue_action_in_public(exception)
+          if consider_all_requests_local || local_request?
+            rescue_action_locally(exception)
+          else
+            rescue_action_in_public(exception)
+          end
         end
       end
 
@@ -200,7 +204,7 @@ module ActionController #:nodoc:
       def perform_action_with_rescue #:nodoc:
         perform_action_without_rescue
       rescue Exception =&gt; exception
-        rescue_action_with_handler(exception) || rescue_action(exception)
+        rescue_action(exception)
       end
 
       def rescues_path(template_name)</diff>
      <filename>actionpack/lib/action_controller/rescue.rb</filename>
    </modified>
    <modified>
      <diff>@@ -296,6 +296,10 @@ module ActionController
     #     article_comments_url(:article_id =&gt; @article)
     #     article_comment_url(:article_id =&gt; @article, :id =&gt; @comment)
     #
+    #   If you don't want to load all objects from the database you might want to use the &lt;tt&gt;article_id&lt;/tt&gt; directly:
+    #
+    #     articles_comments_url(@comment.article_id, @comment)
+    #
     # * &lt;tt&gt;:name_prefix&lt;/tt&gt; - Define a prefix for all generated routes, usually ending in an underscore.
     #   Use this if you have named routes that may clash.
     #</diff>
      <filename>actionpack/lib/action_controller/resources.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,19 +12,21 @@ module ActionController #:nodoc:
     X_SENDFILE_HEADER = 'X-Sendfile'.freeze
 
     protected
-      # Sends the file by streaming it 4096 bytes at a time. This way the
-      # whole file doesn't need to be read into memory at once.  This makes
-      # it feasible to send even large files.
+      # Sends the file, by default streaming it 4096 bytes at a time. This way the
+      # whole file doesn't need to be read into memory at once. This makes it
+      # feasible to send even large files. You can optionally turn off streaming
+      # and send the whole file at once.
       #
-      # Be careful to sanitize the path parameter if it coming from a web
+      # Be careful to sanitize the path parameter if it is coming from a web
       # page. &lt;tt&gt;send_file(params[:path])&lt;/tt&gt; allows a malicious user to
       # download any file on your server.
       #
       # Options:
       # * &lt;tt&gt;:filename&lt;/tt&gt; - suggests a filename for the browser to use.
       #   Defaults to &lt;tt&gt;File.basename(path)&lt;/tt&gt;.
-      # * &lt;tt&gt;:type&lt;/tt&gt; - specifies an HTTP content type.
-      #   Defaults to 'application/octet-stream'.
+      # * &lt;tt&gt;:type&lt;/tt&gt; - specifies an HTTP content type. Defaults to 'application/octet-stream'.
+      # * &lt;tt&gt;:length&lt;/tt&gt; - used to manually override the length (in bytes) of the content that
+      #   is going to be sent to the client. Defaults to &lt;tt&gt;File.size(path)&lt;/tt&gt;.
       # * &lt;tt&gt;:disposition&lt;/tt&gt; - specifies whether the file will be shown inline or downloaded.
       #   Valid values are 'inline' and 'attachment' (default).
       # * &lt;tt&gt;:stream&lt;/tt&gt; - whether to send the file to the user agent as it is read (+true+)
@@ -35,6 +37,12 @@ module ActionController #:nodoc:
       # * &lt;tt&gt;:url_based_filename&lt;/tt&gt; - set to +true+ if you want the browser guess the filename from
       #   the URL, which is necessary for i18n filenames on certain browsers
       #   (setting &lt;tt&gt;:filename&lt;/tt&gt; overrides this option).
+      # * &lt;tt&gt;:x_sendfile&lt;/tt&gt; - uses X-Sendfile to send the file when set to +true+. This is currently
+      #   only available with Lighttpd/Apache2 and specific modules installed and activated. Since this
+      #   uses the web server to send the file, this may lower memory consumption on your server and
+      #   it will not block your application for further requests.
+      #   See http://blog.lighttpd.net/articles/2006/07/02/x-sendfile and
+      #   http://tn123.ath.cx/mod_xsendfile/ for details. Defaults to +false+.
       #
       # The default Content-Type and Content-Disposition headers are
       # set to download arbitrary binary files in as many browsers as
@@ -99,8 +107,7 @@ module ActionController #:nodoc:
       #
       # Options:
       # * &lt;tt&gt;:filename&lt;/tt&gt; - suggests a filename for the browser to use.
-      # * &lt;tt&gt;:type&lt;/tt&gt; - specifies an HTTP content type.
-      #   Defaults to 'application/octet-stream'.
+      # * &lt;tt&gt;:type&lt;/tt&gt; - specifies an HTTP content type. Defaults to 'application/octet-stream'.
       # * &lt;tt&gt;:disposition&lt;/tt&gt; - specifies whether the file will be shown inline or downloaded.
       #   Valid values are 'inline' and 'attachment' (default).
       # * &lt;tt&gt;:status&lt;/tt&gt; - specifies the status code to send with the response. Defaults to '200 OK'.</diff>
      <filename>actionpack/lib/action_controller/streaming.rb</filename>
    </modified>
    <modified>
      <diff>@@ -15,6 +15,27 @@ module ActionController
     end
   end
 
+  # Superclass for Action Controller functional tests. Infers the controller under test from the test class name,
+  # and creates @controller, @request, @response instance variables.
+  #
+  #   class WidgetsControllerTest &lt; ActionController::TestCase
+  #     def test_index
+  #       get :index
+  #     end
+  #   end
+  #
+  # * @controller - WidgetController.new
+  # * @request    - ActionController::TestRequest.new
+  # * @response   - ActionController::TestResponse.new
+  #
+  # (Earlier versions of Rails required each functional test to subclass Test::Unit::TestCase and define
+  # @controller, @request, @response in +setup+.)
+  #
+  # If the controller cannot be inferred from the test class name, you can explicity set it with +tests+.
+  #
+  #   class SpecialEdgeCaseWidgetsControllerTest &lt; ActionController::TestCase
+  #     tests WidgetController
+  #   end
   class TestCase &lt; ActiveSupport::TestCase
     # When the request.remote_addr remains the default for testing, which is 0.0.0.0, the exception is simply raised inline
     # (bystepping the regular exception handling from rescue_action). If the request.remote_addr is anything else, the regular
@@ -41,6 +62,8 @@ module ActionController
     @@controller_class = nil
 
     class &lt;&lt; self
+      # Sets the controller class name. Useful if the name can't be inferred from test class.
+      # Expects +controller_class+ as a constant. Example: &lt;tt&gt;tests WidgetController&lt;/tt&gt;.
       def tests(controller_class)
         self.controller_class = controller_class
       end</diff>
      <filename>actionpack/lib/action_controller/test_case.rb</filename>
    </modified>
    <modified>
      <diff>@@ -171,7 +171,7 @@ module ActionController #:nodoc:
 
     # Was the response successful?
     def success?
-      response_code == 200
+      (200..299).include?(response_code)
     end
 
     # Was the URL not found?
@@ -211,7 +211,7 @@ module ActionController #:nodoc:
       template._first_render
     end
 
-    # A shortcut to the flash. Returns an empyt hash if no session flash exists.
+    # A shortcut to the flash. Returns an empty hash if no session flash exists.
     def flash
       session['flash'] || {}
     end</diff>
      <filename>actionpack/lib/action_controller/test_process.rb</filename>
    </modified>
    <modified>
      <diff>@@ -64,7 +64,7 @@ module HTML
   #
   # When using a combination of the above, the element name comes first
   # followed by identifier, class names, attributes, pseudo classes and
-  # negation in any order. Do not seprate these parts with spaces!
+  # negation in any order. Do not separate these parts with spaces!
   # Space separation is used for descendant selectors.
   #
   # For example:
@@ -158,7 +158,7 @@ module HTML
   # * &lt;tt&gt;:not(selector)&lt;/tt&gt; -- Match the element only if the element does not
   #   match the simple selector.
   #
-  # As you can see, &lt;tt&gt;:nth-child&lt;tt&gt; pseudo class and its varient can get quite
+  # As you can see, &lt;tt&gt;:nth-child&lt;tt&gt; pseudo class and its variant can get quite
   # tricky and the CSS specification doesn't do a much better job explaining it.
   # But after reading the examples and trying a few combinations, it's easy to
   # figure out.</diff>
      <filename>actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb</filename>
    </modified>
    <modified>
      <diff>@@ -171,12 +171,13 @@ module ActionView #:nodoc:
       delegate :erb_trim_mode=, :to =&gt; 'ActionView::TemplateHandlers::ERB'
     end
 
-    # Specify whether templates should be cached. Otherwise the file we be read everytime it is accessed.
-    @@cache_template_loading = false
-    cattr_accessor :cache_template_loading
+    def self.cache_template_loading=(*args)
+      ActiveSupport::Deprecation.warn(&quot;config.action_view.cache_template_loading option has been deprecated and has no affect. &quot; &lt;&lt;
+                                       &quot;Please remove it from your config files.&quot;, caller)
+    end
 
     def self.cache_template_extensions=(*args)
-      ActiveSupport::Deprecation.warn(&quot;config.action_view.cache_template_extensions option has been deprecated and has no affect. &quot; &lt;&lt;
+      ActiveSupport::Deprecation.warn(&quot;config.action_view.cache_template_extensions option has been deprecated and has no effect. &quot; &lt;&lt;
                                        &quot;Please remove it from your config files.&quot;, caller)
     end
 </diff>
      <filename>actionpack/lib/action_view/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -141,7 +141,7 @@ module ActionView
       #
       #   error_messages_for 'user_common', 'user', :object_name =&gt; 'user'
       #
-      # If the objects cannot be located as instance variables, you can add an extra &lt;tt&gt;:object&lt;/tt&gt; paremeter which gives the actual
+      # If the objects cannot be located as instance variables, you can add an extra &lt;tt&gt;:object&lt;/tt&gt; parameter which gives the actual
       # object (or array of objects to use):
       #
       #   error_messages_for 'user', :object =&gt; @question.user</diff>
      <filename>actionpack/lib/action_view/helpers/active_record_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -503,21 +503,24 @@ module ActionView
                     source = &quot;#{@controller.request.relative_url_root}#{source}&quot;
                   end
                 end
-                source = rewrite_asset_path(source)
 
-                if include_host
-                  host = compute_asset_host(source)
+                rewrite_asset_path(source)
+              end
+            end
 
-                  if has_request &amp;&amp; !host.blank? &amp;&amp; host !~ %r{^[-a-z]+://}
-                    host = &quot;#{@controller.request.protocol}#{host}&quot;
-                  end
+          source = ActionView::Base.computed_public_paths[cache_key]
 
-                  &quot;#{host}#{source}&quot;
-                else
-                  source
-                end
-              end
+          if include_host &amp;&amp; source !~ %r{^[-a-z]+://}
+            host = compute_asset_host(source)
+
+            if has_request &amp;&amp; !host.blank? &amp;&amp; host !~ %r{^[-a-z]+://}
+              host = &quot;#{@controller.request.protocol}#{host}&quot;
             end
+
+            &quot;#{host}#{source}&quot;
+          else
+            source
+          end
         end
 
         # Pick an asset host for this source. Returns +nil+ if no host is set,</diff>
      <filename>actionpack/lib/action_view/helpers/asset_tag_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -122,14 +122,15 @@ module ActionView
         nil
       end
 
-      private
-        def with_output_buffer(buf = '')
-          self.output_buffer, old_buffer = buf, output_buffer
-          yield
-          output_buffer
-        ensure
-          self.output_buffer = old_buffer
-        end
+      # Use an alternate output buffer for the duration of the block.
+      # Defaults to a new empty string.
+      def with_output_buffer(buf = '') #:nodoc:
+        self.output_buffer, old_buffer = buf, output_buffer
+        yield
+        output_buffer
+      ensure
+        self.output_buffer = old_buffer
+      end
     end
   end
 end</diff>
      <filename>actionpack/lib/action_view/helpers/capture_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -285,11 +285,11 @@ module ActionView
       #
       #   # Generates a date select that discards the type of the field and defaults to the date in 
       #   # my_date (six days after today)
-      #   select_datetime(my_date_time, :discard_type =&gt; true)
+      #   select_date(my_date, :discard_type =&gt; true)
       #
       #   # Generates a date select that defaults to the datetime in my_date (six days after today)
       #   # prefixed with 'payday' rather than 'date'
-      #   select_datetime(my_date_time, :prefix =&gt; 'payday')
+      #   select_date(my_date, :prefix =&gt; 'payday')
       #
       def select_date(date = Date.current, options = {}, html_options = {})
         options[:order] ||= []</diff>
      <filename>actionpack/lib/action_view/helpers/date_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,21 +2,28 @@ module ActionView
   module Helpers
     # Provides a set of methods for making it easier to debug Rails objects.
     module DebugHelper
-      # Returns a &lt;pre&gt;-tag that has +object+ dumped by YAML. This creates a very
-      # readable way to inspect an object.
+      # Returns a YAML representation of +object+ wrapped with &lt;pre&gt; and &lt;/pre&gt;.
+      # If the object cannot be converted to YAML using +to_yaml+, +inspect+ will be called instead.
+      # Useful for inspecting an object at the time of rendering.
       #
       # ==== Example
-      #  my_hash = {'first' =&gt; 1, 'second' =&gt; 'two', 'third' =&gt; [1,2,3]}
-      #  debug(my_hash)
       #
-      #  =&gt; &lt;pre class='debug_dump'&gt;--- 
-      #  first: 1
-      #  second: two
-      #  third: 
-      #  - 1
-      #  - 2
-      #  - 3
-      #  &lt;/pre&gt;
+      #   @user = User.new({ :username =&gt; 'testing', :password =&gt; 'xyz', :age =&gt; 42}) %&gt;
+      #   debug(@user)
+      #   # =&gt;
+      #   &lt;pre class='debug_dump'&gt;--- !ruby/object:User
+      #   attributes:
+      #   &amp;nbsp; updated_at:
+      #   &amp;nbsp; username: testing
+      #
+      #   &amp;nbsp; age: 42
+      #   &amp;nbsp; password: xyz
+      #   &amp;nbsp; created_at:
+      #   attributes_cache: {}
+      #
+      #   new_record: true
+      #   &lt;/pre&gt;
+
       def debug(object)
         begin
           Marshal::dump(object)
@@ -28,4 +35,4 @@ module ActionView
       end
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>actionpack/lib/action_view/helpers/debug_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -76,7 +76,7 @@ module ActionView
       # Creates a form and a scope around a specific model object that is used as
       # a base for questioning about values for the fields.
       #
-      # Rails provides succint resource-oriented form generation with +form_for+
+      # Rails provides succinct resource-oriented form generation with +form_for+
       # like this:
       #
       #   &lt;% form_for @offer do |f| %&gt;
@@ -449,8 +449,37 @@ module ActionView
       # assigned to the template (identified by +object+). It's intended that +method+ returns an integer and if that
       # integer is above zero, then the checkbox is checked. Additional options on the input tag can be passed as a
       # hash with +options+. The +checked_value+ defaults to 1 while the default +unchecked_value+
-      # is set to 0 which is convenient for boolean values. Since HTTP standards say that unchecked checkboxes don't post anything,
-      # we add a hidden value with the same name as the checkbox as a work around.
+      # is set to 0 which is convenient for boolean values.
+      #
+      # ==== Gotcha
+      #
+      # The HTML specification says unchecked check boxes are not successful, and
+      # thus web browsers do not send them. Unfortunately this introduces a gotcha:
+      # if an Invoice model has a +paid+ flag, and in the form that edits a paid
+      # invoice the user unchecks its check box, no +paid+ parameter is sent. So,
+      # any mass-assignment idiom like
+      #
+      #   @invoice.update_attributes(params[:invoice])
+      #
+      # wouldn't update the flag.
+      #
+      # To prevent this the helper generates a hidden field with the same name as
+      # the checkbox after the very check box. So, the client either sends only the
+      # hidden field (representing the check box is unchecked), or both fields.
+      # Since the HTML specification says key/value pairs have to be sent in the
+      # same order they appear in the form and Rails parameters extraction always
+      # gets the first occurrence of any given key, that works in ordinary forms.
+      #
+      # Unfortunately that workaround does not work when the check box goes
+      # within an array-like parameter, as in
+      #
+      #   &lt;% fields_for &quot;project[invoice_attributes][]&quot;, invoice, :index =&gt; nil do |form| %&gt;
+      #     &lt;%= form.check_box :paid %&gt;
+      #     ...
+      #   &lt;% end %&gt;
+      #
+      # because parameter name repetition is precisely what Rails seeks to distinguish
+      # the elements of the array.
       #
       # ==== Examples
       #   # Let's say that @post.validated? is 1:</diff>
      <filename>actionpack/lib/action_view/helpers/form_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -44,13 +44,22 @@ module ActionView
 
       include PrototypeHelper
 
-      # Returns a link that will trigger a JavaScript +function+ using the
+      # Returns a link of the given +name+ that will trigger a JavaScript +function+ using the
       # onclick handler and return false after the fact.
       #
+      # The first argument +name+ is used as the link text.
+      #
+      # The next arguments are optional and may include the javascript function definition and a hash of html_options.
+      #
       # The +function+ argument can be omitted in favor of an +update_page+
       # block, which evaluates to a string when the template is rendered
       # (instead of making an Ajax request first).
       #
+      # The +html_options+ will accept a hash of html attributes for the link tag. Some examples are :class =&gt; &quot;nav_button&quot;, :id =&gt; &quot;articles_nav_button&quot;
+      #
+      # Note: if you choose to specify the javascript function in a block, but would like to pass html_options, set the +function+ parameter to nil
+      #
+      #
       # Examples:
       #   link_to_function &quot;Greeting&quot;, &quot;alert('Hello world!')&quot;
       #     Produces:
@@ -89,13 +98,21 @@ module ActionView
         content_tag(:a, name, html_options.merge(:href =&gt; href, :onclick =&gt; onclick))
       end
 
-      # Returns a button that'll trigger a JavaScript +function+ using the
+      # Returns a button with the given +name+ text that'll trigger a JavaScript +function+ using the
       # onclick handler.
       #
+      # The first argument +name+ is used as the button's value or display text.
+      #
+      # The next arguments are optional and may include the javascript function definition and a hash of html_options.
+      #
       # The +function+ argument can be omitted in favor of an +update_page+
       # block, which evaluates to a string when the template is rendered
       # (instead of making an Ajax request first).
       #
+      # The +html_options+ will accept a hash of html attributes for the link tag. Some examples are :class =&gt; &quot;nav_button&quot;, :id =&gt; &quot;articles_nav_button&quot;
+      #
+      # Note: if you choose to specify the javascript function in a block, but would like to pass html_options, set the +function+ parameter to nil
+      #
       # Examples:
       #   button_to_function &quot;Greeting&quot;, &quot;alert('Hello world!')&quot;
       #   button_to_function &quot;Delete&quot;, &quot;if (confirm('Really?')) do_delete()&quot;</diff>
      <filename>actionpack/lib/action_view/helpers/javascript_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -61,7 +61,7 @@ module ActionView
     #
     # == Designing your Rails actions for Ajax
     # When building your action handlers (that is, the Rails actions that receive your background requests), it's
-    # important to remember a few things.  First, whatever your action would normall return to the browser, it will
+    # important to remember a few things.  First, whatever your action would normally return to the browser, it will
     # return to the Ajax call.  As such, you typically don't want to render with a layout.  This call will cause
     # the layout to be transmitted back to your page, and, if you have a full HTML/CSS, will likely mess a lot of things up.
     # You can turn the layout off on particular actions by doing the following:
@@ -580,9 +580,10 @@ module ActionView
       class JavaScriptGenerator #:nodoc:
         def initialize(context, &amp;block) #:nodoc:
           @context, @lines = context, []
-          @context.output_buffer = @lines if @context
           include_helpers_from_context
-          @context.instance_exec(self, &amp;block)
+          @context.with_output_buffer(@lines) do
+            @context.instance_exec(self, &amp;block)
+          end
         end
 
         private</diff>
      <filename>actionpack/lib/action_view/helpers/prototype_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -184,7 +184,7 @@ module ActionView
           HTML::WhiteListSanitizer.allowed_attributes.merge(attributes)
         end
 
-        # Adds to the Set of allowed CSS properties for the #sanitize and +sanitize_css+ heleprs.
+        # Adds to the Set of allowed CSS properties for the #sanitize and +sanitize_css+ helpers.
         #
         #   Rails::Initializer.run do |config|
         #     config.action_view.sanitized_allowed_css_properties = 'expression'</diff>
      <filename>actionpack/lib/action_view/helpers/sanitize_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -193,7 +193,7 @@ module ActionView
       #                          
       # * &lt;tt&gt;:onDrop&lt;/tt&gt; - Called when a +draggable_element+ is dropped onto
       #   this element. Override this callback with a JavaScript expression to 
-      #   change the default drop behavour. Example:
+      #   change the default drop behaviour. Example:
       #                          
       #     :onDrop =&gt; &quot;function(draggable_element, droppable_element, event) { alert('I like bananas') }&quot;
       #                          </diff>
      <filename>actionpack/lib/action_view/helpers/scriptaculous_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -64,7 +64,7 @@ module ActionView
       #   &lt;% content_tag :div, :class =&gt; &quot;strong&quot; do -%&gt;
       #     Hello world!
       #   &lt;% end -%&gt;
-      #    # =&gt; &lt;div class=&quot;strong&quot;&gt;&lt;p&gt;Hello world!&lt;/p&gt;&lt;/div&gt;
+      #    # =&gt; &lt;div class=&quot;strong&quot;&gt;Hello world!&lt;/div&gt;
       def content_tag(name, content_or_options_with_block = nil, options = nil, escape = true, &amp;block)
         if block_given?
           options = content_or_options_with_block if content_or_options_with_block.is_a?(Hash)</diff>
      <filename>actionpack/lib/action_view/helpers/tag_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -185,7 +185,7 @@ module ActionView
       #   link_to &quot;Nonsense search&quot;, searches_path(:foo =&gt; &quot;bar&quot;, :baz =&gt; &quot;quux&quot;)
       #   # =&gt; &lt;a href=&quot;/searches?foo=bar&amp;amp;baz=quux&quot;&gt;Nonsense search&lt;/a&gt;
       #
-      # The three options specfic to +link_to+ (&lt;tt&gt;:confirm&lt;/tt&gt;, &lt;tt&gt;:popup&lt;/tt&gt;, and &lt;tt&gt;:method&lt;/tt&gt;) are used as follows:
+      # The three options specific to +link_to+ (&lt;tt&gt;:confirm&lt;/tt&gt;, &lt;tt&gt;:popup&lt;/tt&gt;, and &lt;tt&gt;:method&lt;/tt&gt;) are used as follows:
       #
       #   link_to &quot;Visit Other Site&quot;, &quot;http://www.rubyonrails.org/&quot;, :confirm =&gt; &quot;Are you sure?&quot;
       #   # =&gt; &lt;a href=&quot;http://www.rubyonrails.org/&quot; onclick=&quot;return confirm('Are you sure?');&quot;&gt;Visit Other Site&lt;/a&gt;</diff>
      <filename>actionpack/lib/action_view/helpers/url_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -16,6 +16,14 @@ module ActionView #:nodoc:
     end
 
     class Path #:nodoc:
+      def self.eager_load_templates!
+        @eager_load_templates = true
+      end
+
+      def self.eager_load_templates?
+        @eager_load_templates || false
+      end
+
       attr_reader :path, :paths
       delegate :to_s, :to_str, :inspect, :to =&gt; :path
 
@@ -37,6 +45,9 @@ module ActionView #:nodoc:
         @paths = {}
 
         templates_in_path do |template|
+          # Eager load memoized methods and freeze cached template
+          template.freeze if self.class.eager_load_templates?
+
           @paths[template.path] = template
           @paths[template.path_without_extension] ||= template
         end
@@ -48,10 +59,7 @@ module ActionView #:nodoc:
         def templates_in_path
           (Dir.glob(&quot;#{@path}/**/*/**&quot;) | Dir.glob(&quot;#{@path}/**&quot;)).each do |file|
             unless File.directory?(file)
-              template = Template.new(file.split(&quot;#{self}/&quot;).last, self)
-              # Eager load memoized methods and freeze cached template
-              template.freeze if Base.cache_template_loading
-              yield template
+              yield Template.new(file.split(&quot;#{self}/&quot;).last, self)
             end
           end
         end</diff>
      <filename>actionpack/lib/action_view/paths.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,6 +9,10 @@ module ActionView
 
     include ActiveSupport::Memoizable
 
+    def filename
+      'compiled-template'
+    end
+
     def handler
       Template.handler_class_for_extension(extension)
     end
@@ -35,35 +39,41 @@ module ActionView
     end
 
     private
-      # Compile and evaluate the template's code
+      # Compile and evaluate the template's code (if necessary)
       def compile(local_assigns)
         render_symbol = method(local_assigns)
 
         @@mutex.synchronize do
-          return false unless recompile?(render_symbol)
+          if recompile?(render_symbol)
+            compile!(render_symbol, local_assigns)
+          end
+        end
+      end
 
-          locals_code = local_assigns.keys.map { |key| &quot;#{key} = local_assigns[:#{key}];&quot; }.join
+      def compile!(render_symbol, local_assigns)
+        locals_code = local_assigns.keys.map { |key| &quot;#{key} = local_assigns[:#{key}];&quot; }.join
 
-          source = &lt;&lt;-end_src
-            def #{render_symbol}(local_assigns)
-              old_output_buffer = output_buffer;#{locals_code};#{compiled_source}
-            ensure
-              self.output_buffer = old_output_buffer
-            end
-          end_src
+        source = &lt;&lt;-end_src
+          def #{render_symbol}(local_assigns)
+            old_output_buffer = output_buffer;#{locals_code};#{compiled_source}
+          ensure
+            self.output_buffer = old_output_buffer
+          end
+        end_src
 
-          begin
-            file_name = respond_to?(:filename) ? filename : 'compiled-template'
-            ActionView::Base::CompiledTemplates.module_eval(source, file_name, 0)
-          rescue Exception =&gt; e # errors from template code
-            if logger = ActionController::Base.logger
-              logger.debug &quot;ERROR: compiling #{render_symbol} RAISED #{e}&quot;
-              logger.debug &quot;Function body: #{source}&quot;
-              logger.debug &quot;Backtrace: #{e.backtrace.join(&quot;\n&quot;)}&quot;
-            end
+        begin
+          logger = ActionController::Base.logger
+          logger.debug &quot;Compiling template #{render_symbol}&quot; if logger
 
-            raise ActionView::TemplateError.new(self, {}, e)
+          ActionView::Base::CompiledTemplates.module_eval(source, filename, 0)
+        rescue Exception =&gt; e # errors from template code
+          if logger
+            logger.debug &quot;ERROR: compiling #{render_symbol} RAISED #{e}&quot;
+            logger.debug &quot;Function body: #{source}&quot;
+            logger.debug &quot;Backtrace: #{e.backtrace.join(&quot;\n&quot;)}&quot;
           end
+
+          raise ActionView::TemplateError.new(self, {}, e)
         end
       end
 
@@ -71,8 +81,7 @@ module ActionView
       # The template will be compiled if the file has not been compiled yet, or
       # if local_assigns has a new key, which isn't supported by the compiled code yet.
       def recompile?(symbol)
-        meth = Base::CompiledTemplates.instance_method(template.method) rescue nil
-        !(meth &amp;&amp; Base.cache_template_loading)
+        !(frozen? &amp;&amp; Base::CompiledTemplates.method_defined?(symbol))
       end
   end
 end</diff>
      <filename>actionpack/lib/action_view/renderable.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,8 +22,8 @@ ActiveSupport::Deprecation.debug = true
 ActionController::Base.logger = nil
 ActionController::Routing::Routes.reload rescue nil
 
-ActionView::Base.cache_template_loading = true
 FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures')
+ActionView::PathSet::Path.eager_load_templates!
 ActionController::Base.view_paths = FIXTURE_LOAD_PATH
 
 # Wrap tests that use Mocha and skip if unavailable.</diff>
      <filename>actionpack/test/abstract_unit.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,6 +7,7 @@ module Submodule
   end
   class ContainedNonEmptyController &lt; ActionController::Base
     def public_action
+      render :nothing =&gt; true
     end
     
     hide_action :hidden_action
@@ -105,6 +106,18 @@ end
 
 
 class PerformActionTest &lt; Test::Unit::TestCase
+  class MockLogger
+    attr_reader :logged
+
+    def initialize
+      @logged = []
+    end
+
+    def method_missing(method, *args)
+      @logged &lt;&lt; args.first
+    end
+  end
+
   def use_controller(controller_class)
     @controller = controller_class.new
 
@@ -142,6 +155,13 @@ class PerformActionTest &lt; Test::Unit::TestCase
     get :another_hidden_action
     assert_response 404
   end
+
+  def test_namespaced_action_should_log_module_name
+    use_controller Submodule::ContainedNonEmptyController
+    @controller.logger = MockLogger.new
+    get :public_action
+    assert_match /Processing\sSubmodule::ContainedNonEmptyController#public_action/, @controller.logger.logged[1]
+  end
 end
 
 class DefaultUrlOptionsTest &lt; Test::Unit::TestCase</diff>
      <filename>actionpack/test/controller/base_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -148,7 +148,6 @@ class PageCachingTest &lt; Test::Unit::TestCase
     end
 end
 
-
 class ActionCachingTestController &lt; ActionController::Base
   caches_action :index, :redirected, :forbidden, :if =&gt; Proc.new { |c| !c.request.format.json? }, :expires_in =&gt; 1.hour
   caches_action :show, :cache_path =&gt; 'http://test.host/custom/show'
@@ -489,54 +488,54 @@ class FragmentCachingTest &lt; Test::Unit::TestCase
 
   def test_fragment_cache_key
     assert_equal 'views/what a key', @controller.fragment_cache_key('what a key')
-    assert_equal( &quot;views/test.host/fragment_caching_test/some_action&quot;,
-                  @controller.fragment_cache_key(:controller =&gt; 'fragment_caching_test',:action =&gt; 'some_action'))
+    assert_equal &quot;views/test.host/fragment_caching_test/some_action&quot;,
+                  @controller.fragment_cache_key(:controller =&gt; 'fragment_caching_test',:action =&gt; 'some_action')
   end
 
-  def test_read_fragment__with_caching_enabled
+  def test_read_fragment_with_caching_enabled
     @store.write('views/name', 'value')
     assert_equal 'value', @controller.read_fragment('name')
   end
 
-  def test_read_fragment__with_caching_disabled
+  def test_read_fragment_with_caching_disabled
     ActionController::Base.perform_caching = false
     @store.write('views/name', 'value')
     assert_nil @controller.read_fragment('name')
   end
 
-  def test_fragment_exist__with_caching_enabled
+  def test_fragment_exist_with_caching_enabled
     @store.write('views/name', 'value')
     assert @controller.fragment_exist?('name')
     assert !@controller.fragment_exist?('other_name')
   end
 
-  def test_fragment_exist__with_caching_disabled
+  def test_fragment_exist_with_caching_disabled
     ActionController::Base.perform_caching = false
     @store.write('views/name', 'value')
     assert !@controller.fragment_exist?('name')
     assert !@controller.fragment_exist?('other_name')
   end
 
-  def test_write_fragment__with_caching_enabled
+  def test_write_fragment_with_caching_enabled
     assert_nil @store.read('views/name')
     assert_equal 'value', @controller.write_fragment('name', 'value')
     assert_equal 'value', @store.read('views/name')
   end
 
-  def test_write_fragment__with_caching_disabled
+  def test_write_fragment_with_caching_disabled
     assert_nil @store.read('views/name')
     ActionController::Base.perform_caching = false
     assert_equal nil, @controller.write_fragment('name', 'value')
     assert_nil @store.read('views/name')
   end
 
-  def test_expire_fragment__with_simple_key
+  def test_expire_fragment_with_simple_key
     @store.write('views/name', 'value')
     @controller.expire_fragment 'name'
     assert_nil @store.read('views/name')
   end
 
-  def test_expire_fragment__with__regexp
+  def test_expire_fragment_with_regexp
     @store.write('views/name', 'value')
     @store.write('views/another_name', 'another_value')
     @store.write('views/primalgrasp', 'will not expire ;-)')
@@ -548,7 +547,7 @@ class FragmentCachingTest &lt; Test::Unit::TestCase
     assert_equal 'will not expire ;-)', @store.read('views/primalgrasp')
   end
 
-  def test_fragment_for__with_disabled_caching
+  def test_fragment_for_with_disabled_caching
     ActionController::Base.perform_caching = false
 
     @store.write('views/expensive', 'fragment content')
@@ -573,7 +572,6 @@ class FragmentCachingTest &lt; Test::Unit::TestCase
   end
 end
 
-
 class FunctionalCachingController &lt; ActionController::Base
   def fragment_cached
   end
@@ -590,6 +588,13 @@ class FunctionalCachingController &lt; ActionController::Base
     end
   end
 
+  def formatted_fragment_cached
+    respond_to do |format|
+      format.html
+      format.xml
+      format.js
+    end
+  end
 
   def rescue_action(e)
     raise e
@@ -639,4 +644,35 @@ CACHED
     assert_match /Fragment caching in a partial/, @response.body
     assert_match &quot;Fragment caching in a partial&quot;, @store.read('views/test.host/functional_caching/js_fragment_cached_with_partial')
   end
+
+  def test_html_formatted_fragment_caching
+    get :formatted_fragment_cached, :format =&gt; &quot;html&quot;
+    assert_response :success
+    expected_body = &quot;&lt;body&gt;\n&lt;p&gt;ERB&lt;/p&gt;\n&lt;/body&gt;&quot;
+
+    assert_equal expected_body, @response.body
+
+    assert_equal &quot;&lt;p&gt;ERB&lt;/p&gt;&quot;, @store.read('views/test.host/functional_caching/formatted_fragment_cached')
+  end
+
+  def test_xml_formatted_fragment_caching
+    get :formatted_fragment_cached, :format =&gt; &quot;xml&quot;
+    assert_response :success
+    expected_body = &quot;&lt;body&gt;\n  &lt;p&gt;Builder&lt;/p&gt;\n&lt;/body&gt;\n&quot;
+
+    assert_equal expected_body, @response.body
+
+    assert_equal &quot;  &lt;p&gt;Builder&lt;/p&gt;\n&quot;, @store.read('views/test.host/functional_caching/formatted_fragment_cached')
+  end
+
+  def test_js_formatted_fragment_caching
+    get :formatted_fragment_cached, :format =&gt; &quot;js&quot;
+    assert_response :success
+    expected_body = %(title = &quot;Hey&quot;;\n$(&quot;element_1&quot;).visualEffect(&quot;highlight&quot;);\n) +
+      %($(&quot;element_2&quot;).visualEffect(&quot;highlight&quot;);\nfooter = &quot;Bye&quot;;)
+    assert_equal expected_body, @response.body
+
+    assert_equal ['$(&quot;element_1&quot;).visualEffect(&quot;highlight&quot;);', '$(&quot;element_2&quot;).visualEffect(&quot;highlight&quot;);'],
+      @store.read('views/test.host/functional_caching/formatted_fragment_cached')
+  end
 end</diff>
      <filename>actionpack/test/controller/caching_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -53,6 +53,15 @@ class BaseCgiTest &lt; Test::Unit::TestCase
   end
 
   def default_test; end
+
+  private
+
+  def set_content_data(data)
+    @request.env['REQUEST_METHOD'] = 'POST'
+    @request.env['CONTENT_LENGTH'] = data.length
+    @request.env['CONTENT_TYPE'] = 'application/x-www-form-urlencoded; charset=utf-8'
+    @request.env['RAW_POST_DATA'] = data
+  end
 end
 
 class CgiRequestTest &lt; BaseCgiTest
@@ -155,10 +164,8 @@ end
 
 class CgiRequestParamsParsingTest &lt; BaseCgiTest
   def test_doesnt_break_when_content_type_has_charset
-    data = 'flamenco=love'
-    @request.env['CONTENT_LENGTH'] = data.length
-    @request.env['CONTENT_TYPE'] = 'application/x-www-form-urlencoded; charset=utf-8'
-    @request.env['RAW_POST_DATA'] = data
+    set_content_data 'flamenco=love'
+
     assert_equal({&quot;flamenco&quot;=&gt; &quot;love&quot;}, @request.request_parameters)
   end
 
@@ -168,6 +175,41 @@ class CgiRequestParamsParsingTest &lt; BaseCgiTest
   end
 end
 
+class CgiRequestContentTypeTest &lt; BaseCgiTest
+  def test_html_content_type_verification
+    @request.env['CONTENT_TYPE'] = Mime::HTML.to_s
+    assert @request.content_type.verify_request?
+  end
+
+  def test_xml_content_type_verification
+    @request.env['CONTENT_TYPE'] = Mime::XML.to_s
+    assert !@request.content_type.verify_request?
+  end
+end
+
+class CgiRequestMethodTest &lt; BaseCgiTest
+  def test_get
+    assert_equal :get, @request.request_method
+  end
+
+  def test_post
+    @request.env['REQUEST_METHOD'] = 'POST'
+    assert_equal :post, @request.request_method
+  end
+
+  def test_put
+    set_content_data '_method=put'
+
+    assert_equal :put, @request.request_method
+  end
+
+  def test_delete
+    set_content_data '_method=delete'
+
+    assert_equal :delete, @request.request_method
+  end
+end
+
 class CgiRequestNeedsRewoundTest &lt; BaseCgiTest
   def test_body_should_be_rewound
     data = 'foo'</diff>
      <filename>actionpack/test/controller/cgi_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -60,7 +60,7 @@ class CookieTest &lt; Test::Unit::TestCase
   end
 
   def test_setting_cookie_for_fourteen_days_with_symbols
-    get :authenticate_for_fourteen_days
+    get :authenticate_for_fourteen_days_with_symbols
     assert_equal [ CGI::Cookie::new(&quot;name&quot; =&gt; &quot;user_name&quot;, &quot;value&quot; =&gt; &quot;david&quot;, &quot;expires&quot; =&gt; Time.local(2005, 10, 10)) ], @response.headers[&quot;cookie&quot;]
   end
 </diff>
      <filename>actionpack/test/controller/cookie_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -51,6 +51,15 @@ class BaseRackTest &lt; Test::Unit::TestCase
   end
 
   def default_test; end
+
+  private
+
+  def set_content_data(data)
+    @request.env['REQUEST_METHOD'] = 'POST'
+    @request.env['CONTENT_LENGTH'] = data.length
+    @request.env['CONTENT_TYPE'] = 'application/x-www-form-urlencoded; charset=utf-8'
+    @request.env['RAW_POST_DATA'] = data
+  end
 end
 
 class RackRequestTest &lt; BaseRackTest
@@ -153,10 +162,8 @@ end
 
 class RackRequestParamsParsingTest &lt; BaseRackTest
   def test_doesnt_break_when_content_type_has_charset
-    data = 'flamenco=love'
-    @request.env['CONTENT_LENGTH'] = data.length
-    @request.env['CONTENT_TYPE'] = 'application/x-www-form-urlencoded; charset=utf-8'
-    @request.env['RAW_POST_DATA'] = data
+    set_content_data 'flamenco=love'
+
     assert_equal({&quot;flamenco&quot;=&gt; &quot;love&quot;}, @request.request_parameters)
   end
 
@@ -166,6 +173,41 @@ class RackRequestParamsParsingTest &lt; BaseRackTest
   end
 end
 
+class RackRequestContentTypeTest &lt; BaseRackTest
+  def test_html_content_type_verification
+    @request.env['CONTENT_TYPE'] = Mime::HTML.to_s
+    assert @request.content_type.verify_request?
+  end
+
+  def test_xml_content_type_verification
+    @request.env['CONTENT_TYPE'] = Mime::XML.to_s
+    assert !@request.content_type.verify_request?
+  end
+end
+
+class RackRequestMethodTest &lt; BaseRackTest
+  def test_get
+    assert_equal :get, @request.request_method
+  end
+
+  def test_post
+    @request.env['REQUEST_METHOD'] = 'POST'
+    assert_equal :post, @request.request_method
+  end
+
+  def test_put
+    set_content_data '_method=put'
+
+    assert_equal :put, @request.request_method
+  end
+
+  def test_delete
+    set_content_data '_method=delete'
+
+    assert_equal :delete, @request.request_method
+  end
+end
+
 class RackRequestNeedsRewoundTest &lt; BaseRackTest
   def test_body_should_be_rewound
     data = 'foo'
@@ -234,3 +276,34 @@ class RackResponseTest &lt; BaseRackTest
     assert_equal [&quot;Hello, World!&quot;], parts
   end
 end
+
+class RackResponseHeadersTest &lt; BaseRackTest
+  def setup
+    super
+    @response = ActionController::RackResponse.new(@request)
+    @output = StringIO.new('')
+    @response.headers['Status'] = 200
+  end
+
+  def test_content_type
+    [204, 304].each do |c|
+      @response.headers['Status'] = c
+      assert !response_headers.has_key?(&quot;Content-Type&quot;)
+    end
+
+    [200, 302, 404, 500].each do |c|
+      @response.headers['Status'] = c
+      assert response_headers.has_key?(&quot;Content-Type&quot;)
+    end
+  end
+
+  def test_status
+    assert !response_headers.has_key?('Status')
+  end
+
+  private
+
+  def response_headers
+    @response.out(@output)[1]
+  end
+end</diff>
      <filename>actionpack/test/controller/rack_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -62,6 +62,11 @@ class RescueController &lt; ActionController::Base
     render :text =&gt; exception.message
   end
 
+  # This is a Dispatcher exception and should be in ApplicationController.
+  rescue_from ActionController::RoutingError do
+    render :text =&gt; 'no way'
+  end
+
   def raises
     render :text =&gt; 'already rendered'
     raise &quot;don't panic!&quot;
@@ -378,6 +383,10 @@ class RescueTest &lt; Test::Unit::TestCase
     assert_equal &quot;RescueController::ResourceUnavailableToRescueAsString&quot;, @response.body
   end
 
+  def test_rescue_dispatcher_exceptions
+    RescueController.process_with_exception(@request, @response, ActionController::RoutingError.new(&quot;Route not found&quot;))
+    assert_equal &quot;no way&quot;, @response.body
+  end
 
   protected
     def with_all_requests_local(local = true)</diff>
      <filename>actionpack/test/controller/rescue_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,11 @@ require 'abstract_unit'
 class JavaScriptHelperTest &lt; ActionView::TestCase
   tests ActionView::Helpers::JavaScriptHelper
 
-  attr_accessor :output_buffer
+  attr_accessor :template_format, :output_buffer
+
+  def setup
+    @template = self
+  end
 
   def test_escape_javascript
     assert_equal '', escape_javascript(nil)</diff>
      <filename>actionpack/test/template/javascript_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -28,7 +28,7 @@ class PrototypeHelperBaseTest &lt; ActionView::TestCase
   attr_accessor :template_format, :output_buffer
 
   def setup
-    @template = nil
+    @template = self
     @controller = Class.new do
       def url_for(options)
         if options.is_a?(String)
@@ -243,8 +243,12 @@ class PrototypeHelperTest &lt; PrototypeHelperBaseTest
   end
 
   def test_update_page
+    old_output_buffer = output_buffer
+
     block = Proc.new { |page| page.replace_html('foo', 'bar') }
     assert_equal create_generator(&amp;block).to_s, update_page(&amp;block)
+
+    assert_equal old_output_buffer, output_buffer
   end
 
   def test_update_page_tag</diff>
      <filename>actionpack/test/template/prototype_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,7 @@
 *Edge*
 
+* Set config.active_record.timestamped_migrations = false to have migrations with numeric prefix instead of UTC timestamp. #446. [Andrew Stone, Nik Wakelin]
+
 * change_column_default preserves the not-null constraint.  #617 [Tarmo T&#228;nav]
 
 * Fixed that create database statements would always include &quot;DEFAULT NULL&quot; (Nick Sieger) [#334]</diff>
      <filename>activerecord/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -34,7 +34,7 @@ module ActiveRecord
         class_to_reflection = {}
         # Not all records have the same class, so group then preload
         # group on the reflection itself so that if various subclass share the same association then we do not split them
-        # unncessarily
+        # unnecessarily
         records.group_by {|record| class_to_reflection[record.class] ||= record.class.reflections[association]}.each do |reflection, records|
           raise ConfigurationError, &quot;Association named '#{ association }' was not found; perhaps you misspelled it?&quot; unless reflection
           send(&quot;preload_#{reflection.macro}_association&quot;, records, reflection, preload_options)</diff>
      <filename>activerecord/lib/active_record/association_preload.rb</filename>
    </modified>
    <modified>
      <diff>@@ -582,12 +582,13 @@ module ActiveRecord
     #          has_many :clients
     #        end
     #
-    #       class Company &lt; ActiveRecord::Base; end
+    #       class Client &lt; ActiveRecord::Base; end
     #     end
     #   end
     #
-    # When Firm#clients is called, it will in turn call &lt;tt&gt;MyApplication::Business::Company.find(firm.id)&lt;/tt&gt;. If you want to associate
-    # with a class in another module scope, this can be done by specifying the complete class name.  Example:
+    # When &lt;tt&gt;Firm#clients&lt;/tt&gt; is called, it will in turn call &lt;tt&gt;MyApplication::Business::Client.find_all_by_firm_id(firm.id)&lt;/tt&gt;.
+    # If you want to associate with a class in another module scope, this can be done by specifying the complete class name.
+    # Example:
     #
     #   module MyApplication
     #     module Business</diff>
      <filename>activerecord/lib/active_record/associations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ module ActiveRecord #:nodoc:
   class ActiveRecordError &lt; StandardError
   end
 
-  # Raised when the single-table inheritance mechanism failes to locate the subclass
+  # Raised when the single-table inheritance mechanism fails to locate the subclass
   # (for example due to improper usage of column that +inheritance_column+ points to).
   class SubclassNotFound &lt; ActiveRecordError #:nodoc:
   end
@@ -97,7 +97,7 @@ module ActiveRecord #:nodoc:
   class MissingAttributeError &lt; NoMethodError
   end
 
-  # Raised when an error occured while doing a mass assignment to an attribute through the
+  # Raised when an error occurred while doing a mass assignment to an attribute through the
   # &lt;tt&gt;attributes=&lt;/tt&gt; method. The exception has an +attribute+ property that is the name of the
   # offending attribute.
   class AttributeAssignmentError &lt; ActiveRecordError
@@ -271,7 +271,7 @@ module ActiveRecord #:nodoc:
   #   # Now 'Bob' exist and is an 'admin'
   #   User.find_or_create_by_name('Bob', :age =&gt; 40) { |u| u.admin = true }
   #
-  # Use the &lt;tt&gt;find_or_initialize_by_&lt;/tt&gt; finder if you want to return a new record without saving it first. Protected attributes won't be setted unless they are given in a block. For example:
+  # Use the &lt;tt&gt;find_or_initialize_by_&lt;/tt&gt; finder if you want to return a new record without saving it first. Protected attributes won't be set unless they are given in a block. For example:
   #
   #   # No 'Winter' tag exists
   #   winter = Tag.find_or_initialize_by_name(&quot;Winter&quot;)
@@ -439,6 +439,10 @@ module ActiveRecord #:nodoc:
     cattr_accessor :schema_format , :instance_writer =&gt; false
     @@schema_format = :ruby
 
+    # Specify whether or not to use timestamps for migration numbers
+    cattr_accessor :timestamped_migrations , :instance_writer =&gt; false
+    @@timestamped_migrations = true
+
     # Determine whether to store the full constant name including namespace when using STI
     superclass_delegating_accessor :store_full_sti_class
     self.store_full_sti_class = false
@@ -724,8 +728,7 @@ module ActiveRecord #:nodoc:
       # ==== Attributes
       #
       # * +updates+ - A String of column and value pairs that will be set on any records that match conditions.
-      # * +conditions+ - An SQL fragment like &quot;administrator = 1&quot; or [ &quot;user_name = ?&quot;, username ].
-      #   See conditions in the intro for more info.
+      # * +conditions+ - An SQL fragment like &quot;administrator = 1&quot; or [ &quot;user_name = ?&quot;, username ]. See conditions in the intro for more info.
       # * +options+ - Additional options are &lt;tt&gt;:limit&lt;/tt&gt; and/or &lt;tt&gt;:order&lt;/tt&gt;, see the examples for usage.
       #
       # ==== Examples</diff>
      <filename>activerecord/lib/active_record/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -50,7 +50,7 @@ module ActiveRecord
   #
   # == Inheritable callback queues
   #
-  # Besides the overwriteable callback methods, it's also possible to register callbacks through the use of the callback macros.
+  # Besides the overwritable callback methods, it's also possible to register callbacks through the use of the callback macros.
   # Their main advantage is that the macros add behavior into a callback queue that is kept intact down through an inheritance
   # hierarchy. Example:
   #</diff>
      <filename>activerecord/lib/active_record/callbacks.rb</filename>
    </modified>
    <modified>
      <diff>@@ -383,7 +383,7 @@ module ActiveRecord
 
       def add_column_options!(sql, options) #:nodoc:
         sql &lt;&lt; &quot; DEFAULT #{quote(options[:default], options[:column])}&quot; if options_include_default?(options)
-        # must explcitly check for :null to allow change_column to work on migrations
+        # must explicitly check for :null to allow change_column to work on migrations
         if options.has_key? :null
           if options[:null] == false
             sql &lt;&lt; &quot; NOT NULL&quot;</diff>
      <filename>activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb</filename>
    </modified>
    <modified>
      <diff>@@ -867,7 +867,7 @@ module ActiveRecord
         end
 
       private
-        # The internal PostgreSQL identifer of the money data type.
+        # The internal PostgreSQL identifier of the money data type.
         MONEY_COLUMN_TYPE_OID = 790 #:nodoc:
 
         # Connects to a PostgreSQL server and sets up the adapter depending on the</diff>
      <filename>activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -62,7 +62,7 @@ module ActiveRecord
       changed_attributes.keys
     end
 
-    # Map of changed attrs =&gt; [original value, new value]
+    # Map of changed attrs =&gt; [original value, new value].
     #   person.changes # =&gt; {}
     #   person.name = 'bob'
     #   person.changes # =&gt; { 'name' =&gt; ['bill', 'bob'] }
@@ -93,27 +93,27 @@ module ActiveRecord
     end
 
     private
-      # Map of change attr =&gt; original value.
+      # Map of change &lt;tt&gt;attr =&gt; original value&lt;/tt&gt;.
       def changed_attributes
         @changed_attributes ||= {}
       end
 
-      # Handle *_changed? for method_missing.
+      # Handle &lt;tt&gt;*_changed?&lt;/tt&gt; for +method_missing+.
       def attribute_changed?(attr)
         changed_attributes.include?(attr)
       end
 
-      # Handle *_change for method_missing.
+      # Handle &lt;tt&gt;*_change&lt;/tt&gt; for +method_missing+.
       def attribute_change(attr)
         [changed_attributes[attr], __send__(attr)] if attribute_changed?(attr)
       end
 
-      # Handle *_was for method_missing.
+      # Handle &lt;tt&gt;*_was&lt;/tt&gt; for +method_missing+.
       def attribute_was(attr)
         attribute_changed?(attr) ? changed_attributes[attr] : __send__(attr)
       end
 
-      # Handle *_will_change! for method_missing.
+      # Handle &lt;tt&gt;*_will_change!&lt;/tt&gt; for +method_missing+.
       def attribute_will_change!(attr)
         changed_attributes[attr] = clone_attribute_value(:read_attribute, attr)
       end</diff>
      <filename>activerecord/lib/active_record/dirty.rb</filename>
    </modified>
    <modified>
      <diff>@@ -238,6 +238,22 @@ module ActiveRecord
   # lower than the current schema version: when migrating up, those
   # never-applied &quot;interleaved&quot; migrations will be automatically applied, and
   # when migrating down, never-applied &quot;interleaved&quot; migrations will be skipped.
+  # 
+  # == Timestamped Migrations
+  #
+  # By default, Rails generates migrations that look like:
+  #
+  #    20080717013526_your_migration_name.rb
+  #
+  # The prefix is a generation timestamp (in UTC).
+  #
+  # If you'd prefer to use numeric prefixes, you can turn timestamped migrations
+  # off by setting:
+  #
+  #    config.active_record.timestamped_migrations = false
+  # 
+  # In environment.rb.
+  #
   class Migration
     @@verbose = true
     cattr_accessor :verbose</diff>
      <filename>activerecord/lib/active_record/migration.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 module ActiveRecord
-  # Raised by save! and create! when the record is invalid.  Use the
+  # Raised by &lt;tt&gt;save!&lt;/tt&gt; and &lt;tt&gt;create!&lt;/tt&gt; when the record is invalid.  Use the
   # +record+ method to retrieve the record which did not validate.
   #   begin
   #     complex_operation_that_calls_save!_internally
@@ -33,7 +33,7 @@ module ActiveRecord
     # Adds an error to the base object instead of any particular attribute. This is used
     # to report errors that don't tie to any specific attribute, but rather to the object
     # as a whole. These error messages don't get prepended with any field name when iterating
-    # with each_full, so they should be complete sentences.
+    # with +each_full+, so they should be complete sentences.
     def add_to_base(msg)
       add(:base, msg)
     end
@@ -87,7 +87,7 @@ module ActiveRecord
       !@errors[attribute.to_s].nil?
     end
 
-    # Returns nil, if no errors are associated with the specified +attribute+.
+    # Returns +nil+, if no errors are associated with the specified +attribute+.
     # Returns the error message, if one error is associated with the specified +attribute+.
     # Returns an array of error messages, if more than one error is associated with the specified +attribute+.
     #
@@ -108,7 +108,7 @@ module ActiveRecord
 
     alias :[] :on
 
-    # Returns errors assigned to the base object through add_to_base according to the normal rules of on(attribute).
+    # Returns errors assigned to the base object through +add_to_base+ according to the normal rules of &lt;tt&gt;on(attribute)&lt;/tt&gt;.
     def on_base
       on(:base)
     end
@@ -121,15 +121,15 @@ module ActiveRecord
     #   end
     #
     #   company = Company.create(:address =&gt; '123 First St.')
-    #   company.errors.each{|attr,msg| puts &quot;#{attr} - #{msg}&quot; } # =&gt;
-    #     name - is too short (minimum is 5 characters)
-    #     name - can't be blank
-    #     address - can't be blank
+    #   company.errors.each{|attr,msg| puts &quot;#{attr} - #{msg}&quot; }
+    #   # =&gt; name - is too short (minimum is 5 characters)
+    #   #    name - can't be blank
+    #   #    address - can't be blank
     def each
       @errors.each_key { |attr| @errors[attr].each { |msg| yield attr, msg } }
     end
 
-    # Yields each full error message added. So Person.errors.add(&quot;first_name&quot;, &quot;can't be empty&quot;) will be returned
+    # Yields each full error message added. So &lt;tt&gt;Person.errors.add(&quot;first_name&quot;, &quot;can't be empty&quot;)&lt;/tt&gt; will be returned
     # through iteration as &quot;First name can't be empty&quot;.
     #
     #   class Company &lt; ActiveRecord::Base
@@ -138,10 +138,10 @@ module ActiveRecord
     #   end
     #
     #   company = Company.create(:address =&gt; '123 First St.')
-    #   company.errors.each_full{|msg| puts msg } # =&gt;
-    #     Name is too short (minimum is 5 characters)
-    #     Name can't be blank
-    #     Address can't be blank
+    #   company.errors.each_full{|msg| puts msg }
+    #   # =&gt; Name is too short (minimum is 5 characters)
+    #   #    Name can't be blank
+    #   #    Address can't be blank
     def each_full
       full_messages.each { |msg| yield msg }
     end
@@ -201,13 +201,13 @@ module ActiveRecord
     #   end
     #
     #   company = Company.create(:address =&gt; '123 First St.')
-    #   company.errors.to_xml # =&gt;
-    #     &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
-    #     &lt;errors&gt;
-    #       &lt;error&gt;Name is too short (minimum is 5 characters)&lt;/error&gt;
-    #       &lt;error&gt;Name can't be blank&lt;/error&gt;
-    #       &lt;error&gt;Address can't be blank&lt;/error&gt;
-    #     &lt;/errors&gt;
+    #   company.errors.to_xml
+    #   # =&gt;  &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+    #   #     &lt;errors&gt;
+    #   #       &lt;error&gt;Name is too short (minimum is 5 characters)&lt;/error&gt;
+    #   #       &lt;error&gt;Name can't be blank&lt;/error&gt;
+    #   #       &lt;error&gt;Address can't be blank&lt;/error&gt;
+    #   #     &lt;/errors&gt;
     def to_xml(options={})
       options[:root] ||= &quot;errors&quot;
       options[:indent] ||= 2
@@ -264,7 +264,7 @@ module ActiveRecord
   #   person.errors.on &quot;phone_number&quot;     # =&gt; &quot;has invalid format&quot;
   #   person.errors.each_full { |msg| puts msg }
   #                                       # =&gt; &quot;Last name can't be empty\n&quot; +
-  #                                            &quot;Phone number has invalid format&quot;
+  #                                       #    &quot;Phone number has invalid format&quot;
   #
   #   person.attributes = { &quot;last_name&quot; =&gt; &quot;Heinemeier&quot;, &quot;phone_number&quot; =&gt; &quot;555-555&quot; }
   #   person.save # =&gt; true (and person is now saved in the database)
@@ -303,7 +303,7 @@ module ActiveRecord
                                   :odd =&gt; 'odd?', :even =&gt; 'even?' }.freeze
 
       # Adds a validation method or block to the class. This is useful when
-      # overriding the +validate+ instance method becomes too unwieldly and
+      # overriding the +validate+ instance method becomes too unwieldy and
       # you're looking for more descriptive declaration of your validations.
       #
       # This can be done with a symbol pointing to a method:</diff>
      <filename>activerecord/lib/active_record/validations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -37,7 +37,7 @@ lifecycle methods that operate against a persistent store.
    Person.exists?(1)  #=&gt; true
 
 As you can see, the methods are quite similar to Active Record's methods for dealing with database
-records.  But rather than dealing with 
+records.  But rather than dealing directly with a database record, you're dealing with HTTP resources (which may or may not be database records).
 
 ==== Protocol
 </diff>
      <filename>activeresource/README</filename>
    </modified>
    <modified>
      <diff>@@ -111,7 +111,7 @@ module ActiveResource
   # over HTTPS.
   # 
   # Note: Some values cannot be provided in the URL passed to site.  e.g. email addresses 
-  # as usernames.  In those situations you should use the seperate user and password option.
+  # as usernames.  In those situations you should use the separate user and password option.
   # == Errors &amp; Validation
   #
   # Error handling and validation is handled in much the same manner as you're used to seeing in
@@ -200,7 +200,7 @@ module ActiveResource
     cattr_accessor :logger
 
     class &lt;&lt; self
-      # Gets the URI of the REST resources to map for this class.  The site variable is required 
+      # Gets the URI of the REST resources to map for this class.  The site variable is required for
       # Active Resource's mapping to work.
       def site
         # Not using superclass_delegating_reader because don't want subclasses to modify superclass instance
@@ -226,7 +226,7 @@ module ActiveResource
       end
 
       # Sets the URI of the REST resources to map for this class to the value in the +site+ argument.
-      # The site variable is required Active Resource's mapping to work.
+      # The site variable is required for Active Resource's mapping to work.
       def site=(site)
         @connection = nil
         if site.nil?
@@ -288,7 +288,7 @@ module ActiveResource
       end
 
       # Returns the current format, default is ActiveResource::Formats::XmlFormat.
-      def format # :nodoc:
+      def format
         read_inheritable_attribute(&quot;format&quot;) || ActiveResource::Formats[:xml]
       end
 
@@ -298,7 +298,7 @@ module ActiveResource
         @timeout = timeout
       end
 
-      # Gets tthe number of seconds after which requests to the REST API should time out.
+      # Gets the number of seconds after which requests to the REST API should time out.
       def timeout
         if defined?(@timeout)
           @timeout
@@ -426,16 +426,16 @@ module ActiveResource
 
       alias_method :set_primary_key, :primary_key=  #:nodoc:
 
-      # Create a new resource instance and request to the remote service
+      # Creates a new resource instance and makes a request to the remote service
       # that it be saved, making it equivalent to the following simultaneous calls:
       #
       #   ryan = Person.new(:first =&gt; 'ryan')
       #   ryan.save
       #
-      # The newly created resource is returned.  If a failure has occurred an
-      # exception will be raised (see save).  If the resource is invalid and
-      # has not been saved then valid? will return &lt;tt&gt;false&lt;/tt&gt;,
-      # while new? will still return &lt;tt&gt;true&lt;/tt&gt;.
+      # Returns the newly created resource.  If a failure has occurred an
+      # exception will be raised (see &lt;tt&gt;save&lt;/tt&gt;).  If the resource is invalid and
+      # has not been saved then &lt;tt&gt;valid?&lt;/tt&gt; will return &lt;tt&gt;false&lt;/tt&gt;,
+      # while &lt;tt&gt;new?&lt;/tt&gt; will still return &lt;tt&gt;true&lt;/tt&gt;.
       #
       # ==== Examples
       #   Person.create(:name =&gt; 'Jeremy', :email =&gt; 'myname@nospam.com', :enabled =&gt; true)
@@ -812,7 +812,7 @@ module ActiveResource
     #   Person.delete(guys_id)
     #   that_guy.exists? # =&gt; false
     def exists?
-      !new? &amp;&amp; self.class.exists?(to_param, :params =&gt; prefix_options)      
+      !new? &amp;&amp; self.class.exists?(to_param, :params =&gt; prefix_options)
     end
 
     # A method to convert the the resource to an XML string.</diff>
      <filename>activeresource/lib/active_resource/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -48,8 +48,8 @@ module ActiveResource
           #   # =&gt; [{:id =&gt; 1, :name =&gt; 'Ryan'}]
           #
           # Note: the objects returned from this method are not automatically converted
-          # into Active Resource instances - they are ordinary Hashes. If you are expecting
-          # Active Resource instances, use the &lt;tt&gt;find&lt;/tt&gt; class method with the
+          # into ActiveResource::Base instances - they are ordinary Hashes. If you are expecting
+          # ActiveResource::Base instances, use the &lt;tt&gt;find&lt;/tt&gt; class method with the
           # &lt;tt&gt;:from&lt;/tt&gt; option. For example:
           #
           #   Person.find(:all, :from =&gt; :active)</diff>
      <filename>activeresource/lib/active_resource/custom_methods.rb</filename>
    </modified>
    <modified>
      <diff>@@ -65,7 +65,7 @@ module ActiveResource
     class &lt;&lt; self
 
       # Returns an array of all request objects that have been sent to the mock.  You can use this to check
-      # wether or not your model actually sent an HTTP request.
+      # if your model actually sent an HTTP request.
       #
       # ==== Example
       #   def setup</diff>
      <filename>activeresource/lib/active_resource/http_mock.rb</filename>
    </modified>
    <modified>
      <diff>@@ -29,8 +29,8 @@ module ActiveSupport
         nil
       end
 
-      # Set key = value. Pass :unless_exist =&gt; true if you don't 
-      # want to update the cache if the key is already set. 
+      # Set key = value. Pass :unless_exist =&gt; true if you don't
+      # want to update the cache if the key is already set.
       def write(key, value, options = nil)
         super
         method = options &amp;&amp; options[:unless_exist] ? :add : :set
@@ -56,33 +56,33 @@ module ActiveSupport
         !read(key, options).nil?
       end
 
-      def increment(key, amount = 1)       
+      def increment(key, amount = 1)
         log(&quot;incrementing&quot;, key, amount)
-        
-        response = @data.incr(key, amount)  
+
+        response = @data.incr(key, amount)
         response == Response::NOT_FOUND ? nil : response
-      rescue MemCache::MemCacheError 
+      rescue MemCache::MemCacheError
         nil
       end
 
       def decrement(key, amount = 1)
         log(&quot;decrement&quot;, key, amount)
-        
-        response = data.decr(key, amount) 
+
+        response = @data.decr(key, amount)
         response == Response::NOT_FOUND ? nil : response
-      rescue MemCache::MemCacheError 
+      rescue MemCache::MemCacheError
         nil
-      end        
-      
+      end
+
       def delete_matched(matcher, options = nil)
         super
         raise &quot;Not supported by Memcache&quot;
-      end        
-      
+      end
+
       def clear
         @data.flush_all
-      end        
-      
+      end
+
       def stats
         @data.stats
       end</diff>
      <filename>activesupport/lib/active_support/cache/mem_cache_store.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,7 +21,7 @@ module ActiveSupport #:nodoc:
             # This emits the number without any scientific notation.
             # I prefer it to using self.to_f.to_s, which would lose precision.
             #
-            # Note that YAML allows that when reconsituting floats
+            # Note that YAML allows that when reconstituting floats
             # to native types, some precision may get lost.
             # There is no full precision real YAML tag that I am aware of.
             str = self.to_s</diff>
      <filename>activesupport/lib/active_support/core_ext/bigdecimal/conversions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,11 @@
-%w(keys indifferent_access reverse_merge conversions diff slice except).each do |ext|
+%w(keys indifferent_access deep_merge reverse_merge conversions diff slice except).each do |ext|
   require &quot;active_support/core_ext/hash/#{ext}&quot;
 end
 
 class Hash #:nodoc:
   include ActiveSupport::CoreExtensions::Hash::Keys
   include ActiveSupport::CoreExtensions::Hash::IndifferentAccess
+  include ActiveSupport::CoreExtensions::Hash::DeepMerge
   include ActiveSupport::CoreExtensions::Hash::ReverseMerge
   include ActiveSupport::CoreExtensions::Hash::Conversions
   include ActiveSupport::CoreExtensions::Hash::Diff</diff>
      <filename>activesupport/lib/active_support/core_ext/hash.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,7 +13,7 @@ module ActiveSupport #:nodoc:
           clone.except!(*keys)
         end
 
-        # Replaces the hash without only the given keys.
+        # Replaces the hash without the given keys.
         def except!(*keys)
           keys.map! { |key| convert_key(key) } if respond_to?(:convert_key)
           keys.each { |key| delete(key) }</diff>
      <filename>activesupport/lib/active_support/core_ext/hash/except.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,21 +1,28 @@
 module ActiveSupport #:nodoc:
   module CoreExtensions #:nodoc:
     module Hash #:nodoc:
-      # Allows for reverse merging where its the keys in the calling hash that wins over those in the &lt;tt&gt;other_hash&lt;/tt&gt;.
-      # This is particularly useful for initializing an incoming option hash with default values:
+      # Allows for reverse merging two hashes where the keys in the calling hash take precedence over those
+      # in the &lt;tt&gt;other_hash&lt;/tt&gt;. This is particularly useful for initializing an option hash with default values:
       #
       #   def setup(options = {})
       #     options.reverse_merge! :size =&gt; 25, :velocity =&gt; 10
       #   end
       #
-      # The default &lt;tt&gt;:size&lt;/tt&gt; and &lt;tt&gt;:velocity&lt;/tt&gt; is only set if the +options+ passed in doesn't already have those keys set.
+      # Using &lt;tt&gt;merge&lt;/tt&gt;, the above example would look as follows:
+      #
+      #   def setup(options = {})
+      #     { :size =&gt; 25, :velocity =&gt; 10 }.merge(options)
+      #   end
+      #
+      # The default &lt;tt&gt;:size&lt;/tt&gt; and &lt;tt&gt;:velocity&lt;/tt&gt; are only set if the +options+ hash passed in doesn't already
+      # have the respective key.
       module ReverseMerge
-        # Performs the opposite of merge, with the keys and values from the first hash taking precedence over the second.
+        # Performs the opposite of &lt;tt&gt;merge&lt;/tt&gt;, with the keys and values from the first hash taking precedence over the second.
         def reverse_merge(other_hash)
           other_hash.merge(self)
         end
 
-        # Performs the opposite of merge, with the keys and values from the first hash taking precedence over the second.
+        # Performs the opposite of &lt;tt&gt;merge&lt;/tt&gt;, with the keys and values from the first hash taking precedence over the second.
         # Modifies the receiver in place.
         def reverse_merge!(other_hash)
           replace(reverse_merge(other_hash))</diff>
      <filename>activesupport/lib/active_support/core_ext/hash/reverse_merge.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,6 +9,11 @@ module ActiveSupport #:nodoc:
       #   end
       #
       #   search(options.slice(:mass, :velocity, :time))
+      #
+      # If you have an array of keys you want to limit to, you should splat them:
+      #
+      #   valid_keys = [:mass, :velocity, :time]
+      #   search(options.slice(*valid_keys))
       module Slice
         # Returns a new hash with only the given keys.
         def slice(*keys)</diff>
      <filename>activesupport/lib/active_support/core_ext/hash/slice.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'active_support/core_ext/object/conversions'
 require 'active_support/core_ext/object/extending'
 require 'active_support/core_ext/object/instance_variables'
+require 'active_support/core_ext/object/metaclass'
 require 'active_support/core_ext/object/misc'</diff>
      <filename>activesupport/lib/active_support/core_ext/object.rb</filename>
    </modified>
    <modified>
      <diff>@@ -24,8 +24,8 @@ module ActiveSupport #:nodoc:
         #
         #   &quot;posts&quot;.singularize            # =&gt; &quot;post&quot;
         #   &quot;octopi&quot;.singularize           # =&gt; &quot;octopus&quot;
-        #   &quot;sheep&quot;.singluarize            # =&gt; &quot;sheep&quot;
-        #   &quot;word&quot;.singluarize             # =&gt; &quot;word&quot;
+        #   &quot;sheep&quot;.singularize            # =&gt; &quot;sheep&quot;
+        #   &quot;word&quot;.singularize             # =&gt; &quot;word&quot;
         #   &quot;the blue mailmen&quot;.singularize # =&gt; &quot;the blue mailman&quot;
         #   &quot;CamelOctopi&quot;.singularize      # =&gt; &quot;CamelOctopus&quot;
         def singularize</diff>
      <filename>activesupport/lib/active_support/core_ext/string/inflections.rb</filename>
    </modified>
    <modified>
      <diff>@@ -261,7 +261,7 @@ module ActiveSupport #:nodoc:
         # Layers additional behavior on Time#&lt;=&gt; so that DateTime and ActiveSupport::TimeWithZone instances
         # can be chronologically compared with a Time
         def compare_with_coercion(other)
-          # if other is an ActiveSupport::TimeWithZone, coerce a Time instance from it so we can do &lt;=&gt; comparision
+          # if other is an ActiveSupport::TimeWithZone, coerce a Time instance from it so we can do &lt;=&gt; comparison
           other = other.comparable_time if other.respond_to?(:comparable_time)
           if other.acts_like?(:date)
             # other is a Date/DateTime, so coerce self #to_datetime and hand off to DateTime#&lt;=&gt;</diff>
      <filename>activesupport/lib/active_support/core_ext/time/calculations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 module ActiveSupport
-  # If true, use ISO 8601 format for dates and times.  Otherwise, fall back to the Active Support legacy format.
+  # If true, use ISO 8601 format for dates and times. Otherwise, fall back to the Active Support legacy format.
   mattr_accessor :use_standard_json_time_format
 
   class &lt;&lt; self</diff>
      <filename>activesupport/lib/active_support/json.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,14 @@
 class Date
-  # Returns a JSON string representing the date.
+  # Returns a JSON string representing the date. If ActiveSupport.use_standard_json_time_format is set to true, the
+  # ISO 8601 format is used.
   #
-  # ==== Example:
+  # ==== Examples:
+  #
+  #   # With ActiveSupport.use_standard_json_time_format = true
+  #   Date.new(2005,2,1).to_json
+  #   # =&gt; &quot;2005-02-01&quot;
+  #
+  #   # With ActiveSupport.use_standard_json_time_format = false
   #   Date.new(2005,2,1).to_json
   #   # =&gt; &quot;2005/02/01&quot;
   def to_json(options = nil)</diff>
      <filename>activesupport/lib/active_support/json/encoders/date.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,14 @@
 class DateTime
-  # Returns a JSON string representing the datetime.
+  # Returns a JSON string representing the datetime. If ActiveSupport.use_standard_json_time_format is set to true, the
+  # ISO 8601 format is used.
   #
-  # ==== Example:
+  # ==== Examples:
+  #
+  #   # With ActiveSupport.use_standard_json_time_format = true
+  #   DateTime.civil(2005,2,1,15,15,10).to_json
+  #   # =&gt; &quot;2005-02-01T15:15:10+00:00&quot;
+  #
+  #   # With ActiveSupport.use_standard_json_time_format = false
   #   DateTime.civil(2005,2,1,15,15,10).to_json
   #   # =&gt; &quot;2005/02/01 15:15:10 +0000&quot;
   def to_json(options = nil)</diff>
      <filename>activesupport/lib/active_support/json/encoders/date_time.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,16 @@
 class Time
-  # Returns a JSON string representing the time.
+  # Returns a JSON string representing the time. If ActiveSupport.use_standard_json_time_format is set to true, the
+  # ISO 8601 format is used.
   #
-  # ==== Example:
+  # ==== Examples:
+  #
+  #   # With ActiveSupport.use_standard_json_time_format = true
+  #   Time.utc(2005,2,1,15,15,10).to_json
+  #   # =&gt; &quot;2005-02-01T15:15:10Z&quot;
+  #
+  #   # With ActiveSupport.use_standard_json_time_format = false
   #   Time.utc(2005,2,1,15,15,10).to_json
-  #   # =&gt; 2005/02/01 15:15:10 +0000&quot;
+  #   # =&gt; &quot;2005/02/01 15:15:10 +0000&quot;
   def to_json(options = nil)
     if ActiveSupport.use_standard_json_time_format
       xmlschema.inspect</diff>
      <filename>activesupport/lib/active_support/json/encoders/time.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,16 +10,8 @@ module ActiveSupport
 
     private
       def method_missing(method, *arguments, &amp;block)
-        merge_argument_options! arguments
+        arguments &lt;&lt; (arguments.last.respond_to?(:to_hash) ? @options.deep_merge(arguments.pop) : @options.dup)
         @context.send!(method, *arguments, &amp;block)
       end
-
-      def merge_argument_options!(arguments)
-        arguments &lt;&lt; if arguments.last.respond_to? :to_hash
-          @options.merge(arguments.pop)
-        else
-          @options.dup
-        end
-      end
   end
 end</diff>
      <filename>activesupport/lib/active_support/option_merger.rb</filename>
    </modified>
    <modified>
      <diff>@@ -102,7 +102,19 @@ module ActiveSupport
       &quot;#{time.strftime(&quot;%Y-%m-%dT%H:%M:%S&quot;)}#{formatted_offset(true, 'Z')}&quot;
     end
     alias_method :iso8601, :xmlschema
-  
+
+    # Returns a JSON string representing the TimeWithZone. If ActiveSupport.use_standard_json_time_format is set to
+    # true, the ISO 8601 format is used.
+    #
+    # ==== Examples:
+    #
+    #   # With ActiveSupport.use_standard_json_time_format = true
+    #   Time.utc(2005,2,1,15,15,10).in_time_zone.to_json
+    #   # =&gt; &quot;2005-02-01T15:15:10Z&quot;
+    #
+    #   # With ActiveSupport.use_standard_json_time_format = false
+    #   Time.utc(2005,2,1,15,15,10).in_time_zone.to_json
+    #   # =&gt; &quot;2005/02/01 15:15:10 +0000&quot;
     def to_json(options = nil)
       if ActiveSupport.use_standard_json_time_format
         xmlschema.inspect</diff>
      <filename>activesupport/lib/active_support/time_with_zone.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@ module Builder
   # markup.
   #
   # Usage:
-  #   xe = Builder::XmlEvents.new(hander)
+  #   xe = Builder::XmlEvents.new(handler)
   #   xe.title(&quot;HI&quot;)    # Sends start_tag/end_tag/text messages to the handler.
   #
   # Indentation may also be selected by providing value for the</diff>
      <filename>activesupport/lib/active_support/vendor/builder-2.1.2/builder/xmlevents.rb</filename>
    </modified>
    <modified>
      <diff>@@ -119,7 +119,7 @@ class MemCache
   # Valid options for +opts+ are:
   #
   #   [:namespace]   Prepends this value to all keys added or retrieved.
-  #   [:readonly]    Raises an exeception on cache writes when true.
+  #   [:readonly]    Raises an exception on cache writes when true.
   #   [:multithread] Wraps cache access in a Mutex for thread safety.
   #
   # Other options are ignored.
@@ -207,7 +207,7 @@ class MemCache
   end
 
   ##
-  # Deceremets the value for +key+ by +amount+ and returns the new value.
+  # Decrements the value for +key+ by +amount+ and returns the new value.
   # +key+ must already exist.  If +key+ is not an integer, it is assumed to be
   # 0.  +key+ can not be decremented below 0.
 </diff>
      <filename>activesupport/lib/active_support/vendor/memcache-client-1.5.0/memcache.rb</filename>
    </modified>
    <modified>
      <diff>@@ -38,7 +38,7 @@ module TZInfo
     
     # Returns the set of TimezonePeriod instances that are valid for the given
     # local time as an array. If you just want a single period, use 
-    # period_for_local instead and specify how abiguities should be resolved.
+    # period_for_local instead and specify how ambiguities should be resolved.
     # Raises PeriodNotFound if no periods are found for the given time.
     def periods_for_local(local)
       info.periods_for_local(local)</diff>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/data_timezone.rb</filename>
    </modified>
    <modified>
      <diff>@@ -66,7 +66,7 @@ module TZInfo
     # ArgumentError will be raised if a transition is added out of order.
     # offset_id refers to an id defined with offset. ArgumentError will be 
     # raised if the offset_id cannot be found. numerator_or_time and
-    # denomiator specify the time the transition occurs as. See 
+    # denominator specify the time the transition occurs as. See
     # TimezoneTransitionInfo for more detail about specifying times.
     def transition(year, month, offset_id, numerator_or_time, denominator = nil)
       offset = @offsets[offset_id]      </diff>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/data_timezone_info.rb</filename>
    </modified>
    <modified>
      <diff>@@ -36,7 +36,7 @@ module TZInfo
     
     # Returns the set of TimezonePeriod instances that are valid for the given
     # local time as an array. If you just want a single period, use 
-    # period_for_local instead and specify how abiguities should be resolved.
+    # period_for_local instead and specify how ambiguities should be resolved.
     # Raises PeriodNotFound if no periods are found for the given time.
     def periods_for_local(local)
       @linked_timezone.periods_for_local(local)</diff>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/linked_timezone.rb</filename>
    </modified>
    <modified>
      <diff>@@ -121,7 +121,7 @@ module TZInfo
       TimezoneProxy.new(identifier)
     end
     
-    # If identifier is nil calls super(), otherwise calls get. An identfier 
+    # If identifier is nil calls super(), otherwise calls get. An identifier
     # should always be passed in when called externally.
     def self.new(identifier = nil)
       if identifier        </diff>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/timezone.rb</filename>
    </modified>
    <modified>
      <diff>@@ -37,7 +37,7 @@ module TZInfo
     attr_reader :numerator_or_time
     protected :numerator_or_time
     
-    # Either the denominotor of the DateTime if the transition time is defined
+    # Either the denominator of the DateTime if the transition time is defined
     # as a DateTime, otherwise nil. 
     attr_reader :denominator
     protected :denominator</diff>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/timezone_transition_info.rb</filename>
    </modified>
    <modified>
      <diff>@@ -121,7 +121,7 @@ class XmlSimple
   # Create a &quot;global&quot; cache.
   @@cache = Cache.new
 
-  # Creates and intializes a new XmlSimple object.
+  # Creates and initializes a new XmlSimple object.
   # 
   # defaults::
   #   Default values for options.
@@ -497,7 +497,7 @@ class XmlSimple
       }
     end
     
-    # Fold Hases containing a single anonymous Array up into just the Array.
+    # Fold Hashes containing a single anonymous Array up into just the Array.
     if count == 1 
       anonymoustag = @options['anonymoustag']
       if result.has_key?(anonymoustag) &amp;&amp; result[anonymoustag].instance_of?(Array)
@@ -907,7 +907,7 @@ class XmlSimple
   # Thanks to Norbert Gawor for a bugfix.
   #
   # value::
-  #   Value to be checked for emptyness.
+  #   Value to be checked for emptiness.
   def empty(value)
     case value
       when Hash</diff>
      <filename>activesupport/lib/active_support/vendor/xml-simple-1.0.11/xmlsimple.rb</filename>
    </modified>
    <modified>
      <diff>@@ -245,6 +245,16 @@ class HashExtTest &lt; Test::Unit::TestCase
     assert(!indiff.keys.any? {|k| k.kind_of? String}, &quot;A key was converted to a string!&quot;)
   end
 
+  def test_deep_merge
+    hash_1 = { :a =&gt; &quot;a&quot;, :b =&gt; &quot;b&quot;, :c =&gt; { :c1 =&gt; &quot;c1&quot;, :c2 =&gt; &quot;c2&quot;, :c3 =&gt; { :d1 =&gt; &quot;d1&quot; } } }
+    hash_2 = { :a =&gt; 1, :c =&gt; { :c1 =&gt; 2, :c3 =&gt; { :d2 =&gt; &quot;d2&quot; } } }
+    expected = { :a =&gt; 1, :b =&gt; &quot;b&quot;, :c =&gt; { :c1 =&gt; 2, :c2 =&gt; &quot;c2&quot;, :c3 =&gt; { :d1 =&gt; &quot;d1&quot;, :d2 =&gt; &quot;d2&quot; } } }
+    assert_equal expected, hash_1.deep_merge(hash_2)
+
+    hash_1.deep_merge!(hash_2)
+    assert_equal expected, hash_1
+  end
+
   def test_reverse_merge
     defaults = { :a =&gt; &quot;x&quot;, :b =&gt; &quot;y&quot;, :c =&gt; 10 }.freeze
     options  = { :a =&gt; 1, :b =&gt; 2 }
@@ -282,6 +292,27 @@ class HashExtTest &lt; Test::Unit::TestCase
     assert_equal expected, original
   end
 
+  def test_slice_with_an_array_key
+    original = { :a =&gt; 'x', :b =&gt; 'y', :c =&gt; 10, [:a, :b] =&gt; &quot;an array key&quot; }
+    expected = { [:a, :b] =&gt; &quot;an array key&quot;, :c =&gt; 10 }
+
+    # Should return a new hash with only the given keys when given an array key.
+    assert_equal expected, original.slice([:a, :b], :c)
+    assert_not_equal expected, original
+
+    # Should replace the hash with only the given keys when given an array key.
+    assert_equal expected, original.slice!([:a, :b], :c)
+    assert_equal expected, original
+  end
+
+  def test_slice_with_splatted_keys
+    original = { :a =&gt; 'x', :b =&gt; 'y', :c =&gt; 10, [:a, :b] =&gt; &quot;an array key&quot; }
+    expected = { :a =&gt; 'x', :b =&gt; &quot;y&quot; }
+
+    # Should grab each of the splatted keys.
+    assert_equal expected, original.slice(*[:a, :b])
+  end
+
   def test_indifferent_slice
     original = { :a =&gt; 'x', :b =&gt; 'y', :c =&gt; 10 }.with_indifferent_access
     expected = { :a =&gt; 'x', :b =&gt; 'y' }.with_indifferent_access</diff>
      <filename>activesupport/test/core_ext/hash_ext_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -173,6 +173,14 @@ class ObjectTests &lt; Test::Unit::TestCase
     assert duck.acts_like?(:time)
     assert !duck.acts_like?(:date)
   end
+
+  def test_metaclass
+    string = &quot;Hello&quot;
+    string.metaclass.instance_eval do
+      define_method(:foo) { &quot;bar&quot; }
+    end
+    assert_equal &quot;bar&quot;, string.foo
+  end
 end
 
 class ObjectInstanceVariableTest &lt; Test::Unit::TestCase</diff>
      <filename>activesupport/test/core_ext/object_and_class_ext_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -38,6 +38,33 @@ class OptionMergerTest &lt; Test::Unit::TestCase
     end
   end
 
+  def test_nested_method_with_options_containing_hashes_merge
+    with_options :conditions =&gt; { :method =&gt; :get } do |outer|
+      outer.with_options :conditions =&gt; { :domain =&gt; &quot;www&quot; } do |inner|
+        expected = { :conditions =&gt; { :method =&gt; :get, :domain =&gt; &quot;www&quot; } }
+        assert_equal expected, inner.method_with_options
+      end
+    end
+  end
+
+  def test_nested_method_with_options_containing_hashes_overwrite
+    with_options :conditions =&gt; { :method =&gt; :get, :domain =&gt; &quot;www&quot; } do |outer|
+      outer.with_options :conditions =&gt; { :method =&gt; :post } do |inner|
+        expected = { :conditions =&gt; { :method =&gt; :post, :domain =&gt; &quot;www&quot; } }
+        assert_equal expected, inner.method_with_options
+      end
+    end
+  end
+
+  def test_nested_method_with_options_containing_hashes_going_deep
+    with_options :html =&gt; { :class =&gt; &quot;foo&quot;, :style =&gt; { :margin =&gt; 0, :display =&gt; &quot;block&quot; } } do |outer|
+      outer.with_options :html =&gt; { :title =&gt; &quot;bar&quot;, :style =&gt; { :margin =&gt; &quot;1em&quot;, :color =&gt; &quot;#fff&quot; } } do |inner|
+        expected = { :html =&gt; { :class =&gt; &quot;foo&quot;, :title =&gt; &quot;bar&quot;, :style =&gt; { :margin =&gt; &quot;1em&quot;, :display =&gt; &quot;block&quot;, :color =&gt; &quot;#fff&quot; } } }
+        assert_equal expected, inner.method_with_options
+      end
+    end
+  end
+
   # Needed when counting objects with the ObjectSpace
   def test_option_merger_class_method
     assert_equal ActiveSupport::OptionMerger, ActiveSupport::OptionMerger.new('', '').class</diff>
      <filename>activesupport/test/option_merger_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,7 +10,6 @@ config.cache_classes = true
 # Full error reports are disabled and caching is turned on
 config.action_controller.consider_all_requests_local = false
 config.action_controller.perform_caching             = true
-config.action_view.cache_template_loading            = true
 
 # Use a different cache store in production
 # config.cache_store = :mem_cache_store</diff>
      <filename>railties/environments/production.rb</filename>
    </modified>
    <modified>
      <diff>@@ -66,9 +66,9 @@ class MongrelSpawner &lt; Spawner
       &quot;-l #{OPTIONS[:rails_root]}/log/mongrel.log&quot;
 
     # Add prefix functionality to spawner's call to mongrel_rails
-    # Digging through monrel's project subversion server, the earliest
+    # Digging through mongrel's project subversion server, the earliest
     # Tag that has prefix implemented in the bin/mongrel_rails file
-    # is 0.3.15 which also happens to be the earilest tag listed.
+    # is 0.3.15 which also happens to be the earliest tag listed.
     # References: http://mongrel.rubyforge.org/svn/tags
     if Mongrel::Const::MONGREL_VERSION.to_f &gt;=0.3 &amp;&amp; !OPTIONS[:prefix].nil?
       cmd = cmd + &quot; --prefix #{OPTIONS[:prefix]}&quot;</diff>
      <filename>railties/lib/commands/process/spawner.rb</filename>
    </modified>
    <modified>
      <diff>@@ -98,7 +98,7 @@ module Rails
     #   Rails::Initializer.run(:set_load_path)
     #
     # This is useful if you only want the load path initialized, without
-    # incuring the overhead of completely loading the entire environment.
+    # incurring the overhead of completely loading the entire environment.
     def self.run(command = :process, configuration = Configuration.new)
       yield configuration if block_given?
       initializer = new configuration
@@ -414,8 +414,11 @@ Run `rake gems:install` to install the missing gems.
     # paths have already been set, it is not changed, otherwise it is
     # set to use Configuration#view_path.
     def initialize_framework_views
-      ActionMailer::Base.template_root ||= configuration.view_path  if configuration.frameworks.include?(:action_mailer)
-      ActionController::Base.view_paths = [configuration.view_path] if configuration.frameworks.include?(:action_controller) &amp;&amp; ActionController::Base.view_paths.empty?
+      ActionView::PathSet::Path.eager_load_templates! if configuration.cache_classes
+      view_path = ActionView::PathSet::Path.new(configuration.view_path)
+
+      ActionMailer::Base.template_root ||= view_path if configuration.frameworks.include?(:action_mailer)
+      ActionController::Base.view_paths = view_path if configuration.frameworks.include?(:action_controller) &amp;&amp; ActionController::Base.view_paths.empty?
     end
 
     # If Action Controller is not one of the loaded frameworks (Configuration#frameworks)
@@ -528,7 +531,7 @@ Run `rake gems:install` to install the missing gems.
     # A stub for setting options on ActiveRecord::Base.
     attr_accessor :active_record
 
-    # A stub for setting options on ActiveRecord::Base.
+    # A stub for setting options on ActiveResource::Base.
     attr_accessor :active_resource
 
     # A stub for setting options on ActiveSupport.</diff>
      <filename>railties/lib/initializer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,5 @@
 require 'action_controller/performance_test'
 
 ActionController::Base.perform_caching = true
-ActionView::Base.cache_template_loading = true
 ActiveSupport::Dependencies.mechanism = :require
 Rails.logger.level = ActiveSupport::BufferedLogger::INFO</diff>
      <filename>railties/lib/performance_test_help.rb</filename>
    </modified>
    <modified>
      <diff>@@ -57,6 +57,17 @@ module Rails
         end
 
         protected
+          def current_migration_number
+            Dir.glob(&quot;#{RAILS_ROOT}/#{@migration_directory}/[0-9]*_*.rb&quot;).inject(0) do |max, file_path|
+              n = File.basename(file_path).split('_', 2).first.to_i
+              if n &gt; max then n else max end
+            end
+          end
+             
+          def next_migration_number
+            current_migration_number + 1
+          end
+               
           def migration_directory(relative_path)
             directory(@migration_directory = relative_path)
           end
@@ -70,7 +81,11 @@ module Rails
           end
 
           def next_migration_string(padding = 3)
-            Time.now.utc.strftime(&quot;%Y%m%d%H%M%S&quot;)
+            if ActiveRecord::Base.timestamped_migrations
+              Time.now.utc.strftime(&quot;%Y%m%d%H%M%S&quot;)
+            else
+              &quot;%.#{padding}d&quot; % next_migration_number
+            end
           end
 
           def gsub_file(relative_destination, regexp, *args, &amp;block)</diff>
      <filename>railties/lib/rails_generator/commands.rb</filename>
    </modified>
    <modified>
      <diff>@@ -46,6 +46,7 @@ class AppGenerator &lt; Rails::Generator::Base
       # Root
       m.file &quot;fresh_rakefile&quot;, &quot;Rakefile&quot;
       m.file &quot;README&quot;,         &quot;README&quot;
+      m.file &quot;config.ru&quot;,      &quot;config.ru&quot;
 
       # Application
       m.template &quot;helpers/application.rb&quot;,        &quot;app/controllers/application.rb&quot;, :assigns =&gt; { :app_name =&gt; @app_name, :app_secret =&gt; md5.hexdigest }</diff>
      <filename>railties/lib/rails_generator/generators/applications/app/app_generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,11 @@
 Description:
     Scaffolds an entire resource, from model and migration to controller and
     views, along with a full test suite. The resource is ready to use as a
-    starting point for your restful, resource-oriented application.
+    starting point for your RESTful, resource-oriented application.
 
-    Pass the name of the model, either CamelCased or under_scored, as the first
-    argument, and an optional list of attribute pairs.
+    Pass the name of the model (in singular form), either CamelCased or
+    under_scored, as the first argument, and an optional list of attribute
+    pairs.
 
     Attribute pairs are column_name:sql_type arguments specifying the
     model's attributes. Timestamps are added by default, so you don't have to
@@ -13,13 +14,16 @@ Description:
     You don't have to think up every attribute up front, but it helps to
     sketch out a few so you can start working with the resource immediately.
 
-    For example, `scaffold post title:string body:text published:boolean`
+    For example, 'scaffold post title:string body:text published:boolean'
     gives you a model with those three attributes, a controller that handles
     the create/show/update/destroy, forms to create and edit your posts, and
     an index that lists them all, as well as a map.resources :posts
     declaration in config/routes.rb.
 
+    If you want to remove all the generated files, run
+    'script/destroy scaffold ModelName'.
+
 Examples:
-    `./script/generate scaffold post` # no attributes, view will be anemic
+    `./script/generate scaffold post`
     `./script/generate scaffold post title:string body:text published:boolean`
     `./script/generate scaffold purchase order_id:integer amount:decimal`</diff>
      <filename>railties/lib/rails_generator/generators/components/scaffold/USAGE</filename>
    </modified>
    <modified>
      <diff>@@ -45,7 +45,7 @@ module Rails
             usage = &quot;\nInstalled Generators\n&quot;
             Rails::Generator::Base.sources.inject([]) do |mem, source|
               # Using an association list instead of a hash to preserve order,
-              # for esthetic reasons more than anything else.
+              # for aesthetic reasons more than anything else.
               label = source.label.to_s.capitalize
               pair = mem.assoc(label)
               mem &lt;&lt; (pair = [label, []]) if pair.nil?</diff>
      <filename>railties/lib/rails_generator/scripts.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ require File.dirname(__FILE__) + '/../scripts'
 module Rails::Generator::Scripts
   class Destroy &lt; Base
     mandatory_options :command =&gt; :destroy
-    
+
     protected
     def usage_message
       usage = &quot;\nInstalled Generators\n&quot;
@@ -15,14 +15,13 @@ module Rails::Generator::Scripts
 
       usage &lt;&lt; &lt;&lt;end_blurb
 
-This script will destroy all files created by the corresponding 
-script/generate command. For instance, script/destroy migration CreatePost
-will delete the appropriate ###_create_post.rb file in db/migrate, while 
-script/destroy scaffold Post will delete the posts controller and 
+script/generate command. For instance, 'script/destroy migration CreatePost'
+will delete the appropriate XXX_create_post.rb migration file in db/migrate,
+while 'script/destroy scaffold Post' will delete the posts controller and
 views, post model and migration, all associated tests, and the map.resources
 :posts line in config/routes.rb.
-      
-For instructions on finding new generators, run script/generate
+
+For instructions on finding new generators, run script/generate.
 end_blurb
       return usage
     end</diff>
      <filename>railties/lib/rails_generator/scripts/destroy.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,7 +23,7 @@ module Rails
 
     # Generate a random secret key by using the Win32 API. Raises LoadError
     # if the current platform cannot make use of the Win32 API. Raises
-    # SystemCallError if some other error occured.
+    # SystemCallError if some other error occurred.
     def generate_secret_with_win32_api
       # Following code is based on David Garamond's GUID library for Ruby.
       require 'Win32API'</diff>
      <filename>railties/lib/rails_generator/secret_key_generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -226,7 +226,7 @@ class GeneratorTestCase &lt; Test::Unit::TestCase
     end
   end
 
-  # Asserts that the given fixtures yaml file was generated.
+  # Asserts that the given fixtures YAML file was generated.
   # It takes a fixture name without the &lt;tt&gt;.yml&lt;/tt&gt; part.
   # The parsed YAML tree is passed to a block.
   def assert_generated_fixtures_for(name)</diff>
      <filename>railties/test/generators/generator_test_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>842917dea0cfdf70f158a312cc1f77f769791d8c</id>
    </parent>
    <parent>
      <id>99930d499e424f4560b371412e05d10476216ece</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Kemper</name>
    <login>jeremy</login>
    <email>jeremy@bitsweat.net</email>
  </author>
  <url>http://github.com/rails/rails/commit/636e6b7138864ceb1e309939cd879e710b287f3e</url>
  <id>636e6b7138864ceb1e309939cd879e710b287f3e</id>
  <committed-date>2008-07-17T11:52:56-07:00</committed-date>
  <authored-date>2008-07-17T11:52:56-07:00</authored-date>
  <message>Merge branch 'master' into i18n-merge

Conflicts:

	actionpack/lib/action_view/helpers/form_options_helper.rb
	activerecord/lib/active_record/validations.rb</message>
  <tree>2a36dfef02f706302a20bb5b2d428b32e9af97f0</tree>
  <committer>
    <name>Jeremy Kemper</name>
    <login>jeremy</login>
    <email>jeremy@bitsweat.net</email>
  </committer>
</commit>
