<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>actionpack/lib/action_controller/abstract.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/abstract/base.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/abstract/callbacks.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/abstract/exceptions.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/abstract/helpers.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/abstract/layouts.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/abstract/logger.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/abstract/renderer.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/base.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/chained/benchmarking.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/chained/filters.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/chained/flash.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/cookies.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/helpers.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/http_authentication.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/layout.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/mime_responds.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/redirect.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/render.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/request_forgery_protection.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/responder.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/session_management.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/streaming.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/verification.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/deprecated.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/dispatch/dispatcher.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/dispatch/middlewares.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/dispatch/rescue.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/dispatch/templates/rescues/_request_and_response.erb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/dispatch/templates/rescues/_trace.erb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/dispatch/templates/rescues/diagnostics.erb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/dispatch/templates/rescues/layout.erb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/dispatch/templates/rescues/missing_template.erb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/dispatch/templates/rescues/routing_error.erb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/dispatch/templates/rescues/template_error.erb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/dispatch/templates/rescues/unknown_action.erb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/new_base.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/new_base/base.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/new_base/hide_actions.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/new_base/layouts.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/new_base/renderer.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/new_base/url_for.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/routing/generation/polymorphic_routes.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/routing/generation/url_rewriter.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/routing/resources.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/testing/assertions/dom.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/testing/assertions/model.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/testing/assertions/response.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/testing/assertions/routing.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/testing/assertions/selector.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/testing/assertions/tag.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/testing/integration.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/testing/performance.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/testing/process.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/testing/test_case.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/http/headers.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/http/mime_type.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/http/mime_types.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/http/request.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/http/response.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/http/status_codes.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/middleware/failsafe.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/middleware/params_parser.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/middleware/reloader.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/middleware/rewindable_input.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/middleware/session/abstract_store.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/middleware/session/cookie_store.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/middleware/session/mem_cache_store.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/middleware/stack.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/adapter/camping.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/auth/abstract/handler.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/auth/abstract/request.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/auth/basic.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/auth/digest/md5.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/auth/digest/nonce.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/auth/digest/params.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/auth/digest/request.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/auth/openid.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/builder.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/cascade.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/chunked.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/commonlogger.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/conditionalget.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/content_length.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/content_type.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/deflater.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/directory.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/file.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/handler.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/handler/cgi.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/handler/evented_mongrel.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/handler/fastcgi.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/handler/lsws.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/handler/mongrel.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/handler/scgi.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/handler/swiftiplied_mongrel.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/handler/thin.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/handler/webrick.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/head.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/lint.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/lobster.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/lock.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/methodoverride.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/mime.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/mock.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/recursive.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/reloader.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/request.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/response.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/session/abstract/id.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/session/cookie.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/session/memcache.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/session/pool.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/showexceptions.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/showstatus.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/static.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/urlmap.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_dispatch/vendor/rack-1.0/rack/utils.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_view/render/partials.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_view/render/rendering.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_view/template/error.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_view/template/handler.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_view/template/handlers.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_view/template/handlers/builder.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_view/template/handlers/erb.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_view/template/handlers/rjs.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_view/template/inline.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_view/template/partial.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_view/template/path.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_view/template/renderable.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_view/template/template.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_view/template/text.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/abstract_controller/abstract_controller_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/abstract_controller/callbacks_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/abstract_controller/helper_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/abstract_controller/layouts_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/abstract_controller/test_helper.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/abstract_controller/views/abstract_controller/testing/me3/formatted.html.erb</filename>
    </added>
    <added>
      <filename>actionpack/test/abstract_controller/views/abstract_controller/testing/me3/index.erb</filename>
    </added>
    <added>
      <filename>actionpack/test/abstract_controller/views/abstract_controller/testing/me4/index.erb</filename>
    </added>
    <added>
      <filename>actionpack/test/abstract_controller/views/abstract_controller/testing/me5/index.erb</filename>
    </added>
    <added>
      <filename>actionpack/test/abstract_controller/views/action_with_ivars.erb</filename>
    </added>
    <added>
      <filename>actionpack/test/abstract_controller/views/helper_test.erb</filename>
    </added>
    <added>
      <filename>actionpack/test/abstract_controller/views/index.erb</filename>
    </added>
    <added>
      <filename>actionpack/test/abstract_controller/views/layouts/abstract_controller/testing/me4.erb</filename>
    </added>
    <added>
      <filename>actionpack/test/abstract_controller/views/layouts/application.erb</filename>
    </added>
    <added>
      <filename>actionpack/test/abstract_controller/views/naked_render.erb</filename>
    </added>
    <added>
      <filename>actionpack/test/activerecord/polymorphic_routes_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/controller/request/test_request_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/dispatch/header_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/dispatch/middleware_stack_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/dispatch/mime_type_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/dispatch/rack_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/dispatch/request/json_params_parsing_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/dispatch/request/multipart_params_parsing_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/dispatch/request/query_string_parsing_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/dispatch/request/xml_params_parsing_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/dispatch/request_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/dispatch/session/cookie_store_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/dispatch/session/mem_cache_store_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/dispatch/session/test_session_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/fixtures/happy_path/render_action/hello_world.erb</filename>
    </added>
    <added>
      <filename>actionpack/test/fixtures/layout_tests/views/goodbye.rhtml</filename>
    </added>
    <added>
      <filename>actionpack/test/fixtures/test/basic.html.erb</filename>
    </added>
    <added>
      <filename>actionpack/test/lib/fixture_template.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/new_base/base_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/new_base/render_action_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/new_base/render_implicit_action_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/new_base/render_layout_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/new_base/render_template_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/new_base/render_text_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/new_base/test_helper.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/runner</filename>
    </added>
    <added>
      <filename>activerecord/test/cases/timestamp_test.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/concurrent_hash.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core/all.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core/time.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core/time/autoload.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/array/wrap.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/big_decimal.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/big_decimal/conversions.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/date/acts_like.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/date/freeze.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/date_time/acts_like.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/date_time/zones.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/module/deprecation.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/module/setup.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/object/acts_like.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/object/blank.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/object/duplicable.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/object/try.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/time/acts_like.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/time/marshal_with_utc_flag.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/time/publicize_conversion_methods.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/deprecation/behaviors.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/deprecation/method_wrappers.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/deprecation/proxy_wrappers.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/deprecation/reporting.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/hash_with_indifferent_access.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/mini.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/new_callbacks.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/testing/pending.rb</filename>
    </added>
    <added>
      <filename>activesupport/test/new_callback_inheritance_test.rb</filename>
    </added>
    <added>
      <filename>activesupport/test/new_callbacks_test.rb</filename>
    </added>
    <added>
      <filename>railties/guides/rails_guides/levenshtein.rb</filename>
    </added>
    <added>
      <filename>railties/guides/source/action_view_overview.textile</filename>
    </added>
    <added>
      <filename>railties/guides/source/rails_application_templates.textile</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -4,7 +4,7 @@ require 'rake/contrib/sshpublisher'
 
 env = %(PKG_BUILD=&quot;#{ENV['PKG_BUILD']}&quot;) if ENV['PKG_BUILD']
 
-PROJECTS = %w(activesupport actionpack actionmailer activeresource activerecord railties)
+PROJECTS = %w(activesupport actionpack actionmailer activemodel activeresource activerecord railties)
 
 Dir[&quot;#{File.dirname(__FILE__)}/*/lib/*/version.rb&quot;].each do |version_path|
   require version_path</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -373,6 +373,14 @@ module ActionMailer #:nodoc:
     attr_reader :mail
     attr_reader :template_name, :default_template_name, :action_name
 
+    def controller_path
+      self.class.controller_path
+    end
+    
+    def formats
+      @template.formats
+    end
+
     class &lt;&lt; self
       attr_writer :mailer_name
 
@@ -466,7 +474,7 @@ module ActionMailer #:nodoc:
         # have not already been specified manually.
         if @parts.empty?
           Dir.glob(&quot;#{template_path}/#{@template}.*&quot;).each do |path|
-            template = template_root[&quot;#{mailer_name}/#{File.basename(path)}&quot;]
+            template = template_root.find_by_parts(&quot;#{mailer_name}/#{File.basename(path)}&quot;)
 
             # Skip unless template has a multipart format
             next unless template &amp;&amp; template.multipart?
@@ -475,7 +483,7 @@ module ActionMailer #:nodoc:
               :content_type =&gt; template.content_type,
               :disposition =&gt; &quot;inline&quot;,
               :charset =&gt; charset,
-              :body =&gt; render_message(template, @body)
+              :body =&gt; render_template(template, @body)
             )
           end
           unless @parts.empty?
@@ -489,7 +497,7 @@ module ActionMailer #:nodoc:
         # normal template exists (or if there were no implicit parts) we render
         # it.
         template_exists = @parts.empty?
-        template_exists ||= template_root[&quot;#{mailer_name}/#{@template}&quot;]
+        template_exists ||= template_root.find_by_parts(&quot;#{mailer_name}/#{@template}&quot;)
         @body = render_message(@template, @body) if template_exists
 
         # Finally, if there are other message parts and a textual body exists,
@@ -514,6 +522,7 @@ module ActionMailer #:nodoc:
     # no alternate has been given as the parameter, this will fail.
     def deliver!(mail = @mail)
       raise &quot;no mail object available for delivery!&quot; unless mail
+      
       unless logger.nil?
         logger.info  &quot;Sent mail to #{Array(recipients).join(', ')}&quot;
         logger.debug &quot;\n#{mail.encoded}&quot;
@@ -545,27 +554,43 @@ module ActionMailer #:nodoc:
         @mime_version = @@default_mime_version.dup if @@default_mime_version
       end
 
-      def render_message(method_name, body)
-        if method_name.respond_to?(:content_type)
-          @current_template_content_type = method_name.content_type
+      def render_template(template, body)
+        if template.respond_to?(:content_type)
+          @current_template_content_type = template.content_type
         end
+        
+        @template = initialize_template_class(body)
+        layout = _pick_layout(layout, true) unless template.exempt_from_layout?
+        @template._render_template_with_layout(template, layout, {})
+      ensure
+        @current_template_content_type = nil
+      end
+
+      def render_message(method_name, body)
         render :file =&gt; method_name, :body =&gt; body
       ensure
         @current_template_content_type = nil
       end
 
       def render(opts)
-        body = opts.delete(:body)
-        if opts[:file] &amp;&amp; (opts[:file] !~ /\// &amp;&amp; !opts[:file].respond_to?(:render))
-          opts[:file] = &quot;#{mailer_name}/#{opts[:file]}&quot;
-        end
-
+        layout, file = opts.delete(:layout), opts[:file]
+        
         begin
-          old_template, @template = @template, initialize_template_class(body)
-          layout = respond_to?(:pick_layout, true) ? pick_layout(opts) : false
-          @template.render(opts.merge(:layout =&gt; layout))
-        ensure
-          @template = old_template
+          @template = initialize_template_class(opts.delete(:body))
+          
+          if file
+            prefix = mailer_name unless file =~ /\//
+            template = view_paths.find_by_parts(file, formats, prefix)
+          end
+
+          layout = _pick_layout(layout, 
+            !template || !template.exempt_from_layout?)
+
+          if template
+            @template._render_template_with_layout(template, layout, opts)
+          elsif inline = opts[:inline]
+            @template._render_inline(inline, layout, opts)
+          end
         end
       end
 
@@ -577,12 +602,6 @@ module ActionMailer #:nodoc:
         end
       end
 
-      def candidate_for_layout?(options)
-        !self.view_paths.find_template(default_template_name, default_template_format).exempt_from_layout?
-      rescue ActionView::MissingTemplate
-        return true
-      end
-
       def template_root
         self.class.template_root
       end
@@ -597,7 +616,7 @@ module ActionMailer #:nodoc:
 
       def initialize_template_class(assigns)
         template = ActionView::Base.new(self.class.view_paths, assigns, self)
-        template.template_format = default_template_format
+        template.formats = [default_template_format]
         template
       end
 </diff>
      <filename>actionmailer/lib/action_mailer/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,6 @@ ActionView::Template.register_template_handler :bak, lambda { |template| &quot;Lame b
 
 $:.unshift &quot;#{File.dirname(__FILE__)}/fixtures/helpers&quot;
 
-ActionView::Base.cache_template_loading = true
 FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures')
 ActionMailer::Base.template_root = FIXTURE_LOAD_PATH
 </diff>
      <filename>actionmailer/test/abstract_unit.rb</filename>
    </modified>
    <modified>
      <diff>@@ -565,13 +565,31 @@ class ActionMailerTest &lt; Test::Unit::TestCase
     TestMailer.deliver_signed_up(@recipient)
   end
 
+  class FakeLogger
+    attr_reader :info_contents, :debug_contents
+    
+    def initialize
+      @info_contents, @debug_contents = &quot;&quot;, &quot;&quot;
+    end
+    
+    def info(str)
+      @info_contents &lt;&lt; str
+    end
+    
+    def debug(str)
+      @debug_contents &lt;&lt; str
+    end
+  end
+
   def test_delivery_logs_sent_mail
     mail = TestMailer.create_signed_up(@recipient)
-    logger = mock()
-    logger.expects(:info).with(&quot;Sent mail to #{@recipient}&quot;)
-    logger.expects(:debug).with(&quot;\n#{mail.encoded}&quot;)
-    TestMailer.logger = logger
+    # logger = mock()
+    # logger.expects(:info).with(&quot;Sent mail to #{@recipient}&quot;)
+    # logger.expects(:debug).with(&quot;\n#{mail.encoded}&quot;)
+    TestMailer.logger = FakeLogger.new
     TestMailer.deliver_signed_up(@recipient)
+    assert(TestMailer.logger.info_contents =~ /Sent mail to #{@recipient}/)
+    assert_equal(TestMailer.logger.debug_contents, &quot;\n#{mail.encoded}&quot;)
   end
 
   def test_unquote_quoted_printable_subject</diff>
      <filename>actionmailer/test/mail_service_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,14 @@
+*Edge*
+
+* Fixed that TestResponse.cookies was returning cookies unescaped #1867 [Doug McInnes]
+
+
 *2.3.2 [Final] (March 15, 2009)*
 
 * Fixed that redirection would just log the options, not the final url (which lead to &quot;Redirected to #&lt;Post:0x23150b8&gt;&quot;) [DHH]
 
+* Don't check authenticity tokens for any AJAX requests [Ross Kaffenberger/Bryan Helmkamp]
+
 * Added ability to pass in :public =&gt; true to fresh_when, stale?, and expires_in to make the request proxy cachable #2095 [Gregg Pollack]
 
 * Fixed that passing a custom form builder would be forwarded to nested fields_for calls #2023 [Eloy Duran/Nate Wiger]</diff>
      <filename>actionpack/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -30,7 +30,7 @@ Rake::TestTask.new(:test_action_pack) do |t|
 
   # make sure we include the tests in alphabetical order as on some systems
   # this will not happen automatically and the tests (as a whole) will error
-  t.test_files = Dir.glob( &quot;test/[cft]*/**/*_test.rb&quot; ).sort
+  t.test_files = Dir.glob( &quot;test/[cdft]*/**/*_test.rb&quot; ).sort
 
   t.verbose = true
   #t.warning = true</diff>
      <filename>actionpack/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -31,86 +31,59 @@ rescue LoadError
   end
 end
 
-begin
-  gem 'rack', '~&gt; 1.0.0'
-  require 'rack'
-rescue Gem::LoadError
-  require 'action_controller/vendor/rack-1.0/rack'
-end
+require File.join(File.dirname(__FILE__), &quot;action_pack&quot;)
 
 module ActionController
   # TODO: Review explicit to see if they will automatically be handled by
   # the initilizer if they are really needed.
   def self.load_all!
-    [Base, CGIHandler, CgiRequest, Request, Response, Http::Headers, UrlRewriter, UrlWriter]
+    [Base, Request, Response, UrlRewriter, UrlWriter]
+    [ActionDispatch::Http::Headers]
   end
 
-  autoload :AbstractRequest, 'action_controller/request'
-  autoload :Base, 'action_controller/base'
-  autoload :Benchmarking, 'action_controller/benchmarking'
+  autoload :Base, 'action_controller/base/base'
+  autoload :Benchmarking, 'action_controller/base/chained/benchmarking'
   autoload :Caching, 'action_controller/caching'
-  autoload :Cookies, 'action_controller/cookies'
-  autoload :Dispatcher, 'action_controller/dispatcher'
-  autoload :Failsafe, 'action_controller/failsafe'
-  autoload :Filters, 'action_controller/filters'
-  autoload :Flash, 'action_controller/flash'
-  autoload :Helpers, 'action_controller/helpers'
-  autoload :HttpAuthentication, 'action_controller/http_authentication'
-  autoload :Integration, 'action_controller/integration'
-  autoload :IntegrationTest, 'action_controller/integration'
-  autoload :Layout, 'action_controller/layout'
-  autoload :MiddlewareStack, 'action_controller/middleware_stack'
-  autoload :MimeResponds, 'action_controller/mime_responds'
-  autoload :ParamsParser, 'action_controller/params_parser'
-  autoload :PolymorphicRoutes, 'action_controller/polymorphic_routes'
+  autoload :Cookies, 'action_controller/base/cookies'
+  autoload :Dispatcher, 'action_controller/dispatch/dispatcher'
+  autoload :Filters, 'action_controller/base/chained/filters'
+  autoload :Flash, 'action_controller/base/chained/flash'
+  autoload :Helpers, 'action_controller/base/helpers'
+  autoload :HttpAuthentication, 'action_controller/base/http_authentication'
+  autoload :Integration, 'action_controller/testing/integration'
+  autoload :IntegrationTest, 'action_controller/testing/integration'
+  autoload :Layout, 'action_controller/base/layout'
+  autoload :MimeResponds, 'action_controller/base/mime_responds'
+  autoload :PolymorphicRoutes, 'action_controller/routing/generation/polymorphic_routes'
   autoload :RecordIdentifier, 'action_controller/record_identifier'
-  autoload :Reloader, 'action_controller/reloader'
-  autoload :Request, 'action_controller/request'
-  autoload :RequestForgeryProtection, 'action_controller/request_forgery_protection'
-  autoload :Rescue, 'action_controller/rescue'
-  autoload :Resources, 'action_controller/resources'
-  autoload :Response, 'action_controller/response'
-  autoload :RewindableInput, 'action_controller/rewindable_input'
+  autoload :Redirector, 'action_controller/base/redirect'
+  autoload :Renderer, 'action_controller/base/render'
+  autoload :RequestForgeryProtection, 'action_controller/base/request_forgery_protection'
+  autoload :Rescue, 'action_controller/dispatch/rescue'
+  autoload :Resources, 'action_controller/routing/resources'
+  autoload :Responder, 'action_controller/base/responder'
   autoload :Routing, 'action_controller/routing'
-  autoload :SessionManagement, 'action_controller/session_management'
-  autoload :StatusCodes, 'action_controller/status_codes'
-  autoload :Streaming, 'action_controller/streaming'
-  autoload :TestCase, 'action_controller/test_case'
-  autoload :TestProcess, 'action_controller/test_process'
+  autoload :SessionManagement, 'action_controller/base/session_management'
+  autoload :Streaming, 'action_controller/base/streaming'
+  autoload :TestCase, 'action_controller/testing/test_case'
+  autoload :TestProcess, 'action_controller/testing/process'
   autoload :Translation, 'action_controller/translation'
-  autoload :UploadedFile, 'action_controller/uploaded_file'
-  autoload :UploadedStringIO, 'action_controller/uploaded_file'
-  autoload :UploadedTempfile, 'action_controller/uploaded_file'
-  autoload :UrlRewriter, 'action_controller/url_rewriter'
-  autoload :UrlWriter, 'action_controller/url_rewriter'
-  autoload :Verification, 'action_controller/verification'
+  autoload :UrlEncodedPairParser, 'action_controller/dispatch/url_encoded_pair_parser'
+  autoload :UrlRewriter, 'action_controller/routing/generation/url_rewriter'
+  autoload :UrlWriter, 'action_controller/routing/generation/url_rewriter'
+  autoload :Verification, 'action_controller/base/verification'
 
   module Assertions
-    autoload :DomAssertions, 'action_controller/assertions/dom_assertions'
-    autoload :ModelAssertions, 'action_controller/assertions/model_assertions'
-    autoload :ResponseAssertions, 'action_controller/assertions/response_assertions'
-    autoload :RoutingAssertions, 'action_controller/assertions/routing_assertions'
-    autoload :SelectorAssertions, 'action_controller/assertions/selector_assertions'
-    autoload :TagAssertions, 'action_controller/assertions/tag_assertions'
-  end
-
-  module Http
-    autoload :Headers, 'action_controller/headers'
+    autoload :DomAssertions, 'action_controller/testing/assertions/dom'
+    autoload :ModelAssertions, 'action_controller/testing/assertions/model'
+    autoload :ResponseAssertions, 'action_controller/testing/assertions/response'
+    autoload :RoutingAssertions, 'action_controller/testing/assertions/routing'
+    autoload :SelectorAssertions, 'action_controller/testing/assertions/selector'
+    autoload :TagAssertions, 'action_controller/testing/assertions/tag'
   end
-
-  module Session
-    autoload :AbstractStore, 'action_controller/session/abstract_store'
-    autoload :CookieStore, 'action_controller/session/cookie_store'
-    autoload :MemCacheStore, 'action_controller/session/mem_cache_store'
-  end
-
-  # DEPRECATE: Remove CGI support
-  autoload :CgiRequest, 'action_controller/cgi_process'
-  autoload :CGIHandler, 'action_controller/cgi_process'
 end
 
-autoload :Mime, 'action_controller/mime_type'
-
 autoload :HTML, 'action_controller/vendor/html-scanner'
 
+require 'action_dispatch'
 require 'action_view'</diff>
      <filename>actionpack/lib/action_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,7 +13,7 @@ module ActionController #:nodoc:
   #
   # == Caching stores
   #
-  # All the caching stores from ActiveSupport::Cache is available to be used as backends for Action Controller caching. This setting only
+  # All the caching stores from ActiveSupport::Cache are available to be used as backends for Action Controller caching. This setting only
   # affects action and fragment caching as page caching is always written to disk.
   #
   # Configuration examples (MemoryStore is the default):</diff>
      <filename>actionpack/lib/action_controller/caching.rb</filename>
    </modified>
    <modified>
      <diff>@@ -134,7 +134,7 @@ module ActionController #:nodoc:
           end
         end
         
-        # When true, infer_extension will look up the cache path extension from the request's path &amp; format.
+        # If +infer_extension+ is true, the cache path extension is looked up from the request's path &amp; format.
         # This is desirable when reading and writing the cache, but not when expiring the cache -
         # expire_action should expire the same files regardless of the request format.
         def initialize(controller, options = {}, infer_extension = true)</diff>
      <filename>actionpack/lib/action_controller/caching/actions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-module ActionController  
+module ActionController
   # The record identifier encapsulates a number of naming conventions for dealing with records, like Active Records or 
   # Active Resources or pretty much any other model type that has an id. These patterns are then used to try elevate
   # the view actions to a higher logical level. Example:</diff>
      <filename>actionpack/lib/action_controller/record_identifier.rb</filename>
    </modified>
    <modified>
      <diff>@@ -428,7 +428,7 @@ module ActionController
       end
 
       def call(env)
-        request = Request.new(env)
+        request = ActionDispatch::Request.new(env)
         app = Routing::Routes.recognize(request)
         app.call(env).to_a
       end</diff>
      <filename>actionpack/lib/action_controller/routing/route_set.rb</filename>
    </modified>
    <modified>
      <diff>@@ -31,6 +31,8 @@ rescue LoadError
   end
 end
 
+require File.join(File.dirname(__FILE__), &quot;action_pack&quot;)
+
 module ActionView
   def self.load_all!
     [Base, InlineTemplate, TemplateError]
@@ -38,16 +40,18 @@ module ActionView
 
   autoload :Base, 'action_view/base'
   autoload :Helpers, 'action_view/helpers'
-  autoload :InlineTemplate, 'action_view/inline_template'
-  autoload :Partials, 'action_view/partials'
+  autoload :InlineTemplate, 'action_view/template/inline'
+  autoload :Partials, 'action_view/render/partials'
+  autoload :Path, 'action_view/template/path'
   autoload :PathSet, 'action_view/paths'
-  autoload :Renderable, 'action_view/renderable'
-  autoload :RenderablePartial, 'action_view/renderable_partial'
-  autoload :Template, 'action_view/template'
-  autoload :ReloadableTemplate, 'action_view/reloadable_template'
-  autoload :TemplateError, 'action_view/template_error'
-  autoload :TemplateHandler, 'action_view/template_handler'
-  autoload :TemplateHandlers, 'action_view/template_handlers'
+  autoload :Rendering, 'action_view/render/rendering'
+  autoload :Renderable, 'action_view/template/renderable'
+  autoload :RenderablePartial, 'action_view/template/partial'
+  autoload :Template, 'action_view/template/template'
+  autoload :TemplateError, 'action_view/template/error'
+  autoload :TemplateHandler, 'action_view/template/handler'
+  autoload :TemplateHandlers, 'action_view/template/handlers'
+  autoload :TextTemplate, 'action_view/template/text'
   autoload :Helpers, 'action_view/helpers'
 end
 </diff>
      <filename>actionpack/lib/action_view.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,10 +3,11 @@ module ActionView #:nodoc:
   end
 
   class MissingTemplate &lt; ActionViewError #:nodoc:
-    attr_reader :path
+    attr_reader :path, :action_name
 
     def initialize(paths, path, template_format = nil)
       @path = path
+      @action_name = path.split(&quot;/&quot;).last.split(&quot;.&quot;)[0...-1].join(&quot;.&quot;)
       full_template_path = path.include?('.') ? path : &quot;#{path}.erb&quot;
       display_paths = paths.compact.join(&quot;:&quot;)
       template_type = (path =~ /layouts/i) ? 'layout' : 'template'
@@ -160,14 +161,13 @@ module ActionView #:nodoc:
   #
   # See the ActionView::Helpers::PrototypeHelper::GeneratorMethods documentation for more details.
   class Base
-    include Helpers, Partials, ::ERB::Util
+    include Helpers, Rendering, Partials, ::ERB::Util
+
     extend ActiveSupport::Memoizable
 
-    attr_accessor :base_path, :assigns, :template_extension
+    attr_accessor :base_path, :assigns, :template_extension, :formats
     attr_accessor :controller
 
-    attr_writer :template_format
-
     attr_accessor :output_buffer
 
     class &lt;&lt; self
@@ -193,9 +193,13 @@ module ActionView #:nodoc:
 
     attr_internal :request
 
+    delegate :controller_path, :to =&gt; :controller, :allow_nil =&gt; true
+
     delegate :request_forgery_protection_token, :template, :params, :session, :cookies, :response, :headers,
              :flash, :logger, :action_name, :controller_name, :to =&gt; :controller
 
+    delegate :find_by_parts, :to =&gt; :view_paths
+
     module CompiledTemplates #:nodoc:
       # holds compiled template code
     end
@@ -218,7 +222,8 @@ module ActionView #:nodoc:
       end
     end
 
-    def initialize(view_paths = [], assigns_for_first_render = {}, controller = nil)#:nodoc:
+    def initialize(view_paths = [], assigns_for_first_render = {}, controller = nil, formats = nil)#:nodoc:
+      @formats = formats || [:html]
       @assigns = assigns_for_first_render
       @assigns_added = nil
       @controller = controller
@@ -233,56 +238,6 @@ module ActionView #:nodoc:
 
     def view_paths=(paths)
       @view_paths = self.class.process_view_paths(paths)
-      # we might be using ReloadableTemplates, so we need to let them know this a new request
-      @view_paths.load!
-    end
-
-    # Returns the result of a render that's dictated by the options hash. The primary options are:
-    #
-    # * &lt;tt&gt;:partial&lt;/tt&gt; - See ActionView::Partials.
-    # * &lt;tt&gt;:update&lt;/tt&gt; - Calls update_page with the block given.
-    # * &lt;tt&gt;:file&lt;/tt&gt; - Renders an explicit template file (this used to be the old default), add :locals to pass in those.
-    # * &lt;tt&gt;:inline&lt;/tt&gt; - Renders an inline template similar to how it's done in the controller.
-    # * &lt;tt&gt;:text&lt;/tt&gt; - Renders the text passed in out.
-    #
-    # If no options hash is passed or :update specified, the default is to render a partial and use the second parameter
-    # as the locals hash.
-    def render(options = {}, local_assigns = {}, &amp;block) #:nodoc:
-      local_assigns ||= {}
-
-      case options
-      when Hash
-        options = options.reverse_merge(:locals =&gt; {})
-        if options[:layout]
-          _render_with_layout(options, local_assigns, &amp;block)
-        elsif options[:file]
-          template = self.view_paths.find_template(options[:file], template_format)
-          template.render_template(self, options[:locals])
-        elsif options[:partial]
-          render_partial(options)
-        elsif options[:inline]
-          InlineTemplate.new(options[:inline], options[:type]).render(self, options[:locals])
-        elsif options[:text]
-          options[:text]
-        end
-      when :update
-        update_page(&amp;block)
-      else
-        render_partial(:partial =&gt; options, :locals =&gt; local_assigns)
-      end
-    end
-
-    # The format to be used when choosing between multiple templates with
-    # the same name but differing formats.  See +Request#template_format+
-    # for more details.
-    def template_format
-      if defined? @template_format
-        @template_format
-      elsif controller &amp;&amp; controller.respond_to?(:request)
-        @template_format = controller.request.template_format.to_sym
-      else
-        @template_format = :html
-      end
     end
 
     # Access the current template being rendered.
@@ -332,32 +287,5 @@ module ActionView #:nodoc:
           controller.response.content_type ||= content_type
         end
       end
-
-      def _render_with_layout(options, local_assigns, &amp;block) #:nodoc:
-        partial_layout = options.delete(:layout)
-
-        if block_given?
-          begin
-            @_proc_for_layout = block
-            concat(render(options.merge(:partial =&gt; partial_layout)))
-          ensure
-            @_proc_for_layout = nil
-          end
-        else
-          begin
-            original_content_for_layout = @content_for_layout if defined?(@content_for_layout)
-            @content_for_layout = render(options)
-
-            if (options[:inline] || options[:file] || options[:text])
-              @cached_content_for_layout = @content_for_layout
-              render(:file =&gt; partial_layout, :locals =&gt; local_assigns)
-            else
-              render(options.merge(:partial =&gt; partial_layout))
-            end
-          ensure
-            @content_for_layout = original_content_for_layout
-          end
-        end
-      end
   end
 end</diff>
      <filename>actionpack/lib/action_view/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -194,7 +194,7 @@ module ActionView
               options[:header_message]
             else
               object_name = options[:object_name].to_s.gsub('_', ' ')
-              object_name = I18n.t(object_name, :default =&gt; object_name, :scope =&gt; [:activerecord, :models], :count =&gt; 1)
+              object_name = I18n.t(options[:object_name].to_s, :default =&gt; object_name, :scope =&gt; [:activerecord, :models], :count =&gt; 1)
               locale.t :header, :count =&gt; count, :model =&gt; object_name
             end
             message = options.include?(:message) ? options[:message] : locale.t(:body)</diff>
      <filename>actionpack/lib/action_view/helpers/active_record_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -106,8 +106,8 @@ module ActionView
       alias_method :distance_of_time_in_words_to_now, :time_ago_in_words
 
       # Returns a set of select tags (one for year, month, and day) pre-selected for accessing a specified date-based
-      # attribute (identified by +method+) on an object assigned to the template (identified by +object+). You can
-      # the output in the +options+ hash.
+      # attribute (identified by +method+) on an object assigned to the template (identified by +object+).
+      #
       #
       # ==== Options
       # * &lt;tt&gt;:use_month_numbers&lt;/tt&gt; - Set to true if you want to use month numbers rather than month names (e.g.
@@ -232,7 +232,7 @@ module ActionView
 
       # Returns a set of select tags (one for year, month, day, hour, and minute) pre-selected for accessing a
       # specified datetime-based attribute (identified by +method+) on an object assigned to the template (identified
-      # by +object+). Examples:
+      # by +object+).
       #
       # If anything is passed in the html_options hash it will be applied to every select tag in the set.
       #</diff>
      <filename>actionpack/lib/action_view/helpers/date_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -628,7 +628,7 @@ module ActionView
       #
       # 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
+      # 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
       #
@@ -636,12 +636,15 @@ module ActionView
       #
       # 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.
+      # To prevent this the helper generates an auxiliary hidden field before
+      # the very check box. The hidden field has the same name and its
+      # attributes mimick an unchecked check box.
+      #
+      # This way, 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 parameters extraction gets the last occurrence of any repeated
+      # key in the query string, that works for ordinary forms.
       #
       # Unfortunately that workaround does not work when the check box goes
       # within an array-like parameter, as in
@@ -652,22 +655,26 @@ module ActionView
       #   &lt;% end %&gt;
       #
       # because parameter name repetition is precisely what Rails seeks to distinguish
-      # the elements of the array.
+      # the elements of the array. For each item with a checked check box you
+      # get an extra ghost item with only that attribute, assigned to &quot;0&quot;.
+      #
+      # In that case it is preferable to either use +check_box_tag+ or to use
+      # hashes instead of arrays.
       #
       # ==== Examples
       #   # Let's say that @post.validated? is 1:
       #   check_box(&quot;post&quot;, &quot;validated&quot;)
-      #   # =&gt; &lt;input type=&quot;checkbox&quot; id=&quot;post_validated&quot; name=&quot;post[validated]&quot; value=&quot;1&quot; /&gt;
-      #   #    &lt;input name=&quot;post[validated]&quot; type=&quot;hidden&quot; value=&quot;0&quot; /&gt;
+      #   # =&gt; &lt;input name=&quot;post[validated]&quot; type=&quot;hidden&quot; value=&quot;0&quot; /&gt;
+      #   #    &lt;input type=&quot;checkbox&quot; id=&quot;post_validated&quot; name=&quot;post[validated]&quot; value=&quot;1&quot; /&gt;
       #
       #   # Let's say that @puppy.gooddog is &quot;no&quot;:
       #   check_box(&quot;puppy&quot;, &quot;gooddog&quot;, {}, &quot;yes&quot;, &quot;no&quot;)
-      #   # =&gt; &lt;input type=&quot;checkbox&quot; id=&quot;puppy_gooddog&quot; name=&quot;puppy[gooddog]&quot; value=&quot;yes&quot; /&gt;
-      #   #    &lt;input name=&quot;puppy[gooddog]&quot; type=&quot;hidden&quot; value=&quot;no&quot; /&gt;
+      #   # =&gt; &lt;input name=&quot;puppy[gooddog]&quot; type=&quot;hidden&quot; value=&quot;no&quot; /&gt;
+      #   #    &lt;input type=&quot;checkbox&quot; id=&quot;puppy_gooddog&quot; name=&quot;puppy[gooddog]&quot; value=&quot;yes&quot; /&gt;
       #
       #   check_box(&quot;eula&quot;, &quot;accepted&quot;, { :class =&gt; 'eula_check' }, &quot;yes&quot;, &quot;no&quot;)
-      #   # =&gt; &lt;input type=&quot;checkbox&quot; class=&quot;eula_check&quot; id=&quot;eula_accepted&quot; name=&quot;eula[accepted]&quot; value=&quot;yes&quot; /&gt;
-      #   #    &lt;input name=&quot;eula[accepted]&quot; type=&quot;hidden&quot; value=&quot;no&quot; /&gt;
+      #   # =&gt; &lt;input name=&quot;eula[accepted]&quot; type=&quot;hidden&quot; value=&quot;no&quot; /&gt;
+      #   #    &lt;input type=&quot;checkbox&quot; class=&quot;eula_check&quot; id=&quot;eula_accepted&quot; name=&quot;eula[accepted]&quot; value=&quot;yes&quot; /&gt;
       #
       def check_box(object_name, method, options = {}, checked_value = &quot;1&quot;, unchecked_value = &quot;0&quot;)
         InstanceTag.new(object_name, method, self, options.delete(:object)).to_check_box_tag(options, checked_value, unchecked_value)</diff>
      <filename>actionpack/lib/action_view/helpers/form_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -406,7 +406,7 @@ module ActionView
       # &lt;tt&gt;legend&lt;/tt&gt; will become the fieldset's title (optional as per W3C).
       # &lt;tt&gt;options&lt;/tt&gt; accept the same values as tag.
       #
-      # === Examples
+      # ==== Examples
       #   &lt;% field_set_tag do %&gt;
       #     &lt;p&gt;&lt;%= text_field_tag 'name' %&gt;&lt;/p&gt;
       #   &lt;% end %&gt;</diff>
      <filename>actionpack/lib/action_view/helpers/form_tag_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -987,13 +987,13 @@ module ActionView
             end
 
             def render(*options_for_render)
-              old_format = @context &amp;&amp; @context.template_format
-              @context.template_format = :html if @context
+              old_formats = @context &amp;&amp; @context.formats
+              @context.formats = [:html] if @context
               Hash === options_for_render.first ?
                 @context.render(*options_for_render) :
                   options_for_render.first.to_s
             ensure
-              @context.template_format = old_format if @context
+              @context.formats = old_formats if @context
             end
 
             def javascript_object_for(object)</diff>
      <filename>actionpack/lib/action_view/helpers/prototype_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -324,7 +324,7 @@ module ActionView
 
       # Turns all URLs and e-mail addresses into clickable links. The &lt;tt&gt;:link&lt;/tt&gt; option
       # will limit what should be linked. You can add HTML attributes to the links using
-      # &lt;tt&gt;:href_options&lt;/tt&gt;. Possible values for &lt;tt&gt;:link&lt;/tt&gt; are &lt;tt&gt;:all&lt;/tt&gt; (default),
+      # &lt;tt&gt;:html&lt;/tt&gt;. Possible values for &lt;tt&gt;:link&lt;/tt&gt; are &lt;tt&gt;:all&lt;/tt&gt; (default),
       # &lt;tt&gt;:email_addresses&lt;/tt&gt;, and &lt;tt&gt;:urls&lt;/tt&gt;. If a block is given, each URL and
       # e-mail address is yielded and the result is used as the link text.
       #
@@ -341,7 +341,7 @@ module ActionView
       #   # =&gt; &quot;Visit http://www.loudthinking.com/ or e-mail &lt;a href=\&quot;mailto:david@loudthinking.com\&quot;&gt;david@loudthinking.com&lt;/a&gt;&quot;
       #
       #   post_body = &quot;Welcome to my new blog at http://www.myblog.com/.  Please e-mail me at me@email.com.&quot;
-      #   auto_link(post_body, :href_options =&gt; { :target =&gt; '_blank' }) do |text|
+      #   auto_link(post_body, :html =&gt; { :target =&gt; '_blank' }) do |text|
       #     truncate(text, 15)
       #   end
       #   # =&gt; &quot;Welcome to my new blog at &lt;a href=\&quot;http://www.myblog.com/\&quot; target=\&quot;_blank\&quot;&gt;http://www.m...&lt;/a&gt;.
@@ -359,7 +359,7 @@ module ActionView
       #   auto_link(post_body, :all, :target =&gt; &quot;_blank&quot;)     # =&gt; Once upon\na time
       #   # =&gt; &quot;Welcome to my new blog at &lt;a href=\&quot;http://www.myblog.com/\&quot; target=\&quot;_blank\&quot;&gt;http://www.myblog.com&lt;/a&gt;.
       #         Please e-mail me at &lt;a href=\&quot;mailto:me@email.com\&quot;&gt;me@email.com&lt;/a&gt;.&quot;
-      def auto_link(text, *args, &amp;block)#link = :all, href_options = {}, &amp;block)
+      def auto_link(text, *args, &amp;block)#link = :all, html = {}, &amp;block)
         return '' if text.blank?
 
         options = args.size == 2 ? {} : args.extract_options! # this is necessary because the old auto_link API has a Hash as its last parameter</diff>
      <filename>actionpack/lib/action_view/helpers/text_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,16 +2,13 @@ module ActionView #:nodoc:
   class PathSet &lt; Array #:nodoc:
     def self.type_cast(obj)
       if obj.is_a?(String)
-        if Base.cache_template_loading?
-          Template::EagerPath.new(obj.to_s)
-        else
-          ReloadableTemplate::ReloadablePath.new(obj.to_s)
-        end
+        cache = !Object.const_defined?(:Rails) || Rails.configuration.cache_classes
+        Template::FileSystemPath.new(obj, :cache =&gt; cache)
       else
         obj
       end
     end
-    
+
     def initialize(*args)
       super(*args).map! { |obj| self.class.type_cast(obj) }
     end
@@ -35,9 +32,29 @@ module ActionView #:nodoc:
     def unshift(*objs)
       super(*objs.map { |obj| self.class.type_cast(obj) })
     end
+
+    def find_by_parts(path, extension = nil, prefix = nil, partial = false)
+      template_path = path.sub(/^\//, '')
+
+      each do |load_path|
+        if template = load_path.find_by_parts(template_path, extension, prefix, partial)
+          return template
+        end
+      end
+
+      Template.new(path, self)
+    rescue ActionView::MissingTemplate =&gt; e
+      extension ||= []
+      raise ActionView::MissingTemplate.new(self, &quot;#{prefix}/#{path}.{#{extension.join(&quot;,&quot;)}}&quot;)
+    end
     
-    def load!
-      each(&amp;:load!)
+    def find_by_parts?(path, extension = nil, prefix = nil, partial = false)
+      template_path = path.sub(/^\//, '')
+
+      each do |load_path|
+        return true if template = load_path.find_by_parts(template_path, extension, prefix, partial)
+      end      
+      false
     end
 
     def find_template(original_template_path, format = nil, html_fallback = true)
@@ -45,13 +62,7 @@ module ActionView #:nodoc:
       template_path = original_template_path.sub(/^\//, '')
 
       each do |load_path|
-        if format &amp;&amp; (template = load_path[&quot;#{template_path}.#{I18n.locale}.#{format}&quot;])
-          return template
-        elsif format &amp;&amp; (template = load_path[&quot;#{template_path}.#{format}&quot;])
-          return template
-        elsif template = load_path[&quot;#{template_path}.#{I18n.locale}&quot;]
-          return template
-        elsif template = load_path[template_path]
+        if template = load_path.find_by_parts(template_path, format)
           return template
         # Try to find html version if the format is javascript
         elsif format == :js &amp;&amp; html_fallback &amp;&amp; template = load_path[&quot;#{template_path}.#{I18n.locale}.html&quot;]</diff>
      <filename>actionpack/lib/action_view/paths.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,18 +7,15 @@ module ActionView
       @_rendered = { :template =&gt; nil, :partials =&gt; Hash.new(0) }
       initialize_without_template_tracking(*args)
     end
-  end
-
-  module Renderable
-    alias_method :render_without_template_tracking, :render
-    def render(view, local_assigns = {})
-      if respond_to?(:path) &amp;&amp; !is_a?(InlineTemplate)
-        rendered = view.instance_variable_get(:@_rendered)
-        rendered[:partials][self] += 1 if is_a?(RenderablePartial)
-        rendered[:template] ||= self
+    
+    alias_method :_render_template_without_template_tracking, :_render_template
+    def _render_template(template, local_assigns = {})
+      if template.respond_to?(:path) &amp;&amp; !template.is_a?(InlineTemplate)
+        @_rendered[:partials][template] += 1 if template.is_a?(RenderablePartial)
+        @_rendered[:template] ||= template
       end
-      render_without_template_tracking(view, local_assigns)
-    end
+      _render_template_without_template_tracking(template, local_assigns)
+    end    
   end
 
   class TestCase &lt; ActiveSupport::TestCase</diff>
      <filename>actionpack/lib/action_view/test_case.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,8 +20,7 @@ rescue LoadError
 end
 
 require 'action_controller'
-require 'action_controller/cgi_ext'
-require 'action_controller/test_process'
+require 'action_controller/testing/process'
 require 'action_view/test_case'
 
 # Show backtraces for deprecated behavior for quicker cleanup.
@@ -38,8 +37,4 @@ I18n.backend.store_translations 'pt-BR', {}
 ORIGINAL_LOCALES = I18n.available_locales.map(&amp;:to_s).sort
 
 FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures')
-ActionView::Base.cache_template_loading = true
 ActionController::Base.view_paths = FIXTURE_LOAD_PATH
-CACHED_VIEW_PATHS = ActionView::Base.cache_template_loading? ?
-                      ActionController::Base.view_paths :
-                      ActionController::Base.view_paths.map {|path| ActionView::Template::EagerPath.new(path.to_s)}</diff>
      <filename>actionpack/test/abstract_unit.rb</filename>
    </modified>
    <modified>
      <diff>@@ -45,23 +45,27 @@ class ActiveRecordStoreTest &lt; ActionController::IntegrationTest
     ActiveRecord::SessionStore.session_class.drop_table!
   end
 
-  def test_setting_and_getting_session_value
-    with_test_route_set do
-      get '/set_session_value'
-      assert_response :success
-      assert cookies['_session_id']
-
-      get '/get_session_value'
-      assert_response :success
-      assert_equal 'foo: &quot;bar&quot;', response.body
-
-      get '/set_session_value', :foo =&gt; &quot;baz&quot;
-      assert_response :success
-      assert cookies['_session_id']
-
-      get '/get_session_value'
-      assert_response :success
-      assert_equal 'foo: &quot;baz&quot;', response.body
+  %w{ session sql_bypass }.each do |class_name|
+    define_method(&quot;test_setting_and_getting_session_value_with_#{class_name}_store&quot;) do
+      with_store class_name do
+        with_test_route_set do
+          get '/set_session_value'
+          assert_response :success
+          assert cookies['_session_id']
+
+          get '/get_session_value'
+          assert_response :success
+          assert_equal 'foo: &quot;bar&quot;', response.body
+
+          get '/set_session_value', :foo =&gt; &quot;baz&quot;
+          assert_response :success
+          assert cookies['_session_id']
+
+          get '/get_session_value'
+          assert_response :success
+          assert_equal 'foo: &quot;baz&quot;', response.body
+        end
+      end
     end
   end
 
@@ -171,4 +175,11 @@ class ActiveRecordStoreTest &lt; ActionController::IntegrationTest
         yield
       end
     end
+
+    def with_store(class_name)
+      session_class, ActiveRecord::SessionStore.session_class =
+        ActiveRecord::SessionStore.session_class, &quot;ActiveRecord::SessionStore::#{class_name.camelize}&quot;.constantize
+      yield
+      ActiveRecord::SessionStore.session_class = session_class
+    end
 end</diff>
      <filename>actionpack/test/activerecord/active_record_store_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -168,11 +168,13 @@ end
 class ActionPackAssertionsControllerTest &lt; ActionController::TestCase
   # let's get this party started
   def setup
+    super
     ActionController::Routing::Routes.reload
     ActionController::Routing.use_controllers!(%w(action_pack_assertions admin/inner_module user content admin/user))
   end
 
   def teardown
+    super
     ActionController::Routing::Routes.reload
   end
 </diff>
      <filename>actionpack/test/controller/action_pack_assertions_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,6 +23,7 @@ class AddressesTest &lt; ActionController::TestCase
   tests AddressesTestController
 
   def setup
+    super
     # enable a logger so that (e.g.) the benchmarking stuff runs, so we can get
     # a more accurate simulation of what happens in &quot;real life&quot;.
     @controller.logger = Logger.new(nil)</diff>
      <filename>actionpack/test/controller/addresses_render_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -66,12 +66,14 @@ class AssertSelectTest &lt; ActionController::TestCase
   tests AssertSelectController
 
   def setup
+    super
     ActionMailer::Base.delivery_method = :test
     ActionMailer::Base.perform_deliveries = true
     ActionMailer::Base.deliveries = []
   end
 
   def teardown
+    super
     ActionMailer::Base.deliveries.clear
   end
 </diff>
      <filename>actionpack/test/controller/assert_select_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -170,6 +170,7 @@ class DefaultUrlOptionsTest &lt; ActionController::TestCase
   tests DefaultUrlOptionsController
 
   def setup
+    super
     @request.host = 'www.example.com'
     rescue_action_in_public!
   end
@@ -193,6 +194,7 @@ class EmptyUrlOptionsTest &lt; ActionController::TestCase
   tests NonEmptyController
 
   def setup
+    super
     @request.host = 'www.example.com'
     rescue_action_in_public!
   end</diff>
      <filename>actionpack/test/controller/base_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,7 @@ class BenchmarkTest &lt; ActionController::TestCase
   end
 
   def setup
+    super
     # benchmark doesn't do anything unless a logger is set
     @controller.logger = MockLogger.new
     @request.host = &quot;test.actioncontroller.i&quot;</diff>
      <filename>actionpack/test/controller/benchmark_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -44,6 +44,7 @@ end
 
 class PageCachingTest &lt; ActionController::TestCase
   def setup
+    super
     ActionController::Base.perform_caching = true
 
     ActionController::Routing::Routes.draw do |map|
@@ -222,6 +223,7 @@ end
 
 class ActionCacheTest &lt; ActionController::TestCase
   def setup
+    super
     reset!
     FileUtils.mkdir_p(FILE_STORE_PATH)
     @path_class = ActionController::Caching::Actions::ActionCachePath
@@ -483,6 +485,7 @@ end
 
 class FragmentCachingTest &lt; ActionController::TestCase
   def setup
+    super
     ActionController::Base.perform_caching = true
     @store = ActiveSupport::Cache::MemoryStore.new
     ActionController::Base.cache_store = @store
@@ -615,6 +618,7 @@ end
 
 class FunctionalFragmentCachingTest &lt; ActionController::TestCase
   def setup
+    super
     ActionController::Base.perform_caching = true
     @store = ActiveSupport::Cache::MemoryStore.new
     ActionController::Base.cache_store = @store</diff>
      <filename>actionpack/test/controller/caching_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -27,6 +27,7 @@ class CaptureTest &lt; ActionController::TestCase
   tests CaptureController
 
   def setup
+    super
     # enable a logger so that (e.g.) the benchmarking stuff runs, so we can get
     # a more accurate simulation of what happens in &quot;real life&quot;.
     @controller.logger = Logger.new(nil)</diff>
      <filename>actionpack/test/controller/capture_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -54,6 +54,7 @@ class ContentTypeTest &lt; ActionController::TestCase
   tests ContentTypeController
 
   def setup
+    super
     # enable a logger so that (e.g.) the benchmarking stuff runs, so we can get
     # a more accurate simulation of what happens in &quot;real life&quot;.
     @controller.logger = Logger.new(nil)
@@ -136,10 +137,12 @@ class AcceptBasedContentTypeTest &lt; ActionController::TestCase
   tests ContentTypeController
 
   def setup
+    super
     ActionController::Base.use_accept_header = true
   end
 
   def teardown
+    super
     ActionController::Base.use_accept_header = false
   end
 </diff>
      <filename>actionpack/test/controller/content_type_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,6 +6,10 @@ class CookieTest &lt; ActionController::TestCase
       cookies[&quot;user_name&quot;] = &quot;david&quot;
     end
 
+    def set_with_with_escapable_characters
+      cookies[&quot;that &amp; guy&quot;] = &quot;foo &amp; bar =&gt; baz&quot;
+    end
+
     def authenticate_for_fourteen_days
       cookies[&quot;user_name&quot;] = { &quot;value&quot; =&gt; &quot;david&quot;, &quot;expires&quot; =&gt; Time.utc(2005, 10, 10,5) }
     end
@@ -44,6 +48,7 @@ class CookieTest &lt; ActionController::TestCase
   tests TestController
 
   def setup
+    super
     @request.host = &quot;www.nextangle.com&quot;
   end
 
@@ -53,6 +58,12 @@ class CookieTest &lt; ActionController::TestCase
     assert_equal({&quot;user_name&quot; =&gt; &quot;david&quot;}, @response.cookies)
   end
 
+  def test_setting_with_escapable_characters
+    get :set_with_with_escapable_characters
+    assert_equal [&quot;that+%26+guy=foo+%26+bar+%3D%3E+baz; path=/&quot;], @response.headers[&quot;Set-Cookie&quot;]
+    assert_equal({&quot;that &amp; guy&quot; =&gt; &quot;foo &amp; bar =&gt; baz&quot;}, @response.cookies)
+  end
+
   def test_setting_cookie_for_fourteen_days
     get :authenticate_for_fourteen_days
     assert_equal [&quot;user_name=david; path=/; expires=Mon, 10-Oct-2005 05:00:00 GMT&quot;], @response.headers[&quot;Set-Cookie&quot;]</diff>
      <filename>actionpack/test/controller/cookie_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,8 +6,8 @@ class DispatcherTest &lt; Test::Unit::TestCase
   def setup
     ENV['REQUEST_METHOD'] = 'GET'
 
-    Dispatcher.middleware = ActionController::MiddlewareStack.new do |middleware|
-      middlewares = File.expand_path(File.join(File.dirname(__FILE__), &quot;../../lib/action_controller/middlewares.rb&quot;))
+    Dispatcher.middleware = ActionDispatch::MiddlewareStack.new do |middleware|
+      middlewares = File.expand_path(File.join(File.dirname(__FILE__), &quot;../../lib/action_controller/dispatch/middlewares.rb&quot;))
       middleware.instance_eval(File.read(middlewares))
     end
 
@@ -46,8 +46,8 @@ class DispatcherTest &lt; Test::Unit::TestCase
   end
 
   def test_failsafe_response
-    Dispatcher.any_instance.expects(:dispatch).raises('b00m')
-    ActionController::Failsafe.any_instance.expects(:log_failsafe_exception)
+    Dispatcher.any_instance.expects(:_call).raises('b00m')
+    ActionDispatch::Failsafe.any_instance.expects(:log_failsafe_exception)
 
     assert_nothing_raised do
       assert_equal [
@@ -94,7 +94,7 @@ class DispatcherTest &lt; Test::Unit::TestCase
     def dispatch(cache_classes = true)
       ActionController::Routing::RouteSet.any_instance.stubs(:call).returns([200, {}, 'response'])
       Dispatcher.define_dispatcher_callbacks(cache_classes)
-      Dispatcher.new.call({})
+      Dispatcher.new.call({'rack.input' =&gt; StringIO.new('')})
     end
 
     def assert_subclasses(howmany, klass, message = klass.subclasses.inspect)</diff>
      <filename>actionpack/test/controller/dispatcher_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -37,6 +37,7 @@ end
 
 class LayoutAutoDiscoveryTest &lt; ActionController::TestCase
   def setup
+    super
     @request.host = &quot;www.nextangle.com&quot;
   end
 
@@ -55,7 +56,7 @@ class LayoutAutoDiscoveryTest &lt; ActionController::TestCase
   def test_third_party_template_library_auto_discovers_layout
     @controller = ThirdPartyTemplateLibraryController.new
     get :hello
-    assert_equal 'layouts/third_party_template_library.mab', @controller.active_layout.to_s
+    assert_equal 'layouts/third_party_template_library.mab', @controller.active_layout(true).to_s
     assert_equal 'layouts/third_party_template_library', @response.layout
     assert_response :success
     assert_equal 'Mab', @response.body
@@ -64,14 +65,14 @@ class LayoutAutoDiscoveryTest &lt; ActionController::TestCase
   def test_namespaced_controllers_auto_detect_layouts
     @controller = ControllerNameSpace::NestedController.new
     get :hello
-    assert_equal 'layouts/controller_name_space/nested', @controller.active_layout.to_s
+    assert_equal 'layouts/controller_name_space/nested', @controller.active_layout(true).to_s
     assert_equal 'controller_name_space/nested.rhtml hello.rhtml', @response.body
   end
 
   def test_namespaced_controllers_auto_detect_layouts
     @controller = MultipleExtensions.new
     get :hello
-    assert_equal 'layouts/multiple_extensions.html.erb', @controller.active_layout.to_s
+    assert_equal 'layouts/multiple_extensions.html.erb', @controller.active_layout(true).to_s
     assert_equal 'multiple_extensions.html.erb hello.rhtml', @response.body.strip
   end
 end
@@ -94,6 +95,14 @@ class PrependsViewPathController &lt; LayoutTest
   end
 end
 
+class OnlyLayoutController &lt; LayoutTest
+  layout 'item', :only =&gt; &quot;hello&quot;
+end
+
+class ExceptLayoutController &lt; LayoutTest
+  layout 'item', :except =&gt; &quot;goodbye&quot;
+end
+
 class SetsLayoutInRenderController &lt; LayoutTest
   def hello
     render :layout =&gt; 'third_party_template_library'
@@ -118,6 +127,30 @@ class LayoutSetInResponseTest &lt; ActionController::TestCase
     get :hello
     assert_equal 'layouts/item', @response.layout
   end
+  
+  def test_layout_only_exception_when_included
+    @controller = OnlyLayoutController.new
+    get :hello
+    assert_equal 'layouts/item', @response.layout
+  end
+
+  def test_layout_only_exception_when_excepted
+    @controller = OnlyLayoutController.new
+    get :goodbye
+    assert_equal nil, @response.layout
+  end
+
+  def test_layout_except_exception_when_included
+    @controller = ExceptLayoutController.new
+    get :hello
+    assert_equal 'layouts/item', @response.layout
+  end
+
+  def test_layout_except_exception_when_excepted
+    @controller = ExceptLayoutController.new
+    get :goodbye
+    assert_equal nil, @response.layout
+  end
 
   def test_layout_set_when_using_render
     @controller = SetsLayoutInRenderController.new
@@ -143,9 +176,11 @@ class LayoutSetInResponseTest &lt; ActionController::TestCase
   end
 
   def test_layout_is_picked_from_the_controller_instances_view_path
-    @controller = PrependsViewPathController.new
-    get :hello
-    assert_equal 'layouts/alt', @response.layout
+    pending do
+      @controller = PrependsViewPathController.new
+      get :hello
+      assert_equal 'layouts/alt', @response.layout
+    end
   end
 
   def test_absolute_pathed_layout
@@ -201,4 +236,3 @@ unless RUBY_PLATFORM =~ /(:?mswin|mingw|bccwin)/
     end
   end
 end
-</diff>
      <filename>actionpack/test/controller/layout_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,7 +18,10 @@ class LoggingTest &lt; ActionController::TestCase
     end
   end
 
-  setup :set_logger
+  def setup
+    super
+    set_logger
+  end
 
   def test_logging_without_parameters
     get :show</diff>
      <filename>actionpack/test/controller/logging_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -166,11 +166,13 @@ class MimeControllerTest &lt; ActionController::TestCase
   tests RespondToController
 
   def setup
+    super
     ActionController::Base.use_accept_header = true
     @request.host = &quot;www.example.com&quot;
   end
 
   def teardown
+    super
     ActionController::Base.use_accept_header = false
   end
 
@@ -437,15 +439,15 @@ class MimeControllerTest &lt; ActionController::TestCase
         unless args.empty?
           @action = args.first[:action]
         end
-        response.body = &quot;#{@action} - #{@template.template_format}&quot;
+        response.body = &quot;#{@action} - #{@template.formats}&quot;
       end
     end
 
     get :using_defaults
-    assert_equal &quot;using_defaults - html&quot;, @response.body
+    assert_equal &quot;using_defaults - #{[:html].to_s}&quot;, @response.body
 
     get :using_defaults, :format =&gt; &quot;xml&quot;
-    assert_equal &quot;using_defaults - xml&quot;, @response.body
+    assert_equal &quot;using_defaults - #{[:xml].to_s}&quot;, @response.body
   end
 
   def test_format_with_custom_response_type
@@ -511,6 +513,7 @@ class MimeControllerLayoutsTest &lt; ActionController::TestCase
   tests PostController
 
   def setup
+    super
     @request.host = &quot;www.example.com&quot;
   end
 </diff>
      <filename>actionpack/test/controller/mime_responds_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -315,13 +315,6 @@ class TestController &lt; ActionController::Base
   def render_implicit_html_template_from_xhr_request
   end
 
-  def render_implicit_js_template_without_layout
-  end
-
-  def render_html_explicit_template_and_layout
-    render :template =&gt; 'test/render_implicit_html_template_from_xhr_request', :layout =&gt; 'layouts/default_html'
-  end
-
   def formatted_html_erb
   end
 
@@ -390,7 +383,7 @@ class TestController &lt; ActionController::Base
   end
 
   def accessing_params_in_template_with_layout
-    render :layout =&gt; nil, :inline =&gt;  &quot;Hello: &lt;%= params[:name] %&gt;&quot;
+    render :layout =&gt; true, :inline =&gt;  &quot;Hello: &lt;%= params[:name] %&gt;&quot;
   end
 
   def render_with_explicit_template
@@ -737,8 +730,6 @@ class TestController &lt; ActionController::Base
              &quot;delete_with_js&quot;, &quot;update_page&quot;, &quot;update_page_with_instance_variables&quot;
 
           &quot;layouts/standard&quot;
-        when &quot;render_implicit_js_template_without_layout&quot;
-          &quot;layouts/default_html&quot;
         when &quot;action_talk_to_layout&quot;, &quot;layout_overriding_layout&quot;
           &quot;layouts/talk_from_action&quot;
         when &quot;render_implicit_html_template_from_xhr_request&quot;
@@ -753,6 +744,7 @@ class RenderTest &lt; ActionController::TestCase
   def setup
     # enable a logger so that (e.g.) the benchmarking stuff runs, so we can get
     # a more accurate simulation of what happens in &quot;real life&quot;.
+    super
     @controller.logger = Logger.new(nil)
 
     @request.host = &quot;www.nextangle.com&quot;
@@ -836,11 +828,6 @@ class RenderTest &lt; ActionController::TestCase
     assert_equal &quot;&lt;html&gt;hello world, I'm here!&lt;/html&gt;&quot;, @response.body
   end
 
-  def test_xhr_with_render_text_and_layout
-    xhr :get, :render_text_hello_world_with_layout
-    assert_equal &quot;&lt;html&gt;hello world, I'm here!&lt;/html&gt;&quot;, @response.body
-  end
-
   def test_do_with_render_action_and_layout_false
     get :hello_world_with_layout_false
     assert_equal 'Hello world!', @response.body
@@ -1081,18 +1068,17 @@ class RenderTest &lt; ActionController::TestCase
   end
 
   def test_should_implicitly_render_html_template_from_xhr_request
-    xhr :get, :render_implicit_html_template_from_xhr_request
-    assert_equal &quot;XHR!\nHello HTML!&quot;, @response.body
-  end
-
-  def test_should_render_explicit_html_template_with_html_layout
-    xhr :get, :render_html_explicit_template_and_layout
-    assert_equal &quot;&lt;html&gt;Hello HTML!&lt;/html&gt;\n&quot;, @response.body
+    pending do
+      xhr :get, :render_implicit_html_template_from_xhr_request
+      assert_equal &quot;XHR!\nHello HTML!&quot;, @response.body
+    end
   end
 
   def test_should_implicitly_render_js_template_without_layout
-    get :render_implicit_js_template_without_layout, :format =&gt; :js
-    assert_no_match /&lt;html&gt;/, @response.body
+    pending do
+      get :render_implicit_js_template_without_layout, :format =&gt; :js
+      assert_no_match %r{&lt;html&gt;}, @response.body
+    end
   end
 
   def test_should_render_formatted_template
@@ -1308,7 +1294,7 @@ class RenderTest &lt; ActionController::TestCase
     assert !@response.headers.include?('Content-Length')
     assert_response :no_content
 
-    ActionController::StatusCodes::SYMBOL_TO_STATUS_CODE.each do |status, code|
+    ActionDispatch::StatusCodes::SYMBOL_TO_STATUS_CODE.each do |status, code|
       get :head_with_symbolic_status, :status =&gt; status.to_s
       assert_equal code, @response.response_code
       assert_response status
@@ -1316,7 +1302,7 @@ class RenderTest &lt; ActionController::TestCase
   end
 
   def test_head_with_integer_status
-    ActionController::StatusCodes::STATUS_CODES.each do |code, message|
+    ActionDispatch::StatusCodes::STATUS_CODES.each do |code, message|
       get :head_with_integer_status, :status =&gt; code.to_s
       assert_equal message, @response.message
     end
@@ -1574,6 +1560,7 @@ class EtagRenderTest &lt; ActionController::TestCase
   tests TestController
 
   def setup
+    super
     @request.host = &quot;www.nextangle.com&quot;
     @expected_bang_etag = etag_for(expand_key([:foo, 123]))
   end
@@ -1684,6 +1671,7 @@ class LastModifiedRenderTest &lt; ActionController::TestCase
   tests TestController
 
   def setup
+    super
     @request.host = &quot;www.nextangle.com&quot;
     @last_modified = Time.now.utc.beginning_of_day.httpdate
   end
@@ -1739,6 +1727,7 @@ class RenderingLoggingTest &lt; ActionController::TestCase
   tests TestController
 
   def setup
+    super
     @request.host = &quot;www.nextangle.com&quot;
   end
 
@@ -1746,7 +1735,7 @@ class RenderingLoggingTest &lt; ActionController::TestCase
     @controller.logger = MockLogger.new
     get :layout_test
     logged = @controller.logger.logged.find_all {|l| l =~ /render/i }
-    assert_equal &quot;Rendering template within layouts/standard&quot;, logged[0]
-    assert_equal &quot;Rendering test/hello_world&quot;, logged[1]
+    assert_equal &quot;Rendering test/hello_world&quot;, logged[0]
+    assert_equal &quot;Rendering template within layouts/standard&quot;, logged[1]
   end
 end</diff>
      <filename>actionpack/test/controller/render_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -151,14 +151,10 @@ module RequestForgeryProtectionTests
       delete :index, :format =&gt; 'xml'
     end
   end
-
+  
   def test_should_allow_xhr_post_without_token
     assert_nothing_raised { xhr :post, :index }
   end
-  def test_should_not_allow_xhr_post_with_html_without_token
-    @request.env['CONTENT_TYPE'] = Mime::URL_ENCODED_FORM.to_s
-    assert_raise(ActionController::InvalidAuthenticityToken) { xhr :post, :index }
-  end
   
   def test_should_allow_xhr_put_without_token
     assert_nothing_raised { xhr :put, :index }
@@ -168,6 +164,11 @@ module RequestForgeryProtectionTests
     assert_nothing_raised { xhr :delete, :index }
   end
   
+  def test_should_allow_xhr_post_with_encoded_form_content_type_without_token
+    @request.env['CONTENT_TYPE'] = Mime::URL_ENCODED_FORM.to_s
+    assert_nothing_raised { xhr :post, :index }
+  end
+  
   def test_should_allow_post_with_token
     post :index, :authenticity_token =&gt; @token
     assert_response :success</diff>
      <filename>actionpack/test/controller/request_forgery_protection_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -141,8 +141,11 @@ end
 class RescueControllerTest &lt; ActionController::TestCase
   FIXTURE_PUBLIC = &quot;#{File.dirname(__FILE__)}/../fixtures&quot;.freeze
 
-  setup :set_all_requests_local
-  setup :populate_exception_object
+  def setup
+    super
+    set_all_requests_local
+    populate_exception_object
+  end
 
   def set_all_requests_local
     RescueController.consider_all_requests_local = true
@@ -397,22 +400,6 @@ class RescueControllerTest &lt; ActionController::TestCase
     assert_equal &quot;RescueController::ResourceUnavailableToRescueAsString&quot;, @response.body
   end
 
-  def test_rescue_dispatcher_exceptions
-    env = @request.env
-    env[&quot;action_controller.rescue.request&quot;] = @request
-    env[&quot;action_controller.rescue.response&quot;] = @response
-
-    RescueController.call_with_exception(env, ActionController::RoutingError.new(&quot;Route not found&quot;))
-    assert_equal &quot;no way&quot;, @response.body
-  end
-
-  def test_rescue_dispatcher_exceptions_without_request_set
-    @request.env['REQUEST_URI'] = '/no_way'
-    response = RescueController.call_with_exception(@request.env, ActionController::RoutingError.new(&quot;Route not found&quot;))
-    assert_kind_of ActionController::Response, response
-    assert_equal &quot;no way&quot;, response.body
-  end
-
   protected
     def with_all_requests_local(local = true)
       old_local, ActionController::Base.consider_all_requests_local =
@@ -534,3 +521,83 @@ class ControllerInheritanceRescueControllerTest &lt; ActionController::TestCase
     assert_response :created
   end
 end
+
+class ApplicationController &lt; ActionController::Base
+  rescue_from ActionController::RoutingError do
+    render :text =&gt; 'no way'
+  end
+end
+
+class RescueTest &lt; ActionController::IntegrationTest
+  class TestController &lt; ActionController::Base
+    class RecordInvalid &lt; StandardError
+      def message
+        'invalid'
+      end
+    end
+    rescue_from RecordInvalid, :with =&gt; :show_errors
+
+    def foo
+      render :text =&gt; &quot;foo&quot;
+    end
+
+    def invalid
+      raise RecordInvalid
+    end
+
+    def b00m
+      raise 'b00m'
+    end
+
+    protected
+      def show_errors(exception)
+        render :text =&gt; exception.message
+      end
+  end
+
+  test 'normal request' do
+    with_test_routing do
+      get '/foo'
+      assert_equal 'foo', response.body
+    end
+  end
+
+  test 'rescue exceptions inside controller' do
+    with_test_routing do
+      get '/invalid'
+      assert_equal 'invalid', response.body
+    end
+  end
+
+  test 'rescue routing exceptions' do
+    assert_equal 1, ApplicationController.rescue_handlers.length
+
+    begin
+      with_test_routing do
+        get '/no_way'
+        assert_equal 'no way', response.body
+      end
+    ensure
+      ActionController::Base.rescue_handlers.clear
+    end
+  end
+
+  test 'unrescued exception' do
+    with_test_routing do
+      get '/b00m'
+      assert_match(/Action Controller: Exception caught/, response.body)
+    end
+  end
+
+  private
+    def with_test_routing
+      with_routing do |set|
+        set.draw do |map|
+          map.connect 'foo', :controller =&gt; &quot;rescue_test/test&quot;, :action =&gt; 'foo'
+          map.connect 'invalid', :controller =&gt; &quot;rescue_test/test&quot;, :action =&gt; 'invalid'
+          map.connect 'b00m', :controller =&gt; &quot;rescue_test/test&quot;, :action =&gt; 'b00m'
+        end
+        yield
+      end
+    end
+end</diff>
      <filename>actionpack/test/controller/rescue_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -155,7 +155,7 @@ class SendFileTest &lt; ActionController::TestCase
     define_method &quot;test_default_send_#{method}_status&quot; do
       @controller.options = { :stream =&gt; false }
       assert_nothing_raised { assert_not_nil process(method) }
-      assert_equal ActionController::Base::DEFAULT_RENDER_STATUS_CODE, @response.status
+      assert_equal ActionController::DEFAULT_RENDER_STATUS_CODE, @response.status
     end
   end
 end</diff>
      <filename>actionpack/test/controller/send_file_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -119,6 +119,7 @@ XML
   end
 
   def setup
+    super
     @controller = TestController.new
     @request    = ActionController::TestRequest.new
     @response   = ActionController::TestResponse.new
@@ -127,6 +128,7 @@ XML
   end
 
   def teardown
+    super
     ActionController::Routing::Routes.reload
   end
 
@@ -515,6 +517,14 @@ XML
     assert_nil @request.instance_variable_get(&quot;@request_method&quot;)
   end
 
+  def test_params_reset_after_post_request
+    post :no_op, :foo =&gt; &quot;bar&quot;
+    assert_equal &quot;bar&quot;, @request.params[:foo]
+    @request.recycle!
+    post :no_op
+    assert @request.params[:foo].blank?
+  end
+
   %w(controller response request).each do |variable|
     %w(get post put delete head process).each do |method|
       define_method(&quot;test_#{variable}_missing_for_#{method}_raises_error&quot;) do
@@ -635,7 +645,7 @@ class CleanBacktraceTest &lt; ActionController::TestCase
   end
 
   def test_should_clean_assertion_lines_from_backtrace
-    path = File.expand_path(&quot;#{File.dirname(__FILE__)}/../../lib/action_controller&quot;)
+    path = File.expand_path(&quot;#{File.dirname(__FILE__)}/../../lib/action_controller/testing&quot;)
     exception = ActiveSupport::TestCase::Assertion.new('message')
     exception.set_backtrace [&quot;#{path}/abc&quot;, &quot;#{path}/assertions/def&quot;]
     clean_backtrace { raise exception }</diff>
      <filename>actionpack/test/controller/test_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -29,8 +29,8 @@ class ViewLoadPathsTest &lt; ActionController::TestCase
 
     @controller = TestController.new
     # Following is needed in order to setup @controller.template object properly
-    @controller.send :initialize_template_class, @response
     @controller.send :assign_shortcuts, @request, @response
+    @controller.send :initialize_template_class, @response
 
     # Track the last warning.
     @old_behavior = ActiveSupport::Deprecation.behavior
@@ -41,7 +41,7 @@ class ViewLoadPathsTest &lt; ActionController::TestCase
   def teardown
     ActiveSupport::Deprecation.behavior = @old_behavior
   end
-  
+
   def test_template_load_path_was_set_correctly
     assert_equal [FIXTURE_LOAD_PATH], @controller.view_paths.map(&amp;:to_s)
   end</diff>
      <filename>actionpack/test/controller/view_paths_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,9 +4,12 @@ class ActiveRecordHelperI18nTest &lt; Test::Unit::TestCase
   include ActionView::Helpers::ActiveRecordHelper
   
   attr_reader :request
+
   def setup
     @object = stub :errors =&gt; stub(:count =&gt; 1, :full_messages =&gt; ['full_messages'])
-    @object_name = 'book'
+    @object_name = 'book_seller'
+    @object_name_without_underscore = 'book seller'
+
     stubs(:content_tag).returns 'content_tag'
 
     I18n.stubs(:t).with(:'header', :locale =&gt; 'en', :scope =&gt; [:activerecord, :errors, :template], :count =&gt; 1, :model =&gt; '').returns &quot;1 error prohibited this  from being saved&quot;
@@ -37,8 +40,8 @@ class ActiveRecordHelperI18nTest &lt; Test::Unit::TestCase
   end
   
   def test_error_messages_for_given_object_name_it_translates_object_name
-    I18n.expects(:t).with(:header, :locale =&gt; 'en', :scope =&gt; [:activerecord, :errors, :template], :count =&gt; 1, :model =&gt; @object_name).returns &quot;1 error prohibited this #{@object_name} from being saved&quot;
-    I18n.expects(:t).with(@object_name, :default =&gt; @object_name, :count =&gt; 1, :scope =&gt; [:activerecord, :models]).once.returns @object_name
+    I18n.expects(:t).with(:header, :locale =&gt; 'en', :scope =&gt; [:activerecord, :errors, :template], :count =&gt; 1, :model =&gt; @object_name_without_underscore).returns &quot;1 error prohibited this #{@object_name_without_underscore} from being saved&quot;
+    I18n.expects(:t).with(@object_name, :default =&gt; @object_name_without_underscore, :count =&gt; 1, :scope =&gt; [:activerecord, :models]).once.returns @object_name_without_underscore
     error_messages_for(:object =&gt; @object, :locale =&gt; 'en', :object_name =&gt; @object_name)
   end
 end</diff>
      <filename>actionpack/test/template/active_record_helper_i18n_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -112,6 +112,7 @@ class ActiveRecordHelperTest &lt; ActionView::TestCase
   attr_accessor :request_forgery_protection_token, :form_authenticity_token
 
   def setup
+    super
     setup_post
     setup_user
 </diff>
      <filename>actionpack/test/template/active_record_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ class AssetTagHelperTest &lt; ActionView::TestCase
   tests ActionView::Helpers::AssetTagHelper
 
   def setup
+    super
     silence_warnings do
       ActionView::Helpers::AssetTagHelper.send(
         :const_set,
@@ -627,6 +628,7 @@ class AssetTagHelperNonVhostTest &lt; ActionView::TestCase
   tests ActionView::Helpers::AssetTagHelper
 
   def setup
+    super
     ActionController::Base.relative_url_root = &quot;/collaboration/hieraki&quot;
 
     @controller = Class.new do</diff>
      <filename>actionpack/test/template/asset_tag_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -170,6 +170,7 @@ class AtomFeedTest &lt; ActionController::TestCase
   tests ScrollsController
 
   def setup
+    super
     @request.host = &quot;www.nextangle.com&quot;
   end
 </diff>
      <filename>actionpack/test/template/atom_feed_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,6 @@ require 'abstract_unit'
 require 'controller/fake_models'
 
 class CompiledTemplatesTest &lt; Test::Unit::TestCase
-  
   def setup
     @compiled_templates = ActionView::Base::CompiledTemplates
     @compiled_templates.instance_methods.each do |m|
@@ -11,193 +10,76 @@ class CompiledTemplatesTest &lt; Test::Unit::TestCase
   end
 
   def test_template_gets_compiled
-    with_caching(true) do
-      assert_equal 0, @compiled_templates.instance_methods.size
-      assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
-      assert_equal 1, @compiled_templates.instance_methods.size
-    end
+    assert_equal 0, @compiled_templates.instance_methods.size
+    assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
+    assert_equal 1, @compiled_templates.instance_methods.size
   end
 
   def test_template_gets_recompiled_when_using_different_keys_in_local_assigns
-    with_caching(true) do
-      assert_equal 0, @compiled_templates.instance_methods.size
-      assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
-      assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;, :locals =&gt; {:foo =&gt; &quot;bar&quot;})
-      assert_equal 2, @compiled_templates.instance_methods.size
-    end
+    assert_equal 0, @compiled_templates.instance_methods.size
+    assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
+    assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;, :locals =&gt; {:foo =&gt; &quot;bar&quot;})
+    assert_equal 2, @compiled_templates.instance_methods.size
   end
 
   def test_compiled_template_will_not_be_recompiled_when_rendered_with_identical_local_assigns
-    with_caching(true) do
-      assert_equal 0, @compiled_templates.instance_methods.size
-      assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
-      ActionView::Template.any_instance.expects(:compile!).never
-      assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
-    end
-  end
-
-  def test_template_changes_are_not_reflected_with_cached_template_loading
-    with_caching(true) do
-      with_reloading(false) do
-        assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
-        modify_template &quot;test/hello_world.erb&quot;, &quot;Goodbye world!&quot; do
-          assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
-        end
-        assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
-      end
-    end
-  end
-
-  def test_template_changes_are_reflected_without_cached_template_loading
-    with_caching(true) do
-      with_reloading(true) do
-        assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
-        modify_template &quot;test/hello_world.erb&quot;, &quot;Goodbye world!&quot; do
-          assert_equal &quot;Goodbye world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
-        end
-        assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
-      end
-    end
+    assert_equal 0, @compiled_templates.instance_methods.size
+    assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
+    ActionView::Template.any_instance.expects(:compile!).never
+    assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
   end
 
-  def test_template_becomes_missing_if_deleted_without_cached_template_loading
-    with_reloading(true) do
-      assert_equal 'Hello world!', render(:file =&gt; 'test/hello_world.erb')
-      delete_template 'test/hello_world.erb' do
-        assert_raise(ActionView::MissingTemplate) { render(:file =&gt; 'test/hello_world.erb') }
-      end
-      assert_equal 'Hello world!', render(:file =&gt; 'test/hello_world.erb')
-    end
-  end
-
-  def test_swapping_template_handler_is_working_without_cached_template_loading
-    with_reloading(true) do
-      assert_equal 'Hello world!', render(:file =&gt; 'test/hello_world')
-      delete_template 'test/hello_world.erb' do
-        rename_template 'test/hello_world_from_rxml.builder', 'test/hello_world.builder' do
-          assert_equal &quot;&lt;html&gt;\n  &lt;p&gt;Hello&lt;/p&gt;\n&lt;/html&gt;\n&quot;, render(:file =&gt; 'test/hello_world')
-        end
-      end
-      assert_equal 'Hello world!', render(:file =&gt; 'test/hello_world')
-    end
+  def test_compiled_template_will_always_be_recompiled_when_template_is_not_cached
+    ActionView::Template.any_instance.expects(:recompile?).times(3).returns(true)
+    assert_equal 0, @compiled_templates.instance_methods.size
+    assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;#{FIXTURE_LOAD_PATH}/test/hello_world.erb&quot;)
+    ActionView::Template.any_instance.expects(:compile!).times(3)
+    3.times { assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;#{FIXTURE_LOAD_PATH}/test/hello_world.erb&quot;) }
+    assert_equal 1, @compiled_templates.instance_methods.size
   end
 
-  def test_adding_localized_template_will_take_precedence_without_cached_template_loading
-    with_reloading(true) do
-      assert_equal 'Hello world!', render(:file =&gt; 'test/hello_world')
-      rename_template 'test/hello_world.da.html.erb', 'test/hello_world.en.html.erb' do
-        assert_equal 'Hey verden', render(:file =&gt; 'test/hello_world')
-      end
+  def test_template_changes_are_not_reflected_with_cached_templates
+    assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
+    modify_template &quot;test/hello_world.erb&quot;, &quot;Goodbye world!&quot; do
+      assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
     end
+    assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
   end
 
-  def test_deleting_localized_template_will_fall_back_to_non_localized_template_without_cached_template_loading
-    with_reloading(true) do
-      rename_template 'test/hello_world.da.html.erb', 'test/hello_world.en.html.erb' do
-        assert_equal 'Hey verden', render(:file =&gt; 'test/hello_world')
-        delete_template 'test/hello_world.en.html.erb' do
-          assert_equal 'Hello world!', render(:file =&gt; 'test/hello_world')
-        end
-        assert_equal 'Hey verden', render(:file =&gt; 'test/hello_world')
-      end
-    end
-  end
-
-  def test_parallel_reloadable_view_paths_are_working
-    with_reloading(true) do
-      view_paths_copy = new_reloadable_view_paths
-      assert_equal 'Hello world!', render(:file =&gt; 'test/hello_world')
-      with_view_paths(view_paths_copy, new_reloadable_view_paths) do
-        assert_equal 'Hello world!', render(:file =&gt; 'test/hello_world')
-      end
-      modify_template 'test/hello_world.erb', 'Goodbye world!' do
-        assert_equal 'Goodbye world!', render(:file =&gt; 'test/hello_world')
-        modify_template 'test/hello_world.erb', 'So long, world!' do
-          with_view_paths(view_paths_copy, new_reloadable_view_paths) do
-            assert_equal 'So long, world!', render(:file =&gt; 'test/hello_world')
-          end
-          assert_equal 'So long, world!', render(:file =&gt; 'test/hello_world')
-        end
-      end
+  def test_template_changes_are_reflected_with_uncached_templates
+    assert_equal &quot;Hello world!&quot;, render_without_cache(:file =&gt; &quot;test/hello_world.erb&quot;)
+    modify_template &quot;test/hello_world.erb&quot;, &quot;Goodbye world!&quot; do
+      assert_equal &quot;Goodbye world!&quot;, render_without_cache(:file =&gt; &quot;test/hello_world.erb&quot;)
     end
+    assert_equal &quot;Hello world!&quot;, render_without_cache(:file =&gt; &quot;test/hello_world.erb&quot;)
   end
 
   private
     def render(*args)
-      view_paths = @explicit_view_paths || ActionController::Base.view_paths
-      ActionView::Base.new(view_paths, {}).render(*args)
+      render_with_cache(*args)
     end
 
-    def with_view_paths(*args)
-      args.each do |view_paths|
-        begin
-          @explicit_view_paths = view_paths
-          yield
-        ensure
-          @explicit_view_paths = nil
-        end
-      end
+    def render_with_cache(*args)
+      view_paths = ActionController::Base.view_paths
+      assert_equal ActionView::Template::FileSystemPath, view_paths.first.class
+      ActionView::Base.new(view_paths, {}).render(*args)
     end
 
-    def reset_mtime_of(template_name, view_paths_to_use)
-      view_paths_to_use.find_template(template_name).previously_last_modified = 10.seconds.ago unless ActionView::Base.cache_template_loading?
+    def render_without_cache(*args)
+      path = ActionView::Template::FileSystemPath.new(FIXTURE_LOAD_PATH)
+      view_paths = ActionView::Base.process_view_paths(path)
+      assert_equal ActionView::Template::FileSystemPath, view_paths.first.class
+      ActionView::Base.new(view_paths, {}).render(*args)
     end
 
-    def modify_template(template, content, view_paths_to_use = ActionController::Base.view_paths)
-      filename = filename_for(template)
+    def modify_template(template, content)
+      filename = &quot;#{FIXTURE_LOAD_PATH}/#{template}&quot;
       old_content = File.read(filename)
       begin
         File.open(filename, &quot;wb+&quot;) { |f| f.write(content) }
-        reset_mtime_of(template, view_paths_to_use)
         yield
       ensure
         File.open(filename, &quot;wb+&quot;) { |f| f.write(old_content) }
-        reset_mtime_of(template, view_paths_to_use)
       end
     end
-
-    def filename_for(template)
-      File.join(FIXTURE_LOAD_PATH, template)
-    end
-
-    def rename_template(old_name, new_name)
-      File.rename(filename_for(old_name), filename_for(new_name))
-      yield
-    ensure
-      File.rename(filename_for(new_name), filename_for(old_name))
-    end
-
-    def delete_template(template, &amp;block)
-      rename_template(template, File.join(File.dirname(template), &quot;__#{File.basename(template)}&quot;), &amp;block)
-    end
-
-    def with_caching(perform_caching)
-      old_perform_caching = ActionController::Base.perform_caching
-      begin
-        ActionController::Base.perform_caching = perform_caching
-        yield
-      ensure
-        ActionController::Base.perform_caching = old_perform_caching
-      end
-    end
-
-    def with_reloading(reload_templates, view_paths_owner = ActionController::Base)
-      old_view_paths, old_cache_templates = view_paths_owner.view_paths, ActionView::Base.cache_template_loading
-      begin
-        ActionView::Base.cache_template_loading = !reload_templates
-        view_paths_owner.view_paths = view_paths_for(reload_templates)
-        yield
-      ensure
-        view_paths_owner.view_paths, ActionView::Base.cache_template_loading = old_view_paths, old_cache_templates
-      end
-    end
-
-    def new_reloadable_view_paths
-      ActionView::PathSet.new(CACHED_VIEW_PATHS.map(&amp;:to_s))
-    end
-
-    def view_paths_for(reload_templates)
-      # reloadable paths are cheap to create
-      reload_templates ? new_reloadable_view_paths : CACHED_VIEW_PATHS
-    end
 end</diff>
      <filename>actionpack/test/template/compiled_templates_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -45,6 +45,7 @@ class FormHelperTest &lt; ActionView::TestCase
   tests ActionView::Helpers::FormHelper
 
   def setup
+    super
     @post = Post.new
     @comment = Comment.new
     def @post.errors()</diff>
      <filename>actionpack/test/template/form_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ class FormTagHelperTest &lt; ActionView::TestCase
   tests ActionView::Helpers::FormTagHelper
 
   def setup
+    super
     @controller = Class.new do
       def url_for(options)
         &quot;http://www.example.com&quot;</diff>
      <filename>actionpack/test/template/form_tag_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,9 +3,10 @@ require 'abstract_unit'
 class JavaScriptHelperTest &lt; ActionView::TestCase
   tests ActionView::Helpers::JavaScriptHelper
 
-  attr_accessor :template_format, :output_buffer
+  attr_accessor :formats, :output_buffer
 
   def setup
+    super
     @template = self
   end
 </diff>
      <filename>actionpack/test/template/javascript_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -25,9 +25,10 @@ class Author::Nested &lt; Author; end
 
 
 class PrototypeHelperBaseTest &lt; ActionView::TestCase
-  attr_accessor :template_format, :output_buffer
+  attr_accessor :formats, :output_buffer
 
   def setup
+    super
     @template = self
     @controller = Class.new do
       def url_for(options)</diff>
      <filename>actionpack/test/template/prototype_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,6 +13,7 @@ class RecordTagHelperTest &lt; ActionView::TestCase
   tests ActionView::Helpers::RecordTagHelper
 
   def setup
+    super
     @post = Post.new
   end
 </diff>
      <filename>actionpack/test/template/record_tag_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -29,38 +29,48 @@ module RenderTestCases
   end
 
   def test_render_file_with_localization
-    old_locale = I18n.locale
-    I18n.locale = :da
-    assert_equal &quot;Hey verden&quot;, @view.render(:file =&gt; &quot;test/hello_world&quot;)
-  ensure
-    I18n.locale = old_locale
+    pending do
+      begin
+        old_locale = I18n.locale
+        I18n.locale = :da
+        assert_equal &quot;Hey verden&quot;, @view.render(:file =&gt; &quot;test/hello_world&quot;)
+      ensure
+        I18n.locale = old_locale
+      end
+    end
   end
 
   def test_render_file_with_dashed_locale
     old_locale = I18n.locale
-    I18n.locale = :&quot;pt-BR&quot;
-    assert_equal &quot;Ola mundo&quot;, @view.render(:file =&gt; &quot;test/hello_world&quot;)
+    pending do
+      I18n.locale = :&quot;pt-BR&quot;
+      assert_equal &quot;Ola mundo&quot;, @view.render(:file =&gt; &quot;test/hello_world&quot;)
+    end
   ensure
     I18n.locale = old_locale
   end
 
   def test_render_implicit_html_template_from_xhr_request
-    old_format = @view.template_format
-    @view.template_format = :js
-    assert_equal &quot;Hello HTML!&quot;, @view.render(:file =&gt; &quot;test/render_implicit_html_template_from_xhr_request&quot;)
+    old_format = @view.formats
+    pending do
+      @view.formats = [:js]
+      assert_equal &quot;Hello HTML!&quot;, @view.render(:file =&gt; &quot;test/render_implicit_html_template_from_xhr_request&quot;)
+    end
   ensure
-    @view.template_format = old_format
+    @view.formats = old_format
   end
 
   def test_render_implicit_html_template_from_xhr_request_with_localization
     old_locale = I18n.locale
-    old_format = @view.template_format
-    I18n.locale = :da
-    @view.template_format = :js
-    assert_equal &quot;Hey HTML!\n&quot;, @view.render(:file =&gt; &quot;test/render_implicit_html_template_from_xhr_request&quot;)
+    old_format = @view.formats
+    pending do
+      I18n.locale = :da
+      @view.formats = [:js]
+      assert_equal &quot;Hey HTML!\n&quot;, @view.render(:file =&gt; &quot;test/render_implicit_html_template_from_xhr_request&quot;)
+    end
   ensure
     I18n.locale = old_locale
-    @view.template_format = old_format
+    @view.formats = old_format
   end
 
   def test_render_file_at_top_level
@@ -186,7 +196,7 @@ module RenderTestCases
 
   # TODO: The reason for this test is unclear, improve documentation
   def test_render_missing_xml_partial_and_raise_missing_template
-    @view.template_format = :xml
+    @view.formats = [:xml]
     assert_raise(ActionView::MissingTemplate) { @view.render(:partial =&gt; &quot;test/layout_for_partial&quot;) }
   end
 
@@ -257,34 +267,26 @@ module RenderTestCases
   end
 end
 
-module TemplatesSetupTeardown
-  def setup_view_paths_for(new_cache_template_loading)
-    @previous_cache_template_loading, ActionView::Base.cache_template_loading = ActionView::Base.cache_template_loading, new_cache_template_loading
-    view_paths = new_cache_template_loading ? CACHED_VIEW_PATHS : ActionView::Base.process_view_paths(CACHED_VIEW_PATHS.map(&amp;:to_s))
-    assert_equal(new_cache_template_loading ? ActionView::Template::EagerPath : ActionView::ReloadableTemplate::ReloadablePath, view_paths.first.class)
-    setup_view(view_paths)
-  end
-  
-  def teardown
-    ActionView::Base.cache_template_loading = @previous_cache_template_loading
-  end
-end
-
-class CachedRenderTest &lt; Test::Unit::TestCase
-  include TemplatesSetupTeardown
+class CachedViewRenderTest &lt; ActiveSupport::TestCase
   include RenderTestCases
 
+  # Ensure view path cache is primed
   def setup
-    setup_view_paths_for(cache_templates = true)
+    view_paths = ActionController::Base.view_paths
+    assert_equal ActionView::Template::FileSystemPath, view_paths.first.class
+    setup_view(view_paths)
   end
 end
 
-class ReloadableRenderTest &lt; Test::Unit::TestCase
-  include TemplatesSetupTeardown
+class LazyViewRenderTest &lt; ActiveSupport::TestCase
   include RenderTestCases
 
+  # Test the same thing as above, but make sure the view path
+  # is not eager loaded
   def setup
-    setup_view_paths_for(cache_templates = false)
+    path = ActionView::Template::FileSystemPath.new(FIXTURE_LOAD_PATH)
+    view_paths = ActionView::Base.process_view_paths(path)
+    assert_equal ActionView::Template::FileSystemPath, view_paths.first.class
+    setup_view(view_paths)
   end
 end
-</diff>
      <filename>actionpack/test/template/render_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ class ScriptaculousHelperTest &lt; ActionView::TestCase
   tests ActionView::Helpers::ScriptaculousHelper
 
   def setup
+    super
     @controller = Class.new do
       def url_for(options)
         url =  &quot;http://www.example.com/&quot;</diff>
      <filename>actionpack/test/template/scriptaculous_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,6 +20,7 @@ end
 
 class PeopleHelperTest &lt; ActionView::TestCase
   def setup
+    super
     ActionController::Routing::Routes.draw do |map|
       map.people 'people', :controller =&gt; 'people', :action =&gt; 'index'
       map.connect ':controller/:action/:id'</diff>
      <filename>actionpack/test/template/test_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,6 +6,7 @@ class TextHelperTest &lt; ActionView::TestCase
   include TestingSandbox
 
   def setup
+    super
     # This simulates the fact that instance variables are reset every time
     # a view is rendered.  The cycle helper depends on this behavior.
     @_cycles = nil if (defined? @_cycles)</diff>
      <filename>actionpack/test/template/text_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,6 +7,7 @@ class UrlHelperTest &lt; ActionView::TestCase
   tests ActionView::Helpers::UrlHelper
 
   def setup
+    super
     @controller = Class.new do
       attr_accessor :url, :request
       def url_for(options)
@@ -380,6 +381,7 @@ class UrlHelperWithControllerTest &lt; ActionView::TestCase
   tests ActionView::Helpers::UrlHelper
 
   def setup
+    super
     @request    = ActionController::TestRequest.new
     @response   = ActionController::TestResponse.new
     @controller = UrlHelperController.new
@@ -458,6 +460,7 @@ class LinkToUnlessCurrentWithControllerTest &lt; ActionView::TestCase
   tests ActionView::Helpers::UrlHelper
 
   def setup
+    super
     @request    = ActionController::TestRequest.new
     @response   = ActionController::TestResponse.new
     @controller = TasksController.new
@@ -560,6 +563,7 @@ class PolymorphicControllerTest &lt; ActionView::TestCase
   tests ActionView::Helpers::UrlHelper
 
   def setup
+    super
     @request    = ActionController::TestRequest.new
     @response   = ActionController::TestResponse.new
   end</diff>
      <filename>actionpack/test/template/url_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,10 @@
+*Edge*
+
+* Added :touch option to belongs_to associations that will touch the parent record when the current record is saved or destroyed [DHH]
+
+* Added ActiveRecord::Base#touch to update the updated_at/on attributes (or another specified timestamp) with the current time [DHH]
+
+
 *2.3.2 [Final] (March 15, 2009)*
 
 * Added ActiveRecord::Base.find_each and ActiveRecord::Base.find_in_batches for batch processing [DHH/Jamis Buck]</diff>
      <filename>activerecord/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -981,6 +981,9 @@ module ActiveRecord
       #   If false, don't validate the associated objects when saving the parent object. +false+ by default.
       # [:autosave]
       #   If true, always save the associated object or destroy it if marked for destruction, when saving the parent object. Off by default.
+      # [:touch]
+      #   If true, the associated object will be touched (the updated_at/on attributes set to now) when this record is either saved or
+      #   destroyed. If you specify a symbol, that attribute will be updated with the current time instead of the updated_at/on attribute.
       #
       # Option examples:
       #   belongs_to :firm, :foreign_key =&gt; &quot;client_of&quot;
@@ -990,6 +993,8 @@ module ActiveRecord
       #   belongs_to :attachable, :polymorphic =&gt; true
       #   belongs_to :project, :readonly =&gt; true
       #   belongs_to :post, :counter_cache =&gt; true
+      #   belongs_to :company, :touch =&gt; true
+      #   belongs_to :company, :touch =&gt; :employees_last_updated_at
       def belongs_to(association_id, options = {})
         reflection = create_belongs_to_reflection(association_id, options)
 
@@ -1001,28 +1006,8 @@ module ActiveRecord
           association_constructor_method(:create, reflection, BelongsToAssociation)
         end
 
-        # Create the callbacks to update counter cache
-        if options[:counter_cache]
-          cache_column = reflection.counter_cache_column
-
-          method_name = &quot;belongs_to_counter_cache_after_create_for_#{reflection.name}&quot;.to_sym
-          define_method(method_name) do
-            association = send(reflection.name)
-            association.class.increment_counter(cache_column, send(reflection.primary_key_name)) unless association.nil?
-          end
-          after_create method_name
-
-          method_name = &quot;belongs_to_counter_cache_before_destroy_for_#{reflection.name}&quot;.to_sym
-          define_method(method_name) do
-            association = send(reflection.name)
-            association.class.decrement_counter(cache_column, send(reflection.primary_key_name)) unless association.nil?
-          end
-          before_destroy method_name
-
-          module_eval(
-            &quot;#{reflection.class_name}.send(:attr_readonly,\&quot;#{cache_column}\&quot;.intern) if defined?(#{reflection.class_name}) &amp;&amp; #{reflection.class_name}.respond_to?(:attr_readonly)&quot;
-          )
-        end
+        add_counter_cache_callbacks(reflection)          if options[:counter_cache]
+        add_touch_callbacks(reflection, options[:touch]) if options[:touch]
 
         configure_dependency_for_belongs_to(reflection)
       end
@@ -1329,6 +1314,43 @@ module ActiveRecord
           end
         end
 
+        def add_counter_cache_callbacks(reflection)
+          cache_column = reflection.counter_cache_column
+
+          method_name = &quot;belongs_to_counter_cache_after_create_for_#{reflection.name}&quot;.to_sym
+          define_method(method_name) do
+            association = send(reflection.name)
+            association.class.increment_counter(cache_column, send(reflection.primary_key_name)) unless association.nil?
+          end
+          after_create(method_name)
+
+          method_name = &quot;belongs_to_counter_cache_before_destroy_for_#{reflection.name}&quot;.to_sym
+          define_method(method_name) do
+            association = send(reflection.name)
+            association.class.decrement_counter(cache_column, send(reflection.primary_key_name)) unless association.nil?
+          end
+          before_destroy(method_name)
+
+          module_eval(
+            &quot;#{reflection.class_name}.send(:attr_readonly,\&quot;#{cache_column}\&quot;.intern) if defined?(#{reflection.class_name}) &amp;&amp; #{reflection.class_name}.respond_to?(:attr_readonly)&quot;
+          )
+        end
+        
+        def add_touch_callbacks(reflection, touch_attribute)
+          method_name = &quot;belongs_to_touch_after_save_or_destroy_for_#{reflection.name}&quot;.to_sym
+          define_method(method_name) do
+            association = send(reflection.name)
+            
+            if touch_attribute == true
+              association.touch unless association.nil?
+            else
+              association.touch(touch_attribute) unless association.nil?
+            end
+          end
+          after_save(method_name)
+          after_destroy(method_name)
+        end
+
         def find_with_associations(options = {})
           catch :invalid_query do
             join_dependency = JoinDependency.new(self, merge_includes(scope(:find, :include), options[:include]), options[:joins])
@@ -1353,7 +1375,7 @@ module ActiveRecord
             dependent_conditions = []
             dependent_conditions &lt;&lt; &quot;#{reflection.primary_key_name} = \#{record.quoted_id}&quot;
             dependent_conditions &lt;&lt; &quot;#{reflection.options[:as]}_type = '#{base_class.name}'&quot; if reflection.options[:as]
-            dependent_conditions &lt;&lt; sanitize_sql(reflection.options[:conditions]) if reflection.options[:conditions]
+            dependent_conditions &lt;&lt; sanitize_sql(reflection.options[:conditions], reflection.quoted_table_name) if reflection.options[:conditions]
             dependent_conditions &lt;&lt; extra_conditions if extra_conditions
             dependent_conditions = dependent_conditions.collect {|where| &quot;(#{where})&quot; }.join(&quot; AND &quot;)
             dependent_conditions = dependent_conditions.gsub('@', '\@')
@@ -1499,7 +1521,7 @@ module ActiveRecord
         @@valid_keys_for_belongs_to_association = [
           :class_name, :foreign_key, :foreign_type, :remote, :select, :conditions,
           :include, :dependent, :counter_cache, :extend, :polymorphic, :readonly,
-          :validate
+          :validate, :touch
         ]
 
         def create_belongs_to_reflection(association_id, options)
@@ -2101,7 +2123,7 @@ module ActiveRecord
                 klass.send(:type_condition, aliased_table_name)] unless klass.descends_from_active_record?
 
               [through_reflection, reflection].each do |ref|
-                join &lt;&lt; &quot;AND #{interpolate_sql(sanitize_sql(ref.options[:conditions]))} &quot; if ref &amp;&amp; ref.options[:conditions]
+                join &lt;&lt; &quot;AND #{interpolate_sql(sanitize_sql(ref.options[:conditions], aliased_table_name))} &quot; if ref &amp;&amp; ref.options[:conditions]
               end
 
               join</diff>
      <filename>activerecord/lib/active_record/associations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -169,8 +169,8 @@ module ActiveRecord
         end
 
         # Forwards the call to the reflection class.
-        def sanitize_sql(sql)
-          @reflection.klass.send(:sanitize_sql, sql)
+        def sanitize_sql(sql, table_name = @reflection.klass.quoted_table_name)
+          @reflection.klass.send(:sanitize_sql, sql, table_name)
         end
 
         # Assigns the ID of the owner to the corresponding foreign key in +record+.</diff>
      <filename>activerecord/lib/active_record/associations/association_proxy.rb</filename>
    </modified>
    <modified>
      <diff>@@ -810,25 +810,28 @@ module ActiveRecord #:nodoc:
 
       # Updates all records with details given if they match a set of conditions supplied, limits and order can
       # also be supplied. This method constructs a single SQL UPDATE statement and sends it straight to the
-      # database. It does not instantiate the involved models and it does not trigger Active Record callbacks.
+      # database. It does not instantiate the involved models and it does not trigger Active Record callbacks
+      # or validations.
       #
       # ==== Parameters
       #
-      # * +updates+ - A string of column and value pairs that will be set on any records that match conditions. This creates the SET clause of the generated SQL.
-      # * +conditions+ - An SQL fragment like &quot;administrator = 1&quot; or [ &quot;user_name = ?&quot;, username ]. See conditions in the intro for more info.
+      # * +updates+ - A string, array, or hash representing the SET part of an SQL statement.
+      # * +conditions+ - A string, array, or hash representing the WHERE part of an SQL statement. See conditions in the intro.
       # * +options+ - Additional options are &lt;tt&gt;:limit&lt;/tt&gt; and &lt;tt&gt;:order&lt;/tt&gt;, see the examples for usage.
       #
       # ==== Examples
       #
-      #   # Update all billing objects with the 3 different attributes given
-      #   Billing.update_all( &quot;category = 'authorized', approved = 1, author = 'David'&quot; )
+      #   # Update all customers with the given attributes
+      #   Customer.update_all :wants_email =&gt; true
       #
-      #   # Update records that match our conditions
-      #   Billing.update_all( &quot;author = 'David'&quot;, &quot;title LIKE '%Rails%'&quot; )
+      #   # Update all books with 'Rails' in their title
+      #   Book.update_all &quot;author = 'David'&quot;, &quot;title LIKE '%Rails%'&quot;
       #
-      #   # Update records that match our conditions but limit it to 5 ordered by date
-      #   Billing.update_all( &quot;author = 'David'&quot;, &quot;title LIKE '%Rails%'&quot;,
-      #                         :order =&gt; 'created_at', :limit =&gt; 5 )
+      #   # Update all avatars migrated more than a week ago
+      #   Avatar.update_all ['migrated_at = ?, Time.now.utc], ['migrated_at &gt; ?', 1.week.ago]
+      #
+      #   # Update all books that match our conditions, but limit it to 5 ordered by date
+      #   Book.update_all &quot;author = 'David'&quot;, &quot;title LIKE '%Rails%'&quot;, :order =&gt; 'created_at', :limit =&gt; 5
       def update_all(updates, conditions = nil, options = {})
         sql  = &quot;UPDATE #{quoted_table_name} SET #{sanitize_sql_for_assignment(updates)} &quot;
 
@@ -2228,12 +2231,12 @@ module ActiveRecord #:nodoc:
         #   [&quot;name='%s' and group_id='%s'&quot;, &quot;foo'bar&quot;, 4]  returns  &quot;name='foo''bar' and group_id='4'&quot;
         #   { :name =&gt; &quot;foo'bar&quot;, :group_id =&gt; 4 }  returns &quot;name='foo''bar' and group_id='4'&quot;
         #   &quot;name='foo''bar' and group_id='4'&quot; returns &quot;name='foo''bar' and group_id='4'&quot;
-        def sanitize_sql_for_conditions(condition)
+        def sanitize_sql_for_conditions(condition, table_name = quoted_table_name)
           return nil if condition.blank?
 
           case condition
             when Array; sanitize_sql_array(condition)
-            when Hash;  sanitize_sql_hash_for_conditions(condition)
+            when Hash;  sanitize_sql_hash_for_conditions(condition, table_name)
             else        condition
           end
         end</diff>
      <filename>activerecord/lib/active_record/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -392,9 +392,28 @@ module ActiveRecord
         quote_string(s)
       end
 
+      # Checks the following cases:
+      #
+      # - table_name
+      # - &quot;table.name&quot;
+      # - schema_name.table_name
+      # - schema_name.&quot;table.name&quot;
+      # - &quot;schema.name&quot;.table_name
+      # - &quot;schema.name&quot;.&quot;table.name&quot;
+      def quote_table_name(name)
+        schema, name_part = extract_pg_identifier_from_name(name.to_s)
+
+        unless name_part
+          quote_column_name(schema)
+        else
+          table_name, name_part = extract_pg_identifier_from_name(name_part)
+          &quot;#{quote_column_name(schema)}.#{quote_column_name(table_name)}&quot;
+        end
+      end
+
       # Quotes column names for use in SQL queries.
       def quote_column_name(name) #:nodoc:
-        %(&quot;#{name}&quot;)
+        PGconn.quote_ident(name.to_s)
       end
 
       # Quote date/time values for use in SQL input. Includes microseconds
@@ -621,33 +640,36 @@ module ActiveRecord
       def indexes(table_name, name = nil)
          schemas = schema_search_path.split(/,/).map { |p| quote(p) }.join(',')
          result = query(&lt;&lt;-SQL, name)
-           SELECT distinct i.relname, d.indisunique, a.attname
-             FROM pg_class t, pg_class i, pg_index d, pg_attribute a
+           SELECT distinct i.relname, d.indisunique, d.indkey, t.oid
+             FROM pg_class t, pg_class i, pg_index d
            WHERE i.relkind = 'i'
              AND d.indexrelid = i.oid
              AND d.indisprimary = 'f'
              AND t.oid = d.indrelid
              AND t.relname = '#{table_name}'
              AND i.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname IN (#{schemas}) )
-             AND a.attrelid = t.oid
-             AND ( d.indkey[0]=a.attnum OR d.indkey[1]=a.attnum
-                OR d.indkey[2]=a.attnum OR d.indkey[3]=a.attnum
-                OR d.indkey[4]=a.attnum OR d.indkey[5]=a.attnum
-                OR d.indkey[6]=a.attnum OR d.indkey[7]=a.attnum
-                OR d.indkey[8]=a.attnum OR d.indkey[9]=a.attnum )
           ORDER BY i.relname
         SQL
 
-        current_index = nil
+
         indexes = []
 
-        result.each do |row|
-          if current_index != row[0]
-            indexes &lt;&lt; IndexDefinition.new(table_name, row[0], row[1] == &quot;t&quot;, [])
-            current_index = row[0]
-          end
+        indexes = result.map do |row|
+          index_name = row[0]
+          unique = row[1] == 't'
+          indkey = row[2].split(&quot; &quot;)
+          oid = row[3]
+
+          columns = query(&lt;&lt;-SQL, &quot;Columns for index #{row[0]} on #{table_name}&quot;).inject({}) {|attlist, r| attlist[r[1]] = r[0]; attlist}
+          SELECT a.attname, a.attnum
+          FROM pg_attribute a
+          WHERE a.attrelid = #{oid}
+          AND a.attnum IN (#{indkey.join(&quot;,&quot;)})
+          SQL
+
+          column_names = indkey.map {|attnum| columns[attnum] }
+          IndexDefinition.new(table_name, index_name, unique, column_names)
 
-          indexes.last.columns &lt;&lt; row[2]
         end
 
         indexes
@@ -745,7 +767,7 @@ module ActiveRecord
             AND attr.attrelid     = cons.conrelid
             AND attr.attnum       = cons.conkey[1]
             AND cons.contype      = 'p'
-            AND dep.refobjid      = '#{table}'::regclass
+            AND dep.refobjid      = '#{quote_table_name(table)}'::regclass
         end_sql
 
         if result.nil? or result.empty?
@@ -764,7 +786,7 @@ module ActiveRecord
             JOIN pg_attribute   attr ON (t.oid = attrelid)
             JOIN pg_attrdef     def  ON (adrelid = attrelid AND adnum = attnum)
             JOIN pg_constraint  cons ON (conrelid = adrelid AND adnum = conkey[1])
-            WHERE t.oid = '#{table}'::regclass
+            WHERE t.oid = '#{quote_table_name(table)}'::regclass
               AND cons.contype = 'p'
               AND def.adsrc ~* 'nextval'
           end_sql
@@ -839,7 +861,7 @@ module ActiveRecord
 
       # Drops an index from a table.
       def remove_index(table_name, options = {})
-        execute &quot;DROP INDEX #{index_name(table_name, options)}&quot;
+        execute &quot;DROP INDEX #{quote_table_name(index_name(table_name, options))}&quot;
       end
 
       # Maps logical Rails types to PostgreSQL-specific data types.
@@ -1040,11 +1062,21 @@ module ActiveRecord
             SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
               FROM pg_attribute a LEFT JOIN pg_attrdef d
                 ON a.attrelid = d.adrelid AND a.attnum = d.adnum
-             WHERE a.attrelid = '#{table_name}'::regclass
+             WHERE a.attrelid = '#{quote_table_name(table_name)}'::regclass
                AND a.attnum &gt; 0 AND NOT a.attisdropped
              ORDER BY a.attnum
           end_sql
         end
+
+        def extract_pg_identifier_from_name(name)
+          match_data = name[0,1] == '&quot;' ? name.match(/\&quot;([^\&quot;]+)\&quot;/) : name.match(/([^\.]+)/)
+
+          if match_data
+            rest = name[match_data[0].length..-1]
+            rest = rest[1..-1] if rest[0,1] == &quot;.&quot;
+            [match_data[1], (rest.length &gt; 0 ? rest : nil)]
+          end
+        end
     end
   end
 end</diff>
      <filename>activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -150,6 +150,16 @@ module ActiveRecord
         %Q(&quot;#{name}&quot;)
       end
 
+      # Quote date/time values for use in SQL input. Includes microseconds
+      # if the value is a Time responding to usec.
+      def quoted_date(value) #:nodoc:
+        if value.acts_like?(:time) &amp;&amp; value.respond_to?(:usec)
+          &quot;#{super}.#{sprintf(&quot;%06d&quot;, value.usec)}&quot;
+        else
+          super
+        end
+      end
+
 
       # DATABASE STATEMENTS ======================================
 </diff>
      <filename>activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -40,7 +40,7 @@ module ActiveRecord
   #
   # The example SqlBypass class is a generic SQL session store.  You may
   # use it as a basis for high-performance database-specific stores.
-  class SessionStore &lt; ActionController::Session::AbstractStore
+  class SessionStore &lt; ActionDispatch::Session::AbstractStore
     # The default Active Record class.
     class Session &lt; ActiveRecord::Base
       ##
@@ -184,7 +184,7 @@ module ActiveRecord
 
         # Look up a session by id and unmarshal its data if found.
         def find_by_session_id(session_id)
-          if record = @@connection.select_one(&quot;SELECT * FROM #{@@table_name} WHERE #{@@session_id_column}=#{@@connection.quote(session_id)}&quot;)
+          if record = connection.select_one(&quot;SELECT * FROM #{@@table_name} WHERE #{@@session_id_column}=#{connection.quote(session_id)}&quot;)
             new(:session_id =&gt; session_id, :marshaled_data =&gt; record['data'])
           end
         end</diff>
      <filename>activerecord/lib/active_record/session_store.rb</filename>
    </modified>
    <modified>
      <diff>@@ -15,27 +15,57 @@ module ActiveRecord
       base.class_inheritable_accessor :record_timestamps, :instance_writer =&gt; false
       base.record_timestamps = true
     end
+    
+    # Saves the record with the updated_at/on attributes set to the current time.
+    # If the save fails because of validation errors, an ActiveRecord::RecordInvalid exception is raised.
+    # If an attribute name is passed, that attribute is used for the touch instead of the updated_at/on attributes.
+    #
+    # Examples:
+    #
+    #   product.touch               # updates updated_at
+    #   product.touch(:designed_at) # updates the designed_at attribute
+    def touch(attribute = nil)
+      current_time = current_time_from_proper_timezone
+
+      if attribute
+        write_attribute(attribute, current_time)
+      else
+        write_attribute('updated_at', current_time) if respond_to?(:updated_at)
+        write_attribute('updated_on', current_time) if respond_to?(:updated_on)
+      end
+
+      save!
+    end
+
 
     private
       def create_with_timestamps #:nodoc:
         if record_timestamps
-          t = self.class.default_timezone == :utc ? Time.now.utc : Time.now
-          write_attribute('created_at', t) if respond_to?(:created_at) &amp;&amp; created_at.nil?
-          write_attribute('created_on', t) if respond_to?(:created_on) &amp;&amp; created_on.nil?
+          current_time = current_time_from_proper_timezone
 
-          write_attribute('updated_at', t) if respond_to?(:updated_at) &amp;&amp; updated_at.nil?
-          write_attribute('updated_on', t) if respond_to?(:updated_on) &amp;&amp; updated_on.nil?
+          write_attribute('created_at', current_time) if respond_to?(:created_at) &amp;&amp; created_at.nil?
+          write_attribute('created_on', current_time) if respond_to?(:created_on) &amp;&amp; created_on.nil?
+
+          write_attribute('updated_at', current_time) if respond_to?(:updated_at) &amp;&amp; updated_at.nil?
+          write_attribute('updated_on', current_time) if respond_to?(:updated_on) &amp;&amp; updated_on.nil?
         end
+
         create_without_timestamps
       end
 
       def update_with_timestamps(*args) #:nodoc:
         if record_timestamps &amp;&amp; (!partial_updates? || changed?)
-          t = self.class.default_timezone == :utc ? Time.now.utc : Time.now
-          write_attribute('updated_at', t) if respond_to?(:updated_at)
-          write_attribute('updated_on', t) if respond_to?(:updated_on)
+          current_time = current_time_from_proper_timezone
+
+          write_attribute('updated_at', current_time) if respond_to?(:updated_at)
+          write_attribute('updated_on', current_time) if respond_to?(:updated_on)
         end
+
         update_without_timestamps(*args)
       end
+      
+      def current_time_from_proper_timezone
+        self.class.default_timezone == :utc ? Time.now.utc : Time.now
+      end
   end
-end
+end
\ No newline at end of file</diff>
      <filename>activerecord/lib/active_record/timestamp.rb</filename>
    </modified>
    <modified>
      <diff>@@ -175,6 +175,8 @@ module ActiveRecord
     #     end                                                     # RELEASE savepoint active_record_1
     #                                                             # ^^^^ BOOM! database error!
     #   end
+    #
+    # Note that &quot;TRUNCATE&quot; is also a MySQL DDL statement!
     module ClassMethods
       # See ActiveRecord::Transactions::ClassMethods for detailed documentation.
       def transaction(options = {}, &amp;block)</diff>
      <filename>activerecord/lib/active_record/transactions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -719,6 +719,12 @@ class HasManyAssociationsTest &lt; ActiveRecord::TestCase
     assert Client.find(:all, :conditions =&gt; &quot;firm_id=#{firm.id}&quot;).empty?
   end
 
+  def test_dependence_for_associations_with_hash_condition
+    david = authors(:david)
+    post = posts(:thinking).id
+    assert_difference('Post.count', -1) { assert david.destroy }
+  end
+
   def test_destroy_dependent_when_deleted_from_association
     firm = Firm.find(:first)
     assert_equal 2, firm.clients.size</diff>
      <filename>activerecord/test/cases/associations/has_many_associations_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -29,6 +29,11 @@ class InnerJoinAssociationTest &lt; ActiveRecord::TestCase
     assert_match /INNER JOIN .?categories.? ON.*AND.*.?General.?.*TERMINATING_MARKER/, sql
   end
 
+  def test_construct_finder_sql_applies_aliases_tables_on_association_conditions
+    result = Author.find(:all, :joins =&gt; [:thinking_posts, :welcome_posts])
+    assert_equal authors(:david), result.first
+  end
+
   def test_construct_finder_sql_unpacks_nested_joins
     sql = Author.send(:construct_finder_sql, :joins =&gt; {:posts =&gt; [[:comments]]})
     assert_no_match /inner join.*inner join.*inner join/i, sql, &quot;only two join clauses should be present&quot;</diff>
      <filename>activerecord/test/cases/associations/inner_join_association_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -456,7 +456,7 @@ class BasicsTest &lt; ActiveRecord::TestCase
     )
 
     # For adapters which support microsecond resolution.
-    if current_adapter?(:PostgreSQLAdapter)
+    if current_adapter?(:PostgreSQLAdapter) || current_adapter?(:SQLiteAdapter)
       assert_equal 11, Topic.find(1).written_on.sec
       assert_equal 223300, Topic.find(1).written_on.usec
       assert_equal 9900, Topic.find(2).written_on.usec
@@ -1756,7 +1756,7 @@ class BasicsTest &lt; ActiveRecord::TestCase
   end
 
   def test_scoped_find_with_group_and_having
-    developers = Developer.with_scope(:find =&gt; { :group =&gt; 'salary', :having =&gt; &quot;SUM(salary) &gt; 10000&quot;, :select =&gt; &quot;SUM(salary) as salary&quot; }) do
+    developers = Developer.with_scope(:find =&gt; { :group =&gt; 'developers.salary', :having =&gt; &quot;SUM(salary) &gt; 10000&quot;, :select =&gt; &quot;SUM(salary) as salary&quot; }) do
       Developer.find(:all)
     end
     assert_equal 3, developers.size</diff>
      <filename>activerecord/test/cases/base_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,7 +10,7 @@ class CopyTableTest &lt; ActiveRecord::TestCase
     end
   end
 
-  def test_copy_table(from = 'companies', to = 'companies2', options = {})
+  def test_copy_table(from = 'customers', to = 'customers2', options = {})
     assert_nothing_raised {copy_table(from, to, options)}
     assert_equal row_count(from), row_count(to)
 
@@ -24,11 +24,11 @@ class CopyTableTest &lt; ActiveRecord::TestCase
   end
 
   def test_copy_table_renaming_column
-    test_copy_table('companies', 'companies2',
-        :rename =&gt; {'client_of' =&gt; 'fan_of'}) do |from, to, options|
-      expected = column_values(from, 'client_of')
+    test_copy_table('customers', 'customers2',
+        :rename =&gt; {'name' =&gt; 'person_name'}) do |from, to, options|
+      expected = column_values(from, 'name')
       assert expected.any?, 'only nils in resultset; real values are needed'
-      assert_equal expected, column_values(to, 'fan_of')
+      assert_equal expected, column_values(to, 'person_name')
     end
   end
 </diff>
      <filename>activerecord/test/cases/copy_table_test_sqlite.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,6 +22,11 @@ class SchemaDumperTest &lt; ActiveRecord::TestCase
     assert_no_match %r{create_table &quot;sqlite_sequence&quot;}, output
   end
 
+  def test_schema_dump_includes_camelcase_table_name
+    output = standard_dump
+    assert_match %r{create_table &quot;CamelCase&quot;}, output
+  end
+
   def assert_line_up(lines, pattern, required = false)
     return assert(true) if lines.empty?
     matches = lines.map { |line| line.match(pattern) }
@@ -147,6 +152,11 @@ class SchemaDumperTest &lt; ActiveRecord::TestCase
     end
   end
 
+  def test_schema_dumps_index_columns_in_right_order
+    index_definition = standard_dump.split(/\n/).grep(/add_index.*companies/).first.strip
+    assert_equal 'add_index &quot;companies&quot;, [&quot;firm_id&quot;, &quot;type&quot;, &quot;rating&quot;, &quot;ruby_type&quot;], :name =&gt; &quot;company_index&quot;', index_definition
+  end
+
   if current_adapter?(:MysqlAdapter)
     def test_schema_dump_should_not_add_default_value_for_mysql_text_field
       output = standard_dump</diff>
      <filename>activerecord/test/cases/schema_dumper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,6 +6,7 @@ class SchemaTest &lt; ActiveRecord::TestCase
   SCHEMA_NAME = 'test_schema'
   SCHEMA2_NAME = 'test_schema2'
   TABLE_NAME = 'things'
+  CAPITALIZED_TABLE_NAME = 'Things'
   INDEX_A_NAME = 'a_index_things_on_name'
   INDEX_B_NAME = 'b_index_things_on_different_columns_in_each_schema'
   INDEX_A_COLUMN = 'name'
@@ -18,9 +19,27 @@ class SchemaTest &lt; ActiveRecord::TestCase
     'moment timestamp without time zone default now()'
   ]
 
+  class Thing1 &lt; ActiveRecord::Base
+    set_table_name &quot;test_schema.things&quot;
+  end
+
+  class Thing2 &lt; ActiveRecord::Base
+    set_table_name &quot;test_schema2.things&quot;
+  end
+
+  class Thing3 &lt; ActiveRecord::Base
+    set_table_name 'test_schema.&quot;things.table&quot;'
+  end
+
+  class Thing4 &lt; ActiveRecord::Base
+    set_table_name 'test_schema.&quot;Things&quot;'
+  end
+
   def setup
     @connection = ActiveRecord::Base.connection
     @connection.execute &quot;CREATE SCHEMA #{SCHEMA_NAME} CREATE TABLE #{TABLE_NAME} (#{COLUMNS.join(',')})&quot;
+    @connection.execute &quot;CREATE TABLE #{SCHEMA_NAME}.\&quot;#{TABLE_NAME}.table\&quot; (#{COLUMNS.join(',')})&quot;
+    @connection.execute &quot;CREATE TABLE #{SCHEMA_NAME}.\&quot;#{CAPITALIZED_TABLE_NAME}\&quot; (#{COLUMNS.join(',')})&quot;
     @connection.execute &quot;CREATE SCHEMA #{SCHEMA2_NAME} CREATE TABLE #{TABLE_NAME} (#{COLUMNS.join(',')})&quot;
     @connection.execute &quot;CREATE INDEX #{INDEX_A_NAME} ON #{SCHEMA_NAME}.#{TABLE_NAME}  USING btree (#{INDEX_A_COLUMN});&quot;
     @connection.execute &quot;CREATE INDEX #{INDEX_A_NAME} ON #{SCHEMA2_NAME}.#{TABLE_NAME}  USING btree (#{INDEX_A_COLUMN});&quot;
@@ -39,6 +58,12 @@ class SchemaTest &lt; ActiveRecord::TestCase
     end
   end
 
+  def test_with_schema_prefixed_capitalized_table_name
+    assert_nothing_raised do
+      assert_equal COLUMNS, columns(&quot;#{SCHEMA_NAME}.#{CAPITALIZED_TABLE_NAME}&quot;)
+    end
+  end
+
   def test_with_schema_search_path
     assert_nothing_raised do
       with_schema_search_path(SCHEMA_NAME) do
@@ -47,6 +72,47 @@ class SchemaTest &lt; ActiveRecord::TestCase
     end
   end
 
+
+  def test_proper_encoding_of_table_name
+    assert_equal '&quot;table_name&quot;', @connection.quote_table_name('table_name')
+    assert_equal '&quot;table.name&quot;', @connection.quote_table_name('&quot;table.name&quot;')
+    assert_equal '&quot;schema_name&quot;.&quot;table_name&quot;', @connection.quote_table_name('schema_name.table_name')
+    assert_equal '&quot;schema_name&quot;.&quot;table.name&quot;', @connection.quote_table_name('schema_name.&quot;table.name&quot;')
+    assert_equal '&quot;schema.name&quot;.&quot;table_name&quot;', @connection.quote_table_name('&quot;schema.name&quot;.table_name')
+    assert_equal '&quot;schema.name&quot;.&quot;table.name&quot;', @connection.quote_table_name('&quot;schema.name&quot;.&quot;table.name&quot;')
+  end
+
+  def test_classes_with_qualified_schema_name
+    assert_equal 0, Thing1.count
+    assert_equal 0, Thing2.count
+    assert_equal 0, Thing3.count
+    assert_equal 0, Thing4.count
+
+    Thing1.create(:id =&gt; 1, :name =&gt; &quot;thing1&quot;, :email =&gt; &quot;thing1@localhost&quot;, :moment =&gt; Time.now)
+    assert_equal 1, Thing1.count
+    assert_equal 0, Thing2.count
+    assert_equal 0, Thing3.count
+    assert_equal 0, Thing4.count
+
+    Thing2.create(:id =&gt; 1, :name =&gt; &quot;thing1&quot;, :email =&gt; &quot;thing1@localhost&quot;, :moment =&gt; Time.now)
+    assert_equal 1, Thing1.count
+    assert_equal 1, Thing2.count
+    assert_equal 0, Thing3.count
+    assert_equal 0, Thing4.count
+
+    Thing3.create(:id =&gt; 1, :name =&gt; &quot;thing1&quot;, :email =&gt; &quot;thing1@localhost&quot;, :moment =&gt; Time.now)
+    assert_equal 1, Thing1.count
+    assert_equal 1, Thing2.count
+    assert_equal 1, Thing3.count
+    assert_equal 0, Thing4.count
+
+    Thing4.create(:id =&gt; 1, :name =&gt; &quot;thing1&quot;, :email =&gt; &quot;thing1@localhost&quot;, :moment =&gt; Time.now)
+    assert_equal 1, Thing1.count
+    assert_equal 1, Thing2.count
+    assert_equal 1, Thing3.count
+    assert_equal 1, Thing4.count
+  end
+
   def test_raise_on_unquoted_schema_name
     assert_raise(ActiveRecord::StatementInvalid) do
       with_schema_search_path '$user,public'
@@ -69,6 +135,16 @@ class SchemaTest &lt; ActiveRecord::TestCase
     do_dump_index_tests_for_schema(SCHEMA2_NAME, INDEX_A_COLUMN, INDEX_B_COLUMN_S2)
   end
 
+  def test_with_uppercase_index_name
+    ActiveRecord::Base.connection.execute &quot;CREATE INDEX \&quot;things_Index\&quot; ON #{SCHEMA_NAME}.things (name)&quot;
+    assert_nothing_raised { ActiveRecord::Base.connection.remove_index :things, :name =&gt; &quot;#{SCHEMA_NAME}.things_Index&quot;}
+
+    ActiveRecord::Base.connection.execute &quot;CREATE INDEX \&quot;things_Index\&quot; ON #{SCHEMA_NAME}.things (name)&quot;
+    ActiveRecord::Base.connection.schema_search_path = SCHEMA_NAME
+    assert_nothing_raised { ActiveRecord::Base.connection.remove_index :things, :name =&gt; &quot;things_Index&quot;}
+    ActiveRecord::Base.connection.schema_search_path = &quot;public&quot;
+  end
+
   private
     def columns(table_name)
       @connection.send(:column_definitions, table_name).map do |name, type, default|</diff>
      <filename>activerecord/test/cases/schema_test_postgresql.rb</filename>
    </modified>
    <modified>
      <diff>@@ -25,6 +25,8 @@ class Author &lt; ActiveRecord::Base
   has_many :comments_with_order_and_conditions, :through =&gt; :posts, :source =&gt; :comments, :order =&gt; 'comments.body', :conditions =&gt; &quot;comments.body like 'Thank%'&quot;
   has_many :comments_with_include, :through =&gt; :posts, :source =&gt; :comments, :include =&gt; :post
 
+  has_many :thinking_posts, :class_name =&gt; 'Post', :conditions =&gt; { :title =&gt; 'So I was thinking' }, :dependent =&gt; :delete_all
+  has_many :welcome_posts,  :class_name =&gt; 'Post', :conditions =&gt; { :title =&gt; 'Welcome to the weblog' }
 
   has_many :comments_desc, :through =&gt; :posts, :source =&gt; :comments, :order =&gt; 'comments.id DESC'
   has_many :limited_comments, :through =&gt; :posts, :source =&gt; :comments, :limit =&gt; 1</diff>
      <filename>activerecord/test/models/author.rb</filename>
    </modified>
    <modified>
      <diff>@@ -78,13 +78,6 @@ class DependentFirm &lt; Company
   has_many :companies, :foreign_key =&gt; 'client_of', :order =&gt; &quot;id&quot;, :dependent =&gt; :nullify
 end
 
-class ExclusivelyDependentFirm &lt; Company
-  has_one :account, :foreign_key =&gt; &quot;firm_id&quot;, :dependent =&gt; :delete
-  has_many :dependent_sanitized_conditional_clients_of_firm, :foreign_key =&gt; &quot;client_of&quot;, :class_name =&gt; &quot;Client&quot;, :order =&gt; &quot;id&quot;, :dependent =&gt; :delete_all, :conditions =&gt; &quot;name = 'BigShot Inc.'&quot;
-  has_many :dependent_conditional_clients_of_firm, :foreign_key =&gt; &quot;client_of&quot;, :class_name =&gt; &quot;Client&quot;, :order =&gt; &quot;id&quot;, :dependent =&gt; :delete_all, :conditions =&gt; [&quot;name = ?&quot;, 'BigShot Inc.']
-  has_many :dependent_hash_conditional_clients_of_firm, :foreign_key =&gt; &quot;client_of&quot;, :class_name =&gt; &quot;Client&quot;, :order =&gt; &quot;id&quot;, :dependent =&gt; :delete_all, :conditions =&gt; {:name =&gt; 'BigShot Inc.'}
-end
-
 class Client &lt; Company
   belongs_to :firm, :foreign_key =&gt; &quot;client_of&quot;
   belongs_to :firm_with_basic_id, :class_name =&gt; &quot;Firm&quot;, :foreign_key =&gt; &quot;firm_id&quot;
@@ -125,6 +118,12 @@ class Client &lt; Company
   end
 end
 
+class ExclusivelyDependentFirm &lt; Company
+  has_one :account, :foreign_key =&gt; &quot;firm_id&quot;, :dependent =&gt; :delete
+  has_many :dependent_sanitized_conditional_clients_of_firm, :foreign_key =&gt; &quot;client_of&quot;, :class_name =&gt; &quot;Client&quot;, :order =&gt; &quot;id&quot;, :dependent =&gt; :delete_all, :conditions =&gt; &quot;name = 'BigShot Inc.'&quot;
+  has_many :dependent_conditional_clients_of_firm, :foreign_key =&gt; &quot;client_of&quot;, :class_name =&gt; &quot;Client&quot;, :order =&gt; &quot;id&quot;, :dependent =&gt; :delete_all, :conditions =&gt; [&quot;name = ?&quot;, 'BigShot Inc.']
+  has_many :dependent_hash_conditional_clients_of_firm, :foreign_key =&gt; &quot;client_of&quot;, :class_name =&gt; &quot;Client&quot;, :order =&gt; &quot;id&quot;, :dependent =&gt; :delete_all, :conditions =&gt; {:name =&gt; 'BigShot Inc.'}
+end
 
 class SpecialClient &lt; Client
 end</diff>
      <filename>activerecord/test/models/company.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 class Pet &lt; ActiveRecord::Base
   set_primary_key :pet_id
-  belongs_to :owner
+  belongs_to :owner, :touch =&gt; true
   has_many :toys
 end</diff>
      <filename>activerecord/test/models/pet.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,7 +13,7 @@ class Project &lt; ActiveRecord::Base
                             :after_add =&gt; Proc.new {|o, r| o.developers_log &lt;&lt; &quot;after_adding#{r.id || '&lt;new&gt;'}&quot;},
                             :before_remove =&gt; Proc.new {|o, r| o.developers_log &lt;&lt; &quot;before_removing#{r.id}&quot;},
                             :after_remove =&gt; Proc.new {|o, r| o.developers_log &lt;&lt; &quot;after_removing#{r.id}&quot;}
-  has_and_belongs_to_many :well_payed_salary_groups, :class_name =&gt; &quot;Developer&quot;, :group =&gt; &quot;salary&quot;, :having =&gt; &quot;SUM(salary) &gt; 10000&quot;, :select =&gt; &quot;SUM(salary) as salary&quot;
+  has_and_belongs_to_many :well_payed_salary_groups, :class_name =&gt; &quot;Developer&quot;, :group =&gt; &quot;developers.salary&quot;, :having =&gt; &quot;SUM(salary) &gt; 10000&quot;, :select =&gt; &quot;SUM(salary) as salary&quot;
 
   attr_accessor :developers_log
 </diff>
      <filename>activerecord/test/models/project.rb</filename>
    </modified>
    <modified>
      <diff>@@ -68,6 +68,10 @@ ActiveRecord::Schema.define do
     t.boolean :value
   end
 
+  create_table &quot;CamelCase&quot;, :force =&gt; true do |t|
+    t.string :name
+  end
+
   create_table :categories, :force =&gt; true do |t|
     t.string :name, :null =&gt; false
     t.string :type
@@ -114,6 +118,8 @@ ActiveRecord::Schema.define do
     t.integer :rating, :default =&gt; 1
   end
 
+  add_index :companies, [:firm_id, :type, :rating, :ruby_type], :name =&gt; &quot;company_index&quot;
+
   create_table :computers, :force =&gt; true do |t|
     t.integer :developer, :null =&gt; false
     t.integer :extendedWarranty, :null =&gt; false
@@ -281,6 +287,8 @@ ActiveRecord::Schema.define do
 
   create_table :owners, :primary_key =&gt; :owner_id ,:force =&gt; true do |t|
     t.string :name
+    t.column :updated_at, :datetime
+    t.column :happy_at,   :datetime
   end
 
 </diff>
      <filename>activerecord/test/schema/schema.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 = Active Resource
 
 Active Resource (ARes) connects business objects and Representational State Transfer (REST)
-web services.  It implements object-relational mapping for REST webservices to provide transparent 
+web services.  It implements object-relational mapping for REST web services to provide transparent
 proxying capabilities between a client (ActiveResource) and a RESTful service (which is provided by Simply RESTful routing
 in ActionController::Resources).
 
@@ -22,14 +22,14 @@ received and serialized into a usable Ruby object.
 
 === Configuration and Usage
 
-Putting ActiveResource to use is very similar to ActiveRecord.  It's as simple as creating a model class
+Putting Active Resource to use is very similar to Active Record.  It's as simple as creating a model class
 that inherits from ActiveResource::Base and providing a &lt;tt&gt;site&lt;/tt&gt; class variable to it:
 
    class Person &lt; ActiveResource::Base
      self.site = &quot;http://api.people.com:3000/&quot;
    end
 
-Now the Person class is REST enabled and can invoke REST services very similarly to how ActiveRecord invokes
+Now the Person class is REST enabled and can invoke REST services very similarly to how Active Record invokes
 lifecycle methods that operate against a persistent store.
 
    # Find a person with id = 1
@@ -42,7 +42,7 @@ records.  But rather than dealing directly with a database record, you're dealin
 ==== Protocol
 
 Active Resource is built on a standard XML format for requesting and submitting resources over HTTP.  It mirrors the RESTful routing 
-built into ActionController but will also work with any other REST service that properly implements the protocol. 
+built into Action Controller but will also work with any other REST service that properly implements the protocol.
 REST uses HTTP, but unlike &quot;typical&quot; web applications, it makes use of all the verbs available in the HTTP specification:
 
 * GET requests are used for finding and retrieving resources.
@@ -55,8 +55,8 @@ for more general information on REST web services, see the article here[http://e
 
 ==== Find
 
-GET Http requests expect the XML form of whatever resource/resources is/are being requested.  So,
-for a request for a single element - the XML of that item is expected in response:
+Find requests use the GET method and expect the XML form of whatever resource/resources is/are being requested.  So,
+for a request for a single element, the XML of that item is expected in response:
 
    # Expects a response of
    #
@@ -101,7 +101,7 @@ Collections can also be requested in a similar fashion
 
 ==== Create
 
-Creating a new resource submits the xml form of the resource as the body of the request and expects
+Creating a new resource submits the XML form of the resource as the body of the request and expects
 a 'Location' header in the response with the RESTful URL location of the newly created resource.  The
 id of the newly created resource is parsed out of the Location response header and automatically set
 as the id of the ARes object.</diff>
      <filename>activeresource/README</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@ module ActiveResource
   #   end
   #
   # Now the Person class is mapped to RESTful resources located at &lt;tt&gt;http://api.people.com:3000/people/&lt;/tt&gt;, and
-  # you can now use Active Resource's lifecycles methods to manipulate resources. In the case where you already have
+  # you can now use Active Resource's lifecycle methods to manipulate resources. In the case where you already have
   # an existing model with the same name as the desired RESTful resource you can set the +element_name+ value.
   #
   #   class PersonResource &lt; ActiveResource::Base
@@ -112,6 +112,7 @@ module ActiveResource
   #
   # 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 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
@@ -156,7 +157,7 @@ module ActiveResource
   #
   # === Validation errors
   #
-  # Active Resource supports validations on resources and will return errors if any these validations fail
+  # Active Resource supports validations on resources and will return errors if any of these validations fail
   # (e.g., &quot;First name can not be blank&quot; and so on).  These types of errors are denoted in the response by
   # a response code of &lt;tt&gt;422&lt;/tt&gt; and an XML representation of the validation errors.  The save operation will
   # then fail (with a &lt;tt&gt;false&lt;/tt&gt; return value) and the validation errors can be accessed on the resource in question.
@@ -413,7 +414,7 @@ module ActiveResource
       # will split from the +prefix_options+.
       #
       # ==== Options
-      # * +prefix_options+ - A hash to add a prefix to the request for nested URL's (e.g., &lt;tt&gt;:account_id =&gt; 19&lt;/tt&gt;
+      # * +prefix_options+ - A hash to add a prefix to the request for nested URLs (e.g., &lt;tt&gt;:account_id =&gt; 19&lt;/tt&gt;
       #   would yield a URL like &lt;tt&gt;/accounts/19/purchases.xml&lt;/tt&gt;).
       # * +query_options+ - A hash to add items to the query string for the request.
       #
@@ -691,7 +692,7 @@ module ActiveResource
     end
 
 
-    # A method to determine if the resource a \new object (i.e., it has not been POSTed to the remote service yet).
+    # Returns +true+ if this object hasn't yet been saved, otherwise, returns +false+.
     #
     # ==== Examples
     #   not_new = Computer.create(:brand =&gt; 'Apple', :make =&gt; 'MacBook', :vendor =&gt; 'MacMall')
@@ -760,7 +761,7 @@ module ActiveResource
       id.hash
     end
 
-    # Duplicate the current resource without saving it.
+    # Duplicates the current resource without saving it.
     #
     # ==== Examples
     #   my_invoice = Invoice.create(:customer =&gt; 'That Company')
@@ -779,8 +780,8 @@ module ActiveResource
       end
     end
 
-    # A method to \save (+POST+) or \update (+PUT+) a resource.  It delegates to +create+ if a \new object, 
-    # +update+ if it is existing. If the response to the \save includes a body, it will be assumed that this body
+    # Saves (+POST+) or \updates (+PUT+) a resource.  Delegates to +create+ if the object is \new,
+    # +update+ if it exists. If the response to the \save includes a body, it will be assumed that this body
     # is XML for the final object as it looked after the \save (which would include attributes like +created_at+
     # that weren't part of the original submit).
     #
@@ -832,7 +833,7 @@ module ActiveResource
       !new? &amp;&amp; self.class.exists?(to_param, :params =&gt; prefix_options)
     end
 
-    # A method to convert the the resource to an XML string.
+    # Converts the resource to an XML string representation.
     #
     # ==== Options
     # The +options+ parameter is handed off to the +to_xml+ method on each
@@ -861,8 +862,7 @@ module ActiveResource
       attributes.to_xml({:root =&gt; self.class.element_name}.merge(options))
     end
 
-    # Returns a JSON string representing the model. Some configuration is
-    # available through +options+.
+    # Converts the resource to a JSON string representation.
     #
     # ==== Options
     # The +options+ are passed to the +to_json+ method on each</diff>
      <filename>activeresource/lib/active_resource/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -95,46 +95,46 @@ module ActiveResource
       @password = URI.decode(@site.password) if @site.password
     end
 
-    # Set user for remote service.
+    # Sets the user for remote service.
     def user=(user)
       @user = user
     end
 
-    # Set password for remote service.
+    # Sets the password for remote service.
     def password=(password)
       @password = password
     end
 
-    # Set the number of seconds after which HTTP requests to the remote service should time out.
+    # Sets the number of seconds after which HTTP requests to the remote service should time out.
     def timeout=(timeout)
       @timeout = timeout
     end
 
-    # Execute a GET request.
+    # Executes a GET request.
     # Used to get (find) resources.
     def get(path, headers = {})
       format.decode(request(:get, path, build_request_headers(headers, :get)).body)
     end
 
-    # Execute a DELETE request (see HTTP protocol documentation if unfamiliar).
+    # Executes a DELETE request (see HTTP protocol documentation if unfamiliar).
     # Used to delete resources.
     def delete(path, headers = {})
       request(:delete, path, build_request_headers(headers, :delete))
     end
 
-    # Execute a PUT request (see HTTP protocol documentation if unfamiliar).
+    # Executes a PUT request (see HTTP protocol documentation if unfamiliar).
     # Used to update resources.
     def put(path, body = '', headers = {})
       request(:put, path, body.to_s, build_request_headers(headers, :put))
     end
 
-    # Execute a POST request.
+    # Executes a POST request.
     # Used to create new resources.
     def post(path, body = '', headers = {})
       request(:post, path, body.to_s, build_request_headers(headers, :post))
     end
 
-    # Execute a HEAD request.
+    # Executes a HEAD request.
     # Used to obtain meta-information about resources, such as whether they exist and their size (via response headers).
     def head(path, headers = {})
       request(:head, path, build_request_headers(headers))
@@ -142,7 +142,7 @@ module ActiveResource
 
 
     private
-      # Makes request to remote service.
+      # Makes a request to the remote service.
       def request(method, path, *arguments)
         logger.info &quot;#{method.to_s.upcase} #{site.scheme}://#{site.host}:#{site.port}#{path}&quot; if logger
         result = nil
@@ -153,7 +153,7 @@ module ActiveResource
         raise TimeoutError.new(e.message)
       end
 
-      # Handles response and error codes from remote service.
+      # Handles response and error codes from the remote service.
       def handle_response(response)
         case response.code.to_i
           when 301,302
@@ -183,7 +183,7 @@ module ActiveResource
         end
       end
 
-      # Creates new Net::HTTP instance for communication with
+      # Creates new Net::HTTP instance for communication with the
       # remote service and resources.
       def http
         http             = Net::HTTP.new(@site.host, @site.port)</diff>
      <filename>activeresource/lib/active_resource/connection.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,12 @@
+*Edge*
+
+* Removed rarely-used DRb cache store.  [Jeremy Kemper]
+
+* TimeWithZone.name returns 'Time', to further thwart type checking [Geoff Buesing]
+
+* Time.local instances: Adding 24.hours across the DST boundary adds 24 hours instead of one day #2066 [Michael Curtis]
+
+
 *2.3.2 [Final] (March 15, 2009)*
 
 * XmlMini supports LibXML and Nokogiri backends.  #2084, #2190 [Bart ten Brinke, Aaron Patterson]</diff>
      <filename>activesupport/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -88,7 +88,8 @@ task :release =&gt; [ :package ] do
 end
 
 
-require 'lib/active_support/values/time_zone'
+$LOAD_PATH.unshift &quot;#{File.dirname(__FILE__)}/lib&quot;
+require 'active_support/values/time_zone'
 
 namespace :tzinfo do
   desc &quot;Update bundled tzinfo gem. Only copies the subset of classes and definitions required to support Rails time zone features.&quot;</diff>
      <filename>activesupport/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -23,7 +23,7 @@
 
 module ActiveSupport
   def self.load_all!
-    [Dependencies, Deprecation, Gzip, MessageVerifier, Multibyte, SecureRandom, TimeWithZone]
+    [Dependencies, Deprecation, Gzip, MessageVerifier, Multibyte, SecureRandom] + Core.load_all!
   end
 
   autoload :BacktraceCleaner, 'active_support/backtrace_cleaner'
@@ -32,8 +32,9 @@ module ActiveSupport
   autoload :BufferedLogger, 'active_support/buffered_logger'
   autoload :Cache, 'active_support/cache'
   autoload :Callbacks, 'active_support/callbacks'
+  autoload :NewCallbacks, 'active_support/new_callbacks'
+  autoload :ConcurrentHash, 'active_support/concurrent_hash'
   autoload :Deprecation, 'active_support/deprecation'
-  autoload :Duration, 'active_support/duration'
   autoload :Gzip, 'active_support/gzip'
   autoload :Inflector, 'active_support/inflector'
   autoload :Memoizable, 'active_support/memoizable'
@@ -46,11 +47,11 @@ module ActiveSupport
   autoload :Rescuable, 'active_support/rescuable'
   autoload :SecureRandom, 'active_support/secure_random'
   autoload :StringInquirer, 'active_support/string_inquirer'
-  autoload :TimeWithZone, 'active_support/time_with_zone'
-  autoload :TimeZone, 'active_support/values/time_zone'
   autoload :XmlMini, 'active_support/xml_mini'
 end
 
+require 'active_support/core/all'
+
 require 'active_support/vendor'
 require 'active_support/core_ext'
 require 'active_support/dependencies'</diff>
      <filename>activesupport/lib/active_support.rb</filename>
    </modified>
    <modified>
      <diff>@@ -30,4 +30,13 @@ module ActiveSupport
       end
     end
   end
+
+  # Encodes the value as base64 without the newline breaks. This makes the base64 encoding readily usable as URL parameters
+  # or memcache keys without further processing.
+  #
+  #  ActiveSupport::Base64.encode64s(&quot;Original unencoded string&quot;)
+  #  # =&gt; &quot;T3JpZ2luYWwgdW5lbmNvZGVkIHN0cmluZw==&quot;
+  def Base64.encode64s(value)
+    encode64(value).gsub(/\n/, '')
+  end
 end</diff>
      <filename>activesupport/lib/active_support/base64.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,13 +1,7 @@
-# A base class with no predefined methods that tries to behave like Builder's
-# BlankSlate in Ruby 1.9. In Ruby pre-1.9, this is actually the
-# Builder::BlankSlate class.
-#
-# Ruby 1.9 introduces BasicObject which differs slightly from Builder's
-# BlankSlate that has been used so far. ActiveSupport::BasicObject provides a
-# barebones base class that emulates Builder::BlankSlate while still relying on
-# Ruby 1.9's BasicObject in Ruby 1.9.
 module ActiveSupport
   if defined? ::BasicObject
+    # A class with no predefined methods that behaves similarly to Builder's
+    # BlankSlate. Used for proxy classes.
     class BasicObject &lt; ::BasicObject
       undef_method :==
       undef_method :equal?
@@ -18,7 +12,10 @@ module ActiveSupport
       end
     end
   else
-    require 'blankslate'
-    BasicObject = BlankSlate
+    class BasicObject #:nodoc:
+      instance_methods.each do |m|
+        undef_method(m) if m.to_s !~ /(?:^__|^nil\?$|^send$|^object_id$)/
+      end
+    end
   end
 end</diff>
      <filename>activesupport/lib/active_support/basic_object.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,5 @@
+require 'active_support/core_ext/class/attribute_accessors'
+
 module ActiveSupport
   # Inspired by the buffered logger idea by Ezra
   class BufferedLogger
@@ -67,14 +69,14 @@ module ActiveSupport
     end
 
     for severity in Severity.constants
-      class_eval &lt;&lt;-EOT, __FILE__, __LINE__
-        def #{severity.downcase}(message = nil, progname = nil, &amp;block)  # def debug(message = nil, progname = nil, &amp;block)
-          add(#{severity}, message, progname, &amp;block)                    #   add(DEBUG, message, progname, &amp;block)
-        end                                                              # end
-                                                                         #
-        def #{severity.downcase}?                                        # def debug?
-          #{severity} &gt;= @level                                          #   DEBUG &gt;= @level
-        end                                                              # end
+      class_eval &lt;&lt;-EOT, __FILE__, __LINE__ + 1
+        def #{severity.downcase}(message = nil, progname = nil, &amp;block) # def debug(message = nil, progname = nil, &amp;block)
+          add(#{severity}, message, progname, &amp;block)                   #   add(DEBUG, message, progname, &amp;block)
+        end                                                             # end
+
+        def #{severity.downcase}?                                       # def debug?
+          #{severity} &gt;= @level                                         #   DEBUG &gt;= @level
+        end                                                             # end
       EOT
     end
 </diff>
      <filename>activesupport/lib/active_support/buffered_logger.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,7 @@
 require 'benchmark'
+require 'active_support/core_ext/benchmark'
+require 'active_support/core_ext/exception'
+require 'active_support/core_ext/class/attribute_accessors'
 
 module ActiveSupport
   # See ActiveSupport::Cache::Store for documentation.
@@ -6,7 +9,6 @@ module ActiveSupport
     autoload :FileStore, 'active_support/cache/file_store'
     autoload :MemoryStore, 'active_support/cache/memory_store'
     autoload :SynchronizedMemoryStore, 'active_support/cache/synchronized_memory_store'
-    autoload :DRbStore, 'active_support/cache/drb_store'
     autoload :MemCacheStore, 'active_support/cache/mem_cache_store'
     autoload :CompressedMemCacheStore, 'active_support/cache/compressed_mem_cache_store'
 
@@ -26,8 +28,8 @@ module ActiveSupport
     #   ActiveSupport::Cache.lookup_store(:memory_store)
     #   # =&gt; returns a new ActiveSupport::Cache::MemoryStore object
     #   
-    #   ActiveSupport::Cache.lookup_store(:drb_store)
-    #   # =&gt; returns a new ActiveSupport::Cache::DRbStore object
+    #   ActiveSupport::Cache.lookup_store(:mem_cache_store)
+    #   # =&gt; returns a new ActiveSupport::Cache::MemCacheStore object
     #
     # Any additional arguments will be passed to the corresponding cache store
     # class's constructor:
@@ -44,7 +46,7 @@ module ActiveSupport
 
       case store
       when Symbol
-        store_class_name = (store == :drb_store ? &quot;DRbStore&quot; : store.to_s.camelize)
+        store_class_name = store.to_s.camelize
         store_class = ActiveSupport::Cache.const_get(store_class_name)
         store_class.new(*parameters)
       when nil</diff>
      <filename>activesupport/lib/active_support/cache.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,5 @@
+require 'active_support/core_ext/file/atomic'
+
 module ActiveSupport
   module Cache
     # A cache store implementation which stores everything on the filesystem.</diff>
      <filename>activesupport/lib/active_support/cache/file_store.rb</filename>
    </modified>
    <modified>
      <diff>@@ -27,6 +27,11 @@ module ActiveSupport
                 Thread.current[:#{thread_local_key}] = nil
               end
             EOS
+
+            def klass.to_s
+              &quot;ActiveSupport::Cache::Strategy::LocalCache&quot;
+            end
+
             klass
           end
         end</diff>
      <filename>activesupport/lib/active_support/cache/strategy/local_cache.rb</filename>
    </modified>
    <modified>
      <diff>@@ -204,7 +204,7 @@ module ActiveSupport
     module ClassMethods
       def define_callbacks(*callbacks)
         callbacks.each do |callback|
-          class_eval &lt;&lt;-&quot;end_eval&quot;
+          class_eval &lt;&lt;-&quot;end_eval&quot;, __FILE__, __LINE__ + 1
             def self.#{callback}(*methods, &amp;block)                             # def self.before_save(*methods, &amp;block)
               callbacks = CallbackChain.build(:#{callback}, *methods, &amp;block)  #   callbacks = CallbackChain.build(:before_save, *methods, &amp;block)
               @#{callback}_callbacks ||= CallbackChain.new                     #   @before_save_callbacks ||= CallbackChain.new</diff>
      <filename>activesupport/lib/active_support/callbacks.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,3 @@
-Dir[File.dirname(__FILE__) + &quot;/core_ext/*.rb&quot;].sort.each do |path|
-  filename = File.basename(path, '.rb')
-  require &quot;active_support/core_ext/#{filename}&quot;
+Dir[&quot;#{File.dirname(__FILE__)}/core_ext/*.rb&quot;].sort.each do |path|
+  require &quot;active_support/core_ext/#{File.basename(path, '.rb')}&quot;
 end</diff>
      <filename>activesupport/lib/active_support/core_ext.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,15 +1,6 @@
+require 'active_support/core_ext/array/wrap'
 require 'active_support/core_ext/array/access'
 require 'active_support/core_ext/array/conversions'
 require 'active_support/core_ext/array/extract_options'
 require 'active_support/core_ext/array/grouping'
 require 'active_support/core_ext/array/random_access'
-require 'active_support/core_ext/array/wrapper'
-
-class Array #:nodoc:
-  include ActiveSupport::CoreExtensions::Array::Access
-  include ActiveSupport::CoreExtensions::Array::Conversions
-  include ActiveSupport::CoreExtensions::Array::ExtractOptions
-  include ActiveSupport::CoreExtensions::Array::Grouping
-  include ActiveSupport::CoreExtensions::Array::RandomAccess
-  extend ActiveSupport::CoreExtensions::Array::Wrapper
-end</diff>
      <filename>activesupport/lib/active_support/core_ext/array.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,53 +1,46 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Array #:nodoc:
-      # Makes it easier to access parts of an array.
-      module Access
-        # Returns the tail of the array from +position+.
-        #
-        #   %w( a b c d ).from(0)  # =&gt; %w( a b c d )
-        #   %w( a b c d ).from(2)  # =&gt; %w( c d )
-        #   %w( a b c d ).from(10) # =&gt; nil
-        #   %w().from(0)           # =&gt; nil
-        def from(position)
-          self[position..-1]
-        end
-        
-        # Returns the beginning of the array up to +position+.
-        #
-        #   %w( a b c d ).to(0)  # =&gt; %w( a )
-        #   %w( a b c d ).to(2)  # =&gt; %w( a b c )
-        #   %w( a b c d ).to(10) # =&gt; %w( a b c d )
-        #   %w().to(0)           # =&gt; %w()
-        def to(position)
-          self[0..position]
-        end
+class Array
+  # Returns the tail of the array from +position+.
+  #
+  #   %w( a b c d ).from(0)  # =&gt; %w( a b c d )
+  #   %w( a b c d ).from(2)  # =&gt; %w( c d )
+  #   %w( a b c d ).from(10) # =&gt; nil
+  #   %w().from(0)           # =&gt; nil
+  def from(position)
+    self[position..-1]
+  end
 
-        # Equal to &lt;tt&gt;self[1]&lt;/tt&gt;.
-        def second
-          self[1]
-        end
+  # Returns the beginning of the array up to +position+.
+  #
+  #   %w( a b c d ).to(0)  # =&gt; %w( a )
+  #   %w( a b c d ).to(2)  # =&gt; %w( a b c )
+  #   %w( a b c d ).to(10) # =&gt; %w( a b c d )
+  #   %w().to(0)           # =&gt; %w()
+  def to(position)
+    self[0..position]
+  end
 
-        # Equal to &lt;tt&gt;self[2]&lt;/tt&gt;.
-        def third
-          self[2]
-        end
+  # Equal to &lt;tt&gt;self[1]&lt;/tt&gt;.
+  def second
+    self[1]
+  end
 
-        # Equal to &lt;tt&gt;self[3]&lt;/tt&gt;.
-        def fourth
-          self[3]
-        end
+  # Equal to &lt;tt&gt;self[2]&lt;/tt&gt;.
+  def third
+    self[2]
+  end
 
-        # Equal to &lt;tt&gt;self[4]&lt;/tt&gt;.
-        def fifth
-          self[4]
-        end
+  # Equal to &lt;tt&gt;self[3]&lt;/tt&gt;.
+  def fourth
+    self[3]
+  end
+
+  # Equal to &lt;tt&gt;self[4]&lt;/tt&gt;.
+  def fifth
+    self[4]
+  end
 
-        # Equal to &lt;tt&gt;self[41]&lt;/tt&gt;. Also known as accessing &quot;the reddit&quot;.
-        def forty_two
-          self[41]
-        end
-      end
-    end
+  # Equal to &lt;tt&gt;self[41]&lt;/tt&gt;. Also known as accessing &quot;the reddit&quot;.
+  def forty_two
+    self[41]
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/array/access.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,196 +1,184 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Array #:nodoc:
-      module Conversions
-        # Converts the array to a comma-separated sentence where the last element is joined by the connector word. Options:
-        # * &lt;tt&gt;:words_connector&lt;/tt&gt; - The sign or word used to join the elements in arrays with two or more elements (default: &quot;, &quot;)
-        # * &lt;tt&gt;:two_words_connector&lt;/tt&gt; - The sign or word used to join the elements in arrays with two elements (default: &quot; and &quot;)
-        # * &lt;tt&gt;:last_word_connector&lt;/tt&gt; - The sign or word used to join the last element in arrays with three or more elements (default: &quot;, and &quot;)
-        def to_sentence(options = {})
-          default_words_connector     = I18n.translate(:'support.array.words_connector',     :locale =&gt; options[:locale])
-          default_two_words_connector = I18n.translate(:'support.array.two_words_connector', :locale =&gt; options[:locale])
-          default_last_word_connector = I18n.translate(:'support.array.last_word_connector', :locale =&gt; options[:locale])
+class Array
+  # Converts the array to a comma-separated sentence where the last element is joined by the connector word. Options:
+  # * &lt;tt&gt;:words_connector&lt;/tt&gt; - The sign or word used to join the elements in arrays with two or more elements (default: &quot;, &quot;)
+  # * &lt;tt&gt;:two_words_connector&lt;/tt&gt; - The sign or word used to join the elements in arrays with two elements (default: &quot; and &quot;)
+  # * &lt;tt&gt;:last_word_connector&lt;/tt&gt; - The sign or word used to join the last element in arrays with three or more elements (default: &quot;, and &quot;)
+  def to_sentence(options = {})
+    default_words_connector     = I18n.translate(:'support.array.words_connector',     :locale =&gt; options[:locale])
+    default_two_words_connector = I18n.translate(:'support.array.two_words_connector', :locale =&gt; options[:locale])
+    default_last_word_connector = I18n.translate(:'support.array.last_word_connector', :locale =&gt; options[:locale])
 
-          # Try to emulate to_senteces previous to 2.3
-          if options.has_key?(:connector) || options.has_key?(:skip_last_comma)
-            ::ActiveSupport::Deprecation.warn(&quot;:connector has been deprecated. Use :words_connector instead&quot;, caller) if options.has_key? :connector
-            ::ActiveSupport::Deprecation.warn(&quot;:skip_last_comma has been deprecated. Use :last_word_connector instead&quot;, caller) if options.has_key? :skip_last_comma
+    # Try to emulate to_senteces previous to 2.3
+    if options.has_key?(:connector) || options.has_key?(:skip_last_comma)
+      ::ActiveSupport::Deprecation.warn(&quot;:connector has been deprecated. Use :words_connector instead&quot;, caller) if options.has_key? :connector
+      ::ActiveSupport::Deprecation.warn(&quot;:skip_last_comma has been deprecated. Use :last_word_connector instead&quot;, caller) if options.has_key? :skip_last_comma
 
-            skip_last_comma = options.delete :skip_last_comma
-            if connector = options.delete(:connector)
-              options[:last_word_connector] ||= skip_last_comma ? connector : &quot;, #{connector}&quot;
-            else
-              options[:last_word_connector] ||= skip_last_comma ? default_two_words_connector : default_last_word_connector
-            end
-          end
-          
-          options.assert_valid_keys(:words_connector, :two_words_connector, :last_word_connector, :locale)       
-          options.reverse_merge! :words_connector =&gt; default_words_connector, :two_words_connector =&gt; default_two_words_connector, :last_word_connector =&gt; default_last_word_connector
-          
-          case length
-            when 0
-              &quot;&quot;
-            when 1
-              self[0].to_s
-            when 2
-              &quot;#{self[0]}#{options[:two_words_connector]}#{self[1]}&quot;
-            else
-              &quot;#{self[0...-1].join(options[:words_connector])}#{options[:last_word_connector]}#{self[-1]}&quot;
-          end
-        end
-        
+      skip_last_comma = options.delete :skip_last_comma
+      if connector = options.delete(:connector)
+        options[:last_word_connector] ||= skip_last_comma ? connector : &quot;, #{connector}&quot;
+      else
+        options[:last_word_connector] ||= skip_last_comma ? default_two_words_connector : default_last_word_connector
+      end
+    end
 
-        # Calls &lt;tt&gt;to_param&lt;/tt&gt; on all its elements and joins the result with
-        # slashes. This is used by &lt;tt&gt;url_for&lt;/tt&gt; in Action Pack. 
-        def to_param
-          collect { |e| e.to_param }.join '/'
-        end
+    options.assert_valid_keys(:words_connector, :two_words_connector, :last_word_connector, :locale)
+    options.reverse_merge! :words_connector =&gt; default_words_connector, :two_words_connector =&gt; default_two_words_connector, :last_word_connector =&gt; default_last_word_connector
 
-        # Converts an array into a string suitable for use as a URL query string,
-        # using the given +key+ as the param name.
-        #
-        #   ['Rails', 'coding'].to_query('hobbies') # =&gt; &quot;hobbies%5B%5D=Rails&amp;hobbies%5B%5D=coding&quot;
-        def to_query(key)
-          prefix = &quot;#{key}[]&quot;
-          collect { |value| value.to_query(prefix) }.join '&amp;'
-        end
+    case length
+      when 0
+        &quot;&quot;
+      when 1
+        self[0].to_s
+      when 2
+        &quot;#{self[0]}#{options[:two_words_connector]}#{self[1]}&quot;
+      else
+        &quot;#{self[0...-1].join(options[:words_connector])}#{options[:last_word_connector]}#{self[-1]}&quot;
+    end
+  end
 
-        def self.included(base) #:nodoc:
-          base.class_eval do
-            alias_method :to_default_s, :to_s
-            alias_method :to_s, :to_formatted_s
-          end
-        end
 
-        # Converts a collection of elements into a formatted string by calling
-        # &lt;tt&gt;to_s&lt;/tt&gt; on all elements and joining them:
-        #
-        #   Blog.find(:all).to_formatted_s # =&gt; &quot;First PostSecond PostThird Post&quot;
-        #
-        # Adding in the &lt;tt&gt;:db&lt;/tt&gt; argument as the format yields a prettier
-        # output:
-        #
-        #   Blog.find(:all).to_formatted_s(:db) # =&gt; &quot;First Post,Second Post,Third Post&quot;
-        def to_formatted_s(format = :default)
-          case format
-            when :db
-              if respond_to?(:empty?) &amp;&amp; self.empty?
-                &quot;null&quot;
-              else
-                collect { |element| element.id }.join(&quot;,&quot;)
-              end
-            else
-              to_default_s
-          end
-        end
+  # Calls &lt;tt&gt;to_param&lt;/tt&gt; on all its elements and joins the result with
+  # slashes. This is used by &lt;tt&gt;url_for&lt;/tt&gt; in Action Pack.
+  def to_param
+    collect { |e| e.to_param }.join '/'
+  end
 
-        # Returns a string that represents this array in XML by sending +to_xml+
-        # to each element. Active Record collections delegate their representation
-        # in XML to this method.
-        #
-        # All elements are expected to respond to +to_xml+, if any of them does
-        # not an exception is raised.
-        #
-        # The root node reflects the class name of the first element in plural
-        # if all elements belong to the same type and that's not Hash:
-        #
-        #   customer.projects.to_xml
-        #
-        #   &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
-        #   &lt;projects type=&quot;array&quot;&gt;
-        #     &lt;project&gt;
-        #       &lt;amount type=&quot;decimal&quot;&gt;20000.0&lt;/amount&gt;
-        #       &lt;customer-id type=&quot;integer&quot;&gt;1567&lt;/customer-id&gt;
-        #       &lt;deal-date type=&quot;date&quot;&gt;2008-04-09&lt;/deal-date&gt;
-        #       ...
-        #     &lt;/project&gt;
-        #     &lt;project&gt;
-        #       &lt;amount type=&quot;decimal&quot;&gt;57230.0&lt;/amount&gt;
-        #       &lt;customer-id type=&quot;integer&quot;&gt;1567&lt;/customer-id&gt;
-        #       &lt;deal-date type=&quot;date&quot;&gt;2008-04-15&lt;/deal-date&gt;
-        #       ...
-        #     &lt;/project&gt;
-        #   &lt;/projects&gt;
-        #
-        # Otherwise the root element is &quot;records&quot;:
-        #
-        #   [{:foo =&gt; 1, :bar =&gt; 2}, {:baz =&gt; 3}].to_xml
-        #
-        #   &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
-        #   &lt;records type=&quot;array&quot;&gt;
-        #     &lt;record&gt;
-        #       &lt;bar type=&quot;integer&quot;&gt;2&lt;/bar&gt;
-        #       &lt;foo type=&quot;integer&quot;&gt;1&lt;/foo&gt;
-        #     &lt;/record&gt;
-        #     &lt;record&gt;
-        #       &lt;baz type=&quot;integer&quot;&gt;3&lt;/baz&gt;
-        #     &lt;/record&gt;
-        #   &lt;/records&gt;
-        #
-        # If the collection is empty the root element is &quot;nil-classes&quot; by default:
-        #
-        #   [].to_xml
-        #
-        #   &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
-        #   &lt;nil-classes type=&quot;array&quot;/&gt;
-        #
-        # To ensure a meaningful root element use the &lt;tt&gt;:root&lt;/tt&gt; option:
-        #
-        #   customer_with_no_projects.projects.to_xml(:root =&gt; &quot;projects&quot;)
-        #
-        #   &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
-        #   &lt;projects type=&quot;array&quot;/&gt;
-        #
-        # By default root children have as node name the one of the root
-        # singularized. You can change it with the &lt;tt&gt;:children&lt;/tt&gt; option.
-        #
-        # The +options+ hash is passed downwards:
-        #
-        #   Message.all.to_xml(:skip_types =&gt; true)
-        #
-        #   &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
-        #   &lt;messages&gt;
-        #     &lt;message&gt;
-        #       &lt;created-at&gt;2008-03-07T09:58:18+01:00&lt;/created-at&gt;
-        #       &lt;id&gt;1&lt;/id&gt;
-        #       &lt;name&gt;1&lt;/name&gt;
-        #       &lt;updated-at&gt;2008-03-07T09:58:18+01:00&lt;/updated-at&gt;
-        #       &lt;user-id&gt;1&lt;/user-id&gt;
-        #     &lt;/message&gt;
-        #   &lt;/messages&gt;
-        #
-        def to_xml(options = {})
-          raise &quot;Not all elements respond to to_xml&quot; unless all? { |e| e.respond_to? :to_xml }
-          require 'builder' unless defined?(Builder)
+  # Converts an array into a string suitable for use as a URL query string,
+  # using the given +key+ as the param name.
+  #
+  #   ['Rails', 'coding'].to_query('hobbies') # =&gt; &quot;hobbies%5B%5D=Rails&amp;hobbies%5B%5D=coding&quot;
+  def to_query(key)
+    prefix = &quot;#{key}[]&quot;
+    collect { |value| value.to_query(prefix) }.join '&amp;'
+  end
 
-          options[:root]     ||= all? { |e| e.is_a?(first.class) &amp;&amp; first.class.to_s != &quot;Hash&quot; } ? first.class.to_s.underscore.pluralize : &quot;records&quot;
-          options[:children] ||= options[:root].singularize
-          options[:indent]   ||= 2
-          options[:builder]  ||= Builder::XmlMarkup.new(:indent =&gt; options[:indent])
+  # Converts a collection of elements into a formatted string by calling
+  # &lt;tt&gt;to_s&lt;/tt&gt; on all elements and joining them:
+  #
+  #   Blog.find(:all).to_formatted_s # =&gt; &quot;First PostSecond PostThird Post&quot;
+  #
+  # Adding in the &lt;tt&gt;:db&lt;/tt&gt; argument as the format yields a prettier
+  # output:
+  #
+  #   Blog.find(:all).to_formatted_s(:db) # =&gt; &quot;First Post,Second Post,Third Post&quot;
+  def to_formatted_s(format = :default)
+    case format
+      when :db
+        if respond_to?(:empty?) &amp;&amp; self.empty?
+          &quot;null&quot;
+        else
+          collect { |element| element.id }.join(&quot;,&quot;)
+        end
+      else
+        to_default_s
+    end
+  end
+  alias_method :to_default_s, :to_s
+  alias_method :to_s, :to_formatted_s
 
-          root     = options.delete(:root).to_s
-          children = options.delete(:children)
+  # Returns a string that represents this array in XML by sending +to_xml+
+  # to each element. Active Record collections delegate their representation
+  # in XML to this method.
+  #
+  # All elements are expected to respond to +to_xml+, if any of them does
+  # not an exception is raised.
+  #
+  # The root node reflects the class name of the first element in plural
+  # if all elements belong to the same type and that's not Hash:
+  #
+  #   customer.projects.to_xml
+  #
+  #   &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+  #   &lt;projects type=&quot;array&quot;&gt;
+  #     &lt;project&gt;
+  #       &lt;amount type=&quot;decimal&quot;&gt;20000.0&lt;/amount&gt;
+  #       &lt;customer-id type=&quot;integer&quot;&gt;1567&lt;/customer-id&gt;
+  #       &lt;deal-date type=&quot;date&quot;&gt;2008-04-09&lt;/deal-date&gt;
+  #       ...
+  #     &lt;/project&gt;
+  #     &lt;project&gt;
+  #       &lt;amount type=&quot;decimal&quot;&gt;57230.0&lt;/amount&gt;
+  #       &lt;customer-id type=&quot;integer&quot;&gt;1567&lt;/customer-id&gt;
+  #       &lt;deal-date type=&quot;date&quot;&gt;2008-04-15&lt;/deal-date&gt;
+  #       ...
+  #     &lt;/project&gt;
+  #   &lt;/projects&gt;
+  #
+  # Otherwise the root element is &quot;records&quot;:
+  #
+  #   [{:foo =&gt; 1, :bar =&gt; 2}, {:baz =&gt; 3}].to_xml
+  #
+  #   &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+  #   &lt;records type=&quot;array&quot;&gt;
+  #     &lt;record&gt;
+  #       &lt;bar type=&quot;integer&quot;&gt;2&lt;/bar&gt;
+  #       &lt;foo type=&quot;integer&quot;&gt;1&lt;/foo&gt;
+  #     &lt;/record&gt;
+  #     &lt;record&gt;
+  #       &lt;baz type=&quot;integer&quot;&gt;3&lt;/baz&gt;
+  #     &lt;/record&gt;
+  #   &lt;/records&gt;
+  #
+  # If the collection is empty the root element is &quot;nil-classes&quot; by default:
+  #
+  #   [].to_xml
+  #
+  #   &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+  #   &lt;nil-classes type=&quot;array&quot;/&gt;
+  #
+  # To ensure a meaningful root element use the &lt;tt&gt;:root&lt;/tt&gt; option:
+  #
+  #   customer_with_no_projects.projects.to_xml(:root =&gt; &quot;projects&quot;)
+  #
+  #   &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+  #   &lt;projects type=&quot;array&quot;/&gt;
+  #
+  # By default root children have as node name the one of the root
+  # singularized. You can change it with the &lt;tt&gt;:children&lt;/tt&gt; option.
+  #
+  # The +options+ hash is passed downwards:
+  #
+  #   Message.all.to_xml(:skip_types =&gt; true)
+  #
+  #   &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+  #   &lt;messages&gt;
+  #     &lt;message&gt;
+  #       &lt;created-at&gt;2008-03-07T09:58:18+01:00&lt;/created-at&gt;
+  #       &lt;id&gt;1&lt;/id&gt;
+  #       &lt;name&gt;1&lt;/name&gt;
+  #       &lt;updated-at&gt;2008-03-07T09:58:18+01:00&lt;/updated-at&gt;
+  #       &lt;user-id&gt;1&lt;/user-id&gt;
+  #     &lt;/message&gt;
+  #   &lt;/messages&gt;
+  #
+  def to_xml(options = {})
+    raise &quot;Not all elements respond to to_xml&quot; unless all? { |e| e.respond_to? :to_xml }
+    require 'builder' unless defined?(Builder)
 
-          if !options.has_key?(:dasherize) || options[:dasherize]
-            root = root.dasherize
-          end
+    options[:root]     ||= all? { |e| e.is_a?(first.class) &amp;&amp; first.class.to_s != &quot;Hash&quot; } ? first.class.to_s.underscore.pluralize : &quot;records&quot;
+    options[:children] ||= options[:root].singularize
+    options[:indent]   ||= 2
+    options[:builder]  ||= Builder::XmlMarkup.new(:indent =&gt; options[:indent])
 
-          options[:builder].instruct! unless options.delete(:skip_instruct)
+    root     = options.delete(:root).to_s
+    children = options.delete(:children)
 
-          opts = options.merge({ :root =&gt; children })
+    if !options.has_key?(:dasherize) || options[:dasherize]
+      root = root.dasherize
+    end
 
-          xml = options[:builder]
-          if empty?
-            xml.tag!(root, options[:skip_types] ? {} : {:type =&gt; &quot;array&quot;})
-          else
-            xml.tag!(root, options[:skip_types] ? {} : {:type =&gt; &quot;array&quot;}) {
-              yield xml if block_given?
-              each { |e| e.to_xml(opts.merge({ :skip_instruct =&gt; true })) }
-            }
-          end
-        end
+    options[:builder].instruct! unless options.delete(:skip_instruct)
 
-      end
+    opts = options.merge({ :root =&gt; children })
+
+    xml = options[:builder]
+    if empty?
+      xml.tag!(root, options[:skip_types] ? {} : {:type =&gt; &quot;array&quot;})
+    else
+      xml.tag!(root, options[:skip_types] ? {} : {:type =&gt; &quot;array&quot;}) {
+        yield xml if block_given?
+        each { |e| e.to_xml(opts.merge({ :skip_instruct =&gt; true })) }
+      }
     end
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/array/conversions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,20 +1,14 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Array #:nodoc:
-      module ExtractOptions
-        # Extracts options from a set of arguments. Removes and returns the last
-        # element in the array if it's a hash, otherwise returns a blank hash.
-        #
-        #   def options(*args)
-        #     args.extract_options!
-        #   end
-        #
-        #   options(1, 2)           # =&gt; {}
-        #   options(1, 2, :a =&gt; :b) # =&gt; {:a=&gt;:b}
-        def extract_options!
-          last.is_a?(::Hash) ? pop : {}
-        end
-      end
-    end
+class Array
+  # Extracts options from a set of arguments. Removes and returns the last
+  # element in the array if it's a hash, otherwise returns a blank hash.
+  #
+  #   def options(*args)
+  #     args.extract_options!
+  #   end
+  #
+  #   options(1, 2)           # =&gt; {}
+  #   options(1, 2, :a =&gt; :b) # =&gt; {:a=&gt;:b}
+  def extract_options!
+    last.is_a?(::Hash) ? pop : {}
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/array/extract_options.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,106 +1,100 @@
 require 'enumerator'
 
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Array #:nodoc:
-      module Grouping
-        # Splits or iterates over the array in groups of size +number+,
-        # padding any remaining slots with +fill_with+ unless it is +false+.
-        # 
-        #   %w(1 2 3 4 5 6 7).in_groups_of(3) {|group| p group}
-        #   [&quot;1&quot;, &quot;2&quot;, &quot;3&quot;]
-        #   [&quot;4&quot;, &quot;5&quot;, &quot;6&quot;]
-        #   [&quot;7&quot;, nil, nil]
-        #
-        #   %w(1 2 3).in_groups_of(2, '&amp;nbsp;') {|group| p group}
-        #   [&quot;1&quot;, &quot;2&quot;]
-        #   [&quot;3&quot;, &quot;&amp;nbsp;&quot;]
-        #
-        #   %w(1 2 3).in_groups_of(2, false) {|group| p group}
-        #   [&quot;1&quot;, &quot;2&quot;]
-        #   [&quot;3&quot;]
-        def in_groups_of(number, fill_with = nil)
-          if fill_with == false
-            collection = self
-          else
-            # size % number gives how many extra we have;
-            # subtracting from number gives how many to add;
-            # modulo number ensures we don't add group of just fill.
-            padding = (number - size % number) % number
-            collection = dup.concat([fill_with] * padding)
-          end
-
-          if block_given?
-            collection.each_slice(number) { |slice| yield(slice) }
-          else
-            returning [] do |groups|
-              collection.each_slice(number) { |group| groups &lt;&lt; group }
-            end
-          end
-        end
+class Array
+  # Splits or iterates over the array in groups of size +number+,
+  # padding any remaining slots with +fill_with+ unless it is +false+.
+  #
+  #   %w(1 2 3 4 5 6 7).in_groups_of(3) {|group| p group}
+  #   [&quot;1&quot;, &quot;2&quot;, &quot;3&quot;]
+  #   [&quot;4&quot;, &quot;5&quot;, &quot;6&quot;]
+  #   [&quot;7&quot;, nil, nil]
+  #
+  #   %w(1 2 3).in_groups_of(2, '&amp;nbsp;') {|group| p group}
+  #   [&quot;1&quot;, &quot;2&quot;]
+  #   [&quot;3&quot;, &quot;&amp;nbsp;&quot;]
+  #
+  #   %w(1 2 3).in_groups_of(2, false) {|group| p group}
+  #   [&quot;1&quot;, &quot;2&quot;]
+  #   [&quot;3&quot;]
+  def in_groups_of(number, fill_with = nil)
+    if fill_with == false
+      collection = self
+    else
+      # size % number gives how many extra we have;
+      # subtracting from number gives how many to add;
+      # modulo number ensures we don't add group of just fill.
+      padding = (number - size % number) % number
+      collection = dup.concat([fill_with] * padding)
+    end
 
-        # Splits or iterates over the array in +number+ of groups, padding any
-        # remaining slots with +fill_with+ unless it is +false+.
-        #
-        #   %w(1 2 3 4 5 6 7 8 9 10).in_groups(3) {|group| p group}
-        #   [&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;]
-        #   [&quot;5&quot;, &quot;6&quot;, &quot;7&quot;, nil]
-        #   [&quot;8&quot;, &quot;9&quot;, &quot;10&quot;, nil]
-        #
-        #   %w(1 2 3 4 5 6 7).in_groups(3, '&amp;nbsp;') {|group| p group}
-        #   [&quot;1&quot;, &quot;2&quot;, &quot;3&quot;]
-        #   [&quot;4&quot;, &quot;5&quot;, &quot;&amp;nbsp;&quot;]
-        #   [&quot;6&quot;, &quot;7&quot;, &quot;&amp;nbsp;&quot;]
-        #
-        #   %w(1 2 3 4 5 6 7).in_groups(3, false) {|group| p group}
-        #   [&quot;1&quot;, &quot;2&quot;, &quot;3&quot;]
-        #   [&quot;4&quot;, &quot;5&quot;]
-        #   [&quot;6&quot;, &quot;7&quot;]
-        def in_groups(number, fill_with = nil)
-          # size / number gives minor group size;
-          # size % number gives how many objects need extra accomodation;
-          # each group hold either division or division + 1 items.
-          division = size / number
-          modulo = size % number
+    if block_given?
+      collection.each_slice(number) { |slice| yield(slice) }
+    else
+      groups = []
+      collection.each_slice(number) { |group| groups &lt;&lt; group }
+      groups
+    end
+  end
 
-          # create a new array avoiding dup
-          groups = []
-          start = 0
+  # Splits or iterates over the array in +number+ of groups, padding any
+  # remaining slots with +fill_with+ unless it is +false+.
+  #
+  #   %w(1 2 3 4 5 6 7 8 9 10).in_groups(3) {|group| p group}
+  #   [&quot;1&quot;, &quot;2&quot;, &quot;3&quot;, &quot;4&quot;]
+  #   [&quot;5&quot;, &quot;6&quot;, &quot;7&quot;, nil]
+  #   [&quot;8&quot;, &quot;9&quot;, &quot;10&quot;, nil]
+  #
+  #   %w(1 2 3 4 5 6 7).in_groups(3, '&amp;nbsp;') {|group| p group}
+  #   [&quot;1&quot;, &quot;2&quot;, &quot;3&quot;]
+  #   [&quot;4&quot;, &quot;5&quot;, &quot;&amp;nbsp;&quot;]
+  #   [&quot;6&quot;, &quot;7&quot;, &quot;&amp;nbsp;&quot;]
+  #
+  #   %w(1 2 3 4 5 6 7).in_groups(3, false) {|group| p group}
+  #   [&quot;1&quot;, &quot;2&quot;, &quot;3&quot;]
+  #   [&quot;4&quot;, &quot;5&quot;]
+  #   [&quot;6&quot;, &quot;7&quot;]
+  def in_groups(number, fill_with = nil)
+    # size / number gives minor group size;
+    # size % number gives how many objects need extra accomodation;
+    # each group hold either division or division + 1 items.
+    division = size / number
+    modulo = size % number
 
-          number.times do |index|
-            length = division + (modulo &gt; 0 &amp;&amp; modulo &gt; index ? 1 : 0)
-            padding = fill_with != false &amp;&amp;
-              modulo &gt; 0 &amp;&amp; length == division ? 1 : 0
-            groups &lt;&lt; slice(start, length).concat([fill_with] * padding)
-            start += length
-          end
+    # create a new array avoiding dup
+    groups = []
+    start = 0
 
-          if block_given?
-            groups.each{|g| yield(g) }
-          else
-            groups
-          end
-        end
+    number.times do |index|
+      length = division + (modulo &gt; 0 &amp;&amp; modulo &gt; index ? 1 : 0)
+      padding = fill_with != false &amp;&amp;
+        modulo &gt; 0 &amp;&amp; length == division ? 1 : 0
+      groups &lt;&lt; slice(start, length).concat([fill_with] * padding)
+      start += length
+    end
 
-        # Divides the array into one or more subarrays based on a delimiting +value+
-        # or the result of an optional block.
-        #
-        #   [1, 2, 3, 4, 5].split(3)                # =&gt; [[1, 2], [4, 5]]
-        #   (1..10).to_a.split { |i| i % 3 == 0 }   # =&gt; [[1, 2], [4, 5], [7, 8], [10]]
-        def split(value = nil)
-          using_block = block_given?
+    if block_given?
+      groups.each { |g| yield(g) }
+    else
+      groups
+    end
+  end
 
-          inject([[]]) do |results, element|
-            if (using_block &amp;&amp; yield(element)) || (value == element)
-              results &lt;&lt; []
-            else
-              results.last &lt;&lt; element
-            end
+  # Divides the array into one or more subarrays based on a delimiting +value+
+  # or the result of an optional block.
+  #
+  #   [1, 2, 3, 4, 5].split(3)                # =&gt; [[1, 2], [4, 5]]
+  #   (1..10).to_a.split { |i| i % 3 == 0 }   # =&gt; [[1, 2], [4, 5], [7, 8], [10]]
+  def split(value = nil)
+    using_block = block_given?
 
-            results
-          end
-        end
+    inject([[]]) do |results, element|
+      if (using_block &amp;&amp; yield(element)) || (value == element)
+        results &lt;&lt; []
+      else
+        results.last &lt;&lt; element
       end
+
+      results
     end
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/array/grouping.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,6 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Array #:nodoc:
-      module RandomAccess
-        # Returns a random element from the array.
-        def rand
-          self[Kernel.rand(length)]
-        end
-      end
-    end
+class Array
+  # Returns a random element from the array.
+  def rand
+    self[Kernel.rand(length)]
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/array/random_access.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1 @@
 require 'active_support/core_ext/cgi/escape_skipping_slashes'
-
-class CGI #:nodoc:
-  extend ActiveSupport::CoreExtensions::CGI::EscapeSkippingSlashes
-end</diff>
      <filename>activesupport/lib/active_support/core_ext/cgi.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,23 +1,17 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module CGI #:nodoc:
-      module EscapeSkippingSlashes #:nodoc:
-        if RUBY_VERSION &gt;= '1.9'
-          def escape_skipping_slashes(str)
-            str = str.join('/') if str.respond_to? :join
-            str.gsub(/([^ \/a-zA-Z0-9_.-])/n) do
-              &quot;%#{$1.unpack('H2' * $1.bytesize).join('%').upcase}&quot;
-            end.tr(' ', '+')
-          end
-        else
-          def escape_skipping_slashes(str)
-            str = str.join('/') if str.respond_to? :join
-            str.gsub(/([^ \/a-zA-Z0-9_.-])/n) do
-              &quot;%#{$1.unpack('H2').first.upcase}&quot;
-            end.tr(' ', '+')
-          end
-        end
-      end
+class CGI #:nodoc:
+  if RUBY_VERSION &gt;= '1.9'
+    def self.escape_skipping_slashes(str)
+      str = str.join('/') if str.respond_to? :join
+      str.gsub(/([^ \/a-zA-Z0-9_.-])/n) do
+        &quot;%#{$1.unpack('H2' * $1.bytesize).join('%').upcase}&quot;
+      end.tr(' ', '+')
+    end
+  else
+    def self.escape_skipping_slashes(str)
+      str = str.join('/') if str.respond_to? :join
+      str.gsub(/([^ \/a-zA-Z0-9_.-])/n) do
+        &quot;%#{$1.unpack('H2').first.upcase}&quot;
+      end.tr(' ', '+')
     end
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/cgi/escape_skipping_slashes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,7 +10,7 @@ class Class
   def cattr_reader(*syms)
     syms.flatten.each do |sym|
       next if sym.is_a?(Hash)
-      class_eval(&lt;&lt;-EOS, __FILE__, __LINE__)
+      class_eval(&lt;&lt;-EOS, __FILE__, __LINE__ + 1)
         unless defined? @@#{sym}  # unless defined? @@hair_colors
           @@#{sym} = nil          #   @@hair_colors = nil
         end                       # end
@@ -29,7 +29,7 @@ class Class
   def cattr_writer(*syms)
     options = syms.extract_options!
     syms.flatten.each do |sym|
-      class_eval(&lt;&lt;-EOS, __FILE__, __LINE__)
+      class_eval(&lt;&lt;-EOS, __FILE__, __LINE__ + 1)
         unless defined? @@#{sym}                       # unless defined? @@hair_colors
           @@#{sym} = nil                               #   @@hair_colors = nil
         end                                            # end</diff>
      <filename>activesupport/lib/active_support/core_ext/class/attribute_accessors.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,45 +1,45 @@
-# These class attributes behave something like the class
-# inheritable accessors.  But instead of copying the hash over at
-# the time the subclass is first defined,  the accessors simply
-# delegate to their superclass unless they have been given a 
-# specific value.  This stops the strange situation where values 
-# set after class definition don't get applied to subclasses.
 class Class
   def superclass_delegating_reader(*names)
-    class_name_to_stop_searching_on = self.superclass.name.blank? ? &quot;Object&quot; : self.superclass.name
+    class_name_to_stop_searching_on = superclass.name.blank? ? &quot;Object&quot; : superclass.name
     names.each do |name|
-      class_eval &lt;&lt;-EOS
-      def self.#{name}                                            # def self.only_reader
-        if defined?(@#{name})                                     #   if defined?(@only_reader)
-          @#{name}                                                #     @only_reader
-        elsif superclass &lt; #{class_name_to_stop_searching_on} &amp;&amp;  #   elsif superclass &lt; Object &amp;&amp;
-              superclass.respond_to?(:#{name})                    #         superclass.respond_to?(:only_reader)
-          superclass.#{name}                                      #     superclass.only_reader
-        end                                                       #   end
-      end                                                         # end
-      def #{name}                                                 # def only_reader
-        self.class.#{name}                                        #   self.class.only_reader
-      end                                                         # end
-      def self.#{name}?                                           # def self.only_reader?
-        !!#{name}                                                 #   !!only_reader
-      end                                                         # end
-      def #{name}?                                                # def only_reader?
-        !!#{name}                                                 #   !!only_reader
-      end                                                         # end
+      class_eval(&lt;&lt;-EOS, __FILE__, __LINE__ + 1)
+        def self.#{name}                                            # def self.only_reader
+          if defined?(@#{name})                                     #   if defined?(@only_reader)
+            @#{name}                                                #     @only_reader
+          elsif superclass &lt; #{class_name_to_stop_searching_on} &amp;&amp;  #   elsif superclass &lt; Object &amp;&amp;
+                superclass.respond_to?(:#{name})                    #         superclass.respond_to?(:only_reader)
+            superclass.#{name}                                      #     superclass.only_reader
+          end                                                       #   end
+        end                                                         # end
+        def #{name}                                                 # def only_reader
+          self.class.#{name}                                        #   self.class.only_reader
+        end                                                         # end
+        def self.#{name}?                                           # def self.only_reader?
+          !!#{name}                                                 #   !!only_reader
+        end                                                         # end
+        def #{name}?                                                # def only_reader?
+          !!#{name}                                                 #   !!only_reader
+        end                                                         # end
       EOS
     end
   end
 
   def superclass_delegating_writer(*names)
     names.each do |name|
-      class_eval &lt;&lt;-EOS
-        def self.#{name}=(value)  # def self.only_writer=(value)
-          @#{name} = value        #   @only_writer = value
-        end                       # end
+      class_eval(&lt;&lt;-EOS, __FILE__, __LINE__ + 1)
+        def self.#{name}=(value)     # def self.property=(value)
+          @#{name} = value           #   @property = value
+        end                          # end
       EOS
     end
   end
 
+  # These class attributes behave something like the class
+  # inheritable accessors.  But instead of copying the hash over at
+  # the time the subclass is first defined, the accessors simply
+  # delegate to their superclass unless they have been given a 
+  # specific value.  This stops the strange situation where values 
+  # set after class definition don't get applied to subclasses.
   def superclass_delegating_accessor(*names)
     superclass_delegating_reader(*names)
     superclass_delegating_writer(*names)</diff>
      <filename>activesupport/lib/active_support/core_ext/class/delegating_attributes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,14 +10,14 @@ class Class # :nodoc:
   def class_inheritable_reader(*syms)
     syms.each do |sym|
       next if sym.is_a?(Hash)
-      class_eval &lt;&lt;-EOS
-        def self.#{sym}                        # def self.before_add_for_comments
-          read_inheritable_attribute(:#{sym})  #   read_inheritable_attribute(:before_add_for_comments)
-        end                                    # end
-                                               #
-        def #{sym}                             # def before_add_for_comments
-          self.class.#{sym}                    #   self.class.before_add_for_comments
-        end                                    # end
+      class_eval(&lt;&lt;-EOS, __FILE__, __LINE__ + 1)
+        def self.#{sym}                         # def self.after_add
+          read_inheritable_attribute(:#{sym})   #   read_inheritable_attribute(:after_add)
+        end                                     # end
+
+        def #{sym}                              # def after_add
+          self.class.#{sym}                     #   self.class.after_add
+        end                                     # end
       EOS
     end
   end
@@ -25,7 +25,7 @@ class Class # :nodoc:
   def class_inheritable_writer(*syms)
     options = syms.extract_options!
     syms.each do |sym|
-      class_eval &lt;&lt;-EOS
+      class_eval(&lt;&lt;-EOS, __FILE__, __LINE__ + 1)
         def self.#{sym}=(obj)                          # def self.color=(obj)
           write_inheritable_attribute(:#{sym}, obj)    #   write_inheritable_attribute(:color, obj)
         end                                            # end
@@ -42,7 +42,7 @@ class Class # :nodoc:
   def class_inheritable_array_writer(*syms)
     options = syms.extract_options!
     syms.each do |sym|
-      class_eval &lt;&lt;-EOS
+      class_eval(&lt;&lt;-EOS, __FILE__, __LINE__ + 1)
         def self.#{sym}=(obj)                          # def self.levels=(obj)
           write_inheritable_array(:#{sym}, obj)        #   write_inheritable_array(:levels, obj)
         end                                            # end
@@ -59,7 +59,7 @@ class Class # :nodoc:
   def class_inheritable_hash_writer(*syms)
     options = syms.extract_options!
     syms.each do |sym|
-      class_eval &lt;&lt;-EOS
+      class_eval(&lt;&lt;-EOS, __FILE__, __LINE__ + 1)
         def self.#{sym}=(obj)                          # def self.nicknames=(obj)
           write_inheritable_hash(:#{sym}, obj)         #   write_inheritable_hash(:nicknames, obj)
         end                                            # end
@@ -138,3 +138,82 @@ class Class # :nodoc:
     alias inherited_without_inheritable_attributes inherited
     alias inherited inherited_with_inheritable_attributes
 end
+
+class Class
+  # Defines class-level inheritable attribute reader. Attributes are available to subclasses,
+  # each subclass has a copy of parent's attribute.
+  #
+  # @param *syms&lt;Array[#to_s]&gt; Array of attributes to define inheritable reader for.
+  # @return &lt;Array[#to_s]&gt; Array of attributes converted into inheritable_readers.
+  #
+  # @api public
+  #
+  # @todo Do we want to block instance_reader via :instance_reader =&gt; false
+  # @todo It would be preferable that we do something with a Hash passed in
+  #   (error out or do the same as other methods above) instead of silently
+  #   moving on). In particular, this makes the return value of this function
+  #   less useful.
+  def extlib_inheritable_reader(*ivars)
+    instance_reader = ivars.pop[:reader] if ivars.last.is_a?(Hash)
+
+    ivars.each do |ivar|
+      self.class_eval &lt;&lt;-RUBY, __FILE__, __LINE__ + 1
+        def self.#{ivar}
+          return @#{ivar} if self.object_id == #{self.object_id} || defined?(@#{ivar})
+          ivar = superclass.#{ivar}
+          return nil if ivar.nil? &amp;&amp; !#{self}.instance_variable_defined?(&quot;@#{ivar}&quot;)
+          @#{ivar} = ivar &amp;&amp; !ivar.is_a?(Module) &amp;&amp; !ivar.is_a?(Numeric) &amp;&amp; !ivar.is_a?(TrueClass) &amp;&amp; !ivar.is_a?(FalseClass) ? ivar.dup : ivar
+        end
+      RUBY
+      unless instance_reader == false
+        self.class_eval &lt;&lt;-RUBY, __FILE__, __LINE__ + 1
+          def #{ivar}
+            self.class.#{ivar}
+          end
+        RUBY
+      end
+    end
+  end
+
+  # Defines class-level inheritable attribute writer. Attributes are available to subclasses,
+  # each subclass has a copy of parent's attribute.
+  #
+  # @param *syms&lt;Array[*#to_s, Hash{:instance_writer =&gt; Boolean}]&gt; Array of attributes to
+  #   define inheritable writer for.
+  # @option syms :instance_writer&lt;Boolean&gt; if true, instance-level inheritable attribute writer is defined.
+  # @return &lt;Array[#to_s]&gt; An Array of the attributes that were made into inheritable writers.
+  #
+  # @api public
+  #
+  # @todo We need a style for class_eval &lt;&lt;-HEREDOC. I'd like to make it
+  #   class_eval(&lt;&lt;-RUBY, __FILE__, __LINE__), but we should codify it somewhere.
+  def extlib_inheritable_writer(*ivars)
+    instance_writer = ivars.pop[:writer] if ivars.last.is_a?(Hash)
+    ivars.each do |ivar|
+      self.class_eval &lt;&lt;-RUBY, __FILE__, __LINE__ + 1
+        def self.#{ivar}=(obj)
+          @#{ivar} = obj
+        end
+      RUBY
+      unless instance_writer == false
+        self.class_eval &lt;&lt;-RUBY, __FILE__, __LINE__ + 1
+          def #{ivar}=(obj) self.class.#{ivar} = obj end
+        RUBY
+      end
+    end
+  end
+
+  # Defines class-level inheritable attribute accessor. Attributes are available to subclasses,
+  # each subclass has a copy of parent's attribute.
+  #
+  # @param *syms&lt;Array[*#to_s, Hash{:instance_writer =&gt; Boolean}]&gt; Array of attributes to
+  #   define inheritable accessor for.
+  # @option syms :instance_writer&lt;Boolean&gt; if true, instance-level inheritable attribute writer is defined.
+  # @return &lt;Array[#to_s]&gt; An Array of attributes turned into inheritable accessors.
+  #
+  # @api public
+  def extlib_inheritable_accessor(*syms)
+    extlib_inheritable_reader(*syms)
+    extlib_inheritable_writer(*syms)
+  end
+end
\ No newline at end of file</diff>
      <filename>activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,7 @@
 require 'date'
-require 'active_support/core_ext/date/behavior'
+
+require 'active_support/core_ext/date/acts_like'
+require 'active_support/core_ext/date/freeze'
+
 require 'active_support/core_ext/date/calculations'
 require 'active_support/core_ext/date/conversions'
-
-class Date#:nodoc:
-  include ActiveSupport::CoreExtensions::Date::Behavior
-  include ActiveSupport::CoreExtensions::Date::Calculations
-  include ActiveSupport::CoreExtensions::Date::Conversions
-end</diff>
      <filename>activesupport/lib/active_support/core_ext/date.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,230 +1,215 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Date #:nodoc:
-      # Enables the use of time calculations within Date itself
-      module Calculations
-        def self.included(base) #:nodoc:
-          base.extend ClassMethods
-
-          base.instance_eval do
-            alias_method :plus_without_duration, :+
-            alias_method :+, :plus_with_duration
-
-            alias_method :minus_without_duration, :-
-            alias_method :-, :minus_with_duration
-          end
-        end
-
-        module ClassMethods
-          # Returns a new Date representing the date 1 day ago (i.e. yesterday's date).
-          def yesterday
-            ::Date.today.yesterday
-          end
-
-          # Returns a new Date representing the date 1 day after today (i.e. tomorrow's date).
-          def tomorrow
-            ::Date.today.tomorrow
-          end
-
-          # Returns Time.zone.today when config.time_zone is set, otherwise just returns Date.today.
-          def current
-            ::Time.zone_default ? ::Time.zone.today : ::Date.today
-          end
-        end
-
-        # Tells whether the Date object's date lies in the past
-        def past?
-          self &lt; ::Date.current
-        end
-
-        # Tells whether the Date object's date is today
-        def today?
-          self.to_date == ::Date.current # we need the to_date because of DateTime
-        end
-
-        # Tells whether the Date object's date lies in the future
-        def future?
-          self &gt; ::Date.current
-        end
-
-        # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00)
-        # and then subtracts the specified number of seconds
-        def ago(seconds)
-          to_time.since(-seconds)
-        end
-
-        # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00)
-        # and then adds the specified number of seconds
-        def since(seconds)
-          to_time.since(seconds)
-        end
-        alias :in :since
-
-        # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00)
-        def beginning_of_day
-          to_time
-        end
-        alias :midnight :beginning_of_day
-        alias :at_midnight :beginning_of_day
-        alias :at_beginning_of_day :beginning_of_day
-
-        # Converts Date to a Time (or DateTime if necessary) with the time portion set to the end of the day (23:59:59)
-        def end_of_day
-          to_time.end_of_day
-        end
-
-        def plus_with_duration(other) #:nodoc:
-          if ActiveSupport::Duration === other
-            other.since(self)
-          else
-            plus_without_duration(other)
-          end
-        end
-
-        def minus_with_duration(other) #:nodoc:
-          if ActiveSupport::Duration === other
-            plus_with_duration(-other)
-          else
-            minus_without_duration(other)
-          end
-        end
-
-        # Provides precise Date calculations for years, months, and days.  The +options+ parameter takes a hash with
-        # any of these keys: &lt;tt&gt;:years&lt;/tt&gt;, &lt;tt&gt;:months&lt;/tt&gt;, &lt;tt&gt;:weeks&lt;/tt&gt;, &lt;tt&gt;:days&lt;/tt&gt;.
-        def advance(options)
-          d = self
-          d = d &gt;&gt; options.delete(:years) * 12 if options[:years]
-          d = d &gt;&gt; options.delete(:months)     if options[:months]
-          d = d +  options.delete(:weeks) * 7  if options[:weeks]
-          d = d +  options.delete(:days)       if options[:days]
-          d
-        end
-
-        # Returns a new Date where one or more of the elements have been changed according to the +options+ parameter.
-        #
-        # Examples:
-        #
-        #   Date.new(2007, 5, 12).change(:day =&gt; 1)                  # =&gt; Date.new(2007, 5, 1)
-        #   Date.new(2007, 5, 12).change(:year =&gt; 2005, :month =&gt; 1) # =&gt; Date.new(2005, 1, 12)
-        def change(options)
-          ::Date.new(
-            options[:year]  || self.year,
-            options[:month] || self.month,
-            options[:day]   || self.day
-          )
-        end
-
-        # Returns a new Date/DateTime representing the time a number of specified months ago
-        def months_ago(months)
-          advance(:months =&gt; -months)
-        end
-
-        # Returns a new Date/DateTime representing the time a number of specified months in the future
-        def months_since(months)
-          advance(:months =&gt; months)
-        end
-
-        # Returns a new Date/DateTime representing the time a number of specified years ago
-        def years_ago(years)
-          advance(:years =&gt; -years)
-        end
-
-        # Returns a new Date/DateTime representing the time a number of specified years in the future
-        def years_since(years)
-          advance(:years =&gt; years)
-        end
-
-        # Short-hand for years_ago(1)
-        def last_year
-          years_ago(1)
-        end
-
-        # Short-hand for years_since(1)
-        def next_year
-          years_since(1)
-        end
-
-        # Short-hand for months_ago(1)
-        def last_month
-          months_ago(1)
-        end
-
-        # Short-hand for months_since(1)
-        def next_month
-          months_since(1)
-        end
-
-        # Returns a new Date/DateTime representing the &quot;start&quot; of this week (i.e, Monday; DateTime objects will have time set to 0:00)
-        def beginning_of_week
-          days_to_monday = self.wday!=0 ? self.wday-1 : 6
-          result = self - days_to_monday
-          self.acts_like?(:time) ? result.midnight : result
-        end
-        alias :monday :beginning_of_week
-        alias :at_beginning_of_week :beginning_of_week
-
-        # Returns a new Date/DateTime representing the end of this week (Sunday, DateTime objects will have time set to 23:59:59)
-        def end_of_week
-          days_to_sunday = self.wday!=0 ? 7-self.wday : 0
-          result = self + days_to_sunday.days
-          self.acts_like?(:time) ? result.end_of_day : result
-        end
-        alias :at_end_of_week :end_of_week
-
-        # Returns a new Date/DateTime representing the start of the given day in next week (default is Monday).
-        def next_week(day = :monday)
-          days_into_week = { :monday =&gt; 0, :tuesday =&gt; 1, :wednesday =&gt; 2, :thursday =&gt; 3, :friday =&gt; 4, :saturday =&gt; 5, :sunday =&gt; 6}
-          result = (self + 7).beginning_of_week + days_into_week[day]
-          self.acts_like?(:time) ? result.change(:hour =&gt; 0) : result
-        end
-
-        # Returns a new ; DateTime objects will have time set to 0:00DateTime representing the start of the month (1st of the month; DateTime objects will have time set to 0:00)
-        def beginning_of_month
-          self.acts_like?(:time) ? change(:day =&gt; 1,:hour =&gt; 0, :min =&gt; 0, :sec =&gt; 0) : change(:day =&gt; 1)
-        end
-        alias :at_beginning_of_month :beginning_of_month
-
-        # Returns a new Date/DateTime representing the end of the month (last day of the month; DateTime objects will have time set to 0:00)
-        def end_of_month
-          last_day = ::Time.days_in_month( self.month, self.year )
-          self.acts_like?(:time) ? change(:day =&gt; last_day, :hour =&gt; 23, :min =&gt; 59, :sec =&gt; 59) : change(:day =&gt; last_day)
-        end
-        alias :at_end_of_month :end_of_month
-
-        # Returns a new Date/DateTime representing the start of the quarter (1st of january, april, july, october; DateTime objects will have time set to 0:00)
-        def beginning_of_quarter
-          beginning_of_month.change(:month =&gt; [10, 7, 4, 1].detect { |m| m &lt;= self.month })
-        end
-        alias :at_beginning_of_quarter :beginning_of_quarter
-
-        # Returns a new Date/DateTime representing the end of the quarter (last day of march, june, september, december; DateTime objects will have time set to 23:59:59)
-        def end_of_quarter
-          beginning_of_month.change(:month =&gt; [3, 6, 9, 12].detect { |m| m &gt;= self.month }).end_of_month
-        end
-        alias :at_end_of_quarter :end_of_quarter
-
-        # Returns a new Date/DateTime representing the start of the year (1st of january; DateTime objects will have time set to 0:00)
-        def beginning_of_year
-          self.acts_like?(:time) ? change(:month =&gt; 1, :day =&gt; 1, :hour =&gt; 0, :min =&gt; 0, :sec =&gt; 0) : change(:month =&gt; 1, :day =&gt; 1)
-        end
-        alias :at_beginning_of_year :beginning_of_year
-
-        # Returns a new Time representing the end of the year (31st of december; DateTime objects will have time set to 23:59:59)
-        def end_of_year
-          self.acts_like?(:time) ? change(:month =&gt; 12,:day =&gt; 31,:hour =&gt; 23, :min =&gt; 59, :sec =&gt; 59) : change(:month =&gt; 12, :day =&gt; 31)
-        end
-        alias :at_end_of_year :end_of_year
-
-        # Convenience method which returns a new Date/DateTime representing the time 1 day ago
-        def yesterday
-          self - 1
-        end
-
-        # Convenience method which returns a new Date/DateTime representing the time 1 day since the instance time
-        def tomorrow
-          self + 1
-        end
-      end
+class Date
+  class &lt;&lt; self
+    # Returns a new Date representing the date 1 day ago (i.e. yesterday's date).
+    def yesterday
+      ::Date.today.yesterday
     end
+
+    # Returns a new Date representing the date 1 day after today (i.e. tomorrow's date).
+    def tomorrow
+      ::Date.today.tomorrow
+    end
+
+    # Returns Time.zone.today when config.time_zone is set, otherwise just returns Date.today.
+    def current
+      ::Time.zone_default ? ::Time.zone.today : ::Date.today
+    end
+  end
+
+  # Tells whether the Date object's date lies in the past
+  def past?
+    self &lt; ::Date.current
+  end
+
+  # Tells whether the Date object's date is today
+  def today?
+    self.to_date == ::Date.current # we need the to_date because of DateTime
+  end
+
+  # Tells whether the Date object's date lies in the future
+  def future?
+    self &gt; ::Date.current
+  end
+
+  # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00)
+  # and then subtracts the specified number of seconds
+  def ago(seconds)
+    to_time.since(-seconds)
+  end
+
+  # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00)
+  # and then adds the specified number of seconds
+  def since(seconds)
+    to_time.since(seconds)
+  end
+  alias :in :since
+
+  # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00)
+  def beginning_of_day
+    to_time
+  end
+  alias :midnight :beginning_of_day
+  alias :at_midnight :beginning_of_day
+  alias :at_beginning_of_day :beginning_of_day
+
+  # Converts Date to a Time (or DateTime if necessary) with the time portion set to the end of the day (23:59:59)
+  def end_of_day
+    to_time.end_of_day
+  end
+
+  def plus_with_duration(other) #:nodoc:
+    if ActiveSupport::Duration === other
+      other.since(self)
+    else
+      plus_without_duration(other)
+    end
+  end
+  alias_method :plus_without_duration, :+
+  alias_method :+, :plus_with_duration
+
+  def minus_with_duration(other) #:nodoc:
+    if ActiveSupport::Duration === other
+      plus_with_duration(-other)
+    else
+      minus_without_duration(other)
+    end
+  end
+  alias_method :minus_without_duration, :-
+  alias_method :-, :minus_with_duration
+
+  # Provides precise Date calculations for years, months, and days.  The +options+ parameter takes a hash with
+  # any of these keys: &lt;tt&gt;:years&lt;/tt&gt;, &lt;tt&gt;:months&lt;/tt&gt;, &lt;tt&gt;:weeks&lt;/tt&gt;, &lt;tt&gt;:days&lt;/tt&gt;.
+  def advance(options)
+    d = self
+    d = d &gt;&gt; options.delete(:years) * 12 if options[:years]
+    d = d &gt;&gt; options.delete(:months)     if options[:months]
+    d = d +  options.delete(:weeks) * 7  if options[:weeks]
+    d = d +  options.delete(:days)       if options[:days]
+    d
+  end
+
+  # Returns a new Date where one or more of the elements have been changed according to the +options+ parameter.
+  #
+  # Examples:
+  #
+  #   Date.new(2007, 5, 12).change(:day =&gt; 1)                  # =&gt; Date.new(2007, 5, 1)
+  #   Date.new(2007, 5, 12).change(:year =&gt; 2005, :month =&gt; 1) # =&gt; Date.new(2005, 1, 12)
+  def change(options)
+    ::Date.new(
+      options[:year]  || self.year,
+      options[:month] || self.month,
+      options[:day]   || self.day
+    )
+  end
+
+  # Returns a new Date/DateTime representing the time a number of specified months ago
+  def months_ago(months)
+    advance(:months =&gt; -months)
+  end
+
+  # Returns a new Date/DateTime representing the time a number of specified months in the future
+  def months_since(months)
+    advance(:months =&gt; months)
+  end
+
+  # Returns a new Date/DateTime representing the time a number of specified years ago
+  def years_ago(years)
+    advance(:years =&gt; -years)
+  end
+
+  # Returns a new Date/DateTime representing the time a number of specified years in the future
+  def years_since(years)
+    advance(:years =&gt; years)
+  end
+
+  # Short-hand for years_ago(1)
+  def last_year
+    years_ago(1)
+  end
+
+  # Short-hand for years_since(1)
+  def next_year
+    years_since(1)
+  end
+
+  # Short-hand for months_ago(1)
+  def last_month
+    months_ago(1)
+  end
+
+  # Short-hand for months_since(1)
+  def next_month
+    months_since(1)
+  end
+
+  # Returns a new Date/DateTime representing the &quot;start&quot; of this week (i.e, Monday; DateTime objects will have time set to 0:00)
+  def beginning_of_week
+    days_to_monday = self.wday!=0 ? self.wday-1 : 6
+    result = self - days_to_monday
+    self.acts_like?(:time) ? result.midnight : result
+  end
+  alias :monday :beginning_of_week
+  alias :at_beginning_of_week :beginning_of_week
+
+  # Returns a new Date/DateTime representing the end of this week (Sunday, DateTime objects will have time set to 23:59:59)
+  def end_of_week
+    days_to_sunday = self.wday!=0 ? 7-self.wday : 0
+    result = self + days_to_sunday.days
+    self.acts_like?(:time) ? result.end_of_day : result
+  end
+  alias :at_end_of_week :end_of_week
+
+  # Returns a new Date/DateTime representing the start of the given day in next week (default is Monday).
+  def next_week(day = :monday)
+    days_into_week = { :monday =&gt; 0, :tuesday =&gt; 1, :wednesday =&gt; 2, :thursday =&gt; 3, :friday =&gt; 4, :saturday =&gt; 5, :sunday =&gt; 6}
+    result = (self + 7).beginning_of_week + days_into_week[day]
+    self.acts_like?(:time) ? result.change(:hour =&gt; 0) : result
+  end
+
+  # Returns a new ; DateTime objects will have time set to 0:00DateTime representing the start of the month (1st of the month; DateTime objects will have time set to 0:00)
+  def beginning_of_month
+    self.acts_like?(:time) ? change(:day =&gt; 1,:hour =&gt; 0, :min =&gt; 0, :sec =&gt; 0) : change(:day =&gt; 1)
+  end
+  alias :at_beginning_of_month :beginning_of_month
+
+  # Returns a new Date/DateTime representing the end of the month (last day of the month; DateTime objects will have time set to 0:00)
+  def end_of_month
+    last_day = ::Time.days_in_month( self.month, self.year )
+    self.acts_like?(:time) ? change(:day =&gt; last_day, :hour =&gt; 23, :min =&gt; 59, :sec =&gt; 59) : change(:day =&gt; last_day)
+  end
+  alias :at_end_of_month :end_of_month
+
+  # Returns a new Date/DateTime representing the start of the quarter (1st of january, april, july, october; DateTime objects will have time set to 0:00)
+  def beginning_of_quarter
+    beginning_of_month.change(:month =&gt; [10, 7, 4, 1].detect { |m| m &lt;= self.month })
+  end
+  alias :at_beginning_of_quarter :beginning_of_quarter
+
+  # Returns a new Date/DateTime representing the end of the quarter (last day of march, june, september, december; DateTime objects will have time set to 23:59:59)
+  def end_of_quarter
+    beginning_of_month.change(:month =&gt; [3, 6, 9, 12].detect { |m| m &gt;= self.month }).end_of_month
+  end
+  alias :at_end_of_quarter :end_of_quarter
+
+  # Returns a new Date/DateTime representing the start of the year (1st of january; DateTime objects will have time set to 0:00)
+  def beginning_of_year
+    self.acts_like?(:time) ? change(:month =&gt; 1, :day =&gt; 1, :hour =&gt; 0, :min =&gt; 0, :sec =&gt; 0) : change(:month =&gt; 1, :day =&gt; 1)
+  end
+  alias :at_beginning_of_year :beginning_of_year
+
+  # Returns a new Time representing the end of the year (31st of december; DateTime objects will have time set to 23:59:59)
+  def end_of_year
+    self.acts_like?(:time) ? change(:month =&gt; 12,:day =&gt; 31,:hour =&gt; 23, :min =&gt; 59, :sec =&gt; 59) : change(:month =&gt; 12, :day =&gt; 31)
+  end
+  alias :at_end_of_year :end_of_year
+
+  # Convenience method which returns a new Date/DateTime representing the time 1 day ago
+  def yesterday
+    self - 1
+  end
+
+  # Convenience method which returns a new Date/DateTime representing the time 1 day since the instance time
+  def tomorrow
+    self + 1
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/date/calculations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,107 +1,97 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Date #:nodoc:
-      # Converting dates to formatted strings, times, and datetimes.
-      module Conversions
-        DATE_FORMATS = {
-          :short        =&gt; &quot;%e %b&quot;,
-          :long         =&gt; &quot;%B %e, %Y&quot;,
-          :db           =&gt; &quot;%Y-%m-%d&quot;,
-          :number       =&gt; &quot;%Y%m%d&quot;,
-          :long_ordinal =&gt; lambda { |date| date.strftime(&quot;%B #{date.day.ordinalize}, %Y&quot;) }, # =&gt; &quot;April 25th, 2007&quot;
-          :rfc822       =&gt; &quot;%e %b %Y&quot;
-        }
+require 'active_support/inflector'
 
-        def self.included(base) #:nodoc:
-          base.instance_eval do
-            alias_method :to_default_s, :to_s
-            alias_method :to_s, :to_formatted_s
-            alias_method :default_inspect, :inspect
-            alias_method :inspect, :readable_inspect
+class Date
+  DATE_FORMATS = {
+    :short        =&gt; &quot;%e %b&quot;,
+    :long         =&gt; &quot;%B %e, %Y&quot;,
+    :db           =&gt; &quot;%Y-%m-%d&quot;,
+    :number       =&gt; &quot;%Y%m%d&quot;,
+    :long_ordinal =&gt; lambda { |date| date.strftime(&quot;%B #{ActiveSupport::Inflector.ordinalize(date.day)}, %Y&quot;) }, # =&gt; &quot;April 25th, 2007&quot;
+    :rfc822       =&gt; &quot;%e %b %Y&quot;
+  }
 
-            # Ruby 1.9 has Date#to_time which converts to localtime only.
-            remove_method :to_time if base.instance_methods.include?(:to_time)
+  # Ruby 1.9 has Date#to_time which converts to localtime only.
+  remove_method :to_time if instance_methods.include?(:to_time)
 
-            # Ruby 1.9 has Date#xmlschema which converts to a string without the time component.
-            remove_method :xmlschema if base.instance_methods.include?(:xmlschema)
-          end
-        end
+  # Ruby 1.9 has Date#xmlschema which converts to a string without the time component.
+  remove_method :xmlschema if instance_methods.include?(:xmlschema)
 
-        # Convert to a formatted string. See DATE_FORMATS for predefined formats.
-        #
-        # This method is aliased to &lt;tt&gt;to_s&lt;/tt&gt;.
-        #
-        # ==== Examples
-        #   date = Date.new(2007, 11, 10)       # =&gt; Sat, 10 Nov 2007
-        #
-        #   date.to_formatted_s(:db)            # =&gt; &quot;2007-11-10&quot;
-        #   date.to_s(:db)                      # =&gt; &quot;2007-11-10&quot;
-        #
-        #   date.to_formatted_s(:short)         # =&gt; &quot;10 Nov&quot;
-        #   date.to_formatted_s(:long)          # =&gt; &quot;November 10, 2007&quot;
-        #   date.to_formatted_s(:long_ordinal)  # =&gt; &quot;November 10th, 2007&quot;
-        #   date.to_formatted_s(:rfc822)        # =&gt; &quot;10 Nov 2007&quot;
-        #
-        # == Adding your own time formats to to_formatted_s
-        # You can add your own formats to the Date::DATE_FORMATS hash.
-        # Use the format name as the hash key and either a strftime string
-        # or Proc instance that takes a date argument as the value.
-        #
-        #   # config/initializers/time_formats.rb
-        #   Date::DATE_FORMATS[:month_and_year] = &quot;%B %Y&quot;
-        #   Date::DATE_FORMATS[:short_ordinal] = lambda { |date| date.strftime(&quot;%B #{date.day.ordinalize}&quot;) }
-        def to_formatted_s(format = :default)
-          if formatter = DATE_FORMATS[format]
-            if formatter.respond_to?(:call)
-              formatter.call(self).to_s
-            else
-              strftime(formatter)
-            end
-          else
-            to_default_s
-          end
-        end
+  # Convert to a formatted string. See DATE_FORMATS for predefined formats.
+  #
+  # This method is aliased to &lt;tt&gt;to_s&lt;/tt&gt;.
+  #
+  # ==== Examples
+  #   date = Date.new(2007, 11, 10)       # =&gt; Sat, 10 Nov 2007
+  #
+  #   date.to_formatted_s(:db)            # =&gt; &quot;2007-11-10&quot;
+  #   date.to_s(:db)                      # =&gt; &quot;2007-11-10&quot;
+  #
+  #   date.to_formatted_s(:short)         # =&gt; &quot;10 Nov&quot;
+  #   date.to_formatted_s(:long)          # =&gt; &quot;November 10, 2007&quot;
+  #   date.to_formatted_s(:long_ordinal)  # =&gt; &quot;November 10th, 2007&quot;
+  #   date.to_formatted_s(:rfc822)        # =&gt; &quot;10 Nov 2007&quot;
+  #
+  # == Adding your own time formats to to_formatted_s
+  # You can add your own formats to the Date::DATE_FORMATS hash.
+  # Use the format name as the hash key and either a strftime string
+  # or Proc instance that takes a date argument as the value.
+  #
+  #   # config/initializers/time_formats.rb
+  #   Date::DATE_FORMATS[:month_and_year] = &quot;%B %Y&quot;
+  #   Date::DATE_FORMATS[:short_ordinal] = lambda { |date| date.strftime(&quot;%B #{date.day.ordinalize}&quot;) }
+  def to_formatted_s(format = :default)
+    if formatter = DATE_FORMATS[format]
+      if formatter.respond_to?(:call)
+        formatter.call(self).to_s
+      else
+        strftime(formatter)
+      end
+    else
+      to_default_s
+    end
+  end
+  alias_method :to_default_s, :to_s
+  alias_method :to_s, :to_formatted_s
 
-        # Overrides the default inspect method with a human readable one, e.g., &quot;Mon, 21 Feb 2005&quot;
-        def readable_inspect
-          strftime(&quot;%a, %d %b %Y&quot;)
-        end
+  # Overrides the default inspect method with a human readable one, e.g., &quot;Mon, 21 Feb 2005&quot;
+  def readable_inspect
+    strftime(&quot;%a, %d %b %Y&quot;)
+  end
+  alias_method :default_inspect, :inspect
+  alias_method :inspect, :readable_inspect
 
-        # A method to keep Time, Date and DateTime instances interchangeable on conversions.
-        # In this case, it simply returns +self+.
-        def to_date
-          self
-        end if RUBY_VERSION &lt; '1.9'
+  # A method to keep Time, Date and DateTime instances interchangeable on conversions.
+  # In this case, it simply returns +self+.
+  def to_date
+    self
+  end if RUBY_VERSION &lt; '1.9'
 
-        # Converts a Date instance to a Time, where the time is set to the beginning of the day.
-        # The timezone can be either :local or :utc (default :local).
-        #
-        # ==== Examples
-        #   date = Date.new(2007, 11, 10)  # =&gt; Sat, 10 Nov 2007
-        #
-        #   date.to_time                   # =&gt; Sat Nov 10 00:00:00 0800 2007
-        #   date.to_time(:local)           # =&gt; Sat Nov 10 00:00:00 0800 2007
-        #
-        #   date.to_time(:utc)             # =&gt; Sat Nov 10 00:00:00 UTC 2007
-        def to_time(form = :local)
-          ::Time.send(&quot;#{form}_time&quot;, year, month, day)
-        end
+  # Converts a Date instance to a Time, where the time is set to the beginning of the day.
+  # The timezone can be either :local or :utc (default :local).
+  #
+  # ==== Examples
+  #   date = Date.new(2007, 11, 10)  # =&gt; Sat, 10 Nov 2007
+  #
+  #   date.to_time                   # =&gt; Sat Nov 10 00:00:00 0800 2007
+  #   date.to_time(:local)           # =&gt; Sat Nov 10 00:00:00 0800 2007
+  #
+  #   date.to_time(:utc)             # =&gt; Sat Nov 10 00:00:00 UTC 2007
+  def to_time(form = :local)
+    ::Time.send(&quot;#{form}_time&quot;, year, month, day)
+  end
 
-        # Converts a Date instance to a DateTime, where the time is set to the beginning of the day
-        # and UTC offset is set to 0.
-        #
-        # ==== Examples
-        #   date = Date.new(2007, 11, 10)  # =&gt; Sat, 10 Nov 2007
-        #
-        #   date.to_datetime               # =&gt; Sat, 10 Nov 2007 00:00:00 0000
-        def to_datetime
-          ::DateTime.civil(year, month, day, 0, 0, 0, 0)
-        end if RUBY_VERSION &lt; '1.9'
+  # Converts a Date instance to a DateTime, where the time is set to the beginning of the day
+  # and UTC offset is set to 0.
+  #
+  # ==== Examples
+  #   date = Date.new(2007, 11, 10)  # =&gt; Sat, 10 Nov 2007
+  #
+  #   date.to_datetime               # =&gt; Sat, 10 Nov 2007 00:00:00 0000
+  def to_datetime
+    ::DateTime.civil(year, month, day, 0, 0, 0, 0)
+  end if RUBY_VERSION &lt; '1.9'
 
-        def xmlschema
-          to_time.xmlschema
-        end
-      end
-    end
+  def xmlschema
+    to_time.xmlschema
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/date/conversions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,6 @@
 require 'date'
-require 'active_support/core_ext/time/behavior'
-require 'active_support/core_ext/time/zones'
+
+require 'active_support/core_ext/date_time/acts_like'
 require 'active_support/core_ext/date_time/calculations'
 require 'active_support/core_ext/date_time/conversions'
-
-class DateTime
-  include ActiveSupport::CoreExtensions::Time::Behavior
-  include ActiveSupport::CoreExtensions::Time::Zones
-  include ActiveSupport::CoreExtensions::DateTime::Calculations
-  include ActiveSupport::CoreExtensions::DateTime::Conversions
-end
+require 'active_support/core_ext/date_time/zones'</diff>
      <filename>activesupport/lib/active_support/core_ext/date_time.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,126 +1,112 @@
 require 'rational'
 
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module DateTime #:nodoc:
-      # Enables the use of time calculations within DateTime itself
-      module Calculations
-        def self.included(base) #:nodoc:
-          base.extend ClassMethods
-
-          base.class_eval do
-            alias_method :compare_without_coercion, :&lt;=&gt;
-            alias_method :&lt;=&gt;, :compare_with_coercion
-          end
-        end
-
-        module ClassMethods
-          # DateTimes aren't aware of DST rules, so use a consistent non-DST offset when creating a DateTime with an offset in the local zone
-          def local_offset
-            ::Time.local(2007).utc_offset.to_r / 86400
-          end
+class DateTime
+  class &lt;&lt; self
+    # DateTimes aren't aware of DST rules, so use a consistent non-DST offset when creating a DateTime with an offset in the local zone
+    def local_offset
+      ::Time.local(2007).utc_offset.to_r / 86400
+    end
 
-          def current
-            ::Time.zone_default ? ::Time.zone.now.to_datetime : ::Time.now.to_datetime
-          end
-        end
+    def current
+      ::Time.zone_default ? ::Time.zone.now.to_datetime : ::Time.now.to_datetime
+    end
+  end
 
-        # Tells whether the DateTime object's datetime lies in the past
-        def past?
-          self &lt; ::DateTime.current
-        end
+  # Tells whether the DateTime object's datetime lies in the past
+  def past?
+    self &lt; ::DateTime.current
+  end
 
-        # Tells whether the DateTime object's datetime lies in the future
-        def future?
-          self &gt; ::DateTime.current
-        end
+  # Tells whether the DateTime object's datetime lies in the future
+  def future?
+    self &gt; ::DateTime.current
+  end
 
-        # Seconds since midnight: DateTime.now.seconds_since_midnight
-        def seconds_since_midnight
-          self.sec + (self.min * 60) + (self.hour * 3600)
-        end
+  # Seconds since midnight: DateTime.now.seconds_since_midnight
+  def seconds_since_midnight
+    sec + (min * 60) + (hour * 3600)
+  end
 
-        # Returns a new DateTime where one or more of the elements have been changed according to the +options+ parameter. The time options
-        # (hour, minute, sec) reset cascadingly, so if only the hour is passed, then minute and sec is set to 0. If the hour and
-        # minute is passed, then sec is set to 0.
-        def change(options)
-          ::DateTime.civil(
-            options[:year]  || self.year,
-            options[:month] || self.month,
-            options[:day]   || self.day,
-            options[:hour]  || self.hour,
-            options[:min]   || (options[:hour] ? 0 : self.min),
-            options[:sec]   || ((options[:hour] || options[:min]) ? 0 : self.sec),
-            options[:offset]  || self.offset,
-            options[:start]  || self.start
-          )
-        end
+  # Returns a new DateTime where one or more of the elements have been changed according to the +options+ parameter. The time options
+  # (hour, minute, sec) reset cascadingly, so if only the hour is passed, then minute and sec is set to 0. If the hour and
+  # minute is passed, then sec is set to 0.
+  def change(options)
+    ::DateTime.civil(
+      options[:year]  || year,
+      options[:month] || month,
+      options[:day]   || day,
+      options[:hour]  || hour,
+      options[:min]   || (options[:hour] ? 0 : min),
+      options[:sec]   || ((options[:hour] || options[:min]) ? 0 : sec),
+      options[:offset]  || offset,
+      options[:start]  || start
+    )
+  end
 
-        # Uses Date to provide precise Time calculations for years, months, and days.
-        # The +options+ parameter takes a hash with any of these keys: &lt;tt&gt;:years&lt;/tt&gt;,
-        # &lt;tt&gt;:months&lt;/tt&gt;, &lt;tt&gt;:weeks&lt;/tt&gt;, &lt;tt&gt;:days&lt;/tt&gt;, &lt;tt&gt;:hours&lt;/tt&gt;,
-        # &lt;tt&gt;:minutes&lt;/tt&gt;, &lt;tt&gt;:seconds&lt;/tt&gt;.
-        def advance(options)
-          d = to_date.advance(options)
-          datetime_advanced_by_date = change(:year =&gt; d.year, :month =&gt; d.month, :day =&gt; d.day)
-          seconds_to_advance = (options[:seconds] || 0) + (options[:minutes] || 0) * 60 + (options[:hours] || 0) * 3600
-          seconds_to_advance == 0 ? datetime_advanced_by_date : datetime_advanced_by_date.since(seconds_to_advance)
-        end
+  # Uses Date to provide precise Time calculations for years, months, and days.
+  # The +options+ parameter takes a hash with any of these keys: &lt;tt&gt;:years&lt;/tt&gt;,
+  # &lt;tt&gt;:months&lt;/tt&gt;, &lt;tt&gt;:weeks&lt;/tt&gt;, &lt;tt&gt;:days&lt;/tt&gt;, &lt;tt&gt;:hours&lt;/tt&gt;,
+  # &lt;tt&gt;:minutes&lt;/tt&gt;, &lt;tt&gt;:seconds&lt;/tt&gt;.
+  def advance(options)
+    d = to_date.advance(options)
+    datetime_advanced_by_date = change(:year =&gt; d.year, :month =&gt; d.month, :day =&gt; d.day)
+    seconds_to_advance = (options[:seconds] || 0) + (options[:minutes] || 0) * 60 + (options[:hours] || 0) * 3600
+    seconds_to_advance == 0 ? datetime_advanced_by_date : datetime_advanced_by_date.since(seconds_to_advance)
+  end
 
-        # Returns a new DateTime representing the time a number of seconds ago
-        # Do not use this method in combination with x.months, use months_ago instead!
-        def ago(seconds)
-          self.since(-seconds)
-        end
+  # Returns a new DateTime representing the time a number of seconds ago
+  # Do not use this method in combination with x.months, use months_ago instead!
+  def ago(seconds)
+    since(-seconds)
+  end
 
-        # Returns a new DateTime representing the time a number of seconds since the instance time
-        # Do not use this method in combination with x.months, use months_since instead!
-        def since(seconds)
-          self + Rational(seconds.round, 86400)
-        end
-        alias :in :since
+  # Returns a new DateTime representing the time a number of seconds since the instance time
+  # Do not use this method in combination with x.months, use months_since instead!
+  def since(seconds)
+    self + Rational(seconds.round, 86400)
+  end
+  alias :in :since
 
-        # Returns a new DateTime representing the start of the day (0:00)
-        def beginning_of_day
-          change(:hour =&gt; 0)
-        end
-        alias :midnight :beginning_of_day
-        alias :at_midnight :beginning_of_day
-        alias :at_beginning_of_day :beginning_of_day
+  # Returns a new DateTime representing the start of the day (0:00)
+  def beginning_of_day
+    change(:hour =&gt; 0)
+  end
+  alias :midnight :beginning_of_day
+  alias :at_midnight :beginning_of_day
+  alias :at_beginning_of_day :beginning_of_day
 
-        # Returns a new DateTime representing the end of the day (23:59:59)
-        def end_of_day
-          change(:hour =&gt; 23, :min =&gt; 59, :sec =&gt; 59)
-        end
+  # Returns a new DateTime representing the end of the day (23:59:59)
+  def end_of_day
+    change(:hour =&gt; 23, :min =&gt; 59, :sec =&gt; 59)
+  end
 
-        # Adjusts DateTime to UTC by adding its offset value; offset is set to 0
-        #
-        # Example:
-        #
-        #   DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24))       # =&gt; Mon, 21 Feb 2005 10:11:12 -0600
-        #   DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)).utc   # =&gt; Mon, 21 Feb 2005 16:11:12 +0000
-        def utc
-          new_offset(0)
-        end
-        alias_method :getutc, :utc
+  # Adjusts DateTime to UTC by adding its offset value; offset is set to 0
+  #
+  # Example:
+  #
+  #   DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24))       # =&gt; Mon, 21 Feb 2005 10:11:12 -0600
+  #   DateTime.civil(2005, 2, 21, 10, 11, 12, Rational(-6, 24)).utc   # =&gt; Mon, 21 Feb 2005 16:11:12 +0000
+  def utc
+    new_offset(0)
+  end
+  alias_method :getutc, :utc
 
-        # Returns true if offset == 0
-        def utc?
-          offset == 0
-        end
+  # Returns true if offset == 0
+  def utc?
+    offset == 0
+  end
 
-        # Returns the offset value in seconds
-        def utc_offset
-          (offset * 86400).to_i
-        end
+  # Returns the offset value in seconds
+  def utc_offset
+    (offset * 86400).to_i
+  end
 
-        # Layers additional behavior on DateTime#&lt;=&gt; so that Time and ActiveSupport::TimeWithZone instances can be compared with a DateTime
-        def compare_with_coercion(other)
-          other = other.comparable_time if other.respond_to?(:comparable_time)
-          other = other.to_datetime unless other.acts_like?(:date)
-          compare_without_coercion(other)
-        end
-      end
-    end
+  # Layers additional behavior on DateTime#&lt;=&gt; so that Time and ActiveSupport::TimeWithZone instances can be compared with a DateTime
+  def compare_with_coercion(other)
+    other = other.comparable_time if other.respond_to?(:comparable_time)
+    other = other.to_datetime unless other.acts_like?(:date)
+    compare_without_coercion(other)
   end
+  alias_method :compare_without_coercion, :&lt;=&gt;
+  alias_method :&lt;=&gt;, :compare_with_coercion
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/date_time/calculations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,96 +1,84 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module DateTime #:nodoc:
-      # Converting datetimes to formatted strings, dates, and times.
-      module Conversions
-        def self.append_features(base) #:nodoc:
-          base.class_eval do
-            alias_method :default_inspect, :inspect
-            alias_method :to_default_s, :to_s unless (instance_methods(false) &amp; [:to_s, 'to_s']).empty?
+require 'active_support/inflector'
 
-            # Ruby 1.9 has DateTime#to_time which internally relies on Time. We define our own #to_time which allows
-            # DateTimes outside the range of what can be created with Time.
-            remove_method :to_time if instance_methods.include?(:to_time)
-          end
+class DateTime
+  # Ruby 1.9 has DateTime#to_time which internally relies on Time. We define our own #to_time which allows
+  # DateTimes outside the range of what can be created with Time.
+  remove_method :to_time if instance_methods.include?(:to_time)
 
-          super
-
-          base.class_eval do
-            alias_method :to_s, :to_formatted_s
-            alias_method :inspect, :readable_inspect
-          end
-        end
-
-        # Convert to a formatted string. See Time::DATE_FORMATS for predefined formats.
-        # 
-        # This method is aliased to &lt;tt&gt;to_s&lt;/tt&gt;.
-        # 
-        # === Examples
-        #   datetime = DateTime.civil(2007, 12, 4, 0, 0, 0, 0)   # =&gt; Tue, 04 Dec 2007 00:00:00 +0000
-        # 
-        #   datetime.to_formatted_s(:db)            # =&gt; &quot;2007-12-04 00:00:00&quot;
-        #   datetime.to_s(:db)                      # =&gt; &quot;2007-12-04 00:00:00&quot;
-        #   datetime.to_s(:number)                  # =&gt; &quot;20071204000000&quot;
-        #   datetime.to_formatted_s(:short)         # =&gt; &quot;04 Dec 00:00&quot;
-        #   datetime.to_formatted_s(:long)          # =&gt; &quot;December 04, 2007 00:00&quot;
-        #   datetime.to_formatted_s(:long_ordinal)  # =&gt; &quot;December 4th, 2007 00:00&quot;
-        #   datetime.to_formatted_s(:rfc822)        # =&gt; &quot;Tue, 04 Dec 2007 00:00:00 +0000&quot;
-        #
-        # == Adding your own datetime formats to to_formatted_s
-        # DateTime formats are shared with Time. You can add your own to the
-        # Time::DATE_FORMATS hash. Use the format name as the hash key and
-        # either a strftime string or Proc instance that takes a time or
-        # datetime argument as the value.
-        #
-        #   # config/initializers/time_formats.rb
-        #   Time::DATE_FORMATS[:month_and_year] = &quot;%B %Y&quot;
-        #   Time::DATE_FORMATS[:short_ordinal] = lambda { |time| time.strftime(&quot;%B #{time.day.ordinalize}&quot;) }
-        def to_formatted_s(format = :default)
-          return to_default_s unless formatter = ::Time::DATE_FORMATS[format]
-          formatter.respond_to?(:call) ? formatter.call(self).to_s : strftime(formatter)
-        end
+  # Convert to a formatted string. See Time::DATE_FORMATS for predefined formats.
+  # 
+  # This method is aliased to &lt;tt&gt;to_s&lt;/tt&gt;.
+  # 
+  # === Examples
+  #   datetime = DateTime.civil(2007, 12, 4, 0, 0, 0, 0)   # =&gt; Tue, 04 Dec 2007 00:00:00 +0000
+  # 
+  #   datetime.to_formatted_s(:db)            # =&gt; &quot;2007-12-04 00:00:00&quot;
+  #   datetime.to_s(:db)                      # =&gt; &quot;2007-12-04 00:00:00&quot;
+  #   datetime.to_s(:number)                  # =&gt; &quot;20071204000000&quot;
+  #   datetime.to_formatted_s(:short)         # =&gt; &quot;04 Dec 00:00&quot;
+  #   datetime.to_formatted_s(:long)          # =&gt; &quot;December 04, 2007 00:00&quot;
+  #   datetime.to_formatted_s(:long_ordinal)  # =&gt; &quot;December 4th, 2007 00:00&quot;
+  #   datetime.to_formatted_s(:rfc822)        # =&gt; &quot;Tue, 04 Dec 2007 00:00:00 +0000&quot;
+  #
+  # == Adding your own datetime formats to to_formatted_s
+  # DateTime formats are shared with Time. You can add your own to the
+  # Time::DATE_FORMATS hash. Use the format name as the hash key and
+  # either a strftime string or Proc instance that takes a time or
+  # datetime argument as the value.
+  #
+  #   # config/initializers/time_formats.rb
+  #   Time::DATE_FORMATS[:month_and_year] = &quot;%B %Y&quot;
+  #   Time::DATE_FORMATS[:short_ordinal] = lambda { |time| time.strftime(&quot;%B #{time.day.ordinalize}&quot;) }
+  def to_formatted_s(format = :default)
+    if formatter = ::Time::DATE_FORMATS[format]
+      formatter.respond_to?(:call) ? formatter.call(self).to_s : strftime(formatter)
+    else
+      to_default_s
+    end
+  end
+  alias_method :to_default_s, :to_s unless (instance_methods(false) &amp; [:to_s, 'to_s']).empty?
+  alias_method :to_s, :to_formatted_s
 
-        # Returns the +utc_offset+ as an +HH:MM formatted string. Examples:
-        #
-        #   datetime = DateTime.civil(2000, 1, 1, 0, 0, 0, Rational(-6, 24))
-        #   datetime.formatted_offset         # =&gt; &quot;-06:00&quot;
-        #   datetime.formatted_offset(false)  # =&gt; &quot;-0600&quot;
-        def formatted_offset(colon = true, alternate_utc_string = nil)
-          utc? &amp;&amp; alternate_utc_string || utc_offset.to_utc_offset_s(colon)
-        end
-        
-        # Overrides the default inspect method with a human readable one, e.g., &quot;Mon, 21 Feb 2005 14:30:00 +0000&quot;
-        def readable_inspect
-          to_s(:rfc822)
-        end
+  # Returns the +utc_offset+ as an +HH:MM formatted string. Examples:
+  #
+  #   datetime = DateTime.civil(2000, 1, 1, 0, 0, 0, Rational(-6, 24))
+  #   datetime.formatted_offset         # =&gt; &quot;-06:00&quot;
+  #   datetime.formatted_offset(false)  # =&gt; &quot;-0600&quot;
+  def formatted_offset(colon = true, alternate_utc_string = nil)
+    utc? &amp;&amp; alternate_utc_string || ActiveSupport::TimeZone.seconds_to_utc_offset(utc_offset, colon)
+  end
+  
+  # Overrides the default inspect method with a human readable one, e.g., &quot;Mon, 21 Feb 2005 14:30:00 +0000&quot;
+  def readable_inspect
+    to_s(:rfc822)
+  end
+  alias_method :default_inspect, :inspect
+  alias_method :inspect, :readable_inspect
 
-        # Converts self to a Ruby Date object; time portion is discarded
-        def to_date
-          ::Date.new(year, month, day)
-        end
+  # Converts self to a Ruby Date object; time portion is discarded
+  def to_date
+    ::Date.new(year, month, day)
+  end
 
-        # Attempts to convert self to a Ruby Time object; returns self if out of range of Ruby Time class
-        # If self has an offset other than 0, self will just be returned unaltered, since there's no clean way to map it to a Time
-        def to_time
-          self.offset == 0 ? ::Time.utc_time(year, month, day, hour, min, sec) : self
-        end
+  # Attempts to convert self to a Ruby Time object; returns self if out of range of Ruby Time class
+  # If self has an offset other than 0, self will just be returned unaltered, since there's no clean way to map it to a Time
+  def to_time
+    self.offset == 0 ? ::Time.utc_time(year, month, day, hour, min, sec) : self
+  end
 
-        # To be able to keep Times, Dates and DateTimes interchangeable on conversions
-        def to_datetime
-          self
-        end
+  # To be able to keep Times, Dates and DateTimes interchangeable on conversions
+  def to_datetime
+    self
+  end
 
-        # Converts datetime to an appropriate format for use in XML
-        def xmlschema
-          strftime(&quot;%Y-%m-%dT%H:%M:%S%Z&quot;)
-        end if RUBY_VERSION &lt; '1.9'
-        
-        # Converts self to a floating-point number of seconds since the Unix epoch 
-        def to_f
-          days_since_unix_epoch = self - ::DateTime.civil(1970)
-          (days_since_unix_epoch * 86_400).to_f
-        end
-      end
-    end
+  # Converts datetime to an appropriate format for use in XML
+  def xmlschema
+    strftime(&quot;%Y-%m-%dT%H:%M:%S%Z&quot;)
+  end if RUBY_VERSION &lt; '1.9'
+  
+  # Converts self to a floating-point number of seconds since the Unix epoch 
+  def to_f
+    days_since_unix_epoch = self - ::DateTime.civil(1970)
+    (days_since_unix_epoch * 86_400).to_f
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/date_time/conversions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -77,11 +77,10 @@ module Enumerable
   #   (1..5).each_with_object(1) { |value, memo| memo *= value } # =&gt; 1
   #
   def each_with_object(memo, &amp;block)
-    returning memo do |m|
-      each do |element|
-        block.call(element, m)
-      end
+    each do |element|
+      block.call(element, memo)
     end
+    memo
   end unless [].respond_to?(:each_with_object)
 
   # Convert an enumerable to a hash. Examples:</diff>
      <filename>activesupport/lib/active_support/core_ext/enumerable.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,15 +1,19 @@
 module ActiveSupport
-  if RUBY_VERSION &gt;= '1.9'
-    FrozenObjectError = RuntimeError
-  else
-    FrozenObjectError = TypeError
-  end
+  FrozenObjectError = RUBY_VERSION &lt; '1.9' ? TypeError : RuntimeError
 end
 
 # TODO: Turn all this into using the BacktraceCleaner.
 class Exception # :nodoc:
+  # Clean the paths contained in the message.
+  def self.clean_paths(string)
+    require 'pathname' unless defined? Pathname
+    string.gsub(%r{[\w. ]+(/[\w. ]+)+(\.rb)?(\b|$)}) do |path|
+      Pathname.new(path).cleanpath
+    end
+  end
+
   def clean_message
-    Pathname.clean_within message
+    Exception.clean_paths(message)
   end
 
   TraceSubstitutions = []
@@ -18,9 +22,10 @@ class Exception # :nodoc:
 
   def clean_backtrace
     backtrace.collect do |line|
-      Pathname.clean_within(TraceSubstitutions.inject(line) do |result, (regexp, sub)|
+      substituted = TraceSubstitutions.inject(line) do |result, (regexp, sub)|
         result.gsub regexp, sub
-      end)
+      end
+      Exception.clean_paths(substituted)
     end
   end
 </diff>
      <filename>activesupport/lib/active_support/core_ext/exception.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1 @@
 require 'active_support/core_ext/file/atomic'
-
-class File #:nodoc:
-  extend ActiveSupport::CoreExtensions::File::Atomic
-end</diff>
      <filename>activesupport/lib/active_support/core_ext/file.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,46 +1,40 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module File #:nodoc:
-      module Atomic
-        # Write to a file atomically.  Useful for situations where you don't
-        # want other processes or threads to see half-written files.
-        #
-        #   File.atomic_write(&quot;important.file&quot;) do |file|
-        #     file.write(&quot;hello&quot;)
-        #   end
-        #
-        # If your temp directory is not on the same filesystem as the file you're 
-        # trying to write, you can provide a different temporary directory.
-        # 
-        #   File.atomic_write(&quot;/data/something.important&quot;, &quot;/data/tmp&quot;) do |f|
-        #     file.write(&quot;hello&quot;)
-        #   end
-        def atomic_write(file_name, temp_dir = Dir.tmpdir)
-          require 'tempfile' unless defined?(Tempfile)
+class File
+  # Write to a file atomically.  Useful for situations where you don't
+  # want other processes or threads to see half-written files.
+  #
+  #   File.atomic_write(&quot;important.file&quot;) do |file|
+  #     file.write(&quot;hello&quot;)
+  #   end
+  #
+  # If your temp directory is not on the same filesystem as the file you're
+  # trying to write, you can provide a different temporary directory.
+  #
+  #   File.atomic_write(&quot;/data/something.important&quot;, &quot;/data/tmp&quot;) do |f|
+  #     file.write(&quot;hello&quot;)
+  #   end
+  def self.atomic_write(file_name, temp_dir = Dir.tmpdir)
+    require 'tempfile' unless defined?(Tempfile)
 
-          temp_file = Tempfile.new(basename(file_name), temp_dir)
-          yield temp_file
-          temp_file.close
+    temp_file = Tempfile.new(basename(file_name), temp_dir)
+    yield temp_file
+    temp_file.close
 
-          begin
-            # Get original file permissions
-            old_stat = stat(file_name)
-          rescue Errno::ENOENT
-            # No old permissions, write a temp file to determine the defaults
-            check_name = join(dirname(file_name), &quot;.permissions_check.#{Thread.current.object_id}.#{Process.pid}.#{rand(1000000)}&quot;)
-            open(check_name, &quot;w&quot;) { }
-            old_stat = stat(check_name)
-            unlink(check_name)
-          end
+    begin
+      # Get original file permissions
+      old_stat = stat(file_name)
+    rescue Errno::ENOENT
+      # No old permissions, write a temp file to determine the defaults
+      check_name = join(dirname(file_name), &quot;.permissions_check.#{Thread.current.object_id}.#{Process.pid}.#{rand(1000000)}&quot;)
+      open(check_name, &quot;w&quot;) { }
+      old_stat = stat(check_name)
+      unlink(check_name)
+    end
 
-          # Overwrite original file with temp file
-          rename(temp_file.path, file_name)
+    # Overwrite original file with temp file
+    rename(temp_file.path, file_name)
 
-          # Set correct permissions on new file
-          chown(old_stat.uid, old_stat.gid, file_name)
-          chmod(old_stat.mode, file_name)
-        end
-      end
-    end
+    # Set correct permissions on new file
+    chown(old_stat.uid, old_stat.gid, file_name)
+    chmod(old_stat.mode, file_name)
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/file/atomic.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1 @@
 require 'active_support/core_ext/float/rounding'
-require 'active_support/core_ext/float/time'
-
-class Float #:nodoc:
-  include ActiveSupport::CoreExtensions::Float::Rounding
-  include ActiveSupport::CoreExtensions::Float::Time
-end</diff>
      <filename>activesupport/lib/active_support/core_ext/float.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,24 +1,18 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Float #:nodoc:
-      module Rounding
-        def self.included(base) #:nodoc:
-          base.class_eval do
-            alias_method :round_without_precision, :round
-            alias_method :round, :round_with_precision
-          end
-        end
+class Float
+  remove_method :round
 
-        # Rounds the float with the specified precision.
-        #
-        #   x = 1.337
-        #   x.round    # =&gt; 1
-        #   x.round(1) # =&gt; 1.3
-        #   x.round(2) # =&gt; 1.34
-        def round_with_precision(precision = nil)
-          precision.nil? ? round_without_precision : (self * (10 ** precision)).round / (10 ** precision).to_f
-        end
-      end
+  # Rounds the float with the specified precision.
+  #
+  #   x = 1.337
+  #   x.round    # =&gt; 1
+  #   x.round(1) # =&gt; 1.3
+  #   x.round(2) # =&gt; 1.34
+  def round(precision = nil)
+    if precision
+      magnitude = 10.0 ** precision
+      (self * magnitude).round / magnitude
+    else
+      super()
     end
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/float/rounding.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,8 @@
-%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
-  include ActiveSupport::CoreExtensions::Hash::Slice
-  include ActiveSupport::CoreExtensions::Hash::Except
-end
+require 'active_support/core_ext/hash/conversions'
+require 'active_support/core_ext/hash/deep_merge'
+require 'active_support/core_ext/hash/diff'
+require 'active_support/core_ext/hash/except'
+require 'active_support/core_ext/hash/indifferent_access'
+require 'active_support/core_ext/hash/keys'
+require 'active_support/core_ext/hash/reverse_merge'
+require 'active_support/core_ext/hash/slice'</diff>
      <filename>activesupport/lib/active_support/core_ext/hash.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,237 +1,228 @@
 require 'date'
+require 'active_support/core_ext/object/conversions'
+require 'active_support/core_ext/array/conversions'
 
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Hash #:nodoc:
-      module Conversions
-        # This module exists to decorate files deserialized using Hash.from_xml with
-        # the &lt;tt&gt;original_filename&lt;/tt&gt; and &lt;tt&gt;content_type&lt;/tt&gt; methods.
-        module FileLike #:nodoc:
-          attr_writer :original_filename, :content_type
-
-          def original_filename
-            @original_filename || 'untitled'
-          end
-
-          def content_type
-            @content_type || 'application/octet-stream'
-          end
-        end
+class Hash
+  # This module exists to decorate files deserialized using Hash.from_xml with
+  # the &lt;tt&gt;original_filename&lt;/tt&gt; and &lt;tt&gt;content_type&lt;/tt&gt; methods.
+  module FileLike #:nodoc:
+    attr_writer :original_filename, :content_type
 
-        XML_TYPE_NAMES = {
-          &quot;Symbol&quot;     =&gt; &quot;symbol&quot;,
-          &quot;Fixnum&quot;     =&gt; &quot;integer&quot;,
-          &quot;Bignum&quot;     =&gt; &quot;integer&quot;,
-          &quot;BigDecimal&quot; =&gt; &quot;decimal&quot;,
-          &quot;Float&quot;      =&gt; &quot;float&quot;,
-          &quot;TrueClass&quot;  =&gt; &quot;boolean&quot;,
-          &quot;FalseClass&quot; =&gt; &quot;boolean&quot;,
-          &quot;Date&quot;       =&gt; &quot;date&quot;,
-          &quot;DateTime&quot;   =&gt; &quot;datetime&quot;,
-          &quot;Time&quot;       =&gt; &quot;datetime&quot;,
-          &quot;ActiveSupport::TimeWithZone&quot; =&gt; &quot;datetime&quot;
-        } unless defined?(XML_TYPE_NAMES)
-
-        XML_FORMATTING = {
-          &quot;symbol&quot;   =&gt; Proc.new { |symbol| symbol.to_s },
-          &quot;date&quot;     =&gt; Proc.new { |date| date.to_s(:db) },
-          &quot;datetime&quot; =&gt; Proc.new { |time| time.xmlschema },
-          &quot;binary&quot;   =&gt; Proc.new { |binary| ActiveSupport::Base64.encode64(binary) },
-          &quot;yaml&quot;     =&gt; Proc.new { |yaml| yaml.to_yaml }
-        } unless defined?(XML_FORMATTING)
-
-        # TODO: use Time.xmlschema instead of Time.parse;
-        #       use regexp instead of Date.parse
-        unless defined?(XML_PARSING)
-          XML_PARSING = {
-            &quot;symbol&quot;       =&gt; Proc.new  { |symbol|  symbol.to_sym },
-            &quot;date&quot;         =&gt; Proc.new  { |date|    ::Date.parse(date) },
-            &quot;datetime&quot;     =&gt; Proc.new  { |time|    ::Time.parse(time).utc rescue ::DateTime.parse(time).utc },
-            &quot;integer&quot;      =&gt; Proc.new  { |integer| integer.to_i },
-            &quot;float&quot;        =&gt; Proc.new  { |float|   float.to_f },
-            &quot;decimal&quot;      =&gt; Proc.new  { |number|  BigDecimal(number) },
-            &quot;boolean&quot;      =&gt; Proc.new  { |boolean| %w(1 true).include?(boolean.strip) },
-            &quot;string&quot;       =&gt; Proc.new  { |string|  string.to_s },
-            &quot;yaml&quot;         =&gt; Proc.new  { |yaml|    YAML::load(yaml) rescue yaml },
-            &quot;base64Binary&quot; =&gt; Proc.new  { |bin|     ActiveSupport::Base64.decode64(bin) },
-            &quot;file&quot;         =&gt; Proc.new do |file, entity|
-              f = StringIO.new(ActiveSupport::Base64.decode64(file))
-              f.extend(FileLike)
-              f.original_filename = entity['name']
-              f.content_type = entity['content_type']
-              f
-            end
-          }
+    def original_filename
+      @original_filename || 'untitled'
+    end
 
-          XML_PARSING.update(
-            &quot;double&quot;   =&gt; XML_PARSING[&quot;float&quot;],
-            &quot;dateTime&quot; =&gt; XML_PARSING[&quot;datetime&quot;]
-          )
-        end
+    def content_type
+      @content_type || 'application/octet-stream'
+    end
+  end
 
-        def self.included(klass)
-          klass.extend(ClassMethods)
-        end
+  XML_TYPE_NAMES = {
+    &quot;Symbol&quot;     =&gt; &quot;symbol&quot;,
+    &quot;Fixnum&quot;     =&gt; &quot;integer&quot;,
+    &quot;Bignum&quot;     =&gt; &quot;integer&quot;,
+    &quot;BigDecimal&quot; =&gt; &quot;decimal&quot;,
+    &quot;Float&quot;      =&gt; &quot;float&quot;,
+    &quot;TrueClass&quot;  =&gt; &quot;boolean&quot;,
+    &quot;FalseClass&quot; =&gt; &quot;boolean&quot;,
+    &quot;Date&quot;       =&gt; &quot;date&quot;,
+    &quot;DateTime&quot;   =&gt; &quot;datetime&quot;,
+    &quot;Time&quot;       =&gt; &quot;datetime&quot;
+  } unless defined?(XML_TYPE_NAMES)
+
+  XML_FORMATTING = {
+    &quot;symbol&quot;   =&gt; Proc.new { |symbol| symbol.to_s },
+    &quot;date&quot;     =&gt; Proc.new { |date| date.to_s(:db) },
+    &quot;datetime&quot; =&gt; Proc.new { |time| time.xmlschema },
+    &quot;binary&quot;   =&gt; Proc.new { |binary| ActiveSupport::Base64.encode64(binary) },
+    &quot;yaml&quot;     =&gt; Proc.new { |yaml| yaml.to_yaml }
+  } unless defined?(XML_FORMATTING)
+
+  # TODO: use Time.xmlschema instead of Time.parse;
+  #       use regexp instead of Date.parse
+  unless defined?(XML_PARSING)
+    XML_PARSING = {
+      &quot;symbol&quot;       =&gt; Proc.new  { |symbol|  symbol.to_sym },
+      &quot;date&quot;         =&gt; Proc.new  { |date|    ::Date.parse(date) },
+      &quot;datetime&quot;     =&gt; Proc.new  { |time|    ::Time.parse(time).utc rescue ::DateTime.parse(time).utc },
+      &quot;integer&quot;      =&gt; Proc.new  { |integer| integer.to_i },
+      &quot;float&quot;        =&gt; Proc.new  { |float|   float.to_f },
+      &quot;decimal&quot;      =&gt; Proc.new  { |number|  BigDecimal(number) },
+      &quot;boolean&quot;      =&gt; Proc.new  { |boolean| %w(1 true).include?(boolean.strip) },
+      &quot;string&quot;       =&gt; Proc.new  { |string|  string.to_s },
+      &quot;yaml&quot;         =&gt; Proc.new  { |yaml|    YAML::load(yaml) rescue yaml },
+      &quot;base64Binary&quot; =&gt; Proc.new  { |bin|     ActiveSupport::Base64.decode64(bin) },
+      &quot;file&quot;         =&gt; Proc.new do |file, entity|
+        f = StringIO.new(ActiveSupport::Base64.decode64(file))
+        f.extend(FileLike)
+        f.original_filename = entity['name']
+        f.content_type = entity['content_type']
+        f
+      end
+    }
 
-        # Converts a hash into a string suitable for use as a URL query string. An optional &lt;tt&gt;namespace&lt;/tt&gt; can be
-        # passed to enclose the param names (see example below).
-        #
-        # ==== Examples
-        #   { :name =&gt; 'David', :nationality =&gt; 'Danish' }.to_query # =&gt; &quot;name=David&amp;nationality=Danish&quot;
-        #
-        #   { :name =&gt; 'David', :nationality =&gt; 'Danish' }.to_query('user') # =&gt; &quot;user%5Bname%5D=David&amp;user%5Bnationality%5D=Danish&quot;
-        def to_query(namespace = nil)
-          collect do |key, value|
-            value.to_query(namespace ? &quot;#{namespace}[#{key}]&quot; : key)
-          end.sort * '&amp;'
-        end
-        
-        alias_method :to_param, :to_query
-
-        def to_xml(options = {})
-          require 'builder' unless defined?(Builder)
-
-          options[:indent] ||= 2
-          options.reverse_merge!({ :builder =&gt; Builder::XmlMarkup.new(:indent =&gt; options[:indent]),
-                                   :root =&gt; &quot;hash&quot; })
-          options[:builder].instruct! unless options.delete(:skip_instruct)
-          root = rename_key(options[:root].to_s, options)
-
-          options[:builder].__send__(:method_missing, root) do
-            each do |key, value|
-              case value
-                when ::Hash
-                  value.to_xml(options.merge({ :root =&gt; key, :skip_instruct =&gt; true }))
-                when ::Array
-                  value.to_xml(options.merge({ :root =&gt; key, :children =&gt; key.to_s.singularize, :skip_instruct =&gt; true}))
-                when ::Method, ::Proc
-                  # If the Method or Proc takes two arguments, then
-                  # pass the suggested child element name.  This is
-                  # used if the Method or Proc will be operating over
-                  # multiple records and needs to create an containing
-                  # element that will contain the objects being
-                  # serialized.
-                  if 1 == value.arity
-                    value.call(options.merge({ :root =&gt; key, :skip_instruct =&gt; true }))
-                  else
-                    value.call(options.merge({ :root =&gt; key, :skip_instruct =&gt; true }), key.to_s.singularize)
-                  end
-                else
-                  if value.respond_to?(:to_xml)
-                    value.to_xml(options.merge({ :root =&gt; key, :skip_instruct =&gt; true }))
-                  else
-                    type_name = XML_TYPE_NAMES[value.class.name]
-
-                    key = rename_key(key.to_s, options)
-
-                    attributes = options[:skip_types] || value.nil? || type_name.nil? ? { } : { :type =&gt; type_name }
-                    if value.nil?
-                      attributes[:nil] = true
-                    end
-
-                    options[:builder].tag!(key,
-                      XML_FORMATTING[type_name] ? XML_FORMATTING[type_name].call(value) : value,
-                      attributes
-                    )
-                  end
-              end
-            end
-            
-            yield options[:builder] if block_given?
-          end
+    XML_PARSING.update(
+      &quot;double&quot;   =&gt; XML_PARSING[&quot;float&quot;],
+      &quot;dateTime&quot; =&gt; XML_PARSING[&quot;datetime&quot;]
+    )
+  end
 
-        end
+  # Converts a hash into a string suitable for use as a URL query string. An optional &lt;tt&gt;namespace&lt;/tt&gt; can be
+  # passed to enclose the param names (see example below).
+  #
+  # ==== Examples
+  #   { :name =&gt; 'David', :nationality =&gt; 'Danish' }.to_query # =&gt; &quot;name=David&amp;nationality=Danish&quot;
+  #
+  #   { :name =&gt; 'David', :nationality =&gt; 'Danish' }.to_query('user') # =&gt; &quot;user%5Bname%5D=David&amp;user%5Bnationality%5D=Danish&quot;
+  def to_query(namespace = nil)
+    collect do |key, value|
+      value.to_query(namespace ? &quot;#{namespace}[#{key}]&quot; : key)
+    end.sort * '&amp;'
+  end
+  
+  alias_method :to_param, :to_query
+
+  def to_xml(options = {})
+    require 'builder' unless defined?(Builder)
+
+    options[:indent] ||= 2
+    options.reverse_merge!({ :builder =&gt; Builder::XmlMarkup.new(:indent =&gt; options[:indent]),
+                             :root =&gt; &quot;hash&quot; })
+    options[:builder].instruct! unless options.delete(:skip_instruct)
+    root = rename_key(options[:root].to_s, options)
+
+    options[:builder].__send__(:method_missing, root) do
+      each do |key, value|
+        case value
+          when ::Hash
+            value.to_xml(options.merge({ :root =&gt; key, :skip_instruct =&gt; true }))
+          when ::Array
+            value.to_xml(options.merge({ :root =&gt; key, :children =&gt; key.to_s.singularize, :skip_instruct =&gt; true}))
+          when ::Method, ::Proc
+            # If the Method or Proc takes two arguments, then
+            # pass the suggested child element name.  This is
+            # used if the Method or Proc will be operating over
+            # multiple records and needs to create an containing
+            # element that will contain the objects being
+            # serialized.
+            if 1 == value.arity
+              value.call(options.merge({ :root =&gt; key, :skip_instruct =&gt; true }))
+            else
+              value.call(options.merge({ :root =&gt; key, :skip_instruct =&gt; true }), key.to_s.singularize)
+            end
+          else
+            if value.respond_to?(:to_xml)
+              value.to_xml(options.merge({ :root =&gt; key, :skip_instruct =&gt; true }))
+            else
+              type_name = XML_TYPE_NAMES[value.class.name]
 
-        def rename_key(key, options = {})
-          camelize = options.has_key?(:camelize) &amp;&amp; options[:camelize]
-          dasherize = !options.has_key?(:dasherize) || options[:dasherize]
-          key = key.camelize if camelize
-          dasherize ? key.dasherize : key
-        end
+              key = rename_key(key.to_s, options)
 
-        module ClassMethods
-          def from_xml(xml)
-            typecast_xml_value(unrename_keys(XmlMini.parse(xml)))
-          end
-
-          private
-            def typecast_xml_value(value)
-              case value.class.to_s
-                when 'Hash'
-                  if value['type'] == 'array'
-                    child_key, entries = value.detect { |k,v| k != 'type' }   # child_key is throwaway
-                    if entries.nil? || (c = value['__content__'] &amp;&amp; c.blank?)
-                      []
-                    else
-                      case entries.class.to_s   # something weird with classes not matching here.  maybe singleton methods breaking is_a?
-                      when &quot;Array&quot;
-                        entries.collect { |v| typecast_xml_value(v) }
-                      when &quot;Hash&quot;
-                        [typecast_xml_value(entries)]
-                      else
-                        raise &quot;can't typecast #{entries.inspect}&quot;
-                      end
-                    end
-                  elsif value.has_key?(&quot;__content__&quot;)
-                    content = value[&quot;__content__&quot;]
-                    if parser = XML_PARSING[value[&quot;type&quot;]]
-                      if parser.arity == 2
-                        XML_PARSING[value[&quot;type&quot;]].call(content, value)
-                      else
-                        XML_PARSING[value[&quot;type&quot;]].call(content)
-                      end
-                    else
-                      content
-                    end
-                  elsif value['type'] == 'string' &amp;&amp; value['nil'] != 'true'
-                    &quot;&quot;
-                  # blank or nil parsed values are represented by nil
-                  elsif value.blank? || value['nil'] == 'true'
-                    nil
-                  # If the type is the only element which makes it then 
-                  # this still makes the value nil, except if type is
-                  # a XML node(where type['value'] is a Hash)
-                  elsif value['type'] &amp;&amp; value.size == 1 &amp;&amp; !value['type'].is_a?(::Hash)
-                    nil
-                  else
-                    xml_value = value.inject({}) do |h,(k,v)|
-                      h[k] = typecast_xml_value(v)
-                      h
-                    end
-                    
-                    # Turn { :files =&gt; { :file =&gt; #&lt;StringIO&gt; } into { :files =&gt; #&lt;StringIO&gt; } so it is compatible with
-                    # how multipart uploaded files from HTML appear
-                    xml_value[&quot;file&quot;].is_a?(StringIO) ? xml_value[&quot;file&quot;] : xml_value
-                  end
-                when 'Array'
-                  value.map! { |i| typecast_xml_value(i) }
-                  case value.length
-                    when 0 then nil
-                    when 1 then value.first
-                    else value
-                  end
-                when 'String'
-                  value
-                else
-                  raise &quot;can't typecast #{value.class.name} - #{value.inspect}&quot;
+              attributes = options[:skip_types] || value.nil? || type_name.nil? ? { } : { :type =&gt; type_name }
+              if value.nil?
+                attributes[:nil] = true
               end
+
+              options[:builder].tag!(key,
+                XML_FORMATTING[type_name] ? XML_FORMATTING[type_name].call(value) : value,
+                attributes
+              )
             end
+        end
+      end
+      
+      yield options[:builder] if block_given?
+    end
 
-            def unrename_keys(params)
-              case params.class.to_s
-                when &quot;Hash&quot;
-                  params.inject({}) do |h,(k,v)|
-                    h[k.to_s.underscore.tr(&quot;-&quot;, &quot;_&quot;)] = unrename_keys(v)
-                    h
-                  end
+  end
+
+  def rename_key(key, options = {})
+    camelize = options.has_key?(:camelize) &amp;&amp; options[:camelize]
+    dasherize = !options.has_key?(:dasherize) || options[:dasherize]
+    key = key.camelize if camelize
+    dasherize ? key.dasherize : key
+  end
+
+  class &lt;&lt; self
+    def from_xml(xml)
+      typecast_xml_value(unrename_keys(ActiveSupport::XmlMini.parse(xml)))
+    end
+
+    private
+      def typecast_xml_value(value)
+        case value.class.to_s
+          when 'Hash'
+            if value['type'] == 'array'
+              child_key, entries = value.detect { |k,v| k != 'type' }   # child_key is throwaway
+              if entries.nil? || (c = value['__content__'] &amp;&amp; c.blank?)
+                []
+              else
+                case entries.class.to_s   # something weird with classes not matching here.  maybe singleton methods breaking is_a?
                 when &quot;Array&quot;
-                  params.map { |v| unrename_keys(v) }
+                  entries.collect { |v| typecast_xml_value(v) }
+                when &quot;Hash&quot;
+                  [typecast_xml_value(entries)]
                 else
-                  params
+                  raise &quot;can't typecast #{entries.inspect}&quot;
+                end
               end
+            elsif value.has_key?(&quot;__content__&quot;)
+              content = value[&quot;__content__&quot;]
+              if parser = XML_PARSING[value[&quot;type&quot;]]
+                if parser.arity == 2
+                  XML_PARSING[value[&quot;type&quot;]].call(content, value)
+                else
+                  XML_PARSING[value[&quot;type&quot;]].call(content)
+                end
+              else
+                content
+              end
+            elsif value['type'] == 'string' &amp;&amp; value['nil'] != 'true'
+              &quot;&quot;
+            # blank or nil parsed values are represented by nil
+            elsif value.blank? || value['nil'] == 'true'
+              nil
+            # If the type is the only element which makes it then 
+            # this still makes the value nil, except if type is
+            # a XML node(where type['value'] is a Hash)
+            elsif value['type'] &amp;&amp; value.size == 1 &amp;&amp; !value['type'].is_a?(::Hash)
+              nil
+            else
+              xml_value = value.inject({}) do |h,(k,v)|
+                h[k] = typecast_xml_value(v)
+                h
+              end
+              
+              # Turn { :files =&gt; { :file =&gt; #&lt;StringIO&gt; } into { :files =&gt; #&lt;StringIO&gt; } so it is compatible with
+              # how multipart uploaded files from HTML appear
+              xml_value[&quot;file&quot;].is_a?(StringIO) ? xml_value[&quot;file&quot;] : xml_value
             end
+          when 'Array'
+            value.map! { |i| typecast_xml_value(i) }
+            case value.length
+              when 0 then nil
+              when 1 then value.first
+              else value
+            end
+          when 'String'
+            value
+          else
+            raise &quot;can't typecast #{value.class.name} - #{value.inspect}&quot;
+        end
+      end
+
+      def unrename_keys(params)
+        case params.class.to_s
+          when &quot;Hash&quot;
+            params.inject({}) do |h,(k,v)|
+              h[k.to_s.underscore.tr(&quot;-&quot;, &quot;_&quot;)] = unrename_keys(v)
+              h
+            end
+          when &quot;Array&quot;
+            params.map { |v| unrename_keys(v) }
+          else
+            params
         end
       end
-    end
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/hash/conversions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,23 +1,16 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Hash #:nodoc:
-      # Allows for deep merging
-      module DeepMerge
-        # Returns a new hash with +self+ and +other_hash+ merged recursively.
-        def deep_merge(other_hash)
-          self.merge(other_hash) do |key, oldval, newval|
-            oldval = oldval.to_hash if oldval.respond_to?(:to_hash)
-            newval = newval.to_hash if newval.respond_to?(:to_hash)
-            oldval.class.to_s == 'Hash' &amp;&amp; newval.class.to_s == 'Hash' ? oldval.deep_merge(newval) : newval
-          end
-        end
-
-        # Returns a new hash with +self+ and +other_hash+ merged recursively.
-        # Modifies the receiver in place.
-        def deep_merge!(other_hash)
-          replace(deep_merge(other_hash))
-        end
-      end
+class Hash
+  # Returns a new hash with +self+ and +other_hash+ merged recursively.
+  def deep_merge(other_hash)
+    merge(other_hash) do |key, oldval, newval|
+      oldval = oldval.to_hash if oldval.respond_to?(:to_hash)
+      newval = newval.to_hash if newval.respond_to?(:to_hash)
+      oldval.class.to_s == 'Hash' &amp;&amp; newval.class.to_s == 'Hash' ? oldval.deep_merge(newval) : newval
     end
   end
+
+  # Returns a new hash with +self+ and +other_hash+ merged recursively.
+  # Modifies the receiver in place.
+  def deep_merge!(other_hash)
+    replace(deep_merge(other_hash))
+  end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/hash/deep_merge.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,19 +1,13 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Hash #:nodoc:
-      module Diff
-        # Returns a hash that represents the difference between two hashes.
-        #
-        # Examples:
-        #
-        #   {1 =&gt; 2}.diff(1 =&gt; 2)         # =&gt; {}
-        #   {1 =&gt; 2}.diff(1 =&gt; 3)         # =&gt; {1 =&gt; 2}
-        #   {}.diff(1 =&gt; 2)               # =&gt; {1 =&gt; 2}
-        #   {1 =&gt; 2, 3 =&gt; 4}.diff(1 =&gt; 2) # =&gt; {3 =&gt; 4}
-        def diff(h2)
-          self.dup.delete_if { |k, v| h2[k] == v }.merge(h2.dup.delete_if { |k, v| self.has_key?(k) })
-        end
-      end
-    end
+class Hash
+  # Returns a hash that represents the difference between two hashes.
+  #
+  # Examples:
+  #
+  #   {1 =&gt; 2}.diff(1 =&gt; 2)         # =&gt; {}
+  #   {1 =&gt; 2}.diff(1 =&gt; 3)         # =&gt; {1 =&gt; 2}
+  #   {}.diff(1 =&gt; 2)               # =&gt; {1 =&gt; 2}
+  #   {1 =&gt; 2, 3 =&gt; 4}.diff(1 =&gt; 2) # =&gt; {3 =&gt; 4}
+  def diff(h2)
+    dup.delete_if { |k, v| h2[k] == v }.merge(h2.dup.delete_if { |k, v| has_key?(k) })
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/hash/diff.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,25 +1,16 @@
-require 'set'
-
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Hash #:nodoc:
-      # Return a hash that includes everything but the given keys. This is useful for
-      # limiting a set of parameters to everything but a few known toggles:
-      #
-      #   @person.update_attributes(params[:person].except(:admin))
-      module Except
-        # Returns a new hash without the given keys.
-        def except(*keys)
-          dup.except!(*keys)
-        end
+class Hash
+  # Return a hash that includes everything but the given keys. This is useful for
+  # limiting a set of parameters to everything but a few known toggles:
+  #
+  #   @person.update_attributes(params[:person].except(:admin))
+  def except(*keys)
+    dup.except!(*keys)
+  end
 
-        # 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) }
-          self
-        end
-      end
-    end
+  # 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) }
+    self
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/hash/except.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,143 +1,9 @@
-# This class has dubious semantics and we only have it so that
-# people can write params[:key] instead of params['key']
-# and they get the same value for both keys.
+require 'active_support/hash_with_indifferent_access'
 
-class HashWithIndifferentAccess &lt; Hash
-  def initialize(constructor = {})
-    if constructor.is_a?(Hash)
-      super()
-      update(constructor)
-    else
-      super(constructor)
-    end
-  end
-
-  def default(key = nil)
-    if key.is_a?(Symbol) &amp;&amp; include?(key = key.to_s)
-      self[key]
-    else
-      super
-    end
-  end
-
-  alias_method :regular_writer, :[]= unless method_defined?(:regular_writer)
-  alias_method :regular_update, :update unless method_defined?(:regular_update)
-
-  # Assigns a new value to the hash:
-  #
-  #   hash = HashWithIndifferentAccess.new
-  #   hash[:key] = &quot;value&quot;
-  #
-  def []=(key, value)
-    regular_writer(convert_key(key), convert_value(value))
-  end
-
-  # Updates the instantized hash with values from the second:
-  # 
-  #   hash_1 = HashWithIndifferentAccess.new
-  #   hash_1[:key] = &quot;value&quot;
-  # 
-  #   hash_2 = HashWithIndifferentAccess.new
-  #   hash_2[:key] = &quot;New Value!&quot;
-  # 
-  #   hash_1.update(hash_2) # =&gt; {&quot;key&quot;=&gt;&quot;New Value!&quot;}
-  # 
-  def update(other_hash)
-    other_hash.each_pair { |key, value| regular_writer(convert_key(key), convert_value(value)) }
-    self
-  end
-
-  alias_method :merge!, :update
-
-  # Checks the hash for a key matching the argument passed in:
-  #
-  #   hash = HashWithIndifferentAccess.new
-  #   hash[&quot;key&quot;] = &quot;value&quot;
-  #   hash.key? :key  # =&gt; true
-  #   hash.key? &quot;key&quot; # =&gt; true
-  #
-  def key?(key)
-    super(convert_key(key))
-  end
-
-  alias_method :include?, :key?
-  alias_method :has_key?, :key?
-  alias_method :member?, :key?
-
-  # Fetches the value for the specified key, same as doing hash[key]
-  def fetch(key, *extras)
-    super(convert_key(key), *extras)
-  end
-
-  # Returns an array of the values at the specified indices:
-  #
-  #   hash = HashWithIndifferentAccess.new
-  #   hash[:a] = &quot;x&quot;
-  #   hash[:b] = &quot;y&quot;
-  #   hash.values_at(&quot;a&quot;, &quot;b&quot;) # =&gt; [&quot;x&quot;, &quot;y&quot;]
-  #
-  def values_at(*indices)
-    indices.collect {|key| self[convert_key(key)]}
-  end
-
-  # Returns an exact copy of the hash.
-  def dup
-    HashWithIndifferentAccess.new(self)
-  end
-
-  # Merges the instantized and the specified hashes together, giving precedence to the values from the second hash
-  # Does not overwrite the existing hash.
-  def merge(hash)
-    self.dup.update(hash)
-  end
-
-  # Performs the opposite of merge, with the keys and values from the first hash taking precedence over the second.
-  # This overloaded definition prevents returning a regular hash, if reverse_merge is called on a HashWithDifferentAccess.
-  def reverse_merge(other_hash)
-    super other_hash.with_indifferent_access
-  end
-
-  # Removes a specified key from the hash.
-  def delete(key)
-    super(convert_key(key))
-  end
-
-  def stringify_keys!; self end
-  def symbolize_keys!; self end
-  def to_options!; self end
-
-  # Convert to a Hash with String keys.
-  def to_hash
-    Hash.new(default).merge(self)
-  end
-
-  protected
-    def convert_key(key)
-      key.kind_of?(Symbol) ? key.to_s : key
-    end
-
-    def convert_value(value)
-      case value
-      when Hash
-        value.with_indifferent_access
-      when Array
-        value.collect { |e| e.is_a?(Hash) ? e.with_indifferent_access : e }
-      else
-        value
-      end
-    end
-end
-
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Hash #:nodoc:
-      module IndifferentAccess #:nodoc:
-        def with_indifferent_access
-          hash = HashWithIndifferentAccess.new(self)
-          hash.default = self.default
-          hash
-        end
-      end
-    end
+class Hash
+  def with_indifferent_access
+    hash = ActiveSupport::HashWithIndifferentAccess.new(self)
+    hash.default = self.default
+    hash
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/hash/indifferent_access.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,52 +1,46 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Hash #:nodoc:
-      module Keys
-        # Return a new hash with all keys converted to strings.
-        def stringify_keys
-          inject({}) do |options, (key, value)|
-            options[key.to_s] = value
-            options
-          end
-        end
+class Hash
+  # Return a new hash with all keys converted to strings.
+  def stringify_keys
+    inject({}) do |options, (key, value)|
+      options[key.to_s] = value
+      options
+    end
+  end
 
-        # Destructively convert all keys to strings.
-        def stringify_keys!
-          keys.each do |key|
-            self[key.to_s] = delete(key)
-          end
-          self
-        end
+  # Destructively convert all keys to strings.
+  def stringify_keys!
+    keys.each do |key|
+      self[key.to_s] = delete(key)
+    end
+    self
+  end
 
-        # Return a new hash with all keys converted to symbols.
-        def symbolize_keys
-          inject({}) do |options, (key, value)|
-            options[(key.to_sym rescue key) || key] = value
-            options
-          end
-        end
+  # Return a new hash with all keys converted to symbols.
+  def symbolize_keys
+    inject({}) do |options, (key, value)|
+      options[(key.to_sym rescue key) || key] = value
+      options
+    end
+  end
 
-        # Destructively convert all keys to symbols.
-        def symbolize_keys!
-          self.replace(self.symbolize_keys)
-        end
+  # Destructively convert all keys to symbols.
+  def symbolize_keys!
+    self.replace(self.symbolize_keys)
+  end
 
-        alias_method :to_options,  :symbolize_keys
-        alias_method :to_options!, :symbolize_keys!
+  alias_method :to_options,  :symbolize_keys
+  alias_method :to_options!, :symbolize_keys!
 
-        # Validate all keys in a hash match *valid keys, raising ArgumentError on a mismatch.
-        # Note that keys are NOT treated indifferently, meaning if you use strings for keys but assert symbols
-        # as keys, this will fail.
-        #
-        # ==== Examples
-        #   { :name =&gt; &quot;Rob&quot;, :years =&gt; &quot;28&quot; }.assert_valid_keys(:name, :age) # =&gt; raises &quot;ArgumentError: Unknown key(s): years&quot;
-        #   { :name =&gt; &quot;Rob&quot;, :age =&gt; &quot;28&quot; }.assert_valid_keys(&quot;name&quot;, &quot;age&quot;) # =&gt; raises &quot;ArgumentError: Unknown key(s): name, age&quot;
-        #   { :name =&gt; &quot;Rob&quot;, :age =&gt; &quot;28&quot; }.assert_valid_keys(:name, :age) # =&gt; passes, raises nothing
-        def assert_valid_keys(*valid_keys)
-          unknown_keys = keys - [valid_keys].flatten
-          raise(ArgumentError, &quot;Unknown key(s): #{unknown_keys.join(&quot;, &quot;)}&quot;) unless unknown_keys.empty?
-        end
-      end
-    end
+  # Validate all keys in a hash match *valid keys, raising ArgumentError on a mismatch.
+  # Note that keys are NOT treated indifferently, meaning if you use strings for keys but assert symbols
+  # as keys, this will fail.
+  #
+  # ==== Examples
+  #   { :name =&gt; &quot;Rob&quot;, :years =&gt; &quot;28&quot; }.assert_valid_keys(:name, :age) # =&gt; raises &quot;ArgumentError: Unknown key(s): years&quot;
+  #   { :name =&gt; &quot;Rob&quot;, :age =&gt; &quot;28&quot; }.assert_valid_keys(&quot;name&quot;, &quot;age&quot;) # =&gt; raises &quot;ArgumentError: Unknown key(s): name, age&quot;
+  #   { :name =&gt; &quot;Rob&quot;, :age =&gt; &quot;28&quot; }.assert_valid_keys(:name, :age) # =&gt; passes, raises nothing
+  def assert_valid_keys(*valid_keys)
+    unknown_keys = keys - [valid_keys].flatten
+    raise(ArgumentError, &quot;Unknown key(s): #{unknown_keys.join(&quot;, &quot;)}&quot;) unless unknown_keys.empty?
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/hash/keys.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,35 +1,28 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Hash #:nodoc:
-      # 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
-      #
-      # 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 &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 &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))
-        end
+class Hash
+  # 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
+  #
+  # 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.
+  def reverse_merge(other_hash)
+    other_hash.merge(self)
+  end
 
-        alias_method :reverse_update, :reverse_merge!
-      end
-    end
+  # 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))
   end
+
+  alias_method :reverse_update, :reverse_merge!
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/hash/reverse_merge.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,40 +1,32 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Hash #:nodoc:
-      # Slice a hash to include only the given keys. This is useful for
-      # limiting an options hash to valid keys before passing to a method:
-      #
-      #   def search(criteria = {})
-      #     assert_valid_keys(:mass, :velocity, :time)
-      #   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)
-          keys = keys.map! { |key| convert_key(key) } if respond_to?(:convert_key)
-          hash = self.class.new
-          keys.each { |k| hash[k] = self[k] if has_key?(k) }
-          hash
-        end
+class Hash
+  # Slice a hash to include only the given keys. This is useful for
+  # limiting an options hash to valid keys before passing to a method:
+  #
+  #   def search(criteria = {})
+  #     assert_valid_keys(:mass, :velocity, :time)
+  #   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))
+  def slice(*keys)
+    keys = keys.map! { |key| convert_key(key) } if respond_to?(:convert_key)
+    hash = self.class.new
+    keys.each { |k| hash[k] = self[k] if has_key?(k) }
+    hash
+  end
 
-        # Replaces the hash with only the given keys.
-        # Returns a hash contained the removed key/value pairs
-        #   {:a =&gt; 1, :b =&gt; 2, :c =&gt; 3, :d =&gt; 4}.slice!(:a, :b) # =&gt; {:c =&gt; 3, :d =&gt;4}
-        def slice!(*keys)
-          keys = keys.map! { |key| convert_key(key) } if respond_to?(:convert_key)
-          omit = slice(*self.keys - keys)
-          hash = slice(*keys)
-          replace(hash)
-          omit
-        end
-      end
-    end
+  # Replaces the hash with only the given keys.
+  # Returns a hash contained the removed key/value pairs
+  #   {:a =&gt; 1, :b =&gt; 2, :c =&gt; 3, :d =&gt; 4}.slice!(:a, :b) # =&gt; {:c =&gt; 3, :d =&gt;4}
+  def slice!(*keys)
+    keys = keys.map! { |key| convert_key(key) } if respond_to?(:convert_key)
+    omit = slice(*self.keys - keys)
+    hash = slice(*keys)
+    replace(hash)
+    omit
   end
 end
-</diff>
      <filename>activesupport/lib/active_support/core_ext/hash/slice.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,3 @@
 require 'active_support/core_ext/integer/even_odd'
 require 'active_support/core_ext/integer/inflections'
 require 'active_support/core_ext/integer/time'
-
-class Integer #:nodoc:
-  include ActiveSupport::CoreExtensions::Integer::EvenOdd
-  include ActiveSupport::CoreExtensions::Integer::Inflections
-  include ActiveSupport::CoreExtensions::Integer::Time
-end</diff>
      <filename>activesupport/lib/active_support/core_ext/integer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,29 +1,16 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Integer #:nodoc:
-      # For checking if a fixnum is even or odd.
-      #
-      #   2.even?  # =&gt; true
-      #   2.odd?   # =&gt; false
-      #   1.even?  # =&gt; false
-      #   1.odd?   # =&gt; true
-      #   0.even?  # =&gt; true
-      #   0.odd?   # =&gt; false
-      #   -1.even? # =&gt; false
-      #   -1.odd?  # =&gt; true
-      module EvenOdd
-        def multiple_of?(number)
-          self % number == 0
-        end
+class Integer
+  # Check whether the integer is evenly divisible by the argument.
+  def multiple_of?(number)
+    self % number == 0
+  end
 
-        def even?
-          multiple_of? 2
-        end if RUBY_VERSION &lt; '1.9'
+  # Is the integer a multiple of 2?
+  def even?
+    multiple_of? 2
+  end if RUBY_VERSION &lt; '1.9'
 
-        def odd?
-          !even?
-        end if RUBY_VERSION &lt; '1.9'
-      end
-    end
-  end
+  # Is the integer not a multiple of 2?
+  def odd?
+    !even?
+  end if RUBY_VERSION &lt; '1.9'
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/integer/even_odd.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,20 +1,14 @@
 require 'active_support/inflector'
 
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Integer #:nodoc:
-      module Inflections
-        # Ordinalize turns a number into an ordinal string used to denote the
-        # position in an ordered sequence such as 1st, 2nd, 3rd, 4th.
-        #
-        #   1.ordinalize    # =&gt; &quot;1st&quot;
-        #   2.ordinalize    # =&gt; &quot;2nd&quot;
-        #   1002.ordinalize # =&gt; &quot;1002nd&quot;
-        #   1003.ordinalize # =&gt; &quot;1003rd&quot;
-        def ordinalize
-          Inflector.ordinalize(self)
-        end
-      end
-    end
+class Integer
+  # Ordinalize turns a number into an ordinal string used to denote the
+  # position in an ordered sequence such as 1st, 2nd, 3rd, 4th.
+  #
+  #   1.ordinalize    # =&gt; &quot;1st&quot;
+  #   2.ordinalize    # =&gt; &quot;2nd&quot;
+  #   1002.ordinalize # =&gt; &quot;1002nd&quot;
+  #   1003.ordinalize # =&gt; &quot;1003rd&quot;
+  def ordinalize
+    ActiveSupport::Inflector.ordinalize(self)
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/integer/inflections.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,45 +1,39 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Integer #:nodoc:
-      # Enables the use of time calculations and declarations, like 45.minutes + 2.hours + 4.years.
-      #
-      # These methods use Time#advance for precise date calculations when using from_now, ago, etc. 
-      # as well as adding or subtracting their results from a Time object. For example:
-      #
-      #   # equivalent to Time.now.advance(:months =&gt; 1)
-      #   1.month.from_now
-      #
-      #   # equivalent to Time.now.advance(:years =&gt; 2)
-      #   2.years.from_now
-      #
-      #   # equivalent to Time.now.advance(:months =&gt; 4, :years =&gt; 5)
-      #   (4.months + 5.years).from_now
-      # 
-      # While these methods provide precise calculation when used as in the examples above, care
-      # should be taken to note that this is not true if the result of `months', `years', etc is
-      # converted before use:
-      #
-      #   # equivalent to 30.days.to_i.from_now
-      #   1.month.to_i.from_now
-      #
-      #   # equivalent to 365.25.days.to_f.from_now
-      #   1.year.to_f.from_now
-      #
-      # In such cases, Ruby's core
-      # Date[http://stdlib.rubyonrails.org/libdoc/date/rdoc/index.html] and
-      # Time[http://stdlib.rubyonrails.org/libdoc/time/rdoc/index.html] should be used for precision
-      # date and time arithmetic
-      module Time        
-        def months
-          ActiveSupport::Duration.new(self * 30.days, [[:months, self]])
-        end
-        alias :month :months
+class Integer
+  # Enables the use of time calculations and declarations, like 45.minutes + 2.hours + 4.years.
+  #
+  # These methods use Time#advance for precise date calculations when using from_now, ago, etc. 
+  # as well as adding or subtracting their results from a Time object. For example:
+  #
+  #   # equivalent to Time.now.advance(:months =&gt; 1)
+  #   1.month.from_now
+  #
+  #   # equivalent to Time.now.advance(:years =&gt; 2)
+  #   2.years.from_now
+  #
+  #   # equivalent to Time.now.advance(:months =&gt; 4, :years =&gt; 5)
+  #   (4.months + 5.years).from_now
+  # 
+  # While these methods provide precise calculation when used as in the examples above, care
+  # should be taken to note that this is not true if the result of `months', `years', etc is
+  # converted before use:
+  #
+  #   # equivalent to 30.days.to_i.from_now
+  #   1.month.to_i.from_now
+  #
+  #   # equivalent to 365.25.days.to_f.from_now
+  #   1.year.to_f.from_now
+  #
+  # In such cases, Ruby's core
+  # Date[http://stdlib.rubyonrails.org/libdoc/date/rdoc/index.html] and
+  # Time[http://stdlib.rubyonrails.org/libdoc/time/rdoc/index.html] should be used for precision
+  # date and time arithmetic
+  def months
+    ActiveSupport::Duration.new(self * 30.days, [[:months, self]])
+  end
+  alias :month :months
 
-        def years
-          ActiveSupport::Duration.new(self * 365.25.days, [[:years, self]])
-        end
-        alias :year :years
-      end
-    end
+  def years
+    ActiveSupport::Duration.new(self * 365.25.days, [[:years, self]])
   end
+  alias :year :years
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/integer/time.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,15 +7,17 @@ module Kernel
   #
   #   noisy_call # warning voiced
   def silence_warnings
-    old_verbose, $VERBOSE = $VERBOSE, nil
-    yield
-  ensure
-    $VERBOSE = old_verbose
+    with_warnings(nil) { yield }
   end
 
   # Sets $VERBOSE to true for the duration of the block and back to its original value afterwards.
   def enable_warnings
-    old_verbose, $VERBOSE = $VERBOSE, true
+    with_warnings(true) { yield }
+  end
+
+  # Sets $VERBOSE for the duration of the block and back to its original value afterwards.
+  def with_warnings(flag)
+    old_verbose, $VERBOSE = $VERBOSE, flag
     yield
   ensure
     $VERBOSE = old_verbose
@@ -56,4 +58,4 @@ module Kernel
       raise unless exception_classes.any? { |cls| e.kind_of?(cls) }
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>activesupport/lib/active_support/core_ext/kernel/reporting.rb</filename>
    </modified>
    <modified>
      <diff>@@ -24,15 +24,12 @@ class MissingSourceFile &lt; LoadError #:nodoc:
   ] unless defined?(REGEXPS)
 end
 
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module LoadErrorExtensions #:nodoc:
-      module LoadErrorClassMethods #:nodoc:
-        def new(*args)
-          (self == LoadError &amp;&amp; MissingSourceFile.from_message(args.first)) || super
-        end
-      end
-      ::LoadError.extend(LoadErrorClassMethods)
+class LoadError
+  def self.new(*args)
+    if self == LoadError
+      MissingSourceFile.from_message(args.first)
+    else
+      super
     end
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/load_error.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,23 +1,12 @@
+require 'active_support/core_ext/module/aliasing'
+require 'active_support/core_ext/module/introspection'
+
 require 'active_support/core_ext/module/inclusion'
 require 'active_support/core_ext/module/attribute_accessors'
 require 'active_support/core_ext/module/attr_internal'
 require 'active_support/core_ext/module/attr_accessor_with_default'
 require 'active_support/core_ext/module/delegation'
-require 'active_support/core_ext/module/introspection'
 require 'active_support/core_ext/module/loading'
-require 'active_support/core_ext/module/aliasing'
 require 'active_support/core_ext/module/model_naming'
 require 'active_support/core_ext/module/synchronization'
-
-module ActiveSupport
-  module CoreExtensions
-    # Various extensions for the Ruby core Module class.
-    module Module
-      # Nothing here. Only defined for API documentation purposes.
-    end
-  end
-end
-
-class Module
-  include ActiveSupport::CoreExtensions::Module
-end
+require 'active_support/core_ext/module/setup'</diff>
      <filename>activesupport/lib/active_support/core_ext/module.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,74 +1,70 @@
-module ActiveSupport
-  module CoreExtensions
-    module Module
-      # Encapsulates the common pattern of:
-      #
-      #   alias_method :foo_without_feature, :foo
-      #   alias_method :foo, :foo_with_feature
-      #
-      # With this, you simply do:
-      #
-      #   alias_method_chain :foo, :feature
-      #
-      # And both aliases are set up for you.
-      #
-      # Query and bang methods (foo?, foo!) keep the same punctuation:
-      #
-      #   alias_method_chain :foo?, :feature
-      #
-      # is equivalent to
-      #
-      #   alias_method :foo_without_feature?, :foo?
-      #   alias_method :foo?, :foo_with_feature?
-      #
-      # so you can safely chain foo, foo?, and foo! with the same feature.
-      def alias_method_chain(target, feature)
-        # Strip out punctuation on predicates or bang methods since
-        # e.g. target?_without_feature is not a valid method name.
-        aliased_target, punctuation = target.to_s.sub(/([?!=])$/, ''), $1
-        yield(aliased_target, punctuation) if block_given?
+class Module
+  # Encapsulates the common pattern of:
+  #
+  #   alias_method :foo_without_feature, :foo
+  #   alias_method :foo, :foo_with_feature
+  #
+  # With this, you simply do:
+  #
+  #   alias_method_chain :foo, :feature
+  #
+  # And both aliases are set up for you.
+  #
+  # Query and bang methods (foo?, foo!) keep the same punctuation:
+  #
+  #   alias_method_chain :foo?, :feature
+  #
+  # is equivalent to
+  #
+  #   alias_method :foo_without_feature?, :foo?
+  #   alias_method :foo?, :foo_with_feature?
+  #
+  # so you can safely chain foo, foo?, and foo! with the same feature.
+  def alias_method_chain(target, feature)
+    # Strip out punctuation on predicates or bang methods since
+    # e.g. target?_without_feature is not a valid method name.
+    aliased_target, punctuation = target.to_s.sub(/([?!=])$/, ''), $1
+    yield(aliased_target, punctuation) if block_given?
 
-        with_method, without_method = &quot;#{aliased_target}_with_#{feature}#{punctuation}&quot;, &quot;#{aliased_target}_without_#{feature}#{punctuation}&quot;
+    with_method, without_method = &quot;#{aliased_target}_with_#{feature}#{punctuation}&quot;, &quot;#{aliased_target}_without_#{feature}#{punctuation}&quot;
 
-        alias_method without_method, target
-        alias_method target, with_method
+    alias_method without_method, target
+    alias_method target, with_method
 
-        case
-          when public_method_defined?(without_method)
-            public target
-          when protected_method_defined?(without_method)
-            protected target
-          when private_method_defined?(without_method)
-            private target
-        end
-      end
-
-      # Allows you to make aliases for attributes, which includes
-      # getter, setter, and query methods.
-      #
-      # Example:
-      #
-      #   class Content &lt; ActiveRecord::Base
-      #     # has a title attribute
-      #   end
-      #
-      #   class Email &lt; Content
-      #     alias_attribute :subject, :title
-      #   end
-      #
-      #   e = Email.find(1)
-      #   e.title    # =&gt; &quot;Superstars&quot;
-      #   e.subject  # =&gt; &quot;Superstars&quot;
-      #   e.subject? # =&gt; true
-      #   e.subject = &quot;Megastars&quot;
-      #   e.title    # =&gt; &quot;Megastars&quot;
-      def alias_attribute(new_name, old_name)
-        module_eval &lt;&lt;-STR, __FILE__, __LINE__+1
-          def #{new_name}; self.#{old_name}; end          # def subject; self.title; end
-          def #{new_name}?; self.#{old_name}?; end        # def subject?; self.title?; end
-          def #{new_name}=(v); self.#{old_name} = v; end  # def subject=(v); self.title = v; end
-        STR
-      end
+    case
+      when public_method_defined?(without_method)
+        public target
+      when protected_method_defined?(without_method)
+        protected target
+      when private_method_defined?(without_method)
+        private target
     end
   end
+
+  # Allows you to make aliases for attributes, which includes
+  # getter, setter, and query methods.
+  #
+  # Example:
+  #
+  #   class Content &lt; ActiveRecord::Base
+  #     # has a title attribute
+  #   end
+  #
+  #   class Email &lt; Content
+  #     alias_attribute :subject, :title
+  #   end
+  #
+  #   e = Email.find(1)
+  #   e.title    # =&gt; &quot;Superstars&quot;
+  #   e.subject  # =&gt; &quot;Superstars&quot;
+  #   e.subject? # =&gt; true
+  #   e.subject = &quot;Megastars&quot;
+  #   e.title    # =&gt; &quot;Megastars&quot;
+  def alias_attribute(new_name, old_name)
+    module_eval &lt;&lt;-STR, __FILE__, __LINE__+1
+      def #{new_name}; self.#{old_name}; end          # def subject; self.title; end
+      def #{new_name}?; self.#{old_name}?; end        # def subject?; self.title?; end
+      def #{new_name}=(v); self.#{old_name} = v; end  # def subject=(v); self.title = v; end
+    STR
+  end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/module/aliasing.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,56 +1,60 @@
-# Extends the module object with module and instance accessors for class attributes, 
-# just like the native attr* accessors for instance attributes.
-#
-#  module AppConfiguration
-#    mattr_accessor :google_api_key
-#    self.google_api_key = &quot;123456789&quot;
-#
-#    mattr_accessor :paypal_url
-#    self.paypal_url = &quot;www.sandbox.paypal.com&quot;
-#  end
-#
-#  AppConfiguration.google_api_key = &quot;overriding the api key!&quot;
+require 'active_support/core_ext/array/extract_options'
+
 class Module
   def mattr_reader(*syms)
+    syms.extract_options!
     syms.each do |sym|
-      next if sym.is_a?(Hash)
-      class_eval(&lt;&lt;-EOS, __FILE__, __LINE__)
+      class_eval(&lt;&lt;-EOS, __FILE__, __LINE__ + 1)
         unless defined? @@#{sym}  # unless defined? @@pagination_options
           @@#{sym} = nil          #   @@pagination_options = nil
         end                       # end
-                                  #
+
         def self.#{sym}           # def self.pagination_options
           @@#{sym}                #   @@pagination_options
         end                       # end
-                                  #
+
         def #{sym}                # def pagination_options
           @@#{sym}                #   @@pagination_options
         end                       # end
       EOS
     end
   end
-  
+
   def mattr_writer(*syms)
     options = syms.extract_options!
     syms.each do |sym|
-      class_eval(&lt;&lt;-EOS, __FILE__, __LINE__)
+      class_eval(&lt;&lt;-EOS, __FILE__, __LINE__ + 1)
         unless defined? @@#{sym}                       # unless defined? @@pagination_options
           @@#{sym} = nil                               #   @@pagination_options = nil
         end                                            # end
-                                                       #
+
         def self.#{sym}=(obj)                          # def self.pagination_options=(obj)
           @@#{sym} = obj                               #   @@pagination_options = obj
         end                                            # end
-                                                       #
-        #{&quot;                                            #
-        def #{sym}=(obj)                               # def pagination_options=(obj)
-          @@#{sym} = obj                               #   @@pagination_options = obj
-        end                                            # end
-        &quot; unless options[:instance_writer] == false }  # # instance writer above is generated unless options[:instance_writer] == false
       EOS
+
+      unless options[:instance_writer] == false
+        class_eval(&lt;&lt;-EOS, __FILE__, __LINE__)
+          def #{sym}=(obj)                             # def pagination_options=(obj)
+            @@#{sym} = obj                             #   @@pagination_options = obj
+          end                                          # end
+        EOS
+      end
     end
   end
-  
+
+  # Extends the module object with module and instance accessors for class attributes,
+  # just like the native attr* accessors for instance attributes.
+  #
+  #  module AppConfiguration
+  #    mattr_accessor :google_api_key
+  #    self.google_api_key = &quot;123456789&quot;
+  #
+  #    mattr_accessor :paypal_url
+  #    self.paypal_url = &quot;www.sandbox.paypal.com&quot;
+  #  end
+  #
+  #  AppConfiguration.google_api_key = &quot;overriding the api key!&quot;
   def mattr_accessor(*syms)
     mattr_reader(*syms)
     mattr_writer(*syms)</diff>
      <filename>activesupport/lib/active_support/core_ext/module/attribute_accessors.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,90 +1,86 @@
-module ActiveSupport
-  module CoreExtensions
-    module Module
-      # Returns the name of the module containing this one.
-      #
-      #   p M::N.parent_name # =&gt; &quot;M&quot;
-      def parent_name
-        unless defined? @parent_name
-          @parent_name = name =~ /::[^:]+\Z/ ? $`.freeze : nil
-        end
-        @parent_name
-      end
+class Module
+  # Returns the name of the module containing this one.
+  #
+  #   p M::N.parent_name # =&gt; &quot;M&quot;
+  def parent_name
+    unless defined? @parent_name
+      @parent_name = name =~ /::[^:]+\Z/ ? $`.freeze : nil
+    end
+    @parent_name
+  end
 
-      # Returns the module which contains this one according to its name.
-      #
-      #   module M
-      #     module N
-      #     end
-      #   end
-      #   X = M::N
-      #
-      #   p M::N.parent # =&gt; M
-      #   p X.parent    # =&gt; M
-      #
-      # The parent of top-level and anonymous modules is Object.
-      #
-      #   p M.parent          # =&gt; Object
-      #   p Module.new.parent # =&gt; Object
-      #
-      def parent
-        parent_name ? parent_name.constantize : Object
-      end
+  # Returns the module which contains this one according to its name.
+  #
+  #   module M
+  #     module N
+  #     end
+  #   end
+  #   X = M::N
+  #
+  #   p M::N.parent # =&gt; M
+  #   p X.parent    # =&gt; M
+  #
+  # The parent of top-level and anonymous modules is Object.
+  #
+  #   p M.parent          # =&gt; Object
+  #   p Module.new.parent # =&gt; Object
+  #
+  def parent
+    parent_name ? parent_name.constantize : Object
+  end
 
-      # Returns all the parents of this module according to its name, ordered from
-      # nested outwards. The receiver is not contained within the result.
-      #
-      #   module M
-      #     module N
-      #     end
-      #   end
-      #   X = M::N
-      #
-      #   p M.parents    # =&gt; [Object]
-      #   p M::N.parents # =&gt; [M, Object]
-      #   p X.parents    # =&gt; [M, Object]
-      #
-      def parents
-        parents = []
-        if parent_name
-          parts = parent_name.split('::')
-          until parts.empty?
-            parents &lt;&lt; (parts * '::').constantize
-            parts.pop
-          end
-        end
-        parents &lt;&lt; Object unless parents.include? Object
-        parents
+  # Returns all the parents of this module according to its name, ordered from
+  # nested outwards. The receiver is not contained within the result.
+  #
+  #   module M
+  #     module N
+  #     end
+  #   end
+  #   X = M::N
+  #
+  #   p M.parents    # =&gt; [Object]
+  #   p M::N.parents # =&gt; [M, Object]
+  #   p X.parents    # =&gt; [M, Object]
+  #
+  def parents
+    parents = []
+    if parent_name
+      parts = parent_name.split('::')
+      until parts.empty?
+        parents &lt;&lt; (parts * '::').constantize
+        parts.pop
       end
+    end
+    parents &lt;&lt; Object unless parents.include? Object
+    parents
+  end
 
-      if RUBY_VERSION &lt; '1.9'
-        # Returns the constants that have been defined locally by this object and
-        # not in an ancestor. This method is exact if running under Ruby 1.9. In
-        # previous versions it may miss some constants if their definition in some
-        # ancestor is identical to their definition in the receiver.
-        def local_constants
-          inherited = {}
-
-          ancestors.each do |anc|
-            next if anc == self
-            anc.constants.each { |const| inherited[const] = anc.const_get(const) }
-          end
+  if RUBY_VERSION &lt; '1.9'
+    # Returns the constants that have been defined locally by this object and
+    # not in an ancestor. This method is exact if running under Ruby 1.9. In
+    # previous versions it may miss some constants if their definition in some
+    # ancestor is identical to their definition in the receiver.
+    def local_constants
+      inherited = {}
 
-          constants.select do |const|
-            !inherited.key?(const) || inherited[const].object_id != const_get(const).object_id
-          end
-        end
-      else
-        def local_constants #:nodoc:
-          constants(false)
-        end
+      ancestors.each do |anc|
+        next if anc == self
+        anc.constants.each { |const| inherited[const] = anc.const_get(const) }
       end
 
-      # Returns the names of the constants defined locally rather than the
-      # constants themselves. See &lt;tt&gt;local_constants&lt;/tt&gt;.
-      def local_constant_names
-        local_constants.map { |c| c.to_s }
+      constants.select do |const|
+        !inherited.key?(const) || inherited[const].object_id != const_get(const).object_id
       end
     end
+  else
+    def local_constants #:nodoc:
+      constants(false)
+    end
+  end
+
+  # Returns the names of the constants defined locally rather than the
+  # constants themselves. See &lt;tt&gt;local_constants&lt;/tt&gt;.
+  def local_constant_names
+    local_constants.map { |c| c.to_s }
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/module/introspection.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,14 +10,12 @@ module ActiveSupport
       @partial_path = &quot;#{@cache_key}/#{demodulize.underscore}&quot;.freeze
     end
   end
+end
 
-  module CoreExtensions
-    module Module
-      # Returns an ActiveSupport::ModelName object for module. It can be
-      # used to retrieve all kinds of naming-related information.
-      def model_name
-        @model_name ||= ModelName.new(name)
-      end
-    end
+class Module
+  # Returns an ActiveSupport::ModelName object for module. It can be
+  # used to retrieve all kinds of naming-related information.
+  def model_name
+    @model_name ||= ActiveSupport::ModelName.new(name)
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/module/model_naming.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,9 @@
-# Add a +missing_name+ method to NameError instances.
-class NameError #:nodoc:  
-  # Add a method to obtain the missing name from a NameError.
+class NameError
+  # Extract the name of the missing constant from the exception message.
   def missing_name
     $1 if /((::)?([A-Z]\w*)(::[A-Z]\w*)*)$/ =~ message
   end
-  
+
   # Was this exception raised because the given name was missing?
   def missing_name?(name)
     if name.is_a? Symbol</diff>
      <filename>activesupport/lib/active_support/core_ext/name_error.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,2 @@
-require 'active_support/core_ext/numeric/time'
 require 'active_support/core_ext/numeric/bytes'
-require 'active_support/core_ext/numeric/conversions'
-
-class Numeric #:nodoc:
-  include ActiveSupport::CoreExtensions::Numeric::Time 
-  include ActiveSupport::CoreExtensions::Numeric::Bytes
-  include ActiveSupport::CoreExtensions::Numeric::Conversions 
-end
+require 'active_support/core_ext/numeric/time'</diff>
      <filename>activesupport/lib/active_support/core_ext/numeric.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,44 +1,37 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Numeric #:nodoc:
-      # Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes
-      module Bytes
-        def bytes
-          self
-        end
-        alias :byte :bytes
+class Numeric
+  # Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes
+  def bytes
+    self
+  end
+  alias :byte :bytes
 
-        def kilobytes
-          self * 1024
-        end
-        alias :kilobyte :kilobytes
+  def kilobytes
+    self * 1024
+  end
+  alias :kilobyte :kilobytes
 
-        def megabytes
-          self * 1024.kilobytes
-        end
-        alias :megabyte :megabytes
+  def megabytes
+    self * 1024.kilobytes
+  end
+  alias :megabyte :megabytes
 
-        def gigabytes
-          self * 1024.megabytes 
-        end
-        alias :gigabyte :gigabytes
+  def gigabytes
+    self * 1024.megabytes 
+  end
+  alias :gigabyte :gigabytes
 
-        def terabytes
-          self * 1024.gigabytes
-        end
-        alias :terabyte :terabytes
-        
-        def petabytes
-          self * 1024.terabytes
-        end
-        alias :petabyte :petabytes
-        
-        def exabytes
-          self * 1024.petabytes
-        end
-        alias :exabyte :exabytes
-        
-      end
-    end
+  def terabytes
+    self * 1024.gigabytes
+  end
+  alias :terabyte :terabytes
+  
+  def petabytes
+    self * 1024.terabytes
+  end
+  alias :petabyte :petabytes
+  
+  def exabytes
+    self * 1024.petabytes
   end
+  alias :exabyte :exabytes
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/numeric/bytes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,81 +1,75 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Numeric #:nodoc:
-      # Enables the use of time calculations and declarations, like 45.minutes + 2.hours + 4.years.
-      #
-      # These methods use Time#advance for precise date calculations when using from_now, ago, etc. 
-      # as well as adding or subtracting their results from a Time object. For example:
-      #
-      #   # equivalent to Time.now.advance(:months =&gt; 1)
-      #   1.month.from_now
-      #
-      #   # equivalent to Time.now.advance(:years =&gt; 2)
-      #   2.years.from_now
-      #
-      #   # equivalent to Time.now.advance(:months =&gt; 4, :years =&gt; 5)
-      #   (4.months + 5.years).from_now
-      # 
-      # While these methods provide precise calculation when used as in the examples above, care
-      # should be taken to note that this is not true if the result of `months', `years', etc is
-      # converted before use:
-      #
-      #   # equivalent to 30.days.to_i.from_now
-      #   1.month.to_i.from_now
-      #
-      #   # equivalent to 365.25.days.to_f.from_now
-      #   1.year.to_f.from_now
-      #
-      # In such cases, Ruby's core 
-      # Date[http://stdlib.rubyonrails.org/libdoc/date/rdoc/index.html] and 
-      # Time[http://stdlib.rubyonrails.org/libdoc/time/rdoc/index.html] should be used for precision
-      # date and time arithmetic
-      module Time
-        def seconds
-          ActiveSupport::Duration.new(self, [[:seconds, self]])
-        end
-        alias :second :seconds
-
-        def minutes
-          ActiveSupport::Duration.new(self * 60, [[:seconds, self * 60]])
-        end
-        alias :minute :minutes  
-        
-        def hours
-          ActiveSupport::Duration.new(self * 3600, [[:seconds, self * 3600]])
-        end
-        alias :hour :hours
-        
-        def days
-          ActiveSupport::Duration.new(self * 24.hours, [[:days, self]])
-        end
-        alias :day :days
+class Numeric
+  # Enables the use of time calculations and declarations, like 45.minutes + 2.hours + 4.years.
+  #
+  # These methods use Time#advance for precise date calculations when using from_now, ago, etc. 
+  # as well as adding or subtracting their results from a Time object. For example:
+  #
+  #   # equivalent to Time.now.advance(:months =&gt; 1)
+  #   1.month.from_now
+  #
+  #   # equivalent to Time.now.advance(:years =&gt; 2)
+  #   2.years.from_now
+  #
+  #   # equivalent to Time.now.advance(:months =&gt; 4, :years =&gt; 5)
+  #   (4.months + 5.years).from_now
+  # 
+  # While these methods provide precise calculation when used as in the examples above, care
+  # should be taken to note that this is not true if the result of `months', `years', etc is
+  # converted before use:
+  #
+  #   # equivalent to 30.days.to_i.from_now
+  #   1.month.to_i.from_now
+  #
+  #   # equivalent to 365.25.days.to_f.from_now
+  #   1.year.to_f.from_now
+  #
+  # In such cases, Ruby's core 
+  # Date[http://stdlib.rubyonrails.org/libdoc/date/rdoc/index.html] and 
+  # Time[http://stdlib.rubyonrails.org/libdoc/time/rdoc/index.html] should be used for precision
+  # date and time arithmetic
+  def seconds
+    ActiveSupport::Duration.new(self, [[:seconds, self]])
+  end
+  alias :second :seconds
 
-        def weeks
-          ActiveSupport::Duration.new(self * 7.days, [[:days, self * 7]])
-        end
-        alias :week :weeks
-        
-        def fortnights
-          ActiveSupport::Duration.new(self * 2.weeks, [[:days, self * 14]])
-        end
-        alias :fortnight :fortnights
-        
-        # Reads best without arguments:  10.minutes.ago
-        def ago(time = ::Time.now)
-          time - self
-        end
+  def minutes
+    ActiveSupport::Duration.new(self * 60, [[:seconds, self * 60]])
+  end
+  alias :minute :minutes  
+  
+  def hours
+    ActiveSupport::Duration.new(self * 3600, [[:seconds, self * 3600]])
+  end
+  alias :hour :hours
+  
+  def days
+    ActiveSupport::Duration.new(self * 24.hours, [[:days, self]])
+  end
+  alias :day :days
 
-        # Reads best with argument:  10.minutes.until(time)
-        alias :until :ago
+  def weeks
+    ActiveSupport::Duration.new(self * 7.days, [[:days, self * 7]])
+  end
+  alias :week :weeks
+  
+  def fortnights
+    ActiveSupport::Duration.new(self * 2.weeks, [[:days, self * 14]])
+  end
+  alias :fortnight :fortnights
+  
+  # Reads best without arguments:  10.minutes.ago
+  def ago(time = ::Time.now)
+    time - self
+  end
 
-        # Reads best with argument:  10.minutes.since(time)
-        def since(time = ::Time.now)
-          time + self
-        end
+  # Reads best with argument:  10.minutes.until(time)
+  alias :until :ago
 
-        # Reads best without arguments:  10.minutes.from_now
-        alias :from_now :since
-      end
-    end
+  # Reads best with argument:  10.minutes.since(time)
+  def since(time = ::Time.now)
+    time + self
   end
+
+  # Reads best without arguments:  10.minutes.from_now
+  alias :from_now :since
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/numeric/time.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,7 @@
+require 'active_support/core_ext/object/blank'
+require 'active_support/core_ext/object/duplicable'
+require 'active_support/core_ext/object/try'
+
 require 'active_support/core_ext/object/conversions'
 require 'active_support/core_ext/object/extending'
 require 'active_support/core_ext/object/instance_variables'</diff>
      <filename>activesupport/lib/active_support/core_ext/object.rb</filename>
    </modified>
    <modified>
      <diff>@@ -77,14 +77,4 @@ class Object
   def with_options(options)
     yield ActiveSupport::OptionMerger.new(self, options)
   end
-  
-  # A duck-type assistant method. For example, Active Support extends Date
-  # to define an acts_like_date? method, and extends Time to define
-  # acts_like_time?. As a result, we can do &quot;x.acts_like?(:time)&quot; and
-  # &quot;x.acts_like?(:date)&quot; to do duck-type-safe comparisons, since classes that
-  # we want to act like Time simply need to define an acts_like_time? method.
-  def acts_like?(duck)
-    respond_to? &quot;acts_like_#{duck}?&quot;
-  end
-
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/object/misc.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,9 +3,9 @@ class Proc #:nodoc:
     block, time = self, Time.now
     (class &lt;&lt; object; self end).class_eval do
       method_name = &quot;__bind_#{time.to_i}_#{time.usec}&quot;
-      define_method(method_name, &amp;block)
-      method = instance_method(method_name)
-      remove_method(method_name)
+      define_method(method_name, &amp;block)     # define_method(&quot;__bind_1230458026_720454&quot;, &amp;block)
+      method = instance_method(method_name)  # method = instance_method(&quot;__bind_1230458026_720454&quot;)
+      remove_method(method_name)             # remove_method(&quot;__bind_1230458026_720454&quot;)
       method
     end.bind(object)
   end</diff>
      <filename>activesupport/lib/active_support/core_ext/proc.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,25 +1,23 @@
-if RUBY_VERSION &lt; &quot;1.9&quot;
-  module Process
-    def self.daemon(nochdir = nil, noclose = nil)
-      exit if fork                     # Parent exits, child continues.
-      Process.setsid                   # Become session leader.
-      exit if fork                     # Zap session leader. See [1].
+module Process
+  def self.daemon(nochdir = nil, noclose = nil)
+    exit if fork                     # Parent exits, child continues.
+    Process.setsid                   # Become session leader.
+    exit if fork                     # Zap session leader. See [1].
 
-      unless nochdir
-        Dir.chdir &quot;/&quot;                  # Release old working directory.
-      end
+    unless nochdir
+      Dir.chdir &quot;/&quot;                  # Release old working directory.
+    end
 
-      File.umask 0000                  # Ensure sensible umask. Adjust as needed.
+    File.umask 0000                  # Ensure sensible umask. Adjust as needed.
 
-      unless noclose
-        STDIN.reopen &quot;/dev/null&quot;       # Free file descriptors and
-        STDOUT.reopen &quot;/dev/null&quot;, &quot;a&quot; # point them somewhere sensible.
-        STDERR.reopen '/dev/null', 'a'
-      end
+    unless noclose
+      STDIN.reopen &quot;/dev/null&quot;       # Free file descriptors and
+      STDOUT.reopen &quot;/dev/null&quot;, &quot;a&quot; # point them somewhere sensible.
+      STDERR.reopen '/dev/null', 'a'
+    end
 
-      trap(&quot;TERM&quot;) { exit }
+    trap(&quot;TERM&quot;) { exit }
 
-      return 0
-    end
-  end
+    return 0
+  end unless respond_to?(:daemon)
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/process/daemon.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,4 @@
+require 'active_support/core_ext/range/blockless_step'
 require 'active_support/core_ext/range/conversions'
-require 'active_support/core_ext/range/overlaps'
 require 'active_support/core_ext/range/include_range'
-require 'active_support/core_ext/range/blockless_step'
-
-class Range #:nodoc:
-  include ActiveSupport::CoreExtensions::Range::Conversions
-  include ActiveSupport::CoreExtensions::Range::Overlaps
-  include ActiveSupport::CoreExtensions::Range::IncludeRange
-  include ActiveSupport::CoreExtensions::Range::BlocklessStep
-end
+require 'active_support/core_ext/range/overlaps'</diff>
      <filename>activesupport/lib/active_support/core_ext/range.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,32 +1,27 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Range #:nodoc:
-      # Return an array when step is called without a block.
-      module BlocklessStep
-        def self.included(base) #:nodoc:
-          base.alias_method_chain :step, :blockless
-        end
-
-        if RUBY_VERSION &lt; '1.9'
-          def step_with_blockless(value = 1, &amp;block)
-            if block_given?
-              step_without_blockless(value, &amp;block)
-            else
-              returning [] do |array|
-                step_without_blockless(value) { |step| array &lt;&lt; step }
-              end
-            end
-          end
-        else
-          def step_with_blockless(value = 1, &amp;block)
-            if block_given?
-              step_without_blockless(value, &amp;block)
-            else
-              step_without_blockless(value).to_a
-            end
-          end
-        end
+class Range
+  begin
+    (1..2).step
+  # Range#step doesn't return an Enumerator
+  rescue LocalJumpError
+    # Return an array when step is called without a block.
+    def step_with_blockless(*args, &amp;block)
+      if block_given?
+        step_without_blockless(*args, &amp;block)
+      else
+        array = []
+        step_without_blockless(*args) { |step| array &lt;&lt; step }
+        array
+      end
+    end
+  else
+    def step_with_blockless(*args, &amp;block) #:nodoc:
+      if block_given?
+        step_without_blockless(*args, &amp;block)
+      else
+        step_without_blockless(*args).to_a
       end
     end
   end
+
+  alias_method_chain :step, :blockless
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/range/blockless_step.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,27 +1,21 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Range #:nodoc:
-      # Getting ranges in different convenient string representations and other objects
-      module Conversions
-        RANGE_FORMATS = {
-          :db =&gt; Proc.new { |start, stop| &quot;BETWEEN '#{start.to_s(:db)}' AND '#{stop.to_s(:db)}'&quot; }
-        }
+class Range
+  RANGE_FORMATS = {
+    :db =&gt; Proc.new { |start, stop| &quot;BETWEEN '#{start.to_s(:db)}' AND '#{stop.to_s(:db)}'&quot; }
+  }
 
-        def self.included(base) #:nodoc:
-          base.class_eval do
-            alias_method :to_default_s, :to_s
-            alias_method :to_s, :to_formatted_s
-          end
-        end
-        # Gives a human readable format of the range.
-        #
-        # ==== Example
-        # 
-        #   [1..100].to_formatted_s # =&gt; &quot;1..100&quot;
-        def to_formatted_s(format = :default)
-          RANGE_FORMATS[format] ? RANGE_FORMATS[format].call(first, last) : to_default_s
-        end
-      end
+  # Gives a human readable format of the range.
+  #
+  # ==== Example
+  # 
+  #   [1..100].to_formatted_s # =&gt; &quot;1..100&quot;
+  def to_formatted_s(format = :default)
+    if formatter = RANGE_FORMATS[format]
+      formatter.call(first, last)
+    else
+      to_default_s
     end
   end
+
+  alias_method :to_default_s, :to_s
+  alias_method :to_s, :to_formatted_s
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/range/conversions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,30 +1,21 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Range #:nodoc:
-      # Check if a Range includes another Range.
-      module IncludeRange
-        def self.included(base) #:nodoc:
-          base.alias_method_chain :include?, :range
-        end
-
-        # Extends the default Range#include? to support range comparisons.
-        #  (1..5).include?(1..5) # =&gt; true
-        #  (1..5).include?(2..3) # =&gt; true
-        #  (1..5).include?(2..6) # =&gt; false
-        #
-        # The native Range#include? behavior is untouched.
-        #  (&quot;a&quot;..&quot;f&quot;).include?(&quot;c&quot;) # =&gt; true
-        #  (5..9).include?(11) # =&gt; false
-        def include_with_range?(value)
-          if value.is_a?(::Range)
-            operator = exclude_end? ? :&lt; : :&lt;=
-            end_value = value.exclude_end? ? last.succ : last
-            include?(value.first) &amp;&amp; (value.last &lt;=&gt; end_value).send(operator, 0)
-          else
-            include_without_range?(value)
-          end
-        end
-      end
+class Range
+  # Extends the default Range#include? to support range comparisons.
+  #  (1..5).include?(1..5) # =&gt; true
+  #  (1..5).include?(2..3) # =&gt; true
+  #  (1..5).include?(2..6) # =&gt; false
+  #
+  # The native Range#include? behavior is untouched.
+  #  (&quot;a&quot;..&quot;f&quot;).include?(&quot;c&quot;) # =&gt; true
+  #  (5..9).include?(11) # =&gt; false
+  def include_with_range?(value)
+    if value.is_a?(::Range)
+      operator = exclude_end? ? :&lt; : :&lt;=
+      end_value = value.exclude_end? ? last.succ : last
+      include_without_range?(value.first) &amp;&amp; (value.last &lt;=&gt; end_value).send(operator, 0)
+    else
+      include_without_range?(value)
     end
   end
+
+  alias_method_chain :include?, :range
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/range/include_range.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,15 +1,8 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Range #:nodoc:
-      # Check if Ranges overlap.
-      module Overlaps
-        # Compare two ranges and see if they overlap eachother
-        #  (1..5).overlaps?(4..6) # =&gt; true
-        #  (1..5).overlaps?(7..9) # =&gt; false
-        def overlaps?(other)
-          include?(other.first) || other.include?(first)
-        end
-      end
-    end
+class Range
+  # Compare two ranges and see if they overlap eachother
+  #  (1..5).overlaps?(4..6) # =&gt; true
+  #  (1..5).overlaps?(7..9) # =&gt; false
+  def overlaps?(other)
+    include?(other.first) || other.include?(first)
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/range/overlaps.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,12 +7,12 @@ require 'rexml/rexml'
 unless (defined?(REXML::VERSION) ? REXML::VERSION : REXML::Version) &gt; &quot;3.1.7.2&quot;
   require 'rexml/document'
 
-  # REXML in 1.8.7 has the patch but didn't update Version from 3.1.7.2.
+  # REXML in 1.8.7 has the patch but early patchlevels didn't update Version from 3.1.7.2.
   unless REXML::Document.respond_to?(:entity_expansion_limit=)
     require 'rexml/entity'
 
-    module REXML
-      class Entity &lt; Child
+    module REXML #:nodoc:
+      class Entity &lt; Child #:nodoc:
         undef_method :unnormalized
         def unnormalized
           document.record_entity_expansion! if document
@@ -22,7 +22,7 @@ unless (defined?(REXML::VERSION) ? REXML::VERSION : REXML::Version) &gt; &quot;3.1.7.2&quot;
           @unnormalized
         end
       end
-      class Document &lt; Element
+      class Document &lt; Element #:nodoc:
         @@entity_expansion_limit = 10_000
         def self.entity_expansion_limit= val
           @@entity_expansion_limit = val</diff>
      <filename>activesupport/lib/active_support/core_ext/rexml.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,22 +1,9 @@
-# encoding: utf-8
-
-require 'active_support/core_ext/string/inflections'
 require 'active_support/core_ext/string/conversions'
-require 'active_support/core_ext/string/access'
+require 'active_support/core_ext/string/filters'
+require 'active_support/core_ext/string/multibyte'
 require 'active_support/core_ext/string/starts_ends_with'
+require 'active_support/core_ext/string/inflections'
+require 'active_support/core_ext/string/access'
 require 'active_support/core_ext/string/iterators'
-require 'active_support/core_ext/string/multibyte'
 require 'active_support/core_ext/string/xchar'
-require 'active_support/core_ext/string/filters'
 require 'active_support/core_ext/string/behavior'
-
-class String #:nodoc:
-  include ActiveSupport::CoreExtensions::String::Access
-  include ActiveSupport::CoreExtensions::String::Conversions
-  include ActiveSupport::CoreExtensions::String::Filters
-  include ActiveSupport::CoreExtensions::String::Inflections
-  include ActiveSupport::CoreExtensions::String::StartsEndsWith
-  include ActiveSupport::CoreExtensions::String::Iterators
-  include ActiveSupport::CoreExtensions::String::Behavior
-  include ActiveSupport::CoreExtensions::String::Multibyte
-end</diff>
      <filename>activesupport/lib/active_support/core_ext/string.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,81 +1,96 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module String #:nodoc:
-      unless '1.9'.respond_to?(:force_encoding)
-        # Makes it easier to access parts of a string, such as specific characters and substrings.
-        module Access
-          # Returns the character at the +position+ treating the string as an array (where 0 is the first character).
-          #
-          # Examples: 
-          #   &quot;hello&quot;.at(0)  # =&gt; &quot;h&quot;
-          #   &quot;hello&quot;.at(4)  # =&gt; &quot;o&quot;
-          #   &quot;hello&quot;.at(10) # =&gt; nil
-          def at(position)
-            mb_chars[position, 1].to_s
-          end
-          
-          # Returns the remaining of the string from the +position+ treating the string as an array (where 0 is the first character).
-          #
-          # Examples: 
-          #   &quot;hello&quot;.from(0)  # =&gt; &quot;hello&quot;
-          #   &quot;hello&quot;.from(2)  # =&gt; &quot;llo&quot;
-          #   &quot;hello&quot;.from(10) # =&gt; nil
-          def from(position)
-            mb_chars[position..-1].to_s
-          end
-          
-          # Returns the beginning of the string up to the +position+ treating the string as an array (where 0 is the first character).
-          #
-          # Examples: 
-          #   &quot;hello&quot;.to(0)  # =&gt; &quot;h&quot;
-          #   &quot;hello&quot;.to(2)  # =&gt; &quot;hel&quot;
-          #   &quot;hello&quot;.to(10) # =&gt; &quot;hello&quot;
-          def to(position)
-            mb_chars[0..position].to_s
-          end
+class String
+  unless '1.9'.respond_to?(:force_encoding)
+    # Returns the character at the +position+ treating the string as an array (where 0 is the first character).
+    #
+    # Examples: 
+    #   &quot;hello&quot;.at(0)  # =&gt; &quot;h&quot;
+    #   &quot;hello&quot;.at(4)  # =&gt; &quot;o&quot;
+    #   &quot;hello&quot;.at(10) # =&gt; nil
+    def at(position)
+      mb_chars[position, 1].to_s
+    end
+    
+    # Returns the remaining of the string from the +position+ treating the string as an array (where 0 is the first character).
+    #
+    # Examples: 
+    #   &quot;hello&quot;.from(0)  # =&gt; &quot;hello&quot;
+    #   &quot;hello&quot;.from(2)  # =&gt; &quot;llo&quot;
+    #   &quot;hello&quot;.from(10) # =&gt; nil
+    def from(position)
+      mb_chars[position..-1].to_s
+    end
+    
+    # Returns the beginning of the string up to the +position+ treating the string as an array (where 0 is the first character).
+    #
+    # Examples: 
+    #   &quot;hello&quot;.to(0)  # =&gt; &quot;h&quot;
+    #   &quot;hello&quot;.to(2)  # =&gt; &quot;hel&quot;
+    #   &quot;hello&quot;.to(10) # =&gt; &quot;hello&quot;
+    def to(position)
+      mb_chars[0..position].to_s
+    end
+
+    # Returns the first character of the string or the first +limit+ characters.
+    #
+    # Examples: 
+    #   &quot;hello&quot;.first     # =&gt; &quot;h&quot;
+    #   &quot;hello&quot;.first(2)  # =&gt; &quot;he&quot;
+    #   &quot;hello&quot;.first(10) # =&gt; &quot;hello&quot;
+    def first(limit = 1)
+      if limit == 0
+        ''
+      elsif limit &gt;= size
+        self
+      else
+        mb_chars[0...limit].to_s
+      end
+    end
 
-          # Returns the first character of the string or the first +limit+ characters.
-          #
-          # Examples: 
-          #   &quot;hello&quot;.first     # =&gt; &quot;h&quot;
-          #   &quot;hello&quot;.first(2)  # =&gt; &quot;he&quot;
-          #   &quot;hello&quot;.first(10) # =&gt; &quot;hello&quot;
-          def first(limit = 1)
-            mb_chars[0..(limit - 1)].to_s
-          end
-          
-          # Returns the last character of the string or the last +limit+ characters.
-          #
-          # Examples: 
-          #   &quot;hello&quot;.last     # =&gt; &quot;o&quot;
-          #   &quot;hello&quot;.last(2)  # =&gt; &quot;lo&quot;
-          #   &quot;hello&quot;.last(10) # =&gt; &quot;hello&quot;
-          def last(limit = 1)
-            (mb_chars[(-limit)..-1] || self).to_s
-          end
-        end
+    # Returns the last character of the string or the last +limit+ characters.
+    #
+    # Examples: 
+    #   &quot;hello&quot;.last     # =&gt; &quot;o&quot;
+    #   &quot;hello&quot;.last(2)  # =&gt; &quot;lo&quot;
+    #   &quot;hello&quot;.last(10) # =&gt; &quot;hello&quot;
+    def last(limit = 1)
+      if limit == 0
+        ''
+      elsif limit &gt;= size
+        self
       else
-        module Access #:nodoc:
-          def at(position)
-            self[position]
-          end
+        mb_chars[(-limit)..-1].to_s
+      end
+    end
+  else
+    def at(position)
+      self[position]
+    end
 
-          def from(position)
-            self[position..-1]
-          end
+    def from(position)
+      self[position..-1]
+    end
 
-          def to(position)
-            self[0..position]
-          end
+    def to(position)
+      self[0..position]
+    end
 
-          def first(limit = 1)
-            self[0..(limit - 1)]
-          end
+    def first(limit = 1)
+      if limit == 0
+        ''
+      elsif limit &gt;= size
+        self
+      else
+        to(limit - 1)
+      end
+    end
 
-          def last(limit = 1)
-            from(-limit) || self
-          end
-        end
+    def last(limit = 1)
+      if limit == 0
+        ''
+      elsif limit &gt;= size
+        self
+      else
+        from(-limit)
       end
     end
   end</diff>
      <filename>activesupport/lib/active_support/core_ext/string/access.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,13 +1,7 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module String #:nodoc:
-      module Behavior
-        # Enable more predictable duck-typing on String-like classes. See
-        # Object#acts_like?.
-        def acts_like_string?
-          true
-        end
-      end
-    end
+class String
+  # Enable more predictable duck-typing on String-like classes. See
+  # Object#acts_like?.
+  def acts_like_string?
+    true
   end
-end
\ No newline at end of file
+end</diff>
      <filename>activesupport/lib/active_support/core_ext/string/behavior.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,28 +1,21 @@
 require 'date'
 
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module String #:nodoc:
-      # Converting strings to other objects
-      module Conversions
-        # 'a'.ord == 'a'[0] for Ruby 1.9 forward compatibility.
-        def ord
-          self[0]
-        end if RUBY_VERSION &lt; '1.9'
+class String
+  # 'a'.ord == 'a'[0] for Ruby 1.9 forward compatibility.
+  def ord
+    self[0]
+  end if RUBY_VERSION &lt; '1.9'
 
-        # Form can be either :utc (default) or :local.
-        def to_time(form = :utc)
-          ::Time.send(&quot;#{form}_time&quot;, *::Date._parse(self, false).values_at(:year, :mon, :mday, :hour, :min, :sec).map { |arg| arg || 0 })
-        end
+  # Form can be either :utc (default) or :local.
+  def to_time(form = :utc)
+    ::Time.send(&quot;#{form}_time&quot;, *::Date._parse(self, false).values_at(:year, :mon, :mday, :hour, :min, :sec).map { |arg| arg || 0 })
+  end
 
-        def to_date
-          ::Date.new(*::Date._parse(self, false).values_at(:year, :mon, :mday))
-        end
+  def to_date
+    ::Date.new(*::Date._parse(self, false).values_at(:year, :mon, :mday))
+  end
 
-        def to_datetime
-          ::DateTime.civil(*::Date._parse(self, false).values_at(:year, :mon, :mday, :hour, :min, :sec).map { |arg| arg || 0 })
-        end
-      end
-    end
+  def to_datetime
+    ::DateTime.civil(*::Date._parse(self, false).values_at(:year, :mon, :mday, :hour, :min, :sec).map { |arg| arg || 0 })
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/string/conversions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,26 +1,20 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module String #:nodoc:
-      module Filters
-        # Returns the string, first removing all whitespace on both ends of
-        # the string, and then changing remaining consecutive whitespace
-        # groups into one space each.
-        #
-        # Examples:
-        #   %{ Multi-line
-        #      string }.squish                   # =&gt; &quot;Multi-line string&quot;
-        #   &quot; foo   bar    \n   \t   boo&quot;.squish # =&gt; &quot;foo bar boo&quot;
-        def squish
-          dup.squish!
-        end
+class String
+  # Returns the string, first removing all whitespace on both ends of
+  # the string, and then changing remaining consecutive whitespace
+  # groups into one space each.
+  #
+  # Examples:
+  #   %{ Multi-line
+  #      string }.squish                   # =&gt; &quot;Multi-line string&quot;
+  #   &quot; foo   bar    \n   \t   boo&quot;.squish # =&gt; &quot;foo bar boo&quot;
+  def squish
+    dup.squish!
+  end
 
-        # Performs a destructive squish. See String#squish.
-        def squish!
-          strip!
-          gsub!(/\s+/, ' ')
-          self
-        end
-      end
-    end
+  # Performs a destructive squish. See String#squish.
+  def squish!
+    strip!
+    gsub!(/\s+/, ' ')
+    self
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/string/filters.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,167 +1,160 @@
-require 'active_support/inflector' unless defined?(ActiveSupport::Inflector)
+# String inflections define new methods on the String class to transform names for different purposes.
+# For instance, you can figure out the name of a database from the name of a class.
+#
+#   &quot;ScaleScore&quot;.tableize # =&gt; &quot;scale_scores&quot;
 
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module String #:nodoc:
-      # String inflections define new methods on the String class to transform names for different purposes.
-      # For instance, you can figure out the name of a database from the name of a class.
-      #
-      #   &quot;ScaleScore&quot;.tableize # =&gt; &quot;scale_scores&quot;
-      module Inflections
-        # Returns the plural form of the word in the string.
-        #
-        #   &quot;post&quot;.pluralize             # =&gt; &quot;posts&quot;
-        #   &quot;octopus&quot;.pluralize          # =&gt; &quot;octopi&quot;
-        #   &quot;sheep&quot;.pluralize            # =&gt; &quot;sheep&quot;
-        #   &quot;words&quot;.pluralize            # =&gt; &quot;words&quot;
-        #   &quot;the blue mailman&quot;.pluralize # =&gt; &quot;the blue mailmen&quot;
-        #   &quot;CamelOctopus&quot;.pluralize     # =&gt; &quot;CamelOctopi&quot;
-        def pluralize
-          Inflector.pluralize(self)
-        end
+class String
+  # Returns the plural form of the word in the string.
+  #
+  #   &quot;post&quot;.pluralize             # =&gt; &quot;posts&quot;
+  #   &quot;octopus&quot;.pluralize          # =&gt; &quot;octopi&quot;
+  #   &quot;sheep&quot;.pluralize            # =&gt; &quot;sheep&quot;
+  #   &quot;words&quot;.pluralize            # =&gt; &quot;words&quot;
+  #   &quot;the blue mailman&quot;.pluralize # =&gt; &quot;the blue mailmen&quot;
+  #   &quot;CamelOctopus&quot;.pluralize     # =&gt; &quot;CamelOctopi&quot;
+  def pluralize
+    ActiveSupport::Inflector.pluralize(self)
+  end
 
-        # The reverse of +pluralize+, returns the singular form of a word in a string.
-        #
-        #   &quot;posts&quot;.singularize            # =&gt; &quot;post&quot;
-        #   &quot;octopi&quot;.singularize           # =&gt; &quot;octopus&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
-          Inflector.singularize(self)
-        end
+  # The reverse of +pluralize+, returns the singular form of a word in a string.
+  #
+  #   &quot;posts&quot;.singularize            # =&gt; &quot;post&quot;
+  #   &quot;octopi&quot;.singularize           # =&gt; &quot;octopus&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
+    ActiveSupport::Inflector.singularize(self)
+  end
 
-        # By default, +camelize+ converts strings to UpperCamelCase. If the argument to camelize
-        # is set to &lt;tt&gt;:lower&lt;/tt&gt; then camelize produces lowerCamelCase.
-        #
-        # +camelize+ will also convert '/' to '::' which is useful for converting paths to namespaces.
-        #
-        #   &quot;active_record&quot;.camelize                # =&gt; &quot;ActiveRecord&quot;
-        #   &quot;active_record&quot;.camelize(:lower)        # =&gt; &quot;activeRecord&quot;
-        #   &quot;active_record/errors&quot;.camelize         # =&gt; &quot;ActiveRecord::Errors&quot;
-        #   &quot;active_record/errors&quot;.camelize(:lower) # =&gt; &quot;activeRecord::Errors&quot;
-        def camelize(first_letter = :upper)
-          case first_letter
-            when :upper then Inflector.camelize(self, true)
-            when :lower then Inflector.camelize(self, false)
-          end
-        end
-        alias_method :camelcase, :camelize
+  # By default, +camelize+ converts strings to UpperCamelCase. If the argument to camelize
+  # is set to &lt;tt&gt;:lower&lt;/tt&gt; then camelize produces lowerCamelCase.
+  #
+  # +camelize+ will also convert '/' to '::' which is useful for converting paths to namespaces.
+  #
+  #   &quot;active_record&quot;.camelize                # =&gt; &quot;ActiveRecord&quot;
+  #   &quot;active_record&quot;.camelize(:lower)        # =&gt; &quot;activeRecord&quot;
+  #   &quot;active_record/errors&quot;.camelize         # =&gt; &quot;ActiveRecord::Errors&quot;
+  #   &quot;active_record/errors&quot;.camelize(:lower) # =&gt; &quot;activeRecord::Errors&quot;
+  def camelize(first_letter = :upper)
+    case first_letter
+      when :upper then ActiveSupport::Inflector.camelize(self, true)
+      when :lower then ActiveSupport::Inflector.camelize(self, false)
+    end
+  end
+  alias_method :camelcase, :camelize
 
-        # Capitalizes all the words and replaces some characters in the string to create
-        # a nicer looking title. +titleize+ is meant for creating pretty output. It is not
-        # used in the Rails internals.
-        #
-        # +titleize+ is also aliased as +titlecase+.
-        #
-        #   &quot;man from the boondocks&quot;.titleize # =&gt; &quot;Man From The Boondocks&quot;
-        #   &quot;x-men: the last stand&quot;.titleize  # =&gt; &quot;X Men: The Last Stand&quot;
-        def titleize
-          Inflector.titleize(self)
-        end
-        alias_method :titlecase, :titleize
+  # Capitalizes all the words and replaces some characters in the string to create
+  # a nicer looking title. +titleize+ is meant for creating pretty output. It is not
+  # used in the Rails internals.
+  #
+  # +titleize+ is also aliased as +titlecase+.
+  #
+  #   &quot;man from the boondocks&quot;.titleize # =&gt; &quot;Man From The Boondocks&quot;
+  #   &quot;x-men: the last stand&quot;.titleize  # =&gt; &quot;X Men: The Last Stand&quot;
+  def titleize
+    ActiveSupport::Inflector.titleize(self)
+  end
+  alias_method :titlecase, :titleize
 
-        # The reverse of +camelize+. Makes an underscored, lowercase form from the expression in the string.
-        # 
-        # +underscore+ will also change '::' to '/' to convert namespaces to paths.
-        #
-        #   &quot;ActiveRecord&quot;.underscore         # =&gt; &quot;active_record&quot;
-        #   &quot;ActiveRecord::Errors&quot;.underscore # =&gt; active_record/errors
-        def underscore
-          Inflector.underscore(self)
-        end
+  # The reverse of +camelize+. Makes an underscored, lowercase form from the expression in the string.
+  # 
+  # +underscore+ will also change '::' to '/' to convert namespaces to paths.
+  #
+  #   &quot;ActiveRecord&quot;.underscore         # =&gt; &quot;active_record&quot;
+  #   &quot;ActiveRecord::Errors&quot;.underscore # =&gt; active_record/errors
+  def underscore
+    ActiveSupport::Inflector.underscore(self)
+  end
 
-        # Replaces underscores with dashes in the string.
-        #
-        #   &quot;puni_puni&quot; # =&gt; &quot;puni-puni&quot;
-        def dasherize
-          Inflector.dasherize(self)
-        end
+  # Replaces underscores with dashes in the string.
+  #
+  #   &quot;puni_puni&quot; # =&gt; &quot;puni-puni&quot;
+  def dasherize
+    ActiveSupport::Inflector.dasherize(self)
+  end
 
-        # Removes the module part from the constant expression in the string.
-        #
-        #   &quot;ActiveRecord::CoreExtensions::String::Inflections&quot;.demodulize # =&gt; &quot;Inflections&quot;
-        #   &quot;Inflections&quot;.demodulize                                       # =&gt; &quot;Inflections&quot;
-        def demodulize
-          Inflector.demodulize(self)
-        end
+  # Removes the module part from the constant expression in the string.
+  #
+  #   &quot;ActiveRecord::CoreExtensions::String::Inflections&quot;.demodulize # =&gt; &quot;Inflections&quot;
+  #   &quot;Inflections&quot;.demodulize                                       # =&gt; &quot;Inflections&quot;
+  def demodulize
+    ActiveSupport::Inflector.demodulize(self)
+  end
 
-        # Replaces special characters in a string so that it may be used as part of a 'pretty' URL.
-        # 
-        # ==== Examples
-        #
-        #   class Person
-        #     def to_param
-        #       &quot;#{id}-#{name.parameterize}&quot;
-        #     end
-        #   end
-        # 
-        #   @person = Person.find(1)
-        #   # =&gt; #&lt;Person id: 1, name: &quot;Donald E. Knuth&quot;&gt;
-        # 
-        #   &lt;%= link_to(@person.name, person_path %&gt;
-        #   # =&gt; &lt;a href=&quot;/person/1-donald-e-knuth&quot;&gt;Donald E. Knuth&lt;/a&gt;
-        def parameterize(sep = '-')
-          Inflector.parameterize(self, sep)
-        end
+  # Replaces special characters in a string so that it may be used as part of a 'pretty' URL.
+  # 
+  # ==== Examples
+  #
+  #   class Person
+  #     def to_param
+  #       &quot;#{id}-#{name.parameterize}&quot;
+  #     end
+  #   end
+  # 
+  #   @person = Person.find(1)
+  #   # =&gt; #&lt;Person id: 1, name: &quot;Donald E. Knuth&quot;&gt;
+  # 
+  #   &lt;%= link_to(@person.name, person_path %&gt;
+  #   # =&gt; &lt;a href=&quot;/person/1-donald-e-knuth&quot;&gt;Donald E. Knuth&lt;/a&gt;
+  def parameterize(sep = '-')
+    ActiveSupport::Inflector.parameterize(self, sep)
+  end
 
-        # Creates the name of a table like Rails does for models to table names. This method
-        # uses the +pluralize+ method on the last word in the string.
-        #
-        #   &quot;RawScaledScorer&quot;.tableize # =&gt; &quot;raw_scaled_scorers&quot;
-        #   &quot;egg_and_ham&quot;.tableize     # =&gt; &quot;egg_and_hams&quot;
-        #   &quot;fancyCategory&quot;.tableize   # =&gt; &quot;fancy_categories&quot;
-        def tableize
-          Inflector.tableize(self)
-        end
+  # Creates the name of a table like Rails does for models to table names. This method
+  # uses the +pluralize+ method on the last word in the string.
+  #
+  #   &quot;RawScaledScorer&quot;.tableize # =&gt; &quot;raw_scaled_scorers&quot;
+  #   &quot;egg_and_ham&quot;.tableize     # =&gt; &quot;egg_and_hams&quot;
+  #   &quot;fancyCategory&quot;.tableize   # =&gt; &quot;fancy_categories&quot;
+  def tableize
+    ActiveSupport::Inflector.tableize(self)
+  end
 
-        # Create a class name from a plural table name like Rails does for table names to models.
-        # Note that this returns a string and not a class. (To convert to an actual class
-        # follow +classify+ with +constantize+.)
-        #
-        #   &quot;egg_and_hams&quot;.classify # =&gt; &quot;EggAndHam&quot;
-        #   &quot;posts&quot;.classify        # =&gt; &quot;Post&quot;
-        #
-        # Singular names are not handled correctly.
-        #
-        #   &quot;business&quot;.classify # =&gt; &quot;Busines&quot;
-        def classify
-          Inflector.classify(self)
-        end
-        
-        # Capitalizes the first word, turns underscores into spaces, and strips '_id'.
-        # Like +titleize+, this is meant for creating pretty output.
-        #
-        #   &quot;employee_salary&quot; # =&gt; &quot;Employee salary&quot; 
-        #   &quot;author_id&quot;       # =&gt; &quot;Author&quot;
-        def humanize
-          Inflector.humanize(self)
-        end
+  # Create a class name from a plural table name like Rails does for table names to models.
+  # Note that this returns a string and not a class. (To convert to an actual class
+  # follow +classify+ with +constantize+.)
+  #
+  #   &quot;egg_and_hams&quot;.classify # =&gt; &quot;EggAndHam&quot;
+  #   &quot;posts&quot;.classify        # =&gt; &quot;Post&quot;
+  #
+  # Singular names are not handled correctly.
+  #
+  #   &quot;business&quot;.classify # =&gt; &quot;Busines&quot;
+  def classify
+    ActiveSupport::Inflector.classify(self)
+  end
+  
+  # Capitalizes the first word, turns underscores into spaces, and strips '_id'.
+  # Like +titleize+, this is meant for creating pretty output.
+  #
+  #   &quot;employee_salary&quot; # =&gt; &quot;Employee salary&quot; 
+  #   &quot;author_id&quot;       # =&gt; &quot;Author&quot;
+  def humanize
+    ActiveSupport::Inflector.humanize(self)
+  end
 
-        # Creates a foreign key name from a class name.
-        # +separate_class_name_and_id_with_underscore+ sets whether
-        # the method should put '_' between the name and 'id'.
-        #
-        # Examples
-        #   &quot;Message&quot;.foreign_key        # =&gt; &quot;message_id&quot;
-        #   &quot;Message&quot;.foreign_key(false) # =&gt; &quot;messageid&quot;
-        #   &quot;Admin::Post&quot;.foreign_key    # =&gt; &quot;post_id&quot;
-        def foreign_key(separate_class_name_and_id_with_underscore = true)
-          Inflector.foreign_key(self, separate_class_name_and_id_with_underscore)
-        end
+  # Creates a foreign key name from a class name.
+  # +separate_class_name_and_id_with_underscore+ sets whether
+  # the method should put '_' between the name and 'id'.
+  #
+  # Examples
+  #   &quot;Message&quot;.foreign_key        # =&gt; &quot;message_id&quot;
+  #   &quot;Message&quot;.foreign_key(false) # =&gt; &quot;messageid&quot;
+  #   &quot;Admin::Post&quot;.foreign_key    # =&gt; &quot;post_id&quot;
+  def foreign_key(separate_class_name_and_id_with_underscore = true)
+    ActiveSupport::Inflector.foreign_key(self, separate_class_name_and_id_with_underscore)
+  end
 
-        # +constantize+ tries to find a declared constant with the name specified
-        # in the string. It raises a NameError when the name is not in CamelCase
-        # or is not initialized.
-        #
-        # Examples
-        #   &quot;Module&quot;.constantize # =&gt; Module
-        #   &quot;Class&quot;.constantize  # =&gt; Class
-        def constantize
-          Inflector.constantize(self)
-        end
-      end
-    end
+  # +constantize+ tries to find a declared constant with the name specified
+  # in the string. It raises a NameError when the name is not in CamelCase
+  # or is not initialized.
+  #
+  # Examples
+  #   &quot;Module&quot;.constantize # =&gt; Module
+  #   &quot;Class&quot;.constantize  # =&gt; Class
+  def constantize
+    ActiveSupport::Inflector.constantize(self)
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/string/inflections.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,22 +1,13 @@
-require 'strscan'
+unless '1.9'.respond_to?(:each_char)
+  autoload :StringScanner, 'strscan' unless defined? :StringScanner
 
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module String #:nodoc:
-      # Custom string iterators
-      module Iterators
-        def self.append_features(base)
-          super unless '1.9'.respond_to?(:each_char)
-        end
-
-        # Yields a single-character string for each character in the string.
-        # When $KCODE = 'UTF8', multi-byte characters are yielded appropriately.
-        def each_char
-          scanner, char = StringScanner.new(self), /./mu
-          while c = scanner.scan(char)
-            yield c
-          end
-        end
+  class String
+    # Yields a single-character string for each character in the string.
+    # When $KCODE = 'UTF8', multi-byte characters are yielded appropriately.
+    def each_char
+      scanner, char = StringScanner.new(self), /./mu
+      while c = scanner.scan(char)
+        yield c
       end
     end
   end</diff>
      <filename>activesupport/lib/active_support/core_ext/string/iterators.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,80 +1,73 @@
 # encoding: utf-8
 
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module String #:nodoc:
-      # Implements multibyte methods for easier access to multibyte characters in a String instance.
-      module Multibyte
-        unless '1.9'.respond_to?(:force_encoding)
-          # == Multibyte proxy
-          #
-          # +mb_chars+ is a multibyte safe proxy for string methods.
-          #
-          # In Ruby 1.8 and older it creates and returns an instance of the ActiveSupport::Multibyte::Chars class which
-          # encapsulates the original string. A Unicode safe version of all the String methods are defined on this proxy
-          # class. If the proxy class doesn't respond to a certain method, it's forwarded to the encapsuled string.
-          #
-          #   name = 'Claus M&#252;ller'
-          #   name.reverse  #=&gt; &quot;rell??M sualC&quot;
-          #   name.length   #=&gt; 13
-          #
-          #   name.mb_chars.reverse.to_s   #=&gt; &quot;rell&#252;M sualC&quot;
-          #   name.mb_chars.length         #=&gt; 12
-          #
-          # In Ruby 1.9 and newer +mb_chars+ returns +self+ because String is (mostly) encoding aware. This means that
-          # it becomes easy to run one version of your code on multiple Ruby versions.
-          #
-          # == Method chaining
-          #
-          # All the methods on the Chars proxy which normally return a string will return a Chars object. This allows
-          # method chaining on the result of any of these methods.
-          #
-          #   name.mb_chars.reverse.length #=&gt; 12
-          #
-          # == Interoperability and configuration
-          #
-          # The Chars object tries to be as interchangeable with String objects as possible: sorting and comparing between
-          # String and Char work like expected. The bang! methods change the internal string representation in the Chars
-          # object. Interoperability problems can be resolved easily with a +to_s+ call.
-          #
-          # For more information about the methods defined on the Chars proxy see ActiveSupport::Multibyte::Chars. For
-          # information about how to change the default Multibyte behaviour see ActiveSupport::Multibyte.
-          def mb_chars
-            if ActiveSupport::Multibyte.proxy_class.wants?(self)
-              ActiveSupport::Multibyte.proxy_class.new(self)
-            else
-              self
-            end
-          end
-          
-          # Returns true if the string has UTF-8 semantics (a String used for purely byte resources is unlikely to have
-          # them), returns false otherwise.
-          def is_utf8?
-            ActiveSupport::Multibyte::Chars.consumes?(self)
-          end
+class String
+  unless '1.9'.respond_to?(:force_encoding)
+    # == Multibyte proxy
+    #
+    # +mb_chars+ is a multibyte safe proxy for string methods.
+    #
+    # In Ruby 1.8 and older it creates and returns an instance of the ActiveSupport::Multibyte::Chars class which
+    # encapsulates the original string. A Unicode safe version of all the String methods are defined on this proxy
+    # class. If the proxy class doesn't respond to a certain method, it's forwarded to the encapsuled string.
+    #
+    #   name = 'Claus M&#252;ller'
+    #   name.reverse  #=&gt; &quot;rell??M sualC&quot;
+    #   name.length   #=&gt; 13
+    #
+    #   name.mb_chars.reverse.to_s   #=&gt; &quot;rell&#252;M sualC&quot;
+    #   name.mb_chars.length         #=&gt; 12
+    #
+    # In Ruby 1.9 and newer +mb_chars+ returns +self+ because String is (mostly) encoding aware. This means that
+    # it becomes easy to run one version of your code on multiple Ruby versions.
+    #
+    # == Method chaining
+    #
+    # All the methods on the Chars proxy which normally return a string will return a Chars object. This allows
+    # method chaining on the result of any of these methods.
+    #
+    #   name.mb_chars.reverse.length #=&gt; 12
+    #
+    # == Interoperability and configuration
+    #
+    # The Chars object tries to be as interchangeable with String objects as possible: sorting and comparing between
+    # String and Char work like expected. The bang! methods change the internal string representation in the Chars
+    # object. Interoperability problems can be resolved easily with a +to_s+ call.
+    #
+    # For more information about the methods defined on the Chars proxy see ActiveSupport::Multibyte::Chars. For
+    # information about how to change the default Multibyte behaviour see ActiveSupport::Multibyte.
+    def mb_chars
+      if ActiveSupport::Multibyte.proxy_class.wants?(self)
+        ActiveSupport::Multibyte.proxy_class.new(self)
+      else
+        self
+      end
+    end
+    
+    # Returns true if the string has UTF-8 semantics (a String used for purely byte resources is unlikely to have
+    # them), returns false otherwise.
+    def is_utf8?
+      ActiveSupport::Multibyte::Chars.consumes?(self)
+    end
 
-          unless '1.8.7 and later'.respond_to?(:chars)
-            def chars
-              ActiveSupport::Deprecation.warn('String#chars has been deprecated in favor of String#mb_chars.', caller)
-              mb_chars
-            end
-          end
-        else
-          def mb_chars #:nodoc
-            self
-          end
-          
-          def is_utf8? #:nodoc
-            case encoding
-            when Encoding::UTF_8
-              valid_encoding?
-            when Encoding::ASCII_8BIT, Encoding::US_ASCII
-              dup.force_encoding(Encoding::UTF_8).valid_encoding?
-            else
-              false
-            end
-          end
-        end
+    unless '1.8.7 and later'.respond_to?(:chars)
+      def chars
+        ActiveSupport::Deprecation.warn('String#chars has been deprecated in favor of String#mb_chars.', caller)
+        mb_chars
+      end
+    end
+  else
+    def mb_chars #:nodoc
+      self
+    end
+    
+    def is_utf8? #:nodoc
+      case encoding
+      when Encoding::UTF_8
+        valid_encoding?
+      when Encoding::ASCII_8BIT, Encoding::US_ASCII
+        dup.force_encoding(Encoding::UTF_8).valid_encoding?
+      else
+        false
       end
     end
   end</diff>
      <filename>activesupport/lib/active_support/core_ext/string/multibyte.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,35 +1,18 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module String #:nodoc:
-      # Additional string tests.
-      module StartsEndsWith
-        def self.append_features(base)
-          if '1.8.7 and up'.respond_to?(:start_with?)
-            base.class_eval do
-              alias_method :starts_with?, :start_with?
-              alias_method :ends_with?, :end_with?
-            end
-          else
-            super
-            base.class_eval do
-              alias_method :start_with?, :starts_with?
-              alias_method :end_with?, :ends_with?
-            end
-          end
-        end
-
-        # Does the string start with the specified +prefix+?
-        def starts_with?(prefix)
-          prefix = prefix.to_s
-          self[0, prefix.length] == prefix
-        end
+class String
+  unless '1.8.7 and up'.respond_to?(:start_with?)
+    # Does the string start with the specified +prefix+?
+    def start_with?(prefix)
+      prefix = prefix.to_s
+      self[0, prefix.length] == prefix
+    end
 
-        # Does the string end with the specified +suffix+?
-        def ends_with?(suffix)
-          suffix = suffix.to_s
-          self[-suffix.length, suffix.length] == suffix      
-        end
-      end
+    # Does the string end with the specified +suffix+?
+    def end_with?(suffix)
+      suffix = suffix.to_s
+      self[-suffix.length, suffix.length] == suffix
     end
   end
+
+  alias_method :starts_with?, :start_with?
+  alias_method :ends_with?, :end_with?
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/string/starts_ends_with.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,18 @@
 begin
-  # See http://bogomips.org/fast_xs/ by Eric Wong
+  # See http://bogomips.org/fast_xs/ by Eric Wong.
+  # Also included with hpricot.
   require 'fast_xs'
+rescue LoadError
+  # fast_xs extension unavailable
+else
+  begin
+    require 'builder'
+  rescue LoadError
+    # builder demands the first shot at defining String#to_xs
+  end
 
   class String
     alias_method :original_xs, :to_xs if method_defined?(:to_xs)
     alias_method :to_xs, :fast_xs
   end
-rescue LoadError
-  # fast_xs extension unavailable.
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/string/xchar.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,14 @@
-unless :to_proc.respond_to?(:to_proc)
-  class Symbol
-    # Turns the symbol into a simple proc, which is especially useful for enumerations. Examples:
-    #
-    #   # The same as people.collect { |p| p.name }
-    #   people.collect(&amp;:name)
-    #
-    #   # The same as people.select { |p| p.manager? }.collect { |p| p.salary }
-    #   people.select(&amp;:manager?).collect(&amp;:salary)
-    def to_proc
-      Proc.new { |*args| args.shift.__send__(self, *args) }
-    end
-  end
+class Symbol
+  # Turns the symbol into a simple proc, which is especially useful for enumerations. Examples:
+  #
+  #   # The same as people.collect { |p| p.name }
+  #   people.collect(&amp;:name)
+  #
+  #   # The same as people.select { |p| p.manager? }.collect { |p| p.salary }
+  #   people.select(&amp;:manager?).collect(&amp;:salary)
+  #
+  # This is a builtin method in Ruby 1.8.7 and later.
+  def to_proc
+    Proc.new { |*args| args.shift.__send__(self, *args) }
+  end unless :to_proc.respond_to?(:to_proc)
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/symbol.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,42 +1,10 @@
 require 'date'
 require 'time'
 
-class Time
-  # Ruby 1.8-cvs and 1.9 define private Time#to_date
-  %w(to_date to_datetime).each do |method|
-    public method if private_instance_methods.include?(method)
-  end
+require 'active_support/core_ext/time/publicize_conversion_methods'
+require 'active_support/core_ext/time/marshal_with_utc_flag'
 
-  # Pre-1.9 versions of Ruby have a bug with marshaling Time instances, where utc instances are
-  # unmarshaled in the local zone, instead of utc. We're layering behavior on the _dump and _load
-  # methods so that utc instances can be flagged on dump, and coerced back to utc on load.
-  if RUBY_VERSION &lt; '1.9'
-    class &lt;&lt; self
-      alias_method :_original_load, :_load
-      def _load(marshaled_time)
-        time = _original_load(marshaled_time)
-        utc = time.instance_variable_get('@marshal_with_utc_coercion')
-        utc ? time.utc : time
-      end
-    end
-    
-    alias_method :_original_dump, :_dump
-    def _dump(*args)
-      obj = self.frozen? ? self.dup : self
-      obj.instance_variable_set('@marshal_with_utc_coercion', utc?)
-      obj._original_dump(*args)
-    end
-  end
-end
-
-require 'active_support/core_ext/time/behavior'
+require 'active_support/core_ext/time/acts_like'
 require 'active_support/core_ext/time/calculations'
 require 'active_support/core_ext/time/conversions'
 require 'active_support/core_ext/time/zones'
-
-class Time#:nodoc:
-  include ActiveSupport::CoreExtensions::Time::Behavior
-  include ActiveSupport::CoreExtensions::Time::Calculations
-  include ActiveSupport::CoreExtensions::Time::Conversions
-  include ActiveSupport::CoreExtensions::Time::Zones
-end</diff>
      <filename>activesupport/lib/active_support/core_ext/time.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,303 +1,279 @@
 require 'active_support/duration'
+require 'active_support/core_ext/date/calculations'
 
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Time #:nodoc:
-      # Enables the use of time calculations within Time itself
-      module Calculations
-        def self.included(base) #:nodoc:
-          base.extend ClassMethods
-
-          base.class_eval do
-            alias_method :plus_without_duration, :+
-            alias_method :+, :plus_with_duration
-
-            alias_method :minus_without_duration, :-
-            alias_method :-, :minus_with_duration
-
-            alias_method :minus_without_coercion, :-
-            alias_method :-, :minus_with_coercion
-
-            alias_method :compare_without_coercion, :&lt;=&gt;
-            alias_method :&lt;=&gt;, :compare_with_coercion
-          end
-        end
-
-        COMMON_YEAR_DAYS_IN_MONTH = [nil, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
-
-        module ClassMethods
-          # Overriding case equality method so that it returns true for ActiveSupport::TimeWithZone instances
-          def ===(other)
-            other.is_a?(::Time)
-          end
-
-          # Return the number of days in the given month.
-          # If no year is specified, it will use the current year.
-          def days_in_month(month, year = now.year)
-            return 29 if month == 2 &amp;&amp; ::Date.gregorian_leap?(year)
-            COMMON_YEAR_DAYS_IN_MONTH[month]
-          end
-
-          # Returns a new Time if requested year can be accommodated by Ruby's Time class
-          # (i.e., if year is within either 1970..2038 or 1902..2038, depending on system architecture);
-          # otherwise returns a DateTime
-          def time_with_datetime_fallback(utc_or_local, year, month=1, day=1, hour=0, min=0, sec=0, usec=0)
-            ::Time.send(utc_or_local, year, month, day, hour, min, sec, usec)
-          rescue
-            offset = utc_or_local.to_sym == :local ? ::DateTime.local_offset : 0
-            ::DateTime.civil(year, month, day, hour, min, sec, offset)
-          end
-
-          # Wraps class method +time_with_datetime_fallback+ with +utc_or_local+ set to &lt;tt&gt;:utc&lt;/tt&gt;.
-          def utc_time(*args)
-            time_with_datetime_fallback(:utc, *args)
-          end
-
-          # Wraps class method +time_with_datetime_fallback+ with +utc_or_local+ set to &lt;tt&gt;:local&lt;/tt&gt;.
-          def local_time(*args)
-            time_with_datetime_fallback(:local, *args)
-          end
-        end
-
-        # Tells whether the Time object's time lies in the past
-        def past?
-          self &lt; ::Time.current
-        end
-
-        # Tells whether the Time object's time is today
-        def today?
-          self.to_date == ::Date.current
-        end
-
-        # Tells whether the Time object's time lies in the future
-        def future?
-          self &gt; ::Time.current
-        end
-
-        # Seconds since midnight: Time.now.seconds_since_midnight
-        def seconds_since_midnight
-          self.to_i - self.change(:hour =&gt; 0).to_i + (self.usec/1.0e+6)
-        end
-
-        # Returns a new Time where one or more of the elements have been changed according to the +options+ parameter. The time options
-        # (hour, minute, sec, usec) reset cascadingly, so if only the hour is passed, then minute, sec, and usec is set to 0. If the hour and
-        # minute is passed, then sec and usec is set to 0.
-        def change(options)
-          ::Time.send(
-            self.utc? ? :utc_time : :local_time,
-            options[:year]  || self.year,
-            options[:month] || self.month,
-            options[:day]   || self.day,
-            options[:hour]  || self.hour,
-            options[:min]   || (options[:hour] ? 0 : self.min),
-            options[:sec]   || ((options[:hour] || options[:min]) ? 0 : self.sec),
-            options[:usec]  || ((options[:hour] || options[:min] || options[:sec]) ? 0 : self.usec)
-          )
-        end
-
-        # Uses Date to provide precise Time calculations for years, months, and days.
-        # The +options+ parameter takes a hash with any of these keys: &lt;tt&gt;:years&lt;/tt&gt;,
-        # &lt;tt&gt;:months&lt;/tt&gt;, &lt;tt&gt;:weeks&lt;/tt&gt;, &lt;tt&gt;:days&lt;/tt&gt;, &lt;tt&gt;:hours&lt;/tt&gt;,
-        # &lt;tt&gt;:minutes&lt;/tt&gt;, &lt;tt&gt;:seconds&lt;/tt&gt;.
-        def advance(options)
-          unless options[:weeks].nil?
-            options[:weeks], partial_weeks = options[:weeks].divmod(1)
-            options[:days] = (options[:days] || 0) + 7 * partial_weeks
-          end
-          
-          unless options[:days].nil?
-            options[:days], partial_days = options[:days].divmod(1)
-            options[:hours] = (options[:hours] || 0) + 24 * partial_days
-          end
-          
-          d = to_date.advance(options)
-          time_advanced_by_date = change(:year =&gt; d.year, :month =&gt; d.month, :day =&gt; d.day)
-          seconds_to_advance = (options[:seconds] || 0) + (options[:minutes] || 0) * 60 + (options[:hours] || 0) * 3600
-          seconds_to_advance == 0 ? time_advanced_by_date : time_advanced_by_date.since(seconds_to_advance)
-        end
-
-        # Returns a new Time representing the time a number of seconds ago, this is basically a wrapper around the Numeric extension
-        def ago(seconds)
-          self.since(-seconds)
-        end
-
-        # Returns a new Time representing the time a number of seconds since the instance time, this is basically a wrapper around
-        # the Numeric extension.
-        def since(seconds)
-          f = seconds.since(self)
-          if ActiveSupport::Duration === seconds
-            f
-          else
-            initial_dst = self.dst? ? 1 : 0
-            final_dst   = f.dst? ? 1 : 0
-            (seconds.abs &gt;= 86400 &amp;&amp; initial_dst != final_dst) ? f + (initial_dst - final_dst).hours : f
-          end
-        rescue
-          self.to_datetime.since(seconds)
-        end
-        alias :in :since
-
-        # Returns a new Time representing the time a number of specified months ago
-        def months_ago(months)
-          advance(:months =&gt; -months)
-        end
-
-        # Returns a new Time representing the time a number of specified months in the future
-        def months_since(months)
-          advance(:months =&gt; months)
-        end
-
-        # Returns a new Time representing the time a number of specified years ago
-        def years_ago(years)
-          advance(:years =&gt; -years)
-        end
-
-        # Returns a new Time representing the time a number of specified years in the future
-        def years_since(years)
-          advance(:years =&gt; years)
-        end
-
-        # Short-hand for years_ago(1)
-        def last_year
-          years_ago(1)
-        end
-
-        # Short-hand for years_since(1)
-        def next_year
-          years_since(1)
-        end
-
-
-        # Short-hand for months_ago(1)
-        def last_month
-          months_ago(1)
-        end
-
-        # Short-hand for months_since(1)
-        def next_month
-          months_since(1)
-        end
-
-        # Returns a new Time representing the &quot;start&quot; of this week (Monday, 0:00)
-        def beginning_of_week
-          days_to_monday = self.wday!=0 ? self.wday-1 : 6
-          (self - days_to_monday.days).midnight
-        end
-        alias :monday :beginning_of_week
-        alias :at_beginning_of_week :beginning_of_week
-
-        # Returns a new Time representing the end of this week (Sunday, 23:59:59)
-        def end_of_week
-          days_to_sunday = self.wday!=0 ? 7-self.wday : 0
-          (self + days_to_sunday.days).end_of_day
-        end
-        alias :at_end_of_week :end_of_week
-
-        # Returns a new Time representing the start of the given day in next week (default is Monday).
-        def next_week(day = :monday)
-          days_into_week = { :monday =&gt; 0, :tuesday =&gt; 1, :wednesday =&gt; 2, :thursday =&gt; 3, :friday =&gt; 4, :saturday =&gt; 5, :sunday =&gt; 6}
-          since(1.week).beginning_of_week.since(days_into_week[day].day).change(:hour =&gt; 0)
-        end
-
-        # Returns a new Time representing the start of the day (0:00)
-        def beginning_of_day
-          (self - self.seconds_since_midnight).change(:usec =&gt; 0)
-        end
-        alias :midnight :beginning_of_day
-        alias :at_midnight :beginning_of_day
-        alias :at_beginning_of_day :beginning_of_day
-
-        # Returns a new Time representing the end of the day (23:59:59)
-        def end_of_day
-          change(:hour =&gt; 23, :min =&gt; 59, :sec =&gt; 59)
-        end
-
-        # Returns a new Time representing the start of the month (1st of the month, 0:00)
-        def beginning_of_month
-          #self - ((self.mday-1).days + self.seconds_since_midnight)
-          change(:day =&gt; 1,:hour =&gt; 0, :min =&gt; 0, :sec =&gt; 0, :usec =&gt; 0)
-        end
-        alias :at_beginning_of_month :beginning_of_month
-
-        # Returns a new Time representing the end of the month (last day of the month, 0:00)
-        def end_of_month
-          #self - ((self.mday-1).days + self.seconds_since_midnight)
-          last_day = ::Time.days_in_month( self.month, self.year )
-          change(:day =&gt; last_day, :hour =&gt; 23, :min =&gt; 59, :sec =&gt; 59, :usec =&gt; 0)
-        end
-        alias :at_end_of_month :end_of_month
-
-        # Returns  a new Time representing the start of the quarter (1st of january, april, july, october, 0:00)
-        def beginning_of_quarter
-          beginning_of_month.change(:month =&gt; [10, 7, 4, 1].detect { |m| m &lt;= self.month })
-        end
-        alias :at_beginning_of_quarter :beginning_of_quarter
-
-        # Returns a new Time representing the end of the quarter (last day of march, june, september, december, 23:59:59)
-        def end_of_quarter
-          beginning_of_month.change(:month =&gt; [3, 6, 9, 12].detect { |m| m &gt;= self.month }).end_of_month
-        end
-        alias :at_end_of_quarter :end_of_quarter
-
-        # Returns  a new Time representing the start of the year (1st of january, 0:00)
-        def beginning_of_year
-          change(:month =&gt; 1,:day =&gt; 1,:hour =&gt; 0, :min =&gt; 0, :sec =&gt; 0, :usec =&gt; 0)
-        end
-        alias :at_beginning_of_year :beginning_of_year
-
-        # Returns a new Time representing the end of the year (31st of december, 23:59:59)
-        def end_of_year
-          change(:month =&gt; 12,:day =&gt; 31,:hour =&gt; 23, :min =&gt; 59, :sec =&gt; 59)
-        end
-        alias :at_end_of_year :end_of_year
-
-        # Convenience method which returns a new Time representing the time 1 day ago
-        def yesterday
-          advance(:days =&gt; -1)
-        end
-
-        # Convenience method which returns a new Time representing the time 1 day since the instance time
-        def tomorrow
-          advance(:days =&gt; 1)
-        end
-
-        def plus_with_duration(other) #:nodoc:
-          if ActiveSupport::Duration === other
-            other.since(self)
-          else
-            plus_without_duration(other)
-          end
-        end
-
-        def minus_with_duration(other) #:nodoc:
-          if ActiveSupport::Duration === other
-            other.until(self)
-          else
-            minus_without_duration(other)
-          end
-        end
-
-        # Time#- can also be used to determine the number of seconds between two Time instances.
-        # We're layering on additional behavior so that ActiveSupport::TimeWithZone instances
-        # are coerced into values that Time#- will recognize
-        def minus_with_coercion(other)
-          other = other.comparable_time if other.respond_to?(:comparable_time)
-          minus_without_coercion(other)
-        end
-
-        # 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; 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;
-            to_datetime.compare_without_coercion(other)
-          else
-            compare_without_coercion(other)
-          end
-        end
-      end
+class Time
+  COMMON_YEAR_DAYS_IN_MONTH = [nil, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
+  DAYS_INTO_WEEK = { :monday =&gt; 0, :tuesday =&gt; 1, :wednesday =&gt; 2, :thursday =&gt; 3, :friday =&gt; 4, :saturday =&gt; 5, :sunday =&gt; 6 }
+
+  class &lt;&lt; self
+    # Overriding case equality method so that it returns true for ActiveSupport::TimeWithZone instances
+    def ===(other)
+      other.is_a?(::Time)
+    end
+
+    # Return the number of days in the given month.
+    # If no year is specified, it will use the current year.
+    def days_in_month(month, year = now.year)
+      return 29 if month == 2 &amp;&amp; ::Date.gregorian_leap?(year)
+      COMMON_YEAR_DAYS_IN_MONTH[month]
+    end
+
+    # Returns a new Time if requested year can be accommodated by Ruby's Time class
+    # (i.e., if year is within either 1970..2038 or 1902..2038, depending on system architecture);
+    # otherwise returns a DateTime
+    def time_with_datetime_fallback(utc_or_local, year, month=1, day=1, hour=0, min=0, sec=0, usec=0)
+      ::Time.send(utc_or_local, year, month, day, hour, min, sec, usec)
+    rescue
+      offset = utc_or_local.to_sym == :local ? ::DateTime.local_offset : 0
+      ::DateTime.civil(year, month, day, hour, min, sec, offset)
+    end
+
+    # Wraps class method +time_with_datetime_fallback+ with +utc_or_local+ set to &lt;tt&gt;:utc&lt;/tt&gt;.
+    def utc_time(*args)
+      time_with_datetime_fallback(:utc, *args)
+    end
+
+    # Wraps class method +time_with_datetime_fallback+ with +utc_or_local+ set to &lt;tt&gt;:local&lt;/tt&gt;.
+    def local_time(*args)
+      time_with_datetime_fallback(:local, *args)
+    end
+  end
+
+  # Tells whether the Time object's time lies in the past
+  def past?
+    self &lt; ::Time.current
+  end
+
+  # Tells whether the Time object's time is today
+  def today?
+    to_date == ::Date.current
+  end
+
+  # Tells whether the Time object's time lies in the future
+  def future?
+    self &gt; ::Time.current
+  end
+
+  # Seconds since midnight: Time.now.seconds_since_midnight
+  def seconds_since_midnight
+    to_i - change(:hour =&gt; 0).to_i + (usec / 1.0e+6)
+  end
+
+  # Returns a new Time where one or more of the elements have been changed according to the +options+ parameter. The time options
+  # (hour, minute, sec, usec) reset cascadingly, so if only the hour is passed, then minute, sec, and usec is set to 0. If the hour and
+  # minute is passed, then sec and usec is set to 0.
+  def change(options)
+    ::Time.send(
+      utc? ? :utc_time : :local_time,
+      options[:year]  || year,
+      options[:month] || month,
+      options[:day]   || day,
+      options[:hour]  || hour,
+      options[:min]   || (options[:hour] ? 0 : min),
+      options[:sec]   || ((options[:hour] || options[:min]) ? 0 : sec),
+      options[:usec]  || ((options[:hour] || options[:min] || options[:sec]) ? 0 : usec)
+    )
+  end
+
+  # Uses Date to provide precise Time calculations for years, months, and days.
+  # The +options+ parameter takes a hash with any of these keys: &lt;tt&gt;:years&lt;/tt&gt;,
+  # &lt;tt&gt;:months&lt;/tt&gt;, &lt;tt&gt;:weeks&lt;/tt&gt;, &lt;tt&gt;:days&lt;/tt&gt;, &lt;tt&gt;:hours&lt;/tt&gt;,
+  # &lt;tt&gt;:minutes&lt;/tt&gt;, &lt;tt&gt;:seconds&lt;/tt&gt;.
+  def advance(options)
+    unless options[:weeks].nil?
+      options[:weeks], partial_weeks = options[:weeks].divmod(1)
+      options[:days] = (options[:days] || 0) + 7 * partial_weeks
+    end
+    
+    unless options[:days].nil?
+      options[:days], partial_days = options[:days].divmod(1)
+      options[:hours] = (options[:hours] || 0) + 24 * partial_days
+    end
+    
+    d = to_date.advance(options)
+    time_advanced_by_date = change(:year =&gt; d.year, :month =&gt; d.month, :day =&gt; d.day)
+    seconds_to_advance = (options[:seconds] || 0) + (options[:minutes] || 0) * 60 + (options[:hours] || 0) * 3600
+    seconds_to_advance == 0 ? time_advanced_by_date : time_advanced_by_date.since(seconds_to_advance)
+  end
+
+  # Returns a new Time representing the time a number of seconds ago, this is basically a wrapper around the Numeric extension
+  def ago(seconds)
+    since(-seconds)
+  end
+
+  # Returns a new Time representing the time a number of seconds since the instance time
+  def since(seconds)
+    self + seconds
+  rescue
+    to_datetime.since(seconds)
+  end
+  alias :in :since
+
+  # Returns a new Time representing the time a number of specified months ago
+  def months_ago(months)
+    advance(:months =&gt; -months)
+  end
+
+  # Returns a new Time representing the time a number of specified months in the future
+  def months_since(months)
+    advance(:months =&gt; months)
+  end
+
+  # Returns a new Time representing the time a number of specified years ago
+  def years_ago(years)
+    advance(:years =&gt; -years)
+  end
+
+  # Returns a new Time representing the time a number of specified years in the future
+  def years_since(years)
+    advance(:years =&gt; years)
+  end
+
+  # Short-hand for years_ago(1)
+  def last_year
+    years_ago(1)
+  end
+
+  # Short-hand for years_since(1)
+  def next_year
+    years_since(1)
+  end
+
+
+  # Short-hand for months_ago(1)
+  def last_month
+    months_ago(1)
+  end
+
+  # Short-hand for months_since(1)
+  def next_month
+    months_since(1)
+  end
+
+  # Returns a new Time representing the &quot;start&quot; of this week (Monday, 0:00)
+  def beginning_of_week
+    days_to_monday = wday!=0 ? wday-1 : 6
+    (self - days_to_monday.days).midnight
+  end
+  alias :monday :beginning_of_week
+  alias :at_beginning_of_week :beginning_of_week
+
+  # Returns a new Time representing the end of this week (Sunday, 23:59:59)
+  def end_of_week
+    days_to_sunday = wday!=0 ? 7-wday : 0
+    (self + days_to_sunday.days).end_of_day
+  end
+  alias :at_end_of_week :end_of_week
+
+  # Returns a new Time representing the start of the given day in next week (default is Monday).
+  def next_week(day = :monday)
+    since(1.week).beginning_of_week.since(DAYS_INTO_WEEK[day].day).change(:hour =&gt; 0)
+  end
+
+  # Returns a new Time representing the start of the day (0:00)
+  def beginning_of_day
+    (self - seconds_since_midnight).change(:usec =&gt; 0)
+  end
+  alias :midnight :beginning_of_day
+  alias :at_midnight :beginning_of_day
+  alias :at_beginning_of_day :beginning_of_day
+
+  # Returns a new Time representing the end of the day (23:59:59)
+  def end_of_day
+    change(:hour =&gt; 23, :min =&gt; 59, :sec =&gt; 59)
+  end
+
+  # Returns a new Time representing the start of the month (1st of the month, 0:00)
+  def beginning_of_month
+    #self - ((self.mday-1).days + self.seconds_since_midnight)
+    change(:day =&gt; 1,:hour =&gt; 0, :min =&gt; 0, :sec =&gt; 0, :usec =&gt; 0)
+  end
+  alias :at_beginning_of_month :beginning_of_month
+
+  # Returns a new Time representing the end of the month (last day of the month, 0:00)
+  def end_of_month
+    #self - ((self.mday-1).days + self.seconds_since_midnight)
+    last_day = ::Time.days_in_month(month, year)
+    change(:day =&gt; last_day, :hour =&gt; 23, :min =&gt; 59, :sec =&gt; 59, :usec =&gt; 0)
+  end
+  alias :at_end_of_month :end_of_month
+
+  # Returns  a new Time representing the start of the quarter (1st of january, april, july, october, 0:00)
+  def beginning_of_quarter
+    beginning_of_month.change(:month =&gt; [10, 7, 4, 1].detect { |m| m &lt;= month })
+  end
+  alias :at_beginning_of_quarter :beginning_of_quarter
+
+  # Returns a new Time representing the end of the quarter (last day of march, june, september, december, 23:59:59)
+  def end_of_quarter
+    beginning_of_month.change(:month =&gt; [3, 6, 9, 12].detect { |m| m &gt;= month }).end_of_month
+  end
+  alias :at_end_of_quarter :end_of_quarter
+
+  # Returns  a new Time representing the start of the year (1st of january, 0:00)
+  def beginning_of_year
+    change(:month =&gt; 1, :day =&gt; 1, :hour =&gt; 0, :min =&gt; 0, :sec =&gt; 0, :usec =&gt; 0)
+  end
+  alias :at_beginning_of_year :beginning_of_year
+
+  # Returns a new Time representing the end of the year (31st of december, 23:59:59)
+  def end_of_year
+    change(:month =&gt; 12, :day =&gt; 31, :hour =&gt; 23, :min =&gt; 59, :sec =&gt; 59)
+  end
+  alias :at_end_of_year :end_of_year
+
+  # Convenience method which returns a new Time representing the time 1 day ago
+  def yesterday
+    advance(:days =&gt; -1)
+  end
+
+  # Convenience method which returns a new Time representing the time 1 day since the instance time
+  def tomorrow
+    advance(:days =&gt; 1)
+  end
+
+  def plus_with_duration(other) #:nodoc:
+    if ActiveSupport::Duration === other
+      other.since(self)
+    else
+      plus_without_duration(other)
+    end
+  end
+  alias_method :plus_without_duration, :+
+  alias_method :+, :plus_with_duration
+
+  def minus_with_duration(other) #:nodoc:
+    if ActiveSupport::Duration === other
+      other.until(self)
+    else
+      minus_without_duration(other)
+    end
+  end
+  alias_method :minus_without_duration, :-
+  alias_method :-, :minus_with_duration
+
+  # Time#- can also be used to determine the number of seconds between two Time instances.
+  # We're layering on additional behavior so that ActiveSupport::TimeWithZone instances
+  # are coerced into values that Time#- will recognize
+  def minus_with_coercion(other)
+    other = other.comparable_time if other.respond_to?(:comparable_time)
+    minus_without_coercion(other)
+  end
+  alias_method :minus_without_coercion, :-
+  alias_method :-, :minus_with_coercion
+
+  # 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; 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;
+      to_datetime.compare_without_coercion(other)
+    else
+      compare_without_coercion(other)
     end
   end
+  alias_method :compare_without_coercion, :&lt;=&gt;
+  alias_method :&lt;=&gt;, :compare_with_coercion
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/time/calculations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,90 +1,84 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Time #:nodoc:
-      # Converting times to formatted strings, dates, and datetimes.
-      module Conversions
-        DATE_FORMATS = {
-          :db           =&gt; &quot;%Y-%m-%d %H:%M:%S&quot;,
-          :number       =&gt; &quot;%Y%m%d%H%M%S&quot;,
-          :time         =&gt; &quot;%H:%M&quot;,
-          :short        =&gt; &quot;%d %b %H:%M&quot;,
-          :long         =&gt; &quot;%B %d, %Y %H:%M&quot;,
-          :long_ordinal =&gt; lambda { |time| time.strftime(&quot;%B #{time.day.ordinalize}, %Y %H:%M&quot;) },
-          :rfc822       =&gt; lambda { |time| time.strftime(&quot;%a, %d %b %Y %H:%M:%S #{time.formatted_offset(false)}&quot;) }
-        }
+require 'active_support/inflector'
+require 'active_support/values/time_zone'
 
-        def self.included(base) #:nodoc:
-          base.class_eval do
-            alias_method :to_default_s, :to_s
-            alias_method :to_s, :to_formatted_s
-          end
-        end
+class Time
+  DATE_FORMATS = {
+    :db           =&gt; &quot;%Y-%m-%d %H:%M:%S&quot;,
+    :number       =&gt; &quot;%Y%m%d%H%M%S&quot;,
+    :time         =&gt; &quot;%H:%M&quot;,
+    :short        =&gt; &quot;%d %b %H:%M&quot;,
+    :long         =&gt; &quot;%B %d, %Y %H:%M&quot;,
+    :long_ordinal =&gt; lambda { |time| time.strftime(&quot;%B #{ActiveSupport::Inflector.ordinalize(time.day)}, %Y %H:%M&quot;) },
+    :rfc822       =&gt; lambda { |time| time.strftime(&quot;%a, %d %b %Y %H:%M:%S #{time.formatted_offset(false)}&quot;) }
+  }
 
-        # Converts to a formatted string. See DATE_FORMATS for builtin formats.
-        #
-        # This method is aliased to &lt;tt&gt;to_s&lt;/tt&gt;.
-        #
-        #   time = Time.now                     # =&gt; Thu Jan 18 06:10:17 CST 2007
-        #
-        #   time.to_formatted_s(:time)          # =&gt; &quot;06:10:17&quot;
-        #   time.to_s(:time)                    # =&gt; &quot;06:10:17&quot;
-        #
-        #   time.to_formatted_s(:db)            # =&gt; &quot;2007-01-18 06:10:17&quot;
-        #   time.to_formatted_s(:number)        # =&gt; &quot;20070118061017&quot;
-        #   time.to_formatted_s(:short)         # =&gt; &quot;18 Jan 06:10&quot;
-        #   time.to_formatted_s(:long)          # =&gt; &quot;January 18, 2007 06:10&quot;
-        #   time.to_formatted_s(:long_ordinal)  # =&gt; &quot;January 18th, 2007 06:10&quot;
-        #   time.to_formatted_s(:rfc822)        # =&gt; &quot;Thu, 18 Jan 2007 06:10:17 -0600&quot;
-        #
-        # == Adding your own time formats to +to_formatted_s+
-        # You can add your own formats to the Time::DATE_FORMATS hash.
-        # Use the format name as the hash key and either a strftime string
-        # or Proc instance that takes a time argument as the value.
-        #
-        #   # config/initializers/time_formats.rb
-        #   Time::DATE_FORMATS[:month_and_year] = &quot;%B %Y&quot;
-        #   Time::DATE_FORMATS[:short_ordinal] = lambda { |time| time.strftime(&quot;%B #{time.day.ordinalize}&quot;) }
-        def to_formatted_s(format = :default)
-          return to_default_s unless formatter = DATE_FORMATS[format]
-          formatter.respond_to?(:call) ? formatter.call(self).to_s : strftime(formatter)
-        end
-        
-        # Returns the UTC offset as an +HH:MM formatted string.
-        #
-        #   Time.local(2000).formatted_offset         # =&gt; &quot;-06:00&quot;
-        #   Time.local(2000).formatted_offset(false)  # =&gt; &quot;-0600&quot;
-        def formatted_offset(colon = true, alternate_utc_string = nil)
-          utc? &amp;&amp; alternate_utc_string || utc_offset.to_utc_offset_s(colon)
-        end
+  # Converts to a formatted string. See DATE_FORMATS for builtin formats.
+  #
+  # This method is aliased to &lt;tt&gt;to_s&lt;/tt&gt;.
+  #
+  #   time = Time.now                     # =&gt; Thu Jan 18 06:10:17 CST 2007
+  #
+  #   time.to_formatted_s(:time)          # =&gt; &quot;06:10:17&quot;
+  #   time.to_s(:time)                    # =&gt; &quot;06:10:17&quot;
+  #
+  #   time.to_formatted_s(:db)            # =&gt; &quot;2007-01-18 06:10:17&quot;
+  #   time.to_formatted_s(:number)        # =&gt; &quot;20070118061017&quot;
+  #   time.to_formatted_s(:short)         # =&gt; &quot;18 Jan 06:10&quot;
+  #   time.to_formatted_s(:long)          # =&gt; &quot;January 18, 2007 06:10&quot;
+  #   time.to_formatted_s(:long_ordinal)  # =&gt; &quot;January 18th, 2007 06:10&quot;
+  #   time.to_formatted_s(:rfc822)        # =&gt; &quot;Thu, 18 Jan 2007 06:10:17 -0600&quot;
+  #
+  # == Adding your own time formats to +to_formatted_s+
+  # You can add your own formats to the Time::DATE_FORMATS hash.
+  # Use the format name as the hash key and either a strftime string
+  # or Proc instance that takes a time argument as the value.
+  #
+  #   # config/initializers/time_formats.rb
+  #   Time::DATE_FORMATS[:month_and_year] = &quot;%B %Y&quot;
+  #   Time::DATE_FORMATS[:short_ordinal] = lambda { |time| time.strftime(&quot;%B #{time.day.ordinalize}&quot;) }
+  def to_formatted_s(format = :default)
+    if formatter = DATE_FORMATS[format]
+      formatter.respond_to?(:call) ? formatter.call(self).to_s : strftime(formatter)
+    else
+      to_default_s
+    end
+  end
+  alias_method :to_default_s, :to_s
+  alias_method :to_s, :to_formatted_s
+ 
+  # Returns the UTC offset as an +HH:MM formatted string.
+  #
+  #   Time.local(2000).formatted_offset         # =&gt; &quot;-06:00&quot;
+  #   Time.local(2000).formatted_offset(false)  # =&gt; &quot;-0600&quot;
+  def formatted_offset(colon = true, alternate_utc_string = nil)
+    utc? &amp;&amp; alternate_utc_string || ActiveSupport::TimeZone.seconds_to_utc_offset(utc_offset, colon)
+  end
 
-        # Converts a Time object to a Date, dropping hour, minute, and second precision.
-        #
-        #   my_time = Time.now  # =&gt; Mon Nov 12 22:59:51 -0500 2007
-        #   my_time.to_date     # =&gt; Mon, 12 Nov 2007
-        #
-        #   your_time = Time.parse(&quot;1/13/2009 1:13:03 P.M.&quot;)  # =&gt; Tue Jan 13 13:13:03 -0500 2009
-        #   your_time.to_date                                 # =&gt; Tue, 13 Jan 2009
-        def to_date
-          ::Date.new(year, month, day)
-        end
+  # Converts a Time object to a Date, dropping hour, minute, and second precision.
+  #
+  #   my_time = Time.now  # =&gt; Mon Nov 12 22:59:51 -0500 2007
+  #   my_time.to_date     # =&gt; Mon, 12 Nov 2007
+  #
+  #   your_time = Time.parse(&quot;1/13/2009 1:13:03 P.M.&quot;)  # =&gt; Tue Jan 13 13:13:03 -0500 2009
+  #   your_time.to_date                                 # =&gt; Tue, 13 Jan 2009
+  def to_date
+    ::Date.new(year, month, day)
+  end
 
-        # A method to keep Time, Date and DateTime instances interchangeable on conversions.
-        # In this case, it simply returns +self+.
-        def to_time
-          self
-        end
+  # A method to keep Time, Date and DateTime instances interchangeable on conversions.
+  # In this case, it simply returns +self+.
+  def to_time
+    self
+  end
 
-        # Converts a Time instance to a Ruby DateTime instance, preserving UTC offset.
-        #
-        #   my_time = Time.now    # =&gt; Mon Nov 12 23:04:21 -0500 2007
-        #   my_time.to_datetime   # =&gt; Mon, 12 Nov 2007 23:04:21 -0500
-        #
-        #   your_time = Time.parse(&quot;1/13/2009 1:13:03 P.M.&quot;)  # =&gt; Tue Jan 13 13:13:03 -0500 2009
-        #   your_time.to_datetime                             # =&gt; Tue, 13 Jan 2009 13:13:03 -0500
-        def to_datetime
-          ::DateTime.civil(year, month, day, hour, min, sec, Rational(utc_offset, 86400))
-        end
-      end
-    end
+  # Converts a Time instance to a Ruby DateTime instance, preserving UTC offset.
+  #
+  #   my_time = Time.now    # =&gt; Mon Nov 12 23:04:21 -0500 2007
+  #   my_time.to_datetime   # =&gt; Mon, 12 Nov 2007 23:04:21 -0500
+  #
+  #   your_time = Time.parse(&quot;1/13/2009 1:13:03 P.M.&quot;)  # =&gt; Tue Jan 13 13:13:03 -0500 2009
+  #   your_time.to_datetime                             # =&gt; Tue, 13 Jan 2009 13:13:03 -0500
+  def to_datetime
+    ::DateTime.civil(year, month, day, hour, min, sec, Rational(utc_offset, 86400))
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/time/conversions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,86 +1,78 @@
-module ActiveSupport #:nodoc:
-  module CoreExtensions #:nodoc:
-    module Time #:nodoc:
-      module Zones
-        def self.included(base) #:nodoc:
-          base.extend(ClassMethods) if base == ::Time # i.e., don't include class methods in DateTime
-        end
-        
-        module ClassMethods
-          attr_accessor :zone_default
-          
-          # Returns the TimeZone for the current request, if this has been set (via Time.zone=). 
-          # If &lt;tt&gt;Time.zone&lt;/tt&gt; has not been set for the current request, returns the TimeZone specified in &lt;tt&gt;config.time_zone&lt;/tt&gt;.
-          def zone
-            Thread.current[:time_zone] || zone_default
-          end
+require 'active_support/time_with_zone'
+
+class Time
+  class &lt;&lt; self
+    attr_accessor :zone_default
+
+    # Returns the TimeZone for the current request, if this has been set (via Time.zone=). 
+    # If &lt;tt&gt;Time.zone&lt;/tt&gt; has not been set for the current request, returns the TimeZone specified in &lt;tt&gt;config.time_zone&lt;/tt&gt;.
+    def zone
+      Thread.current[:time_zone] || zone_default
+    end
 
-          # Sets &lt;tt&gt;Time.zone&lt;/tt&gt; to a TimeZone object for the current request/thread. 
-          #
-          # This method accepts any of the following:
-          #
-          # * A Rails TimeZone object.
-          # * An identifier for a Rails TimeZone object (e.g., &quot;Eastern Time (US &amp; Canada)&quot;, &lt;tt&gt;-5.hours&lt;/tt&gt;).
-          # * A TZInfo::Timezone object.
-          # * An identifier for a TZInfo::Timezone object (e.g., &quot;America/New_York&quot;).
-          #
-          # Here's an example of how you might set &lt;tt&gt;Time.zone&lt;/tt&gt; on a per request basis -- &lt;tt&gt;current_user.time_zone&lt;/tt&gt;
-          # just needs to return a string identifying the user's preferred TimeZone:
-          #
-          #   class ApplicationController &lt; ActionController::Base
-          #     before_filter :set_time_zone
-          #
-          #     def set_time_zone
-          #       Time.zone = current_user.time_zone
-          #     end
-          #   end
-          def zone=(time_zone)
-            Thread.current[:time_zone] = get_zone(time_zone)
-          end
-          
-          # Allows override of &lt;tt&gt;Time.zone&lt;/tt&gt; locally inside supplied block; resets &lt;tt&gt;Time.zone&lt;/tt&gt; to existing value when done.
-          def use_zone(time_zone)
-            old_zone, ::Time.zone = ::Time.zone, get_zone(time_zone)
-            yield
-          ensure
-            ::Time.zone = old_zone
-          end
-          
-          # Returns &lt;tt&gt;Time.zone.now&lt;/tt&gt; when &lt;tt&gt;config.time_zone&lt;/tt&gt; is set, otherwise just returns &lt;tt&gt;Time.now&lt;/tt&gt;.
-          def current
-            ::Time.zone_default ? ::Time.zone.now : ::Time.now
-          end
-          
-          private
-            def get_zone(time_zone)
-              return time_zone if time_zone.nil? || time_zone.is_a?(TimeZone)
-              # lookup timezone based on identifier (unless we've been passed a TZInfo::Timezone)
-              unless time_zone.respond_to?(:period_for_local)
-                time_zone = TimeZone[time_zone] || TZInfo::Timezone.get(time_zone) rescue nil
-              end
-              # Return if a TimeZone instance, or wrap in a TimeZone instance if a TZInfo::Timezone
-              if time_zone
-                time_zone.is_a?(TimeZone) ? time_zone : TimeZone.create(time_zone.name, nil, time_zone)
-              end
-            end
+    # Sets &lt;tt&gt;Time.zone&lt;/tt&gt; to a TimeZone object for the current request/thread. 
+    #
+    # This method accepts any of the following:
+    #
+    # * A Rails TimeZone object.
+    # * An identifier for a Rails TimeZone object (e.g., &quot;Eastern Time (US &amp; Canada)&quot;, &lt;tt&gt;-5.hours&lt;/tt&gt;).
+    # * A TZInfo::Timezone object.
+    # * An identifier for a TZInfo::Timezone object (e.g., &quot;America/New_York&quot;).
+    #
+    # Here's an example of how you might set &lt;tt&gt;Time.zone&lt;/tt&gt; on a per request basis -- &lt;tt&gt;current_user.time_zone&lt;/tt&gt;
+    # just needs to return a string identifying the user's preferred TimeZone:
+    #
+    #   class ApplicationController &lt; ActionController::Base
+    #     before_filter :set_time_zone
+    #
+    #     def set_time_zone
+    #       Time.zone = current_user.time_zone
+    #     end
+    #   end
+    def zone=(time_zone)
+      Thread.current[:time_zone] = get_zone(time_zone)
+    end
+
+    # Allows override of &lt;tt&gt;Time.zone&lt;/tt&gt; locally inside supplied block; resets &lt;tt&gt;Time.zone&lt;/tt&gt; to existing value when done.
+    def use_zone(time_zone)
+      old_zone, ::Time.zone = ::Time.zone, get_zone(time_zone)
+      yield
+    ensure
+      ::Time.zone = old_zone
+    end
+
+    # Returns &lt;tt&gt;Time.zone.now&lt;/tt&gt; when &lt;tt&gt;config.time_zone&lt;/tt&gt; is set, otherwise just returns &lt;tt&gt;Time.now&lt;/tt&gt;.
+    def current
+      ::Time.zone_default ? ::Time.zone.now : ::Time.now
+    end
+
+    private
+      def get_zone(time_zone)
+        return time_zone if time_zone.nil? || time_zone.is_a?(ActiveSupport::TimeZone)
+        # lookup timezone based on identifier (unless we've been passed a TZInfo::Timezone)
+        unless time_zone.respond_to?(:period_for_local)
+          time_zone = ActiveSupport::TimeZone[time_zone] || TZInfo::Timezone.get(time_zone) rescue nil
         end
-        
-        # Returns the simultaneous time in &lt;tt&gt;Time.zone&lt;/tt&gt;.
-        #
-        #   Time.zone = 'Hawaii'         # =&gt; 'Hawaii'
-        #   Time.utc(2000).in_time_zone  # =&gt; Fri, 31 Dec 1999 14:00:00 HST -10:00
-        #
-        # This method is similar to Time#localtime, except that it uses &lt;tt&gt;Time.zone&lt;/tt&gt; as the local zone
-        # instead of the operating system's time zone.
-        #
-        # You can also pass in a TimeZone instance or string that identifies a TimeZone as an argument, 
-        # and the conversion will be based on that zone instead of &lt;tt&gt;Time.zone&lt;/tt&gt;.
-        #
-        #   Time.utc(2000).in_time_zone('Alaska')  # =&gt; Fri, 31 Dec 1999 15:00:00 AKST -09:00
-        def in_time_zone(zone = ::Time.zone)
-          ActiveSupport::TimeWithZone.new(utc? ? self : getutc, ::Time.__send__(:get_zone, zone))
+        # Return if a TimeZone instance, or wrap in a TimeZone instance if a TZInfo::Timezone
+        if time_zone
+          time_zone.is_a?(ActiveSupport::TimeZone) ? time_zone : ActiveSupport::TimeZone.create(time_zone.name, nil, time_zone)
         end
       end
-    end
   end
-end
\ No newline at end of file
+
+  # Returns the simultaneous time in &lt;tt&gt;Time.zone&lt;/tt&gt;.
+  #
+  #   Time.zone = 'Hawaii'         # =&gt; 'Hawaii'
+  #   Time.utc(2000).in_time_zone  # =&gt; Fri, 31 Dec 1999 14:00:00 HST -10:00
+  #
+  # This method is similar to Time#localtime, except that it uses &lt;tt&gt;Time.zone&lt;/tt&gt; as the local zone
+  # instead of the operating system's time zone.
+  #
+  # You can also pass in a TimeZone instance or string that identifies a TimeZone as an argument, 
+  # and the conversion will be based on that zone instead of &lt;tt&gt;Time.zone&lt;/tt&gt;.
+  #
+  #   Time.utc(2000).in_time_zone('Alaska')  # =&gt; Fri, 31 Dec 1999 15:00:00 AKST -09:00
+  def in_time_zone(zone = ::Time.zone)
+    ActiveSupport::TimeWithZone.new(utc? ? self : getutc, ::Time.__send__(:get_zone, zone))
+  end
+end</diff>
      <filename>activesupport/lib/active_support/core_ext/time/zones.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,11 @@
+require 'set'
+require 'active_support/inflector'
+require 'active_support/core_ext/name_error'
+require 'active_support/core_ext/object/blank'
+require 'active_support/core_ext/module/aliasing'
+require 'active_support/core_ext/module/attribute_accessors'
+require 'active_support/core_ext/module/introspection'
+
 module ActiveSupport #:nodoc:
   module Dependencies #:nodoc:
     extend self
@@ -16,7 +24,7 @@ module ActiveSupport #:nodoc:
 
     # Should we load files or require them?
     mattr_accessor :mechanism
-    self.mechanism = :load
+    self.mechanism = ENV['NO_RELOAD'] ? :require : :load
 
     # The set of directories from which we may automatically load files. Files
     # under these directories will be reloaded on each request in development mode,
@@ -328,7 +336,7 @@ module ActiveSupport #:nodoc:
 
     # Search for a file in load_paths matching the provided suffix.
     def search_for_file(path_suffix)
-      path_suffix = path_suffix + '.rb' unless path_suffix.ends_with? '.rb'
+      path_suffix = &quot;#{path_suffix}.rb&quot; unless path_suffix =~ /\.rb\Z/
       load_paths.each do |root|
         path = File.join(root, path_suffix)
         return path if File.file? path
@@ -410,7 +418,7 @@ module ActiveSupport #:nodoc:
       # If we have an anonymous module, all we can do is attempt to load from Object.
       from_mod = Object if from_mod.name.blank?
 
-      unless qualified_const_defined?(from_mod.name) &amp;&amp; from_mod.name.constantize.object_id == from_mod.object_id
+      unless qualified_const_defined?(from_mod.name) &amp;&amp; Inflector.constantize(from_mod.name).object_id == from_mod.object_id
         raise ArgumentError, &quot;A copy of #{from_mod} has been removed from the module tree but is still active!&quot;
       end
 
@@ -501,7 +509,7 @@ module ActiveSupport #:nodoc:
 
           # Handle the case where the module has yet to be defined.
           initial_constants = if qualified_const_defined?(mod_name)
-            mod_name.constantize.local_constant_names
+            Inflector.constantize(mod_name).local_constant_names
           else
             []
           end
@@ -526,7 +534,7 @@ module ActiveSupport #:nodoc:
           # Module still doesn't exist? Treat it as if it has no constants.
           next [] unless qualified_const_defined?(mod_name)
 
-          mod = mod_name.constantize
+          mod = Inflector.constantize(mod_name)
           next [] unless mod.is_a? Module
           new_constants = mod.local_constant_names - prior_constants
 
@@ -596,7 +604,7 @@ module ActiveSupport #:nodoc:
       if names.size == 1 # It's under Object
         parent = Object
       else
-        parent = (names[0..-2] * '::').constantize
+        parent = Inflector.constantize(names[0..-2] * '::')
       end
 
       log &quot;removing constant #{const}&quot;</diff>
      <filename>activesupport/lib/active_support/dependencies.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,196 +1,18 @@
-require 'yaml'
+require 'active_support/deprecation/behaviors'
+require 'active_support/deprecation/reporting'
+require 'active_support/deprecation/method_wrappers'
+require 'active_support/deprecation/proxy_wrappers'
 
 module ActiveSupport
   module Deprecation #:nodoc:
-    mattr_accessor :debug
-    self.debug = false
-
-    # Choose the default warn behavior according to RAILS_ENV.
-    # Ignore deprecation warnings in production.
-    DEFAULT_BEHAVIORS = {
-      'test'        =&gt; Proc.new { |message, callstack|
-                         $stderr.puts(message)
-                         $stderr.puts callstack.join(&quot;\n  &quot;) if debug
-                       },
-      'development' =&gt; Proc.new { |message, callstack|
-                         logger = defined?(Rails) ? Rails.logger : Logger.new($stderr)
-                         logger.warn message
-                         logger.debug callstack.join(&quot;\n  &quot;) if debug
-                       }
-    }
-
     class &lt;&lt; self
-      def warn(message = nil, callstack = caller)
-        behavior.call(deprecation_message(callstack, message), callstack) if behavior &amp;&amp; !silenced?
-      end
-
-      def default_behavior
-        if defined?(RAILS_ENV)
-          DEFAULT_BEHAVIORS[RAILS_ENV.to_s]
-        else
-          DEFAULT_BEHAVIORS['test']
-        end
-      end
-
-      # Have deprecations been silenced?
-      def silenced?
-        @silenced = false unless defined?(@silenced)
-        @silenced
-      end
-
-      # Silence deprecation warnings within the block.
-      def silence
-        old_silenced, @silenced = @silenced, true
-        yield
-      ensure
-        @silenced = old_silenced
-      end
-
-      attr_writer :silenced
-
-
-      private
-        def deprecation_message(callstack, message = nil)
-          message ||= &quot;You are using deprecated behavior which will be removed from the next major or minor release.&quot;
-          &quot;DEPRECATION WARNING: #{message}. #{deprecation_caller_message(callstack)}&quot;
-        end
-
-        def deprecation_caller_message(callstack)
-          file, line, method = extract_callstack(callstack)
-          if file
-            if line &amp;&amp; method
-              &quot;(called from #{method} at #{file}:#{line})&quot;
-            else
-              &quot;(called from #{file}:#{line})&quot;
-            end
-          end
-        end
-
-        def extract_callstack(callstack)
-          if md = callstack.first.match(/^(.+?):(\d+)(?::in `(.*?)')?/)
-            md.captures
-          else
-            callstack.first
-          end
-        end
+      # The version the deprecated behavior will be removed, by default.
+      attr_accessor :deprecation_horizon
     end
+    self.deprecation_horizon = '3.0'
 
-    # Behavior is a block that takes a message argument.
-    mattr_accessor :behavior
-    self.behavior = default_behavior
-
-    # Warnings are not silenced by default.
+    # By default, warnings are not silenced and debugging is off.
     self.silenced = false
-
-    module ClassMethods #:nodoc:
-      # Declare that a method has been deprecated.
-      def deprecate(*method_names)
-        options = method_names.extract_options!
-        method_names = method_names + options.keys
-        method_names.each do |method_name|
-          alias_method_chain(method_name, :deprecation) do |target, punctuation|
-            class_eval(&lt;&lt;-EOS, __FILE__, __LINE__)
-              def #{target}_with_deprecation#{punctuation}(*args, &amp;block)   # def generate_secret_with_deprecation(*args, &amp;block)
-                ::ActiveSupport::Deprecation.warn(                          #   ::ActiveSupport::Deprecation.warn(
-                  self.class.deprecated_method_warning(                     #     self.class.deprecated_method_warning(
-                    :#{method_name},                                        #       :generate_secret,
-                    #{options[method_name].inspect}),                       #       &quot;You should use ActiveSupport::SecureRandom.hex(64)&quot;),
-                  caller                                                    #     caller
-                )                                                           #   )
-                #{target}_without_deprecation#{punctuation}(*args, &amp;block)  #   generate_secret_without_deprecation(*args, &amp;block)
-              end                                                           # end
-            EOS
-          end
-        end
-      end
-
-      def deprecated_method_warning(method_name, message=nil)
-        warning = &quot;#{method_name} is deprecated and will be removed from Rails #{deprecation_horizon}&quot;
-        case message
-          when Symbol then &quot;#{warning} (use #{message} instead)&quot;
-          when String then &quot;#{warning} (#{message})&quot;
-          else warning
-        end
-      end
-
-      def deprecation_horizon
-        '2.3'
-      end
-    end
-
-    class DeprecationProxy #:nodoc:
-      silence_warnings do
-        instance_methods.each { |m| undef_method m unless m =~ /^__/ }
-      end
-
-      # Don't give a deprecation warning on inspect since test/unit and error
-      # logs rely on it for diagnostics.
-      def inspect
-        target.inspect
-      end
-
-      private
-        def method_missing(called, *args, &amp;block)
-          warn caller, called, args
-          target.__send__(called, *args, &amp;block)
-        end
-    end
-
-    class DeprecatedObjectProxy &lt; DeprecationProxy
-      def initialize(object, message)
-        @object = object
-        @message = message
-      end
-
-      private
-        def target
-          @object
-        end
-
-        def warn(callstack, called, args)
-          ActiveSupport::Deprecation.warn(@message, callstack)
-        end
-    end
-
-    # Stand-in for &lt;tt&gt;@request&lt;/tt&gt;, &lt;tt&gt;@attributes&lt;/tt&gt;, &lt;tt&gt;@params&lt;/tt&gt;, etc.
-    # which emits deprecation warnings on any method call (except +inspect+).
-    class DeprecatedInstanceVariableProxy &lt; DeprecationProxy #:nodoc:
-      def initialize(instance, method, var = &quot;@#{method}&quot;)
-        @instance, @method, @var = instance, method, var
-      end
-
-      private
-        def target
-          @instance.__send__(@method)
-        end
-
-        def warn(callstack, called, args)
-          ActiveSupport::Deprecation.warn(&quot;#{@var} is deprecated! Call #{@method}.#{called} instead of #{@var}.#{called}. Args: #{args.inspect}&quot;, callstack)
-        end
-    end
-
-    class DeprecatedConstantProxy &lt; DeprecationProxy #:nodoc:
-      def initialize(old_const, new_const)
-        @old_const = old_const
-        @new_const = new_const
-      end
-
-      def class
-        target.class
-      end
-
-      private
-        def target
-          @new_const.to_s.constantize
-        end
-
-        def warn(callstack, called, args)
-          ActiveSupport::Deprecation.warn(&quot;#{@old_const} is deprecated! Use #{@new_const} instead.&quot;, callstack)
-        end
-    end
+    self.debug = false
   end
 end
-
-class Module
-  include ActiveSupport::Deprecation::ClassMethods
-end</diff>
      <filename>activesupport/lib/active_support/deprecation.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,8 @@
 # encoding: utf-8
-require 'singleton'
 require 'iconv'
 
+require 'active_support/core_ext/string/multibyte'
+
 module ActiveSupport
   # The Inflector transforms words from singular to plural, class names to table names, modularized class names to ones without,
   # and class names to foreign keys. The default inflections for pluralization, singularization, and uncountable words are kept
@@ -30,7 +31,9 @@ module ActiveSupport
     # pluralization and singularization rules that is runs. This guarantees that your rules run before any of the rules that may
     # already have been loaded.
     class Inflections
-      include Singleton
+      def self.instance
+        @__instance__ ||= new
+      end
 
       attr_reader :plurals, :singulars, :uncountables, :humans
 
@@ -401,6 +404,3 @@ end
 # in case active_support/inflector is required without the rest of active_support
 require 'active_support/inflections'
 require 'active_support/core_ext/string/inflections'
-unless String.included_modules.include?(ActiveSupport::CoreExtensions::String::Inflections)
-  String.send :include, ActiveSupport::CoreExtensions::String::Inflections
-end</diff>
      <filename>activesupport/lib/active_support/inflector.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,7 @@
-require 'yaml'
-require 'strscan'
+autoload :YAML, 'yaml' unless defined? YAML
+autoload :StringScanner, 'strscan' unless defined? StringScanner
+
+require 'active_support/core_ext/string/starts_ends_with'
 
 module ActiveSupport
   module JSON
@@ -45,7 +47,7 @@ module ActiveSupport
           if marks.empty?
             json.gsub(/\\([\\\/]|u[[:xdigit:]]{4})/) do
               ustr = $1
-              if ustr.starts_with?('u')
+              if ustr.start_with?('u')
                 [ustr[1..-1].to_i(16)].pack(&quot;U&quot;)
               elsif ustr == '\\'
                 '\\\\'
@@ -61,10 +63,10 @@ module ActiveSupport
               scanner.pos = left.succ
               output &lt;&lt; scanner.peek(right_pos[i] - scanner.pos + 1).gsub(/\\([\\\/]|u[[:xdigit:]]{4})/) do
                 ustr = $1
-                if ustr.starts_with?('u')
+                if ustr.start_with?('u')
                   [ustr[1..-1].to_i(16)].pack(&quot;U&quot;)
                 elsif ustr == '\\'
-                '\\\\'
+                  '\\\\'
                 else
                   ustr
                 end</diff>
      <filename>activesupport/lib/active_support/json/decoding.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,5 @@
+require 'active_support/core_ext/array/wrap'
+
 class Hash
   # Returns a JSON string representing the hash.
   #</diff>
      <filename>activesupport/lib/active_support/json/encoders/hash.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,5 @@
+require 'active_support/core_ext/object/instance_variables'
+
 class Object
   # Dumps object in JSON (JavaScript Object Notation). See www.json.org for more info.
   def to_json(options = {})</diff>
      <filename>activesupport/lib/active_support/json/encoders/object.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,17 @@
 module ActiveSupport
+  module SafelyMemoizable
+    def safely_memoize(*symbols)
+      symbols.each do |symbol|
+        class_eval &lt;&lt;-RUBY, __FILE__, __LINE__ + 1
+          def #{symbol}(*args)
+            memoized = @_memoized_#{symbol} || ::ActiveSupport::ConcurrentHash.new
+            memoized[args] ||= memoized_#{symbol}(*args)
+          end
+        RUBY
+      end
+    end
+  end
+  
   module Memoizable
     def self.memoized_ivar_for(symbol)
       &quot;@_memoized_#{symbol.to_s.sub(/\?\Z/, '_query').sub(/!\Z/, '_bang')}&quot;.to_sym
@@ -58,7 +71,7 @@ module ActiveSupport
         original_method = :&quot;_unmemoized_#{symbol}&quot;
         memoized_ivar = ActiveSupport::Memoizable.memoized_ivar_for(symbol)
 
-        class_eval &lt;&lt;-EOS, __FILE__, __LINE__
+        class_eval &lt;&lt;-EOS, __FILE__, __LINE__ + 1
           include InstanceMethods                                                  # include InstanceMethods
                                                                                    #
           if method_defined?(:#{original_method})                                  # if method_defined?(:_unmemoized_mime_type)
@@ -69,7 +82,7 @@ module ActiveSupport
           if instance_method(:#{symbol}).arity == 0                                # if instance_method(:mime_type).arity == 0
             def #{symbol}(reload = false)                                          #   def mime_type(reload = false)
               if reload || !defined?(#{memoized_ivar}) || #{memoized_ivar}.empty?  #     if reload || !defined?(@_memoized_mime_type) || @_memoized_mime_type.empty?
-                #{memoized_ivar} = [#{original_method}.freeze]                     #       @_memoized_mime_type = [_unmemoized_mime_type.freeze]
+                #{memoized_ivar} = [#{original_method}]                            #       @_memoized_mime_type = [_unmemoized_mime_type]
               end                                                                  #     end
               #{memoized_ivar}[0]                                                  #     @_memoized_mime_type[0]
             end                                                                    #   end
@@ -82,7 +95,7 @@ module ActiveSupport
                 if !reload &amp;&amp; #{memoized_ivar}.has_key?(args)                      #       if !reload &amp;&amp; @_memoized_mime_type.has_key?(args)
                   #{memoized_ivar}[args]                                           #         @_memoized_mime_type[args]
                 elsif #{memoized_ivar}                                             #       elsif @_memoized_mime_type
-                  #{memoized_ivar}[args] = #{original_method}(*args).freeze        #         @_memoized_mime_type[args] = _unmemoized_mime_type(*args).freeze
+                  #{memoized_ivar}[args] = #{original_method}(*args)               #         @_memoized_mime_type[args] = _unmemoized_mime_type(*args)
                 end                                                                #       end
               else                                                                 #     else
                 #{original_method}(*args)                                          #       _unmemoized_mime_type(*args)</diff>
      <filename>activesupport/lib/active_support/memoizable.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,11 +23,11 @@ module ActiveSupport #:nodoc:
 
       # Lazy load the Unicode database so it's only loaded when it's actually used
       ATTRIBUTES.each do |attr_name|
-        class_eval(&lt;&lt;-EOS, __FILE__, __LINE__)
-          def #{attr_name}  # def codepoints
-            load            #   load
-            @#{attr_name}   #   @codepoints
-          end               # end
+        class_eval(&lt;&lt;-EOS, __FILE__, __LINE__ + 1)
+          def #{attr_name}     # def codepoints
+            load               #   load
+            @#{attr_name}      #   @codepoints
+          end                  # end
         EOS
       end
 </diff>
      <filename>activesupport/lib/active_support/multibyte/unicode_database.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,5 @@
+require 'active_support/core_ext/hash/deep_merge'
+
 module ActiveSupport
   class OptionMerger #:nodoc:
     instance_methods.each do |method|</diff>
      <filename>activesupport/lib/active_support/option_merger.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,7 @@
+require 'active_support/ordered_hash'
+
 module ActiveSupport #:nodoc:
-  class OrderedOptions &lt; OrderedHash #:nodoc:
+  class OrderedOptions &lt; OrderedHash
     def []=(key, value)
       super(key.to_sym, value)
     end</diff>
      <filename>activesupport/lib/active_support/ordered_options.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,6 @@
+require 'active_support/core_ext/class/inheritable_attributes'
+require 'active_support/core_ext/proc'
+
 module ActiveSupport
   # Rescuable module adds support for easier exception handling.
   module Rescuable</diff>
      <filename>activesupport/lib/active_support/rescuable.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,6 +12,7 @@ require 'active_support/testing/setup_and_teardown'
 require 'active_support/testing/assertions'
 require 'active_support/testing/deprecation'
 require 'active_support/testing/declarative'
+require 'active_support/testing/pending'
 
 module ActiveSupport
   class TestCase &lt; ::Test::Unit::TestCase
@@ -34,6 +35,7 @@ module ActiveSupport
     include ActiveSupport::Testing::SetupAndTeardown
     include ActiveSupport::Testing::Assertions
     include ActiveSupport::Testing::Deprecation
+    include ActiveSupport::Testing::Pending
     extend ActiveSupport::Testing::Declarative
   end
 end</diff>
      <filename>activesupport/lib/active_support/test_case.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,18 +1,43 @@
 module ActiveSupport
   module Testing
     module Declarative
-      # test &quot;verify something&quot; do
-      #   ...
-      # end
-      def test(name, &amp;block)
-        test_name = &quot;test_#{name.gsub(/\s+/,'_')}&quot;.to_sym
-        defined = instance_method(test_name) rescue false
-        raise &quot;#{test_name} is already defined in #{self}&quot; if defined
-        if block_given?
-          define_method(test_name, &amp;block)
-        else
-          define_method(test_name) do
-            flunk &quot;No implementation provided for #{name}&quot;
+      
+      def self.extended(klass)
+        klass.class_eval do
+          
+          unless method_defined?(:describe)
+            def self.describe(text)
+              class_eval &lt;&lt;-RUBY_EVAL
+                def self.name
+                  &quot;#{text}&quot;
+                end
+              RUBY_EVAL
+            end
+          end
+          
+          if defined?(Spec)
+            class &lt;&lt; self
+              alias_method :test, :it
+            end
+          end          
+          
+        end
+      end 
+
+      unless defined?(Spec)
+        # test &quot;verify something&quot; do
+        #   ...
+        # end
+        def test(name, &amp;block)
+          test_name = &quot;test_#{name.gsub(/\s+/,'_')}&quot;.to_sym
+          defined = instance_method(test_name) rescue false
+          raise &quot;#{test_name} is already defined in #{self}&quot; if defined
+          if block_given?
+            define_method(test_name, &amp;block)
+          else
+            define_method(test_name) do
+              flunk &quot;No implementation provided for #{name}&quot;
+            end
           end
         end
       end</diff>
      <filename>activesupport/lib/active_support/testing/declarative.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,6 +10,8 @@ module ActiveSupport
 
           if defined?(MiniTest::Assertions) &amp;&amp; TestCase &lt; MiniTest::Assertions
             include ForMiniTest
+          elsif defined? Spec
+            include ForRspec
           else
             include ForClassicTestUnit
           end
@@ -34,7 +36,7 @@ module ActiveSupport
           result
         end
       end
-
+      
       module ForClassicTestUnit
         # For compatibility with Ruby &lt; 1.8.6
         PASSTHROUGH_EXCEPTIONS = Test::Unit::TestCase::PASSTHROUGH_EXCEPTIONS rescue [NoMemoryError, SignalException, Interrupt, SystemExit]</diff>
      <filename>activesupport/lib/active_support/testing/setup_and_teardown.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,9 @@
-require 'tzinfo'
+require 'active_support/duration'
+require 'active_support/core_ext/numeric/time'
+require 'active_support/core_ext/integer/time'
+require 'active_support/core_ext/time/conversions'
+require 'active_support/core_ext/date/conversions'
+require 'active_support/core_ext/date_time/conversions'
 
 module ActiveSupport
   # A Time-like class that can represent a time in any time zone. Necessary because standard Ruby Time instances are
@@ -15,7 +20,7 @@ module ActiveSupport
   #   Time.zone.now                                   # =&gt; Sun, 18 May 2008 13:07:55 EDT -04:00
   #   Time.utc(2007, 2, 10, 20, 30, 45).in_time_zone  # =&gt; Sat, 10 Feb 2007 15:30:45 EST -05:00
   #
-  # See TimeZone and ActiveSupport::CoreExtensions::Time::Zones for further documentation for these methods.
+  # See Time and TimeZone for further documentation of these methods.
   #
   # TimeWithZone instances implement the same API as Ruby Time instances, so that Time and TimeWithZone instances are interchangable. Examples:
   #
@@ -31,6 +36,11 @@ module ActiveSupport
   #   t.is_a?(Time)                         # =&gt; true
   #   t.is_a?(ActiveSupport::TimeWithZone)  # =&gt; true
   class TimeWithZone
+    
+    def self.name
+      'Time' # Report class name as 'Time' to thwart type checking
+    end
+    
     include Comparable
     attr_reader :time_zone
 
@@ -87,7 +97,7 @@ module ActiveSupport
     alias_method :gmtoff, :utc_offset
 
     def formatted_offset(colon = true, alternate_utc_string = nil)
-      utc? &amp;&amp; alternate_utc_string || utc_offset.to_utc_offset_s(colon)
+      utc? &amp;&amp; alternate_utc_string || TimeZone.seconds_to_utc_offset(utc_offset, colon)
     end
 
     # Time uses +zone+ to display the time zone abbreviation, so we're duck-typing it.
@@ -148,8 +158,9 @@ module ActiveSupport
     # &lt;tt&gt;:db&lt;/tt&gt; format outputs time in UTC; all others output time in local.
     # Uses TimeWithZone's +strftime+, so &lt;tt&gt;%Z&lt;/tt&gt; and &lt;tt&gt;%z&lt;/tt&gt; work correctly.
     def to_s(format = :default)
-      return utc.to_s(format) if format == :db
-      if formatter = ::Time::DATE_FORMATS[format]
+      if format == :db
+        utc.to_s(format)
+      elsif formatter = ::Time::DATE_FORMATS[format]
         formatter.respond_to?(:call) ? formatter.call(self).to_s : strftime(formatter)
       else
         &quot;#{time.strftime(&quot;%Y-%m-%d %H:%M:%S&quot;)} #{formatted_offset(false, 'UTC')}&quot; # mimicking Ruby 1.9 Time#to_s format
@@ -238,10 +249,10 @@ module ActiveSupport
     end
 
     %w(year mon month day mday wday yday hour min sec to_date).each do |method_name|
-      class_eval &lt;&lt;-EOV
-        def #{method_name}     # def year
-          time.#{method_name}  #   time.year
-        end                    # end
+      class_eval &lt;&lt;-EOV, __FILE__, __LINE__ + 1
+        def #{method_name}    # def month
+          time.#{method_name} #   time.month
+        end                   # end
       EOV
     end
 </diff>
      <filename>activesupport/lib/active_support/time_with_zone.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,7 @@
+require 'active_support/core_ext/time'
+require 'active_support/core_ext/date'
+require 'active_support/core_ext/date_time'
+
 # The TimeZone class serves as a wrapper around TZInfo::Timezone instances. It allows us to do the following:
 #
 # * Limit the set of zones provided by TZInfo to a meaningful subset of 142 zones.
@@ -170,6 +174,20 @@ module ActiveSupport
       MAPPING.freeze
     end
 
+    UTC_OFFSET_WITH_COLON = '%+03d:%02d'
+    UTC_OFFSET_WITHOUT_COLON = UTC_OFFSET_WITH_COLON.sub(':', '')
+
+    # Assumes self represents an offset from UTC in seconds (as returned from Time#utc_offset)
+    # and turns this into an +HH:MM formatted string. Example:
+    #
+    #   TimeZone.seconds_to_utc_offset(-21_600) # =&gt; &quot;-06:00&quot;
+    def self.seconds_to_utc_offset(seconds, colon = true)
+      format = colon ? UTC_OFFSET_WITH_COLON : UTC_OFFSET_WITHOUT_COLON
+      hours = seconds / 3600
+      minutes = (seconds.abs % 3600) / 60
+      format % [hours, minutes]
+    end
+
     include Comparable
     attr_reader :name
 
@@ -190,7 +208,7 @@ module ActiveSupport
     # Returns the offset of this time zone as a formatted string, of the
     # format &quot;+HH:MM&quot;.
     def formatted_offset(colon=true, alternate_utc_string = nil)
-      utc_offset == 0 &amp;&amp; alternate_utc_string || utc_offset.to_utc_offset_s(colon)
+      utc_offset == 0 &amp;&amp; alternate_utc_string || self.class.seconds_to_utc_offset(utc_offset, colon)
     end
 
     # Compare this time zone to the parameter. The two are comapred first on
@@ -345,14 +363,13 @@ module ActiveSupport
                  &quot;Wellington&quot; ],
        [ 46_800, &quot;Nuku'alofa&quot; ]].
       each do |offset, *places|
-        places.each do |place|
+        places.sort.each do |place|
           place.freeze
           zone = new(place, offset)
           ZONES &lt;&lt; zone
           ZONES_MAP[place] = zone
         end
       end
-      ZONES.sort!
       ZONES.freeze
       ZONES_MAP.freeze
 </diff>
      <filename>activesupport/lib/active_support/values/time_zone.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,6 @@ begin
 rescue Gem::LoadError
   $:.unshift &quot;#{File.dirname(__FILE__)}/vendor/builder-2.1.2&quot;
 end
-require 'builder'
 
 begin
   gem 'memcache-client', '&gt;= 1.6.5'</diff>
      <filename>activesupport/lib/active_support/vendor.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,4 @@
+#--
 # Authors::   Matt Aimonetti (http://railsontherun.com/),
 #             Sven Fuchs (http://www.artweb-design.de),
 #             Joshua Harvey (http://www.workingwithrails.com/person/759-joshua-harvey),
@@ -5,10 +6,14 @@
 #             Stephan Soller (http://www.arkanis-development.de/)
 # Copyright:: Copyright (c) 2008 The Ruby i18n Team
 # License::   MIT
-require 'i18n/backend/simple'
-require 'i18n/exceptions'
+#++
 
 module I18n
+  autoload :ArgumentError, 'i18n/exceptions'
+  module Backend
+    autoload :Simple, 'i18n/backend/simple'
+  end
+
   @@backend = nil
   @@load_path = nil
   @@default_locale = :'en'</diff>
      <filename>activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-require 'yaml'
+require 'i18n/exceptions'
 
 module I18n
   module Backend
@@ -186,6 +186,7 @@ module I18n
         # Loads a YAML translations file. The data must have locales as
         # toplevel keys.
         def load_yml(filename)
+          require 'yaml' unless defined? :YAML
           YAML::load(IO.read(filename))
         end
 
@@ -211,4 +212,4 @@ module I18n
         end
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb</filename>
    </modified>
    <modified>
      <diff>@@ -50,4 +50,4 @@ module I18n
       super &quot;can not load translations from #{filename}, the file type #{type} is not known&quot;
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n/exceptions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,15 +21,15 @@ module ActiveSupport
   end
 end
 
-module LibXML
-  module Conversions
-    module Document
+module LibXML #:nodoc:
+  module Conversions #:nodoc:
+    module Document #:nodoc:
       def to_hash
         root.to_hash
       end
     end
 
-    module Node
+    module Node #:nodoc:
       CONTENT_ROOT = '__content__'
       LIB_XML_LIMIT = 30000000 # Hardcoded LibXML limit
 </diff>
      <filename>activesupport/lib/active_support/xml_mini/libxml.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,14 +18,14 @@ module ActiveSupport
       end
     end
 
-    module Conversions
-      module Document
+    module Conversions #:nodoc:
+      module Document #:nodoc:
         def to_hash
           root.to_hash
         end
       end
 
-      module Node
+      module Node #:nodoc:
         CONTENT_ROOT = '__content__'
 
         # Convert XML document to hash</diff>
      <filename>activesupport/lib/active_support/xml_mini/nokogiri.rb</filename>
    </modified>
    <modified>
      <diff>@@ -56,7 +56,9 @@ module ActiveSupport
           hash
         else
           # must use value to prevent double-escaping
-          merge!(hash, CONTENT_KEY, element.texts.sum(&amp;:value))
+          texts = ''
+          element.texts.each { |t| texts &lt;&lt; t.value }
+          merge!(hash, CONTENT_KEY, texts)
         end
       end
 </diff>
      <filename>activesupport/lib/active_support/xml_mini/rexml.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,16 +4,19 @@ require 'test/unit'
 gem 'mocha', '&gt;= 0.9.5'
 require 'mocha'
 
+ENV['NO_RELOAD'] = '1'
 $:.unshift &quot;#{File.dirname(__FILE__)}/../lib&quot;
 require 'active_support'
 require 'active_support/test_case'
 
 def uses_memcached(test_name)
   require 'memcache'
-  MemCache.new('localhost').stats
-  yield
-rescue MemCache::MemCacheError
-  $stderr.puts &quot;Skipping #{test_name} tests. Start memcached and try again.&quot;
+  begin
+    MemCache.new('localhost').stats
+    yield
+  rescue MemCache::MemCacheError
+    $stderr.puts &quot;Skipping #{test_name} tests. Start memcached and try again.&quot;
+  end
 end
 
 def with_kcode(code)</diff>
      <filename>activesupport/test/abstract_unit.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,7 @@
 require 'abstract_unit'
 require 'stringio'
 require 'fileutils'
+require 'active_support/buffered_logger'
 
 class BufferedLoggerTest &lt; Test::Unit::TestCase
   def setup</diff>
      <filename>activesupport/test/buffered_logger_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'abstract_unit'
+require 'active_support/cache'
 
 class CacheKeyTest &lt; ActiveSupport::TestCase
   def test_expand_cache_key
@@ -13,12 +14,6 @@ class CacheStoreSettingTest &lt; ActiveSupport::TestCase
     assert_equal &quot;/path/to/cache/directory&quot;, store.cache_path
   end
 
-  def test_drb_fragment_cache_store
-    store = ActiveSupport::Cache.lookup_store :drb_store, &quot;druby://localhost:9192&quot;
-    assert_kind_of(ActiveSupport::Cache::DRbStore, store)
-    assert_equal &quot;druby://localhost:9192&quot;, store.address
-  end
-
   def test_mem_cache_fragment_cache_store
     store = ActiveSupport::Cache.lookup_store :mem_cache_store, &quot;localhost&quot;
     assert_kind_of(ActiveSupport::Cache::MemCacheStore, store)</diff>
      <filename>activesupport/test/caching_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,11 +7,11 @@ class Record
 
   class &lt;&lt; self
     def callback_symbol(callback_method)
-      returning(&quot;#{callback_method}_method&quot;) do |method_name|
-        define_method(method_name) do
-          history &lt;&lt; [callback_method, :symbol]
-        end
+      method_name = &quot;#{callback_method}_method&quot;
+      define_method(method_name) do
+        history &lt;&lt; [callback_method, :symbol]
       end
+      method_name
     end
 
     def callback_string(callback_method)</diff>
      <filename>activesupport/test/callbacks_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
 require 'abstract_unit'
 require 'stringio'
+require 'active_support/core_ext/logger'
 
 class CleanLoggerTest &lt; Test::Unit::TestCase
   def setup</diff>
      <filename>activesupport/test/clean_logger_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
 require 'abstract_unit'
-require 'bigdecimal'
+require 'active_support/core_ext/array'
+require 'active_support/core_ext/big_decimal'
 
 class ArrayExtAccessTests &lt; Test::Unit::TestCase
   def test_from</diff>
      <filename>activesupport/test/core_ext/array_ext_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'abstract_unit'
+require 'active_support/core_ext/cgi'
 
 class EscapeSkippingSlashesTest &lt; Test::Unit::TestCase
   def test_array</diff>
      <filename>activesupport/test/core_ext/cgi_ext_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'abstract_unit'
+require 'active_support/core_ext/class/delegating_attributes'
 
 module DelegatingFixtures
   class Parent</diff>
      <filename>activesupport/test/core_ext/class/delegating_attributes_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'abstract_unit'
+require 'active_support/core_ext/class'
 
 class A
 end</diff>
      <filename>activesupport/test/core_ext/class_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'abstract_unit'
+require 'active_support/core_ext/date'
 
 class DateExtCalculationsTest &lt; Test::Unit::TestCase
   def test_to_s</diff>
      <filename>activesupport/test/core_ext/date_ext_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -60,26 +60,6 @@ class DurationTest &lt; ActiveSupport::TestCase
     assert_equal((7 * 24 * 1.7).hours.ago, 1.7.weeks.ago)
   end
 
-  def test_deprecated_fractional_years
-    years_re = /Fractional years are not respected\. Convert value to integer before calling #years\./
-    assert_deprecated(years_re){1.0.years}
-    assert_deprecated(years_re){1.5.years}
-    assert_not_deprecated{1.years}
-    assert_deprecated(years_re){1.0.year}
-    assert_deprecated(years_re){1.5.year}
-    assert_not_deprecated{1.year}
-  end
-
-  def test_deprecated_fractional_months
-    months_re = /Fractional months are not respected\. Convert value to integer before calling #months\./
-    assert_deprecated(months_re){1.5.months}
-    assert_deprecated(months_re){1.0.months}
-    assert_not_deprecated{1.months}
-    assert_deprecated(months_re){1.5.month}
-    assert_deprecated(months_re){1.0.month}
-    assert_not_deprecated{1.month}
-  end
-
   def test_since_and_ago_anchored_to_time_now_when_time_zone_default_not_set
     Time.zone_default = nil
     with_env_tz 'US/Eastern' do
@@ -109,6 +89,18 @@ class DurationTest &lt; ActiveSupport::TestCase
   ensure
     Time.zone_default = nil
   end
+  
+  def test_adding_hours_across_dst_boundary
+    with_env_tz 'CET' do
+      assert_equal Time.local(2009,3,29,0,0,0) + 24.hours, Time.local(2009,3,30,1,0,0)
+    end
+  end
+  
+  def test_adding_day_across_dst_boundary
+    with_env_tz 'CET' do
+      assert_equal Time.local(2009,3,29,0,0,0) + 1.day, Time.local(2009,3,30,0,0,0)
+    end
+  end
 
   protected
     def with_env_tz(new_tz = 'US/Eastern')</diff>
      <filename>activesupport/test/core_ext/duration_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,6 @@
 require 'abstract_unit'
+require 'active_support/core_ext/array'
+require 'active_support/core_ext/enumerable'
 
 Payment = Struct.new(:price)
 class SummablePayment &lt; Payment</diff>
      <filename>activesupport/test/core_ext/enumerable_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'abstract_unit'
+require 'active_support/core_ext/file'
 
 class AtomicWriteTest &lt; Test::Unit::TestCase
   def test_atomic_write_without_errors</diff>
      <filename>activesupport/test/core_ext/file_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'abstract_unit'
+require 'active_support/core_ext/float/rounding'
 
 class FloatExtRoundingTests &lt; Test::Unit::TestCase
   def test_round_for_positive_number</diff>
      <filename>activesupport/test/core_ext/float_ext_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 require 'abstract_unit'
-require 'builder'
+require 'active_support/core_ext/hash'
 
 class HashExtTest &lt; Test::Unit::TestCase
   def setup</diff>
      <filename>activesupport/test/core_ext/hash_ext_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'abstract_unit'
+require 'active_support/core_ext/integer'
 
 class IntegerExtTest &lt; Test::Unit::TestCase
   def test_even</diff>
      <filename>activesupport/test/core_ext/integer_ext_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'abstract_unit'
+require 'active_support/core_ext/kernel'
 
 class KernelTest &lt; Test::Unit::TestCase
   def test_silence_warnings
@@ -41,3 +42,18 @@ class KernelTest &lt; Test::Unit::TestCase
     assert_equal 1, silence_stderr { 1 }
   end
 end
+
+class KernelSupressTest &lt; Test::Unit::TestCase
+  def test_reraise
+    assert_raise(LoadError) do
+      suppress(ArgumentError) { raise LoadError }
+    end
+  end
+
+  def test_supression
+    suppress(ArgumentError) { raise ArgumentError }
+    suppress(LoadError) { raise LoadError }
+    suppress(LoadError, ArgumentError) { raise LoadError }
+    suppress(LoadError, ArgumentError) { raise ArgumentError }
+  end
+end</diff>
      <filename>activesupport/test/core_ext/kernel_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'abstract_unit'
+require 'active_support/core_ext/load_error'
 
 class TestMissingSourceFile &lt; Test::Unit::TestCase
   def test_with_require</diff>
      <filename>activesupport/test/core_ext/load_error_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,8 @@
 require 'abstract_unit'
 
+require 'active_support/core_ext/class/attribute_accessors'
+require 'active_support/core_ext/module/synchronization'
+
 class SynchronizationTest &lt; Test::Unit::TestCase
   def setup
     @target = Class.new
@@ -82,4 +85,4 @@ class SynchronizationTest &lt; Test::Unit::TestCase
     assert_nothing_raised { @target.to_s; @target.to_s }
     assert_equal 2, @target.mutex.sync_count
   end
-end
\ No newline at end of file
+end</diff>
      <filename>activesupport/test/core_ext/module/synchronization_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'abstract_unit'
+require 'active_support/core_ext/module'
 
 module One
   Constant1 = &quot;Hello World&quot;</diff>
      <filename>activesupport/test/core_ext/module_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,7 @@
 require 'abstract_unit'
 
+require 'active_support/core_ext/numeric/bytes'
+
 class NumericExtTimeAndDateTimeTest &lt; Test::Unit::TestCase
   def setup
     @now = Time.local(2005,2,10,15,30,45)
@@ -145,18 +147,3 @@ class NumericExtSizeTest &lt; Test::Unit::TestCase
     assert_equal 3458764513820540928, 3.exabyte
   end
 end
-
-class NumericExtConversionsTest &lt; Test::Unit::TestCase
-  
-  def test_to_utc_offset_s_with_colon
-    assert_equal &quot;-06:00&quot;, -21_600.to_utc_offset_s
-    assert_equal &quot;+00:00&quot;, 0.to_utc_offset_s
-    assert_equal &quot;+05:00&quot;, 18_000.to_utc_offset_s
-  end
-  
-  def test_to_utc_offset_s_without_colon
-    assert_equal &quot;-0600&quot;, -21_600.to_utc_offset_s(false)
-    assert_equal &quot;+0000&quot;, 0.to_utc_offset_s(false)
-    assert_equal &quot;+0500&quot;, 18_000.to_utc_offset_s(false)
-  end
-end</diff>
      <filename>activesupport/test/core_ext/numeric_ext_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'abstract_unit'
+require 'active_support/core_ext/object'
 
 class ClassA; end
 class ClassB &lt; ClassA; end
@@ -108,16 +109,6 @@ class ClassExtTest &lt; Test::Unit::TestCase
 end
 
 class ObjectTests &lt; Test::Unit::TestCase
-  def test_suppress_re_raises
-    assert_raise(LoadError) { suppress(ArgumentError) {raise LoadError} }
-  end
-  def test_suppress_supresses
-    suppress(ArgumentError) { raise ArgumentError }
-    suppress(LoadError) { raise LoadError }
-    suppress(LoadError, ArgumentError) { raise LoadError }
-    suppress(LoadError, ArgumentError) { raise ArgumentError }
-  end
-
   def test_extended_by
     foo = Foo.new
     assert foo.extended_by.include?(Bar)</diff>
      <filename>activesupport/test/core_ext/object_and_class_ext_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'abstract_unit'
+require 'active_support/core_ext/range'
 
 class RangeTest &lt; Test::Unit::TestCase
   def test_to_s_from_dates</diff>
      <filename>activesupport/test/core_ext/range_ext_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,8 @@ require 'date'
 require 'abstract_unit'
 require 'inflector_test_cases'
 
+require 'active_support/core_ext/string'
+
 class StringInflectionsTest &lt; Test::Unit::TestCase
   include InflectorTestCases
 
@@ -132,10 +134,12 @@ class StringInflectionsTest &lt; Test::Unit::TestCase
 
     assert_equal &quot;h&quot;, s.first
     assert_equal &quot;he&quot;, s.first(2)
+    assert_equal &quot;&quot;, s.first(0)
 
     assert_equal &quot;o&quot;, s.last
     assert_equal &quot;llo&quot;, s.last(3)
     assert_equal &quot;hello&quot;, s.last(10)
+    assert_equal &quot;&quot;, s.last(0)
 
     assert_equal 'x', 'x'.first
     assert_equal 'x', 'x'.first(4)</diff>
      <filename>activesupport/test/core_ext/string_ext_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -183,26 +183,46 @@ class TimeExtCalculationsTest &lt; Test::Unit::TestCase
   def test_daylight_savings_time_crossings_backward_start
     with_env_tz 'US/Eastern' do
       # dt: US: 2005 April 3rd 4:18am
-      assert_equal Time.local(2005,4,2,4,18,0), Time.local(2005,4,3,4,18,0).ago(86400), 'dt-1.day=&gt;st'
-      assert_equal Time.local(2005,4,1,4,18,0), Time.local(2005,4,2,4,18,0).ago(86400), 'st-1.day=&gt;st'
+      assert_equal Time.local(2005,4,2,3,18,0), Time.local(2005,4,3,4,18,0).ago(24.hours), 'dt-24.hours=&gt;st'
+      assert_equal Time.local(2005,4,2,3,18,0), Time.local(2005,4,3,4,18,0).ago(86400), 'dt-86400=&gt;st'
+      assert_equal Time.local(2005,4,2,3,18,0), Time.local(2005,4,3,4,18,0).ago(86400.seconds), 'dt-86400.seconds=&gt;st'
+      
+      assert_equal Time.local(2005,4,1,4,18,0), Time.local(2005,4,2,4,18,0).ago(24.hours), 'st-24.hours=&gt;st'
+      assert_equal Time.local(2005,4,1,4,18,0), Time.local(2005,4,2,4,18,0).ago(86400), 'st-86400=&gt;st'
+      assert_equal Time.local(2005,4,1,4,18,0), Time.local(2005,4,2,4,18,0).ago(86400.seconds), 'st-86400.seconds=&gt;st'
     end
     with_env_tz 'NZ' do
       # dt: New Zealand: 2006 October 1st 4:18am
-      assert_equal Time.local(2006,9,30,4,18,0), Time.local(2006,10,1,4,18,0).ago(86400), 'dt-1.day=&gt;st'
-      assert_equal Time.local(2006,9,29,4,18,0), Time.local(2006,9,30,4,18,0).ago(86400), 'st-1.day=&gt;st'
+      assert_equal Time.local(2006,9,30,3,18,0), Time.local(2006,10,1,4,18,0).ago(24.hours), 'dt-24.hours=&gt;st'
+      assert_equal Time.local(2006,9,30,3,18,0), Time.local(2006,10,1,4,18,0).ago(86400), 'dt-86400=&gt;st'
+      assert_equal Time.local(2006,9,30,3,18,0), Time.local(2006,10,1,4,18,0).ago(86400.seconds), 'dt-86400.seconds=&gt;st'
+      
+      assert_equal Time.local(2006,9,29,4,18,0), Time.local(2006,9,30,4,18,0).ago(24.hours), 'st-24.hours=&gt;st'
+      assert_equal Time.local(2006,9,29,4,18,0), Time.local(2006,9,30,4,18,0).ago(86400), 'st-86400=&gt;st'
+      assert_equal Time.local(2006,9,29,4,18,0), Time.local(2006,9,30,4,18,0).ago(86400.seconds), 'st-86400.seconds=&gt;st'
     end
   end
 
   def test_daylight_savings_time_crossings_backward_end
     with_env_tz 'US/Eastern' do
       # st: US: 2005 October 30th 4:03am
-      assert_equal Time.local(2005,10,29,4,3), Time.local(2005,10,30,4,3,0).ago(86400), 'st-1.day=&gt;dt'
-      assert_equal Time.local(2005,10,28,4,3), Time.local(2005,10,29,4,3,0).ago(86400), 'dt-1.day=&gt;dt'
+      assert_equal Time.local(2005,10,29,5,3), Time.local(2005,10,30,4,3,0).ago(24.hours), 'st-24.hours=&gt;dt'
+      assert_equal Time.local(2005,10,29,5,3), Time.local(2005,10,30,4,3,0).ago(86400), 'st-86400=&gt;dt'
+      assert_equal Time.local(2005,10,29,5,3), Time.local(2005,10,30,4,3,0).ago(86400.seconds), 'st-86400.seconds=&gt;dt'
+      
+      assert_equal Time.local(2005,10,28,4,3), Time.local(2005,10,29,4,3,0).ago(24.hours), 'dt-24.hours=&gt;dt'
+      assert_equal Time.local(2005,10,28,4,3), Time.local(2005,10,29,4,3,0).ago(86400), 'dt-86400=&gt;dt'
+      assert_equal Time.local(2005,10,28,4,3), Time.local(2005,10,29,4,3,0).ago(86400.seconds), 'dt-86400.seconds=&gt;dt'
     end
     with_env_tz 'NZ' do
       # st: New Zealand: 2006 March 19th 4:03am
-      assert_equal Time.local(2006,3,18,4,3), Time.local(2006,3,19,4,3,0).ago(86400), 'st-1.day=&gt;dt'
-      assert_equal Time.local(2006,3,17,4,3), Time.local(2006,3,18,4,3,0).ago(86400), 'dt-1.day=&gt;dt'
+      assert_equal Time.local(2006,3,18,5,3), Time.local(2006,3,19,4,3,0).ago(24.hours), 'st-24.hours=&gt;dt'
+      assert_equal Time.local(2006,3,18,5,3), Time.local(2006,3,19,4,3,0).ago(86400), 'st-86400=&gt;dt'
+      assert_equal Time.local(2006,3,18,5,3), Time.local(2006,3,19,4,3,0).ago(86400.seconds), 'st-86400.seconds=&gt;dt'
+      
+      assert_equal Time.local(2006,3,17,4,3), Time.local(2006,3,18,4,3,0).ago(24.hours), 'dt-24.hours=&gt;dt'
+      assert_equal Time.local(2006,3,17,4,3), Time.local(2006,3,18,4,3,0).ago(86400), 'dt-86400=&gt;dt'
+      assert_equal Time.local(2006,3,17,4,3), Time.local(2006,3,18,4,3,0).ago(86400.seconds), 'dt-86400.seconds=&gt;dt'
     end
   end
 
@@ -231,6 +251,7 @@ class TimeExtCalculationsTest &lt; Test::Unit::TestCase
       assert_equal Time.local(2006,3,17,4,3), Time.local(2006,3,18,4,3,0).ago(1.day), 'dt-1.day=&gt;dt'
     end
   end
+  
   def test_since
     assert_equal Time.local(2005,2,22,10,10,11), Time.local(2005,2,22,10,10,10).since(1)
     assert_equal Time.local(2005,2,22,11,10,10), Time.local(2005,2,22,10,10,10).since(3600)
@@ -243,13 +264,23 @@ class TimeExtCalculationsTest &lt; Test::Unit::TestCase
   def test_daylight_savings_time_crossings_forward_start
     with_env_tz 'US/Eastern' do
       # st: US: 2005 April 2nd 7:27pm
-      assert_equal Time.local(2005,4,3,19,27,0), Time.local(2005,4,2,19,27,0).since(86400), 'st+1.day=&gt;dt'
-      assert_equal Time.local(2005,4,4,19,27,0), Time.local(2005,4,3,19,27,0).since(86400), 'dt+1.day=&gt;dt'
+      assert_equal Time.local(2005,4,3,20,27,0), Time.local(2005,4,2,19,27,0).since(24.hours), 'st+24.hours=&gt;dt'
+      assert_equal Time.local(2005,4,3,20,27,0), Time.local(2005,4,2,19,27,0).since(86400), 'st+86400=&gt;dt'
+      assert_equal Time.local(2005,4,3,20,27,0), Time.local(2005,4,2,19,27,0).since(86400.seconds), 'st+86400.seconds=&gt;dt'
+      
+      assert_equal Time.local(2005,4,4,19,27,0), Time.local(2005,4,3,19,27,0).since(24.hours), 'dt+24.hours=&gt;dt'
+      assert_equal Time.local(2005,4,4,19,27,0), Time.local(2005,4,3,19,27,0).since(86400), 'dt+86400=&gt;dt'
+      assert_equal Time.local(2005,4,4,19,27,0), Time.local(2005,4,3,19,27,0).since(86400.seconds), 'dt+86400.seconds=&gt;dt'
     end
     with_env_tz 'NZ' do
       # st: New Zealand: 2006 September 30th 7:27pm
-      assert_equal Time.local(2006,10,1,19,27,0), Time.local(2006,9,30,19,27,0).since(86400), 'st+1.day=&gt;dt'
-      assert_equal Time.local(2006,10,2,19,27,0), Time.local(2006,10,1,19,27,0).since(86400), 'dt+1.day=&gt;dt'
+      assert_equal Time.local(2006,10,1,20,27,0), Time.local(2006,9,30,19,27,0).since(24.hours), 'st+24.hours=&gt;dt'
+      assert_equal Time.local(2006,10,1,20,27,0), Time.local(2006,9,30,19,27,0).since(86400), 'st+86400=&gt;dt'
+      assert_equal Time.local(2006,10,1,20,27,0), Time.local(2006,9,30,19,27,0).since(86400.seconds), 'st+86400.seconds=&gt;dt'
+      
+      assert_equal Time.local(2006,10,2,19,27,0), Time.local(2006,10,1,19,27,0).since(24.hours), 'dt+24.hours=&gt;dt'
+      assert_equal Time.local(2006,10,2,19,27,0), Time.local(2006,10,1,19,27,0).since(86400), 'dt+86400=&gt;dt'
+      assert_equal Time.local(2006,10,2,19,27,0), Time.local(2006,10,1,19,27,0).since(86400.seconds), 'dt+86400.seconds=&gt;dt'
     end
   end
 
@@ -295,13 +326,23 @@ class TimeExtCalculationsTest &lt; Test::Unit::TestCase
   def test_daylight_savings_time_crossings_forward_end
     with_env_tz 'US/Eastern' do
       # dt: US: 2005 October 30th 12:45am
-      assert_equal Time.local(2005,10,31,0,45,0), Time.local(2005,10,30,0,45,0).since(86400), 'dt+1.day=&gt;st'
-      assert_equal Time.local(2005,11, 1,0,45,0), Time.local(2005,10,31,0,45,0).since(86400), 'st+1.day=&gt;st'
+      assert_equal Time.local(2005,10,30,23,45,0), Time.local(2005,10,30,0,45,0).since(24.hours), 'dt+24.hours=&gt;st'
+      assert_equal Time.local(2005,10,30,23,45,0), Time.local(2005,10,30,0,45,0).since(86400), 'dt+86400=&gt;st'
+      assert_equal Time.local(2005,10,30,23,45,0), Time.local(2005,10,30,0,45,0).since(86400.seconds), 'dt+86400.seconds=&gt;st'
+      
+      assert_equal Time.local(2005,11, 1,0,45,0), Time.local(2005,10,31,0,45,0).since(24.hours), 'st+24.hours=&gt;st'
+      assert_equal Time.local(2005,11, 1,0,45,0), Time.local(2005,10,31,0,45,0).since(86400), 'st+86400=&gt;st'
+      assert_equal Time.local(2005,11, 1,0,45,0), Time.local(2005,10,31,0,45,0).since(86400.seconds), 'st+86400.seconds=&gt;st'
     end
     with_env_tz 'NZ' do
       # dt: New Zealand: 2006 March 19th 1:45am
-      assert_equal Time.local(2006,3,20,1,45,0), Time.local(2006,3,19,1,45,0).since(86400), 'dt+1.day=&gt;st'
-      assert_equal Time.local(2006,3,21,1,45,0), Time.local(2006,3,20,1,45,0).since(86400), 'st+1.day=&gt;st'
+      assert_equal Time.local(2006,3,20,0,45,0), Time.local(2006,3,19,1,45,0).since(24.hours), 'dt+24.hours=&gt;st'
+      assert_equal Time.local(2006,3,20,0,45,0), Time.local(2006,3,19,1,45,0).since(86400), 'dt+86400=&gt;st'
+      assert_equal Time.local(2006,3,20,0,45,0), Time.local(2006,3,19,1,45,0).since(86400.seconds), 'dt+86400.seconds=&gt;st'
+      
+      assert_equal Time.local(2006,3,21,1,45,0), Time.local(2006,3,20,1,45,0).since(24.hours), 'st+24.hours=&gt;st'
+      assert_equal Time.local(2006,3,21,1,45,0), Time.local(2006,3,20,1,45,0).since(86400), 'st+86400=&gt;st'
+      assert_equal Time.local(2006,3,21,1,45,0), Time.local(2006,3,20,1,45,0).since(86400.seconds), 'st+86400.seconds=&gt;st'
     end
   end
 </diff>
      <filename>activesupport/test/core_ext/time_ext_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'abstract_unit'
+require 'active_support/time_with_zone'
 
 class TimeWithZoneTest &lt; Test::Unit::TestCase
 
@@ -317,6 +318,10 @@ class TimeWithZoneTest &lt; Test::Unit::TestCase
     assert @twz.kind_of?(Time)
     assert @twz.is_a?(ActiveSupport::TimeWithZone)
   end
+  
+  def test_class_name
+    assert_equal 'Time', ActiveSupport::TimeWithZone.name
+  end
 
   def test_method_missing_with_time_return_value
     assert_instance_of ActiveSupport::TimeWithZone, @twz.months_since(1)</diff>
      <filename>activesupport/test/core_ext/time_with_zone_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
 require 'abstract_unit'
 require 'uri'
+require 'active_support/core_ext/uri'
 
 class URIExtTest &lt; Test::Unit::TestCase
   def test_uri_decode_handle_multibyte</diff>
      <filename>activesupport/test/core_ext/uri_ext_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
 # encoding: utf-8
 require 'abstract_unit'
+require 'active_support/json'
 
 class TestJSONEncoding &lt; Test::Unit::TestCase
   class Foo</diff>
      <filename>activesupport/test/json/encoding_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 require 'abstract_unit'
 
-class MemoizableTest &lt; Test::Unit::TestCase
+class MemoizableTest &lt; ActiveSupport::TestCase
   class Person
     extend ActiveSupport::Memoizable
 
@@ -125,8 +125,13 @@ class MemoizableTest &lt; Test::Unit::TestCase
   end
 
   def test_memorized_results_are_immutable
-    assert_equal &quot;Josh&quot;, @person.name
-    assert_raise(ActiveSupport::FrozenObjectError) { @person.name.gsub!(&quot;Josh&quot;, &quot;Gosh&quot;) }
+    # This is purely a performance enhancement that we can revisit once the rest of
+    # the code is in place. Ideally, we'd be able to do memoization in a freeze-friendly
+    # way without amc hacks
+    pending do
+      assert_equal &quot;Josh&quot;, @person.name
+      assert_raise(ActiveSupport::FrozenObjectError) { @person.name.gsub!(&quot;Josh&quot;, &quot;Gosh&quot;) }
+    end
   end
 
   def test_reloadable</diff>
      <filename>activesupport/test/memoizable_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'abstract_unit'
+require 'active_support/core_ext/object/misc'
 
 class OptionMergerTest &lt; Test::Unit::TestCase
   def setup</diff>
      <filename>activesupport/test/option_merger_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -196,6 +196,18 @@ class TimeZoneTest &lt; Test::Unit::TestCase
     assert_equal(-18_000, zone.utc_offset)
   end
 
+  def test_seconds_to_utc_offset_with_colon
+    assert_equal &quot;-06:00&quot;, ActiveSupport::TimeZone.seconds_to_utc_offset(-21_600)
+    assert_equal &quot;+00:00&quot;, ActiveSupport::TimeZone.seconds_to_utc_offset(0)
+    assert_equal &quot;+05:00&quot;, ActiveSupport::TimeZone.seconds_to_utc_offset(18_000)
+  end
+
+  def test_seconds_to_utc_offset_without_colon
+    assert_equal &quot;-0600&quot;, ActiveSupport::TimeZone.seconds_to_utc_offset(-21_600, false)
+    assert_equal &quot;+0000&quot;, ActiveSupport::TimeZone.seconds_to_utc_offset(0, false)
+    assert_equal &quot;+0500&quot;, ActiveSupport::TimeZone.seconds_to_utc_offset(18_000, false)
+  end
+
   def test_formatted_offset_positive
     zone = ActiveSupport::TimeZone['Moscow']
     assert_equal &quot;+03:00&quot;, zone.formatted_offset</diff>
      <filename>activesupport/test/time_zone_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -54,12 +54,21 @@ ci      ALL=NOPASSWD: /usr/local/bin/geminstaller, /usr/local/bin/ruby, /usr/loc
 * Install/setup nginx:
 $ sudo aptitude install nginx
 $ sudo vi /etc/nginx/sites-available/default
+# Add the following entry at the top of the file above the 'server {' line:
+upstream mongrel {
+  server 127.0.0.1:3333;
+}
+
 # Change server_name entry to match server name
 
-# comment two lines and add one to proxy to ccrb:
-#               root   /var/www/nginx-default;
-#               index  index.html index.htm;
-                proxy_pass      http://127.0.0.1:3333;
+# replace the contents of the root 'location / {}' block with the following entries:
+    proxy_pass          http://mongrel;
+    proxy_redirect      off;
+    proxy_set_header    Host             $host;
+    proxy_set_header    X-Real-IP        $remote_addr;
+    proxy_set_header    X-Forwarded-For  $proxy_add_x_forwarded_for;
+    proxy_set_header    X-Client-Verify  SUCCESS;
+    proxy_read_timeout  65;
 
 # also comment default locations for /doc and /images
 $ sudo /etc/init.d/nginx start</diff>
      <filename>ci/ci_setup_notes.txt</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 Project.configure do |project|
  project.build_command = 'ruby ci/ci_build.rb'
-# project.email_notifier.emails = ['thewoolleyman@gmail.com']
- project.email_notifier.emails = ['thewoolleyman@gmail.com','michael@koziarski.com', 'david@loudthinking.com', 'jeremy@bitsweat.net', 'josh@joshpeek.com', 'pratiknaik@gmail.com', 'wycats@gmail.com']
+ project.email_notifier.emails = ['thewoolleyman@gmail.com']
+# project.email_notifier.emails = ['thewoolleyman@gmail.com','michael@koziarski.com', 'david@loudthinking.com', 'jeremy@bitsweat.net', 'josh@joshpeek.com', 'pratiknaik@gmail.com', 'wycats@gmail.com']
  project.email_notifier.from = 'thewoolleyman+railsci@gmail.com'
 end</diff>
      <filename>ci/cruise_config.rb</filename>
    </modified>
    <modified>
      <diff>@@ -247,6 +247,7 @@ end
 
 desc 'Generate guides (for authors), use ONLY=foo to process just &quot;foo.textile&quot;'
 task :guides do
+  ENV[&quot;WARN_BROKEN_LINKS&quot;] = &quot;1&quot; # authors can't disable this
   ruby &quot;guides/rails_guides.rb&quot;
 end
 </diff>
      <filename>railties/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -56,7 +56,12 @@ module Rails
         returning table = '&lt;table&gt;' do
           properties.each do |(name, value)|
             table &lt;&lt; %(&lt;tr&gt;&lt;td class=&quot;name&quot;&gt;#{CGI.escapeHTML(name.to_s)}&lt;/td&gt;)
-            table &lt;&lt; %(&lt;td class=&quot;value&quot;&gt;#{CGI.escapeHTML(value.to_s)}&lt;/td&gt;&lt;/tr&gt;)
+            formatted_value = if value.kind_of?(Array)
+                  &quot;&lt;ul&gt;&quot; + value.map { |v| &quot;&lt;li&gt;#{CGI.escapeHTML(v.to_s)}&lt;/li&gt;&quot; }.join + &quot;&lt;/ul&gt;&quot;
+                else
+                  CGI.escapeHTML(value.to_s)
+                end
+            table &lt;&lt; %(&lt;td class=&quot;value&quot;&gt;#{formatted_value}&lt;/td&gt;&lt;/tr&gt;)
           end
           table &lt;&lt; '&lt;/table&gt;'
         end
@@ -102,6 +107,10 @@ module Rails
       end
     end
 
+    property 'Middleware' do
+      ActionController::Dispatcher.middleware.active.map(&amp;:inspect)
+    end
+
     # The Rails Git revision, if it's checked out into vendor/rails.
     property 'Edge Rails revision' do
       edge_rails_revision</diff>
      <filename>railties/builtin/rails_info/rails/info.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ class Rails::InfoController &lt; ActionController::Base
     if consider_all_requests_local || local_request?
       render :inline =&gt; Rails::Info.to_html
     else
-      render :text =&gt; '&lt;p&gt;For security purposes, this information is only available to local requests.&lt;/p&gt;', :status =&gt; 500
+      render :text =&gt; '&lt;p&gt;For security purposes, this information is only available to local requests.&lt;/p&gt;', :status =&gt; :forbidden
     end
   end
 end</diff>
      <filename>railties/builtin/rails_info/rails/info_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,5 +3,5 @@
 # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
 # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
 
-# You can also remove all the silencers if you're trying do debug a problem that might steem from framework code.
+# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
 # Rails.backtrace_cleaner.remove_silencers!
\ No newline at end of file</diff>
      <filename>railties/configs/initializers/backtrace_silencers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,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
 
 # See everything in the log (default is :info)
 # config.log_level = :debug</diff>
      <filename>railties/environments/production.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,7 +12,6 @@ config.whiny_nils = true
 # Show full error reports and disable caching
 config.action_controller.consider_all_requests_local = true
 config.action_controller.perform_caching             = false
-config.action_view.cache_template_loading            = true
 
 # Disable request forgery protection in test environment
 config.action_controller.allow_forgery_protection    = false</diff>
      <filename>railties/environments/test.rb</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>railties/guides/images/fxn.jpg</filename>
    </modified>
    <modified>
      <diff>@@ -33,6 +33,7 @@ module RailsGuides
   autoload :Indexer, &quot;rails_guides/indexer&quot;
   autoload :Helpers, &quot;rails_guides/helpers&quot;
   autoload :TextileExtensions, &quot;rails_guides/textile_extensions&quot;
+  autoload :Levenshtein, &quot;rails_guides/levenshtein&quot;
 end
 
 RedCloth.send(:include, RailsGuides::TextileExtensions)</diff>
      <filename>railties/guides/rails_guides.rb</filename>
    </modified>
    <modified>
      <diff>@@ -48,7 +48,7 @@ module RailsGuides
 
         if guide =~ /\.erb\.textile/
           # Generate the erb pages with textile formatting - e.g. index/authors
-          result = view.render(:layout =&gt; 'layout', :file =&gt; name)
+          result = view.render(:layout =&gt; 'layout', :file =&gt; guide)
           f.write textile(result)
         else
           body = File.read(File.join(view_path, guide))
@@ -57,6 +57,7 @@ module RailsGuides
 
           result = view.render(:layout =&gt; 'layout', :text =&gt; textile(body))
           f.write result
+          warn_about_broken_links(result) if ENV.key?(&quot;WARN_BROKEN_LINKS&quot;)
         end
       end
     end
@@ -134,5 +135,38 @@ module RailsGuides
         code_blocks[$1.to_i]
       end
     end
+
+    def warn_about_broken_links(html)
+      anchors = extract_anchors(html)
+      check_fragment_identifiers(html, anchors)
+    end
+    
+    def extract_anchors(html)
+      # Textile generates headers with IDs computed from titles.
+      anchors = Set.new
+      html.scan(/&lt;h\d\s+id=&quot;([^&quot;]+)/).flatten.each do |anchor|
+        if anchors.member?(anchor)
+          puts &quot;*** DUPLICATE HEADER ID: #{anchor}, please consider rewording&quot; if ENV.key?(&quot;WARN_DUPLICATE_HEADERS&quot;)
+        else
+          anchors &lt;&lt; anchor
+        end
+      end
+
+      # Also, footnotes are rendered as paragraphs this way.
+      anchors += Set.new(html.scan(/&lt;p\s+class=&quot;footnote&quot;\s+id=&quot;([^&quot;]+)/).flatten)
+      return anchors
+    end
+    
+    def check_fragment_identifiers(html, anchors)
+      html.scan(/&lt;a\s+href=&quot;#([^&quot;]+)/).flatten.each do |fragment_identifier|
+        next if fragment_identifier == 'mainCol' # in layout, jumps to some DIV
+        unless anchors.member?(fragment_identifier)
+          guess = anchors.min { |a, b|
+            Levenshtein.distance(fragment_identifier, a) &lt;=&gt; Levenshtein.distance(fragment_identifier, b)
+          }
+          puts &quot;*** BROKEN LINK: ##{fragment_identifier}, perhaps you meant ##{guess}.&quot;
+        end
+      end
+    end
   end
 end</diff>
      <filename>railties/guides/rails_guides/generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -32,7 +32,7 @@ Here's a summary of the rack-related changes:
 * +CGI::Session::MemCacheStore+ has been replaced by +ActionController::Session::MemCacheStore+.
 * +CGI::Session::ActiveRecordStore+ has been replaced by +ActiveRecord::SessionStore+.
 * You can still change your session store with +ActionController::Base.session_store = :active_record_store+.
-* Default sessions options are still set with +ActionController::Base.session = { :key =&gt; &quot;...&quot; }+.
+* Default sessions options are still set with +ActionController::Base.session = { :key =&gt; &quot;...&quot; }+. However, the +:session_domain+ option has been renamed to +:domain+.
 * The mutex that normally wraps your entire request has been moved into middleware, +ActionController::Lock+.
 * +ActionController::AbstractRequest+ and +ActionController::Request+ have been unified. The new +ActionController::Request+ inherits from +Rack::Request+. This affects access to +response.headers['type']+ in test requests. Use +response.content_type+ instead.
 * +ActiveRecord::QueryCache+ middleware is automatically inserted onto the middleware stack if +ActiveRecord+ has been loaded. This middleware sets up and flushes the per-request Active Record query cache.
@@ -582,7 +582,7 @@ h4. Other Railties Changes
 * The default +environment.rb+ file has been decluttered.
 * The dbconsole script now lets you use an all-numeric password without crashing.
 * +Rails.root+ now returns a +Pathname+ object, which means you can use it directly with the +join+ method to &quot;clean up existing code&quot;:http://afreshcup.com/2008/12/05/a-little-rails_root-tidiness/ that uses +File.join+.
-* Various files in /public that deal with CGI and FCGI dispatching are no longer generated in every Rails application by default (you can still get them if you need them by adding +--with-dispatches+ when you run the +rails+ command, or add them later with +rake rails:generate_dispatchers+).
+* Various files in /public that deal with CGI and FCGI dispatching are no longer generated in every Rails application by default (you can still get them if you need them by adding +--with-dispatchers+ when you run the +rails+ command, or add them later with +rake rails:update:generate_dispatchers+).
 * Rails Guides have been converted from AsciiDoc to Textile markup.
 * Scaffolded views and controllers have been cleaned up a bit.
 * +script/server+ now accepts a &lt;tt&gt;--path&lt;/tt&gt; argument to mount a Rails application from a specific path.</diff>
      <filename>railties/guides/source/2_3_release_notes.textile</filename>
    </modified>
    <modified>
      <diff>@@ -111,7 +111,6 @@ h5. +last+
 &lt;tt&gt;Model.last(options = nil)&lt;/tt&gt; finds the last record matched by the supplied options. If no +options+ are supplied, the last matching record is returned. For example:
 
 &lt;ruby&gt;
-# Find the client with primary key (id) 10.
 client = Client.last
 =&gt; #&lt;Client id: 221, name: =&gt; &quot;Russel&quot;&gt;
 &lt;/ruby&gt;</diff>
      <filename>railties/guides/source/active_record_querying.textile</filename>
    </modified>
    <modified>
      <diff>@@ -18,9 +18,11 @@ h3. Basic Caching
 This is an introduction to the three types of caching techniques that Rails
 provides by default without the use of any third party plugins.
 
-To get started make sure +config.action_controller.perform_caching+ is set
-to +true+ for your environment. This flag is normally set in the
-corresponding config/environments/*.rb. By default, caching is disabled for development and test, and enabled for production.
+To start playing with testing you'll want to ensure that
++config.action_controller.perform_caching+ is set
+to +true+ if you're running in development mode. This flag is normally set in the
+corresponding config/environments/*.rb and caching is disabled by default
+ for development and test, and enabled for production.
 
 &lt;ruby&gt;
 config.action_controller.perform_caching = true
@@ -29,51 +31,56 @@ config.action_controller.perform_caching = true
 h4. Page Caching
 
 Page caching is a Rails mechanism which allows the request for a generated
-page to be fulfilled by the webserver, without ever having to go through the
+page to be fulfilled by the webserver (i.e. apache or nginx), without ever having to go through the
 Rails stack at all. Obviously, this is super-fast. Unfortunately, it can't be
 applied to every situation (such as pages that need authentication) and since
 the webserver is literally just serving a file from the filesystem, cache
 expiration is an issue that needs to be dealt with.
 
-So, how do you enable this super-fast cache behavior? Suppose you
+So, how do you enable this super-fast cache behavior?  Simple, let's say you
 have a controller called +ProductsController+ and an +index+ action that lists all
-the products. You could enable caching for this action like this:
+the products
 
 &lt;ruby&gt;
 class ProductsController &lt; ActionController
 
   caches_page :index
 
-  def index; end
+  def index
+    @products = Products.all
+  end
 
 end
 &lt;/ruby&gt;
 
-The first time anyone requests products/index, Rails will generate a file
-called +index.html+. If a web server see this file, it will be served in response to the
-next request for products/index, without your Rails application being called.
+The first time anyone requests +/products+, Rails will generate a file
+called +products.html+ and the webserver will then look for that file before it
+passes the next request for +/products+ to your Rails application.
 
-By default, the page cache directory is set to Rails.public_path (which is
-usually set to +File.join(self.root, &quot;public&quot;)+ - that is, the public directory under your Rails application's root). This can be configured by
+By default, the page cache directory is set to +Rails.public_path+ (which is
+usually set to the +public+ folder) and this can be configured by
 changing the configuration setting +config.action_controller.page_cache_directory+.
-Changing the default from /public helps avoid naming conflicts, since you may
-want to put other static html in /public, but changing this will require web
+Changing the default from +public+ helps avoid naming conflicts, since you may
+want to put other static html in +public+, but changing this will require web
 server reconfiguration to let the web server know where to serve the cached
 files from.
 
-The page caching mechanism will automatically add a +.html+ extension to
+The Page Caching mechanism will automatically add a +.html+ extension to
 requests for pages that do not have an extension to make it easy for the
-webserver to find those pages. This can be configured by changing the
+webserver to find those pages and this can be configured by changing the
 configuration setting +config.action_controller.page_cache_extension+.
 
-In order to expire this page when a new product is added you could extend the products controller like this:
+In order to expire this page when a new product is added we could extend our
+example controller like this:
 
 &lt;ruby&gt;
 class ProductsController &lt; ActionController
 
   caches_page :index
 
-  def index; end
+  def index
+    @products = Products.all
+  end
 
   def create
     expire_page :action =&gt; :index
@@ -85,45 +92,42 @@ end
 If you want a more complicated expiration scheme, you can use cache sweepers
 to expire cached objects when things change. This is covered in the section on Sweepers.
 
-Note: Page caching ignores all parameters, so /products/list?page=1 will be written out to the filesystem as /products/list.html and if someone requests /products/list?page=2, they will be returned the same result as page=1. Be careful when page caching GET parameters in the URL!
+Note: Page caching ignores all parameters. For example +/products?page=1+ will be written out to the filesystem as +products.html+ with no reference to the +page+ parameter. Thus, if someone requests +/products?page=2+ later, they will get the cached first page. Be careful when page caching GET parameters in the URL!
 
 h4. Action Caching
 
-One of the issues with page caching is that you cannot use it for pages that
-require checking code to determine whether the user should be permitted access. This is where Action Caching comes in.
-action caching works like page caching except for the fact that the incoming
-web request does go from the web server to the Rails stack and Action Pack so
-that before filters can be run on it before the cache is served. This allows you to use
-authentication and other restrictions while still serving the
+One of the issues with Page Caching is that you cannot use it for pages that
+require to restrict access somehow. This is where Action Caching comes in.
+Action Caching works like Page Caching except for the fact that the incoming
+web request does go from the webserver to the Rails stack and Action Pack so
+that before filters can be run on it before the cache is served. This allows
+authentication and other restriction to be run while still serving the
 result of the output from a cached copy.
 
-Clearing the cache works in the exact same way as with page caching.
+Clearing the cache works in the exact same way as with Page Caching.
 
-Let's say you only wanted authenticated users to edit or create a Product
-object, but still cache those pages:
+Let's say you only wanted authenticated users to call actions on +ProductsController+.
 
 &lt;ruby&gt;
 class ProductsController &lt; ActionController
 
-  before_filter :authenticate, :only =&gt; [ :edit, :create ]
-  caches_page :index
-  caches_action :edit
+  before_filter :authenticate
+  caches_action :index
 
-  def index; end
+  def index
+    @products = Product.all
+  end
 
   def create
-    expire_page :action =&gt; :index
-    expire_action :action =&gt; :edit
+    expire_action :action =&gt; :index
   end
 
-  def edit; end
-
 end
 &lt;/ruby&gt;
 
 You can also use +:if+ (or +:unless+) to pass a Proc that specifies when the
 action should be cached. Also, you can use +:layout =&gt; false+ to cache without
-layout so that dynamic information in the layout such as the name of the logged-in user
+layout so that dynamic information in the layout such as logged in user info
 or the number of items in the cart can be left uncached. This feature is
 available as of Rails 2.2.
 
@@ -149,7 +153,7 @@ Fragment Caching allows a fragment of view logic to be wrapped in a cache
 block and served out of the cache store when the next request comes in.
 
 As an example, if you wanted to show all the orders placed on your website
-in real time and didn't want to cache that part  of the page, but did want
+in real time and didn't want to cache that part of the page, but did want
 to cache the part of the page which lists all products available, you
 could use this piece of code:
 
@@ -160,35 +164,33 @@ could use this piece of code:
 
 &lt;% cache do %&gt;
   All available products:
-  &lt;% Product.find(:all).each do |p| %&gt;
+  &lt;% Product.all.each do |p| %&gt;
     &lt;%= link_to p.name, product_url(p) %&gt;
   &lt;% end %&gt;
 &lt;% end %&gt;
 &lt;/ruby&gt;
 
 The cache block in our example will bind to the action that called it and is
-written out to the same place as the action cache, which means that if you
+written out to the same place as the Action Cache, which means that if you
 want to cache multiple fragments per action, you should provide an +action_suffix+ to the cache call:
 
 &lt;ruby&gt;
-&lt;% cache(:action =&gt; 'recent', :action_suffix =&gt; 'all_prods') do %&gt;
+&lt;% cache(:action =&gt; 'recent', :action_suffix =&gt; 'all_products') do %&gt;
   All available products:
 &lt;/ruby&gt;
 
-You can expire the cache using the +expire_fragment+ method, like so:
+and you can expire it using the +expire_fragment+ method, like so:
 
 &lt;ruby&gt;
-expire_fragment(:controller =&gt; 'products', :action =&gt; 'recent', 
-  :action_suffix =&gt; 'all_prods)
+expire_fragment(:controller =&gt; 'products', :action =&gt; 'recent', :action_suffix =&gt; 'all_products')
 &lt;/ruby&gt;
 
-If you don't want the cache block to bind to the action that called it, you can
-also use globally keyed fragments. To do this, call the +cache+ method with a key, like
+If you don't want the cache block to bind to the action that called it, You can
+also use globally keyed fragments by calling the +cache+ method with a key, like
 so:
 
 &lt;ruby&gt;
-&lt;% cache(:key =&gt; 
-  ['all_available_products', @latest_product.created_at].join(':')) do %&gt;
+&lt;% cache('all_available_products') do %&gt;
   All available products:
 &lt;% end %&gt;
 &lt;/ruby&gt;
@@ -197,16 +199,15 @@ This fragment is then available to all actions in the +ProductsController+ using
 the key and can be expired the same way:
 
 &lt;ruby&gt;
-expire_fragment(:key =&gt; 
-  ['all_available_products', @latest_product.created_at].join(':'))
+expire_fragment('all_available_products')
 &lt;/ruby&gt;
 
 h4. Sweepers
 
 Cache sweeping is a mechanism which allows you to get around having a ton of
-+expire_{page,action,fragment}+ calls in your code. It does this by moving all the work
-required to expire cached content into na +ActionController::Caching::Sweeper+
-class. This class is an Observer that looks for changes to an object via callbacks,
++expire_{page,action,fragment}+ calls in your code.  It does this by moving all the work
+required to expire cached content into a +ActionController::Caching::Sweeper+
+class.  This class is an Observer and looks for changes to an object via callbacks,
 and when a change occurs it expires the caches associated with that object in
 an around or after filter.
 
@@ -214,9 +215,8 @@ Continuing with our Product controller example, we could rewrite it with a
 sweeper like this:
 
 &lt;ruby&gt;
-class StoreSweeper &lt; ActionController::Caching::Sweeper
-  # This sweeper is going to keep an eye on the Product model
-  observe Product
+class ProductSweeper &lt; ActionController::Caching::Sweeper
+  observe Product # This sweeper is going to keep an eye on the Product model
 
   # If our sweeper detects that a Product was created call this
   def after_create(product)
@@ -234,91 +234,82 @@ class StoreSweeper &lt; ActionController::Caching::Sweeper
   end
 
   private
-  def expire_cache_for(record)
-    # Expire the list page now that we added a new product
-    expire_page(:controller =&gt; '#{record}', :action =&gt; 'list')
+  def expire_cache_for(product)
+    # Expire the index page now that we added a new product
+    expire_page(:controller =&gt; 'products', :action =&gt; 'index')
 
     # Expire a fragment
-    expire_fragment(:controller =&gt; '#{record}', 
-      :action =&gt; 'recent', :action_suffix =&gt; 'all_products')
+    expire_fragment('all_available_products')
   end
 end
 &lt;/ruby&gt;
 
-The sweeper has to be added to the controller that will use it. So, if we wanted to expire the cached content for the
+You may notice that the actual product gets passed to the sweeper, so if we
+were caching the edit action for each product, we could add a expire method
+which specifies the page we want to expire:
+
+&lt;ruby&gt;
+  expire_action(:controller =&gt; 'products', :action =&gt; 'edit', :id =&gt; product)
+&lt;/ruby&gt;
+
+Then we add it to our controller to tell it to call the sweeper when certain
+actions are called. So, if we wanted to expire the cached content for the
 list and edit actions when the create action was called, we could do the
 following:
 
 &lt;ruby&gt;
 class ProductsController &lt; ActionController
 
-  before_filter :authenticate, :only =&gt; [ :edit, :create ]
-  caches_page :list
-  caches_action :edit
-  cache_sweeper :store_sweeper, :only =&gt; [ :create ]
-
-  def list; end
+  before_filter :authenticate
+  caches_action :index
+  cache_sweeper :product_sweeper
 
-  def create
-    expire_page :action =&gt; :list
-    expire_action :action =&gt; :edit
+  def index
+    @products = Product.all
   end
 
-  def edit; end
-
 end
 &lt;/ruby&gt;
 
 h4. SQL Caching
 
 Query caching is a Rails feature that caches the result set returned by each
-query. If Rails encounters the same query again during the current request, it
+query so that if Rails encounters the same query again for that request, it
 will used the cached result set as opposed to running the query against the
-database.
+database again.
 
 For example:
 
 &lt;ruby&gt;
 class ProductsController &lt; ActionController
 
-  before_filter :authenticate, :only =&gt; [ :edit, :create ]
-  caches_page :list
-  caches_action :edit
-  cache_sweeper :store_sweeper, :only =&gt; [ :create ]
-
-  def list
+  def index
     # Run a find query
-    Product.find(:all)
+    @products = Product.all
 
     ...
 
     # Run the same query again
-    Product.find(:all)
-  end
-
-  def create
-    expire_page :action =&gt; :list
-    expire_action :action =&gt; :edit
+    @products = Product.all
   end
 
-  def edit; end
-
 end
 &lt;/ruby&gt;
 
-In the 'list' action above, the result set returned by the first
-Product.find(:all) will be cached and will be used to avoid querying the
-database again the second time that finder is called.
+The second time the same query is run against the database, it's not actually
+going to hit the database.  The first time the result is returned from the query
+it is stored in the query cache (in memory) and the second time it's pulled from memory.
 
-Query caches are created at the start of an action and destroyed at the end of
-that action and thus persist only for the duration of the action.
+However, it's important to note that query caches are created at the start of an action and destroyed at the end of
+that action and thus persist only for the duration of the action.  If you'd like to store query results in a more
+persistent fashion, you can in Rails by using low level caching.
 
-h4. Cache Stores
+h4. Cache stores
 
 Rails (as of 2.1) provides different stores for the cached data created by action and
 fragment caches. Page caches are always stored on disk.
 
-Rails 2.1 and above provide ActiveSupport::Cache::Store which can be used to
+Rails 2.1 and above provide +ActiveSupport::Cache::Store+ which can be used to
 cache strings. Some cache store implementations, like MemoryStore, are able to
 cache arbitrary Ruby objects, but don't count on every cache store to be able
 to do that.
@@ -344,12 +335,13 @@ need thread-safety.
 ActionController::Base.cache_store = :memory_store
 &lt;/ruby&gt;
 
-2) ActiveSupport::Cache::FileStore: Cached data is stored on the disk. This is
+2) ActiveSupport::Cache::FileStore: Cached data is stored on the disk, this is
 the default store and the default path for this store is: /tmp/cache. Works
 well for all types of environments and allows all processes running from the
 same application directory to access the cached content. If /tmp/cache does not
 exist, the default store becomes MemoryStore.
 
+
 &lt;ruby&gt;
 ActionController::Base.cache_store = :file_store, &quot;/path/to/cache/directory&quot;
 &lt;/ruby&gt;
@@ -359,6 +351,7 @@ DRb process that all servers communicate with. This works for all environments
 and only keeps one cache around for all processes, but requires that you run
 and manage a separate DRb process.
 
+
 &lt;ruby&gt;
 ActionController::Base.cache_store = :drb_store, &quot;druby://localhost:9192&quot;
 &lt;/ruby&gt;
@@ -368,28 +361,26 @@ Rails uses the bundled memcached-client gem by default. This is currently the
 most popular cache store for production websites.
 
 Special features:
-
-* Clustering and load balancing. One can specify multiple memcached servers,
+ * Clustering and load balancing. One can specify multiple memcached servers,
    and MemCacheStore will load balance between all available servers. If a
    server goes down, then MemCacheStore will ignore it until it goes back
    online.
-* Time-based expiry support. See +write+ and the +:expires_in+ option.
-* Per-request in memory cache for all communication with the MemCache server(s).
+ * Time-based expiry support. See +write+ and the +:expires_in+ option.
+ * Per-request in memory cache for all communication with the MemCache server(s).
 
 It also accepts a hash of additional options:
 
-* +:namespace+- specifies a string that will automatically be prepended to keys when accessing the memcached store.
-* +:readonly+- a boolean value that when set to true will make the store read-only, with an error raised on any attempt to write.
-* +:multithread+ - a boolean value that adds thread safety to read/write operations - it is unlikely you'll need to use this option as the Rails threadsafe! method offers the same functionality.
+ * +:namespace+- specifies a string that will automatically be prepended to keys when accessing the memcached store.
+ * +:readonly+- a boolean value that when set to true will make the store read-only, with an error raised on any attempt to write.
+ * +:multithread+ - a boolean value that adds thread safety to read/write operations - it is unlikely you'll need to use this option as the Rails threadsafe! method offers the same functionality.
 
 The read and write methods of the MemCacheStore accept an options hash too.
-When reading you can specify +:raw =&gt; true+ to prevent the object being
-marshaled
+When reading you can specify +:raw =&gt; true+ to prevent the object being marshaled
 (by default this is false which means the raw value in the cache is passed to
 +Marshal.load+ before being returned to you.)
 
-When writing to the cache it is also possible to specify +:raw =&gt; true+. This means
-that the value is not passed to +Marshal.dump+ before being stored in the cache (by
+When writing to the cache it is also possible to specify +:raw =&gt; true+ means
+the value is not passed to +Marshal.dump+ before being stored in the cache (by
 default this is false). 
 
 The write method also accepts an +:unless_exist+ flag which determines whether
@@ -424,15 +415,14 @@ ActionController::Base.cache_store = :compressed_mem_cache_store, &quot;localhost&quot;
 ActionController::Base.cache_store = MyOwnStore.new(&quot;parameter&quot;)
 &lt;/ruby&gt;
 
-NOTE: +config.cache_store+ can be used in place of
-+ActionController::Base.cache_store+ in the +Rails::Initializer.run+ block in
-environment.rb.
++Note: +config.cache_store+ can be used in place of
++ActionController::Base.cache_store+ in your +Rails::Initializer.run+ block in
++environment.rb+
 
 In addition to all of this, Rails also adds the +ActiveRecord::Base#cache_key+
-method that generates a key using the class name, id and updated_at timestamp
-(if available).
+method that generates a key using the class name, +id+ and +updated_at+ timestamp (if available).
 
-An example:
+You can access these cache stores at a low level for storing queries and other objects. Here's an example:
 
 &lt;ruby&gt;
 Rails.cache.read(&quot;city&quot;)   # =&gt; nil
@@ -440,18 +430,18 @@ Rails.cache.write(&quot;city&quot;, &quot;Duckburgh&quot;)
 Rails.cache.read(&quot;city&quot;)   # =&gt; &quot;Duckburgh&quot;
 &lt;/ruby&gt;
 
-h3. Conditional GET Support
+h3. Conditional GET support
 
 Conditional GETs are a feature of the HTTP specification that provide a way for web
 servers to tell browsers that the response to a GET request hasn't changed
 since the last request and can be safely pulled from the browser cache.
 
-They work by using the HTTP_IF_NONE_MATCH and HTTP_IF_MODIFIED_SINCE headers to
-pass back and forth both a unique content identifier and the timestamp of when
-the content was last changed. If the browser makes a request where the content
-identifier (etag) or last modified since timestamp matches the server&#8217;s version
-then the server only needs to send back an empty response with a not modified
-status.
+They work by using the +HTTP_IF_NONE_MATCH+ and +HTTP_IF_MODIFIED_SINCE+ headers
+to pass back and forth both a unique content identifier and the timestamp of
+when the content was last changed. If the browser makes a request where the
+content identifier (etag) or last modified since timestamp matches the server&#8217;s
+version then the server only needs to send back an empty response with a not
+modified status.
 
 It is the server's (i.e. our) responsibility to look for a last modified
 timestamp and the if-none-match header and determine whether or not to send
@@ -509,16 +499,18 @@ Also the new &quot;Cache money&quot;:http://github.com/nkallen/cache-money/tree/master plu
 
 h3. References
 
+* &quot;Scaling Rails Screencasts&quot;:http://railslab.newrelic.com/scaling-rails
 * &quot;RailsEnvy, Rails Caching Tutorial, Part 1&quot;:http://www.railsenvy.com/2007/2/28/rails-caching-tutorial
 * &quot;RailsEnvy, Rails Caching Tutorial, Part 1&quot;:http://www.railsenvy.com/2007/3/20/ruby-on-rails-caching-tutorial-part-2
 * &quot;ActiveSupport::Cache documentation&quot;:http://api.rubyonrails.org/classes/ActiveSupport/Cache.html
 * &quot;Rails 2.1 integrated caching tutorial&quot;:http://thewebfellas.com/blog/2008/6/9/rails-2-1-now-with-better-integrated-caching
 
-h3. Changelog
 
+h3. Changelog
 &quot;Lighthouse ticket&quot;:http://rails.lighthouseapp.com/projects/16213-rails-guides/tickets/10-guide-to-caching
 
-* February  22, 2009: Beefed up the section on cache_stores
-* December  27, 2008: Typo fixes
-* November  23, 2008: Incremental updates with various suggested changes and formatting cleanup
-* September 15, 2008: Initial version by Aditya Chadha
+April      1, 2009: Made a bunch of small fixes
+February  22, 2009: Beefed up the section on cache_stores
+December  27, 2008: Typo fixes
+November  23, 2008: Incremental updates with various suggested changes and formatting cleanup
+September 15, 2008: Initial version by Aditya Chadha</diff>
      <filename>railties/guides/source/caching_with_rails.textile</filename>
    </modified>
    <modified>
      <diff>@@ -683,7 +683,7 @@ This would result in +params[:addresses]+ being an array of hashes with keys +li
 
 There's a restriction, however, while hashes can be nested arbitrarily, only one level of &quot;arrayness&quot; is allowed. Arrays can be usually replaced by hashes, for example instead of having an array of model objects one can have a hash of model objects keyed by their id, an array index or some other parameter.
 
-WARNING: Array parameters do not play well with the +check_box+ helper. According to the HTML specification unchecked checkboxes submit no value. However it is often convenient for a checkbox to always submit a value. The +check_box+ helper fakes this by creating a second hidden input with the same name. If the checkbox is unchecked only the hidden input is submitted and if it is checked then both are submitted but the value submitted by the checkbox takes precedence. When working with array parameters this duplicate submission will confuse Rails since duplicate input names are how it decides when to start a new array element. It is preferable to either use +check_box_tag+ or to use hashes instead of arrays.
+WARNING: Array parameters do not play well with the +check_box+ helper. According to the HTML specification unchecked checkboxes submit no value. However it is often convenient for a checkbox to always submit a value. The +check_box+ helper fakes this by creating an auxiliary hidden input with the same name. If the checkbox is unchecked only the hidden input is submitted and if it is checked then both are submitted but the value submitted by the checkbox takes precedence. When working with array parameters this duplicate submission will confuse Rails since duplicate input names are how it decides when to start a new array element. It is preferable to either use +check_box_tag+ or to use hashes instead of arrays.
 
 h4. Using Form Helpers
 </diff>
      <filename>railties/guides/source/form_helpers.textile</filename>
    </modified>
    <modified>
      <diff>@@ -312,7 +312,7 @@ Now if you navigate to +http://localhost:3000+ in your browser, you'll see the +
 
 NOTE. For more information about routing, refer to &quot;Rails Routing from the Outside In&quot;:routing.html.
 
-h3. Getting Up and Running Quickly With Scaffolding
+h3. Getting Up and Running Quickly with Scaffolding
 
 Rails _scaffolding_ is a quick way to generate some of the major pieces of an application. If you want to create the models, views, and controllers for a new resource in a single operation, scaffolding is the tool for the job.
 
@@ -474,7 +474,7 @@ This code sets the +@posts+ instance variable to an array of all posts in the da
 
 TIP: For more information on finding records with Active Record, see &quot;Active Record Query Interface&quot;:active_record_querying.html.
 
-The +respond_to+ block handles both HTML and XML calls to this action. If you browse to +http://localhost:3000/posts.xml+, you'll see all of the posts in XML format. The HTML format looks for a view in +app/views/posts/+ with a name that corresponds to the action name. Rails makes all of the instance variables from the action available to the view. Here's +app/view/posts/index.html.erb+:
+The +respond_to+ block handles both HTML and XML calls to this action. If you browse to +http://localhost:3000/posts.xml+, you'll see all of the posts in XML format. The HTML format looks for a view in +app/views/posts/+ with a name that corresponds to the action name. Rails makes all of the instance variables from the action available to the view. Here's +app/views/posts/index.html.erb+:
 
 &lt;erb&gt;
 &lt;h1&gt;Listing posts&lt;/h1&gt;
@@ -1269,7 +1269,7 @@ You'll also need to modify +views/posts/_form.html.erb+ to include the tags:
 
 With these changes in place, you'll find that you can edit a post and its tags directly on the same view.
 
-NOTE. You may want to use javascript to dynamically add additional tags on a single form. For an example of this and other advanced techniques, see the &quot;nested model sample application&quot;:http://github.com/alloy/complex-form-examples/tree/nested_attributes.
+NOTE. You may want to use JavaScript to dynamically add additional tags on a single form. For an example of this and other advanced techniques, see the &quot;complex form examples application&quot;:http://github.com/alloy/complex-form-examples/tree/master.
 
 h3. What's Next?
 </diff>
      <filename>railties/guides/source/getting_started.textile</filename>
    </modified>
    <modified>
      <diff>@@ -959,7 +959,7 @@ On pages generated by +NewsController+, you want to hide the top menu and add a
   &lt;div id=&quot;right_menu&quot;&gt;Right menu items here&lt;/div&gt;
   &lt;%= yield(:news_content) or yield %&gt;
   &lt;% end -%&gt;
-&lt;% render :file =&gt; 'layouts/application' %&gt;
+&lt;%= render :file =&gt; 'layouts/application' %&gt;
 &lt;/erb&gt;
 
 That's it. The News views will use the new layout, hiding the top menu and adding a new right menu inside the &quot;content&quot; div.</diff>
      <filename>railties/guides/source/layouts_and_rendering.textile</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,7 @@ This guide covers Rails integration with Rack and interfacing with other Rack co
 
 endprologue.
 
-WARNING: This guide assumes a working knowledge of Rack protocol and Rack concepts such as middlewares, url maps and Rack::Builder.
+WARNING: This guide assumes a working knowledge of Rack protocol and Rack concepts such as middlewares, url maps and +Rack::Builder+.
 
 h3. Introduction to Rack
 
@@ -51,9 +51,9 @@ app = Rack::Builder.new {
 Middlewares used in the code above are primarily useful only in the development envrionment. The following table explains their usage:
 
 |_.Middleware|_.Purpose|
-|Rails::Rack::LogTailer|Appends log file output to console|
-|Rails::Rack::Static|Serves static files inside +RAILS_ROOT/public+ directory|
-|Rails::Rack::Debugger|Starts Debugger|
+|+Rails::Rack::LogTailer+|Appends log file output to console|
+|+Rails::Rack::Static+|Serves static files inside +RAILS_ROOT/public+ directory|
+|+Rails::Rack::Debugger+|Starts Debugger|
 
 h4. +rackup+
 
@@ -101,7 +101,7 @@ use Rack::Lock
 use ActionController::Failsafe
 use ActionController::Session::CookieStore, , {:secret=&gt;&quot;&lt;secret&gt;&quot;, :session_key=&gt;&quot;_&lt;app&gt;_session&quot;}
 use Rails::Rack::Metal
-use ActionController::RewindableInput
+use ActionDispatch::RewindableInput
 use ActionController::ParamsParser
 use Rack::MethodOverride
 use Rack::Head
@@ -109,7 +109,7 @@ use ActiveRecord::QueryCache
 run ActionController::Dispatcher.new
 &lt;/ruby&gt;
 
-Purpose of each of this middlewares is explained in &quot;Internal Middlewares&quot;:#internal-middleware-stack section.
+Purpose of each of this middlewares is explained in the &quot;Internal Middlewares&quot;:#internal-middleware-stack section.
 
 h4. Configuring Middleware Stack
 
@@ -128,7 +128,7 @@ You can add a new middleware to the middleware stack using any of the following
 &lt;strong&gt;Example:&lt;/strong&gt;
 
 &lt;ruby&gt;
-# environment.rb
+# config/environment.rb
 
 # Push Rack::BounceFavicon at the bottom
 config.middleware.use Rack::BounceFavicon
@@ -145,7 +145,7 @@ You can swap an existing middleware in the middleware stack using +config.middle
 &lt;strong&gt;Example:&lt;/strong&gt;
 
 &lt;ruby&gt;
-# environment.rb
+# config/environment.rb
 
 # Replace ActionController::Failsafe with Lifo::Failsafe
 config.middleware.swap ActionController::Failsafe, Lifo::Failsafe
@@ -166,14 +166,14 @@ h4. Internal Middleware Stack
 Much of Action Controller's functionality is implemented as Middlewares. The following table explains the purpose of each of them:
 
 |_.Middleware|_.Purpose|
-|Rack::Lock|Sets +env[&quot;rack.multithread&quot;]+ flag to +true+ and wraps the application within a Mutex.|
-|ActionController::Failsafe|Returns HTTP Status +500+ to the client if an exception gets raised while dispatching.|
-|ActiveRecord::QueryCache|Enable the Active Record query cache.|
-|ActionController::Session::CookieStore|Uses the cookie based session store.|
-|ActionController::Session::MemCacheStore|Uses the memcached based session store.|
-|ActiveRecord::SessionStore|Uses the database based session store.|
-|Rack::MethodOverride|Sets HTTP method based on +_method+ parameter or +env[&quot;HTTP_X_HTTP_METHOD_OVERRIDE&quot;]+.|
-|Rack::Head|Discards the response body if the client sends a +HEAD+ request.|
+|+Rack::Lock+|Sets +env[&quot;rack.multithread&quot;]+ flag to +true+ and wraps the application within a Mutex.|
+|+ActionController::Failsafe+|Returns HTTP Status +500+ to the client if an exception gets raised while dispatching.|
+|+ActiveRecord::QueryCache+|Enable the Active Record query cache.|
+|+ActionController::Session::CookieStore+|Uses the cookie based session store.|
+|+ActionController::Session::MemCacheStore+|Uses the memcached based session store.|
+|+ActiveRecord::SessionStore+|Uses the database based session store.|
+|+Rack::MethodOverride+|Sets HTTP method based on +_method+ parameter or +env[&quot;HTTP_X_HTTP_METHOD_OVERRIDE&quot;]+.|
+|+Rack::Head+|Discards the response body if the client sends a +HEAD+ request.|
 
 TIP: It's possible to use any of the above middlewares in your custom Rack stack.
 
@@ -229,7 +229,7 @@ h3. Rails Metal Applications
 
 Rails Metal applications are minimal Rack applications specially designed for integrating with a typical Rails application. As Rails Metal Applications skip all of the Action Controller stack, serving a request has no overhead from the Rails framework itself. This is especially useful for infrequent cases where the performance of the full stack Rails framework is an issue.
 
-Ryan Bates' railscast on the &quot;Rails Metal&quot;:http://railscasts.com/episodes/150-rails-metal provides a nice walkthrough generating and using Rails Metal.
+Ryan Bates' &quot;railscast on Rails Metal&quot;:http://railscasts.com/episodes/150-rails-metal provides a nice walkthrough generating and using Rails Metal.
 
 h4. Generating a Metal Application
 
@@ -256,7 +256,7 @@ class Poller
 end
 &lt;/ruby&gt;
 
-Metal applications within +app/metal+ folders in plugins will also be discovered and added to the list 
+Metal applications within +app/metal+ folders in plugins will also be discovered and added to the list.
 
 Metal applications are an optimization. You should make sure to &quot;understand the related performance implications&quot;:http://weblog.rubyonrails.org/2008/12/20/performance-of-rails-metal before using it.
 </diff>
      <filename>railties/guides/source/rails_on_rack.textile</filename>
    </modified>
    <modified>
      <diff>@@ -582,7 +582,7 @@ To add a member route, use the +:member+ option:
 map.resources :photos, :member =&gt; { :preview =&gt; :get }
 &lt;/ruby&gt;
 
-This will enable Rails to recognize URLs such as +/photos/1/preview+ using the GET HTTP verb, and route them to the preview action of the Photos controller. It will also create a +preview_photo+ route helper.
+This will enable Rails to recognize URLs such as +/photos/1/preview+ using the GET HTTP verb, and route them to the preview action of the Photos controller. It will also create the +preview_photo_url+ and +preview_photo_path+ route helpers.
 
 Within the hash of member routes, each route name specifies the HTTP verb that it will recognize. You can use +:get+, +:put+, +:post+, +:delete+, or +:any+ here. You can also specify an array of methods, if you need more than one but you don't want to allow just anything:
 
@@ -598,7 +598,7 @@ To add a collection route, use the +:collection+ option:
 map.resources :photos, :collection =&gt; { :search =&gt; :get }
 &lt;/ruby&gt;
 
-This will enable Rails to recognize URLs such as +/photos/search+ using the GET HTTP verb, and route them to the search action of the Photos controller. It will also create a +search_photos+ route helper.
+This will enable Rails to recognize URLs such as +/photos/search+ using the GET HTTP verb, and route them to the search action of the Photos controller. It will also create the +search_photos_url+ and +search_photos_path+ route helpers.
 
 Just as with member routes, you can specify an array of methods for a collection route:
 
@@ -614,7 +614,7 @@ To add a new route (one that creates a new resource), use the +:new+ option:
 map.resources :photos, :new =&gt; { :upload =&gt; :post }
 &lt;/ruby&gt;
 
-This will enable Rails to recognize URLs such as +/photos/upload+ using the POST HTTP verb, and route them to the upload action of the Photos controller. It will also create a +upload_photos+ route helper.
+This will enable Rails to recognize URLs such as +/photos/upload+ using the POST HTTP verb, and route them to the upload action of the Photos controller. It will also create the +upload_photos_path+ and +upload_photos_url+ route helpers.
 
 TIP: If you want to redefine the verbs accepted by one of the standard actions, you can do so by explicitly mapping that action. For example:&lt;br/&gt;+map.resources :photos, :new =&gt; { :new =&gt; :any }+&lt;br/&gt;This will allow the new action to be invoked by any request to +photos/new+, no matter what HTTP verb you use.
 </diff>
      <filename>railties/guides/source/routing.textile</filename>
    </modified>
    <modified>
      <diff>@@ -99,7 +99,12 @@
       }
       #about-content td.name  {color: #555}
       #about-content td.value {color: #000}
-      
+
+      #about-content ul {
+        padding: 0;
+        list-style-type: none;
+      }
+
       #about-content.failure {
         background-color: #fcc;
         border: 1px solid #f00;</diff>
      <filename>railties/html/index.html</filename>
    </modified>
    <modified>
      <diff>@@ -20,5 +20,5 @@
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #++
-require 'action_controller/dispatcher'
+require 'action_controller/dispatch/dispatcher'
 Dispatcher = ActionController::Dispatcher</diff>
      <filename>railties/lib/dispatcher.rb</filename>
    </modified>
    <modified>
      <diff>@@ -378,8 +378,11 @@ Run `rake gems:install` to install the missing gems.
 
     def load_view_paths
       if configuration.frameworks.include?(:action_view)
-        ActionController::Base.view_paths.load! if configuration.frameworks.include?(:action_controller)
-        ActionMailer::Base.view_paths.load! if configuration.frameworks.include?(:action_mailer)
+        if configuration.cache_classes
+          view_path = ActionView::Template::FileSystemPath.new(configuration.view_path)
+          ActionController::Base.view_paths = view_path if configuration.frameworks.include?(:action_controller)
+          ActionMailer::Base.template_root = view_path if configuration.frameworks.include?(:action_mailer)
+        end
       end
     end
 
@@ -565,7 +568,7 @@ Run `rake gems:install` to install the missing gems.
       Rails::Rack::Metal.metal_paths += plugin_loader.engine_metal_paths
 
       configuration.middleware.insert_before(
-        :&quot;ActionController::RewindableInput&quot;,
+        :&quot;ActionDispatch::RewindableInput&quot;,
         Rails::Rack::Metal, :if =&gt; Rails::Rack::Metal.metals.any?)
     end
 </diff>
      <filename>railties/lib/initializer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -83,7 +83,9 @@ namespace :rails do
   desc &quot;Applies the template supplied by LOCATION=/path/to/template&quot;
   task :template do
     require 'rails_generator/generators/applications/app/template_runner'
-    Rails::TemplateRunner.new(ENV[&quot;LOCATION&quot;])
+    template = ENV[&quot;LOCATION&quot;]
+    template = File.expand_path(template) if template !~ %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://}
+    Rails::TemplateRunner.new(template)
   end
 
   namespace :update do</diff>
      <filename>railties/lib/tasks/framework.rake</filename>
    </modified>
    <modified>
      <diff>@@ -3,9 +3,9 @@
 silence_warnings { RAILS_ENV = &quot;test&quot; }
 
 require 'test/unit'
-require 'action_controller/test_case'
+require 'action_controller/testing/test_case'
 require 'action_view/test_case'
-require 'action_controller/integration'
+require 'action_controller/testing/integration'
 require 'action_mailer/test_case' if defined?(ActionMailer)
 
 if defined?(ActiveRecord)</diff>
      <filename>railties/lib/test_help.rb</filename>
    </modified>
    <modified>
      <diff>@@ -351,7 +351,7 @@ class InitializerDatabaseMiddlewareTest &lt; Test::Unit::TestCase
 
   def test_database_middleware_doesnt_initialize_when_session_store_is_not_active_record
     store = ActionController::Base.session_store
-    ActionController::Base.session_store = ActionController::Session::CookieStore
+    ActionController::Base.session_store = ActionDispatch::Session::CookieStore
 
     # Define the class, so we don't have to actually make it load
     eval(&quot;class ActiveRecord::ConnectionAdapters::ConnectionManagement; end&quot;)
@@ -380,12 +380,6 @@ class InitializerViewPathsTest  &lt; Test::Unit::TestCase
     ActionMailer::Base.view_paths.expects(:load!).never
     Rails::Initializer.run(:load_view_paths, @config)
   end
-  
-  def test_load_view_paths_loads_view_paths
-    ActionController::Base.view_paths.expects(:load!)
-    ActionMailer::Base.view_paths.expects(:load!)
-    Rails::Initializer.run(:load_view_paths, @config)
-  end
 end
 
 class RailsRootTest &lt; Test::Unit::TestCase</diff>
      <filename>railties/test/initializer_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,52 +1,46 @@
 require 'abstract_unit'
 require 'action_controller'
-require 'action_controller/test_process'
+require 'action_controller/testing/process'
 
-module Rails; end
 require 'rails/info'
 require 'rails/info_controller'
 
-class Rails::InfoController &lt; ActionController::Base
-  @local_request = false
-  class &lt;&lt; self
-    cattr_accessor :local_request
-  end
-  
-  # Re-raise errors caught by the controller.
-  def rescue_action(e) raise e end;
-  
-protected
-  def local_request?
-    self.class.local_request
-  end
-end
-
 ActionController::Routing::Routes.draw do |map|
   map.connect ':controller/:action/:id'
 end
 
-class Rails::InfoControllerTest &lt; ActionController::TestCase
+class InfoControllerTest &lt; ActionController::TestCase
+  tests Rails::InfoController
+
   def setup
-    @controller = Rails::InfoController.new
-    @request    = ActionController::TestRequest.new
-    @response   = ActionController::TestResponse.new
+    @controller.stubs(:consider_all_requests_local =&gt; false, :local_request? =&gt; true)
+  end
+
+  test &quot;info controller does not allow remote requests&quot; do
+    @controller.stubs(:consider_all_requests_local =&gt; false, :local_request? =&gt; false)
+    get :properties
+    assert_response :forbidden
+  end
 
-    ActionController::Base.consider_all_requests_local = true
+  test &quot;info controller renders an error message when request was forbidden&quot; do
+    @controller.stubs(:consider_all_requests_local =&gt; false, :local_request? =&gt; false)
+    get :properties
+    assert_select 'p'
+  end
+
+  test &quot;info controller allows requests when all requests are considered local&quot; do
+    @controller.stubs(:consider_all_requests_local =&gt; true, :local_request? =&gt; false)
+    get :properties
+    assert_response :success
   end
 
-  def test_rails_info_properties_table_rendered_for_local_request
-    Rails::InfoController.local_request = true
+  test &quot;info controller allows local requests&quot; do
     get :properties
-    assert_tag :tag =&gt; 'table'
     assert_response :success
   end
-  
-  def test_rails_info_properties_error_rendered_for_non_local_request
-    Rails::InfoController.local_request = false
-    ActionController::Base.consider_all_requests_local = false
 
+  test &quot;info controller renders a table with properties&quot; do
     get :properties
-    assert_tag :tag =&gt; 'p'
-    assert_response 500
+    assert_select 'table'
   end
 end</diff>
      <filename>railties/test/rails_info_controller_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,12 @@
 $:.unshift File.dirname(__FILE__) + &quot;/../lib&quot;
 $:.unshift File.dirname(__FILE__) + &quot;/../builtin/rails_info&quot;
 $:.unshift File.dirname(__FILE__) + &quot;/../../activesupport/lib&quot;
+$:.unshift File.dirname(__FILE__) + &quot;/../../actionpack/lib&quot;
 
 require 'test/unit'
 require 'active_support'
+require 'active_support/test_case'
+require 'action_controller'
 
 unless defined?(Rails) &amp;&amp; defined?(Rails::Info)
   module Rails
@@ -11,7 +14,7 @@ unless defined?(Rails) &amp;&amp; defined?(Rails::Info)
   end
 end
 
-class InfoTest &lt; Test::Unit::TestCase
+class InfoTest &lt; ActiveSupport::TestCase
   def setup
     Rails.send :remove_const, :Info
     silence_warnings { load 'rails/info.rb' }
@@ -72,6 +75,18 @@ EOS
     end
   end
 
+  def test_middleware_property
+    assert property_defined?('Middleware')
+  end
+
+  def test_html_includes_middleware
+    html = Rails::Info.to_html
+    assert html.include?('&lt;tr&gt;&lt;td class=&quot;name&quot;&gt;Middleware&lt;/td&gt;')
+    properties.value_for('Middleware').each do |value|
+      assert html.include?(&quot;&lt;li&gt;#{CGI.escapeHTML(value)}&lt;/li&gt;&quot;)
+    end
+  end
+
   protected
     def svn_info=(info)
       Rails::Info.module_eval do</diff>
      <filename>railties/test/rails_info_test.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>actionpack/lib/action_controller/assertions/dom_assertions.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/assertions/model_assertions.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/assertions/response_assertions.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/assertions/routing_assertions.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/assertions/selector_assertions.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/assertions/tag_assertions.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/base.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/benchmarking.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/cgi_ext.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/cgi_ext/cookie.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/cgi_ext/query_extension.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/cgi_ext/stdinput.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/cgi_process.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/cookies.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/dispatcher.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/failsafe.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/filters.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/flash.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/headers.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/helpers.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/http_authentication.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/integration.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/layout.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/middleware_stack.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/middlewares.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/mime_responds.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/mime_type.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/mime_types.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/params_parser.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/performance_test.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/polymorphic_routes.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/reloader.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/request.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/request_forgery_protection.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/rescue.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/resources.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/response.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/rewindable_input.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/session/abstract_store.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/session/cookie_store.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/session/mem_cache_store.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/session_management.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/status_codes.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/streaming.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/templates/rescues/_request_and_response.erb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/templates/rescues/_trace.erb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/templates/rescues/diagnostics.erb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/templates/rescues/layout.erb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/templates/rescues/missing_template.erb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/templates/rescues/routing_error.erb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/templates/rescues/template_error.erb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/templates/rescues/unknown_action.erb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/test_case.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/test_process.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/uploaded_file.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/url_rewriter.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/adapter/camping.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/abstract/handler.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/abstract/request.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/basic.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/digest/md5.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/digest/nonce.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/digest/params.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/digest/request.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/auth/openid.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/builder.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/cascade.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/chunked.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/commonlogger.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/conditionalget.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/content_length.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/content_type.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/deflater.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/directory.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/file.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/handler.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/cgi.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/evented_mongrel.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/fastcgi.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/lsws.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/mongrel.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/scgi.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/swiftiplied_mongrel.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/thin.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/handler/webrick.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/head.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/lint.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/lobster.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/lock.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/methodoverride.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/mime.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/mock.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/recursive.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/reloader.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/request.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/response.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/session/abstract/id.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/session/cookie.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/session/memcache.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/session/pool.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/showexceptions.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/showstatus.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/static.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/urlmap.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/vendor/rack-1.0/rack/utils.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/verification.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_view/inline_template.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_view/partials.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_view/reloadable_template.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_view/renderable.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_view/renderable_partial.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_view/template.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_view/template_error.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_view/template_handler.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_view/template_handlers.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_view/template_handlers/builder.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_view/template_handlers/erb.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_view/template_handlers/rjs.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/test/controller/header_test.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/test/controller/middleware_stack_test.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/test/controller/mime_type_test.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/test/controller/polymorphic_routes_test.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/test/controller/rack_test.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/test/controller/request/json_params_parsing_test.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/test/controller/request/multipart_params_parsing_test.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/test/controller/request/query_string_parsing_test.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/test/controller/request/url_encoded_params_parsing_test.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/test/controller/request/xml_params_parsing_test.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/test/controller/request_test.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/test/controller/session/cookie_store_test.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/test/controller/session/mem_cache_store_test.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/test/controller/session/test_session_test.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/test/fixtures/layouts/default_html.html.erb</filename>
    </removed>
    <removed>
      <filename>actionpack/test/fixtures/test/render_implicit_js_template_without_layout.js.erb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/cache/drb_store.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/core_ext/array/wrapper.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/core_ext/base64.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/core_ext/base64/encoding.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/core_ext/bigdecimal.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/core_ext/bigdecimal/conversions.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/core_ext/blank.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/core_ext/date/behavior.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/core_ext/duplicable.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/core_ext/float/time.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/core_ext/numeric/conversions.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/core_ext/pathname.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/core_ext/pathname/clean_within.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/core_ext/time/behavior.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/core_ext/try.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/test/core_ext/pathname_test.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>d758d996d1b66e2a65640f79f01ce2ac674d7ed5</id>
    </parent>
    <parent>
      <id>ca49299434bc764b667cd86846d892e91a150ef3</id>
    </parent>
  </parents>
  <author>
    <name>Pratik Naik</name>
    <email>pratiknaik@gmail.com</email>
  </author>
  <url>http://github.com/alloy/rails/commit/5f3f100ce2d689480da85abc88e5e940cf90189e</url>
  <id>5f3f100ce2d689480da85abc88e5e940cf90189e</id>
  <committed-date>2009-04-22T07:26:03-07:00</committed-date>
  <authored-date>2009-04-22T07:26:03-07:00</authored-date>
  <message>Merge branch 'master' into active_model

Conflicts:
	activeresource/lib/active_resource/validations.rb</message>
  <tree>15c1a05a5308a9eea56d7f0889ac46d9cac5b57c</tree>
  <committer>
    <name>Pratik Naik</name>
    <email>pratiknaik@gmail.com</email>
  </committer>
</commit>
