<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>actionpack/lib/action_controller/base/compatibility.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/conditional_get.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/exceptions.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/flash.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/hide_actions.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/http.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/layouts.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/rack_convenience.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/redirector.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/render_options.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/renderer.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/rescuable.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/session.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/testing.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/base/url_for.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/legacy/layout.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/old_base.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_controller/testing/performance_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/lib/action_view/template/resolver.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/fixtures/public/.gitignore</filename>
    </added>
    <added>
      <filename>actionpack/test/fixtures/public/elsewhere/cools.js</filename>
    </added>
    <added>
      <filename>actionpack/test/fixtures/public/elsewhere/file.css</filename>
    </added>
    <added>
      <filename>actionpack/test/fixtures/public/javascripts/common.javascript</filename>
    </added>
    <added>
      <filename>actionpack/test/fixtures/public/stylesheets/random.styles</filename>
    </added>
    <added>
      <filename>actionpack/test/fixtures/test/render_implicit_js_template_without_layout.js.erb</filename>
    </added>
    <added>
      <filename>actionpack/test/fixtures/test/utf8_magic.html.erb</filename>
    </added>
    <added>
      <filename>actionpack/test/new_base/render_rjs_test.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/old_base/abstract_unit.rb</filename>
    </added>
    <added>
      <filename>actionpack/test/template/capture_helper_test.rb</filename>
    </added>
    <added>
      <filename>activemodel/lib/active_model/attributes.rb</filename>
    </added>
    <added>
      <filename>activemodel/lib/active_model/naming.rb</filename>
    </added>
    <added>
      <filename>activemodel/lib/active_model/serializers/json.rb</filename>
    </added>
    <added>
      <filename>activemodel/test/cases/attributes_test.rb</filename>
    </added>
    <added>
      <filename>activemodel/test/cases/json_serialization_test.rb</filename>
    </added>
    <added>
      <filename>activemodel/test/cases/naming_test.rb</filename>
    </added>
    <added>
      <filename>activerecord/lib/active_record/associations/through_association_scope.rb</filename>
    </added>
    <added>
      <filename>activerecord/test/schema/oracle_specific_schema.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/boolean.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/boolean/conversions.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/nil.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/nil/conversions.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/core_ext/regexp.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/json/decoding.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/testing/isolation.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/data_timezone.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/data_timezone_info.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Africa/Algiers.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Africa/Cairo.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Africa/Casablanca.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Africa/Harare.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Africa/Johannesburg.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Africa/Monrovia.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Africa/Nairobi.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Argentina/Buenos_Aires.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Argentina/San_Juan.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Bogota.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Caracas.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Chicago.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Chihuahua.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Denver.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Godthab.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Guatemala.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Halifax.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Indiana/Indianapolis.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Juneau.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/La_Paz.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Lima.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Los_Angeles.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Mazatlan.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Mexico_City.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Monterrey.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/New_York.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Phoenix.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Regina.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Santiago.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Sao_Paulo.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/St_Johns.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/America/Tijuana.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Almaty.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Baghdad.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Baku.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Bangkok.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Chongqing.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Colombo.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Dhaka.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Hong_Kong.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Irkutsk.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Jakarta.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Jerusalem.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Kabul.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Kamchatka.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Karachi.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Kathmandu.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Kolkata.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Krasnoyarsk.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Kuala_Lumpur.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Kuwait.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Magadan.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Muscat.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Novosibirsk.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Rangoon.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Riyadh.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Seoul.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Shanghai.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Singapore.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Taipei.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Tashkent.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Tbilisi.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Tehran.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Tokyo.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Ulaanbaatar.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Urumqi.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Vladivostok.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Yakutsk.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Yekaterinburg.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Asia/Yerevan.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Atlantic/Azores.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Atlantic/Cape_Verde.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Atlantic/South_Georgia.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Australia/Adelaide.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Australia/Brisbane.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Australia/Darwin.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Australia/Hobart.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Australia/Melbourne.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Australia/Perth.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Australia/Sydney.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Etc/UTC.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Amsterdam.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Athens.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Belgrade.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Berlin.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Bratislava.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Brussels.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Bucharest.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Budapest.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Copenhagen.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Dublin.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Helsinki.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Istanbul.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Kiev.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Lisbon.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Ljubljana.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/London.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Madrid.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Minsk.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Moscow.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Paris.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Prague.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Riga.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Rome.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Sarajevo.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Skopje.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Sofia.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Stockholm.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Tallinn.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Vienna.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Vilnius.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Warsaw.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Europe/Zagreb.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Pacific/Auckland.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Pacific/Fiji.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Pacific/Guam.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Pacific/Honolulu.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Pacific/Majuro.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Pacific/Midway.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Pacific/Noumea.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Pacific/Pago_Pago.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Pacific/Port_Moresby.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/definitions/Pacific/Tongatapu.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/info_timezone.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/linked_timezone.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/linked_timezone_info.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/offset_rationals.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/ruby_core_support.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/time_or_datetime.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/timezone.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/timezone_definition.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/timezone_info.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/timezone_offset_info.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/timezone_period.rb</filename>
    </added>
    <added>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.13/tzinfo/timezone_transition_info.rb</filename>
    </added>
    <added>
      <filename>activesupport/test/core_ext/boolean_ext_test.rb</filename>
    </added>
    <added>
      <filename>activesupport/test/core_ext/nil_ext_test.rb</filename>
    </added>
    <added>
      <filename>activesupport/test/core_ext/regexp_ext_test.rb</filename>
    </added>
    <added>
      <filename>activesupport/test/fixtures/omgomg.rb</filename>
    </added>
    <added>
      <filename>activesupport/test/isolation_test.rb</filename>
    </added>
    <added>
      <filename>railties/lib/initializer_old.rb</filename>
    </added>
    <added>
      <filename>railties/lib/rails/configuration.rb</filename>
    </added>
    <added>
      <filename>railties/lib/rails/core.rb</filename>
    </added>
    <added>
      <filename>railties/lib/rails/paths.rb</filename>
    </added>
    <added>
      <filename>railties/test/initializer/check_ruby_version_test.rb</filename>
    </added>
    <added>
      <filename>railties/test/initializer/install_gem_spec_stubs_test.rb</filename>
    </added>
    <added>
      <filename>railties/test/initializer/path_test.rb</filename>
    </added>
    <added>
      <filename>railties/test/initializer/root/app/controllers/.keep</filename>
    </added>
    <added>
      <filename>railties/test/initializer/root/app/helpers/.keep</filename>
    </added>
    <added>
      <filename>railties/test/initializer/root/app/metal/.keep</filename>
    </added>
    <added>
      <filename>railties/test/initializer/root/app/models/.keep</filename>
    </added>
    <added>
      <filename>railties/test/initializer/root/app/views/.keep</filename>
    </added>
    <added>
      <filename>railties/test/initializer/root/config/database.yml</filename>
    </added>
    <added>
      <filename>railties/test/initializer/root/config/environments/.keep</filename>
    </added>
    <added>
      <filename>railties/test/initializer/root/config/locales/.keep</filename>
    </added>
    <added>
      <filename>railties/test/initializer/root/config/routes.rb</filename>
    </added>
    <added>
      <filename>railties/test/initializer/root/lib/.keep</filename>
    </added>
    <added>
      <filename>railties/test/initializer/root/tmp/.keep</filename>
    </added>
    <added>
      <filename>railties/test/initializer/root/tmp/cache/.keep</filename>
    </added>
    <added>
      <filename>railties/test/initializer/root/vendor/.keep</filename>
    </added>
    <added>
      <filename>railties/test/initializer/test_helper.rb</filename>
    </added>
    <added>
      <filename>railties/test/new_initializer_test.rb</filename>
    </added>
    <added>
      <filename>railties/test/paths_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -21,16 +21,9 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #++
 
-begin
-  require 'action_controller'
-rescue LoadError
-  actionpack_path = &quot;#{File.dirname(__FILE__)}/../../actionpack/lib&quot;
-  if File.directory?(actionpack_path)
-    $:.unshift actionpack_path
-    require 'action_controller'
-  end
-end
-
+actionpack_path = &quot;#{File.dirname(__FILE__)}/../../actionpack/lib&quot;
+$:.unshift(actionpack_path) if File.directory?(actionpack_path)
+require 'action_controller'
 require 'action_view'
 
 module ActionMailer</diff>
      <filename>actionmailer/lib/action_mailer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,7 @@
+require &quot;active_support/core_ext/class&quot;
+# Use the old layouts until actionmailer gets refactored
+require &quot;action_controller/legacy/layout&quot;
+
 module ActionMailer #:nodoc:
   # Action Mailer allows you to send email from your application using a mailer model and views.
   #
@@ -697,7 +701,7 @@ module ActionMailer #:nodoc:
       def perform_delivery_smtp(mail)
         destinations = mail.destinations
         mail.ready_to_send
-        sender = (mail['return-path'] &amp;&amp; mail['return-path'].spec) || mail.from
+        sender = (mail['return-path'] &amp;&amp; mail['return-path'].spec) || mail['from']
 
         smtp = Net::SMTP.new(smtp_settings[:address], smtp_settings[:port])
         smtp.enable_starttls_auto if smtp_settings[:enable_starttls_auto] &amp;&amp; smtp.respond_to?(:enable_starttls_auto)</diff>
      <filename>actionmailer/lib/action_mailer/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -48,13 +48,14 @@ module ActionMailer
               file_name  = arg.to_s.underscore + '_helper'
               class_name = file_name.camelize
 
-              begin
-                require_dependency(file_name)
-              rescue LoadError =&gt; load_error
-                requiree = / -- (.*?)(\.rb)?$/.match(load_error.message).to_a[1]
-                msg = (requiree == file_name) ? &quot;Missing helper file helpers/#{file_name}.rb&quot; : &quot;Can't load file: #{requiree}&quot;
-                raise LoadError.new(msg).copy_blame!(load_error)
-              end
+              require_dependency(file_name, &quot;Missing helper file helpers/%s.rb&quot;)
+              # begin
+              #   require_dependency(file_name)
+              # rescue LoadError =&gt; load_error
+              #   requiree = / -- (.*?)(\.rb)?$/.match(load_error.message).to_a[1]
+              #   msg = (requiree == file_name) ? &quot;Missing helper file helpers/#{file_name}.rb&quot; : &quot;Can't load file: #{requiree}&quot;
+              #   raise LoadError.new(msg).copy_blame!(load_error)
+              # end
 
               add_template_helper(class_name.constantize)
             else
@@ -97,7 +98,7 @@ module ActionMailer
             child.master_helper_module.__send__(:include, master_helper_module)
             child.helper child.name.to_s.underscore
           rescue MissingSourceFile =&gt; e
-            raise unless e.is_missing?(&quot;helpers/#{child.name.to_s.underscore}_helper&quot;)
+            raise unless e.is_missing?(&quot;#{child.name.to_s.underscore}_helper&quot;)
           end
         end
     end</diff>
      <filename>actionmailer/lib/action_mailer/helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 module ActionMailer
   module VERSION #:nodoc:
-    MAJOR = 2
-    MINOR = 3
-    TINY  = 2
+    MAJOR = 3
+    MINOR = 0
+    TINY  = &quot;pre&quot;
 
     STRING = [MAJOR, MINOR, TINY].join('.')
   end</diff>
      <filename>actionmailer/lib/action_mailer/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,6 @@
 require 'rubygems'
 require 'test/unit'
 
-gem 'mocha', '&gt;= 0.9.5'
-require 'mocha'
-
 $:.unshift &quot;#{File.dirname(__FILE__)}/../lib&quot;
 $:.unshift &quot;#{File.dirname(__FILE__)}/../../activesupport/lib&quot;
 $:.unshift &quot;#{File.dirname(__FILE__)}/../../actionpack/lib&quot;</diff>
      <filename>actionmailer/test/abstract_unit.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,9 +22,11 @@ task :default =&gt; [ :test ]
 # Run the unit tests
 
 desc &quot;Run all unit tests&quot;
-task :test =&gt; [:test_action_pack, :test_active_record_integration, :test_new_base, :test_new_base_on_old_tests]
+task :test =&gt; [:test_action_pack, :test_active_record_integration, :test_new_base]
 
-test_lib_dirs = [ENV[&quot;NEW&quot;] ? &quot;test/new_base&quot; : &quot;test&quot;, &quot;test/lib&quot;]
+test_lib_dirs = ENV[&quot;NEW&quot;] ? [&quot;test/new_base&quot;] : []
+test_lib_dirs.push &quot;test&quot;, &quot;test/lib&quot;
+# test_lib_dirs = [ENV[&quot;NEW&quot;] ? &quot;test/new_base&quot; : &quot;test&quot;, &quot;test/lib&quot;]
 Rake::TestTask.new(:test_action_pack) do |t|
   t.libs.concat test_lib_dirs
 
@@ -35,6 +37,7 @@ Rake::TestTask.new(:test_action_pack) do |t|
   t.verbose = true
   #t.warning = true
 end
+
 task :isolated_test do
   ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
   Dir.glob(&quot;test/{controller,dispatch,template}/**/*_test.rb&quot;).all? do |file|
@@ -112,7 +115,7 @@ spec = Gem::Specification.new do |s|
   s.has_rdoc = true
   s.requirements &lt;&lt; 'none'
 
-  s.add_dependency('activesupport', '= 2.3.2' + PKG_BUILD)
+  s.add_dependency('activesupport', '= 3.0.pre' + PKG_BUILD)
 
   s.require_path = 'lib'
   s.autorequire = 'action_controller'</diff>
      <filename>actionpack/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,84 +1,62 @@
-#--
-# Copyright (c) 2004-2009 David Heinemeier Hansson
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# &quot;Software&quot;), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#++
-
-activesupport_path = &quot;#{File.dirname(__FILE__)}/../../activesupport/lib&quot;
-$:.unshift activesupport_path if File.directory?(activesupport_path)
-require 'active_support'
-
-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, Request, Response, UrlRewriter, UrlWriter]
-    [ActionDispatch::Http::Headers]
-  end
+  autoload :Base,                 &quot;action_controller/base/base&quot;
+  autoload :ConditionalGet,       &quot;action_controller/base/conditional_get&quot;
+  autoload :HideActions,          &quot;action_controller/base/hide_actions&quot;
+  autoload :Http,                 &quot;action_controller/base/http&quot;
+  autoload :Layouts,              &quot;action_controller/base/layouts&quot;
+  autoload :RackConvenience,      &quot;action_controller/base/rack_convenience&quot;
+  autoload :Rails2Compatibility,  &quot;action_controller/base/compatibility&quot;
+  autoload :Redirector,           &quot;action_controller/base/redirector&quot;
+  autoload :Renderer,             &quot;action_controller/base/renderer&quot;
+  autoload :RenderOptions,        &quot;action_controller/base/render_options&quot;
+  autoload :Renderers,            &quot;action_controller/base/render_options&quot;
+  autoload :Rescue,               &quot;action_controller/base/rescuable&quot;
+  autoload :Testing,              &quot;action_controller/base/testing&quot;
+  autoload :UrlFor,               &quot;action_controller/base/url_for&quot;
+  autoload :Session,              &quot;action_controller/base/session&quot;
+  autoload :Helpers,              &quot;action_controller/base/helpers&quot;
 
-  autoload :Base, 'action_controller/base/base'
-  autoload :Benchmarking, 'action_controller/base/chained/benchmarking'
-  autoload :Caching, 'action_controller/caching'
-  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'
+  # Ported modules
+  # require 'action_controller/routing'
+  autoload :Caching,           'action_controller/caching'
+  autoload :Dispatcher,        'action_controller/dispatch/dispatcher'
+  autoload :Integration,       'action_controller/testing/integration'
+  autoload :MimeResponds,      'action_controller/base/mime_responds'
   autoload :PolymorphicRoutes, 'action_controller/routing/generation/polymorphic_routes'
-  autoload :RecordIdentifier, 'action_controller/record_identifier'
-  autoload :Redirector, 'action_controller/base/redirect'
-  autoload :Renderer, 'action_controller/base/render'
-  autoload :RequestForgeryProtection, 'action_controller/base/request_forgery_protection'
-  autoload :Rescue, 'action_controller/base/rescue'
-  autoload :Resources, 'action_controller/routing/resources'
-  autoload :Responder, 'action_controller/base/responder'
-  autoload :Routing, 'action_controller/routing'
+  autoload :RecordIdentifier,  'action_controller/record_identifier'
+  autoload :Resources,         'action_controller/routing/resources'
   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 :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'
-  autoload :FilterParameterLogging, 'action_controller/base/filter_parameter_logging'
+  autoload :TestCase,          'action_controller/testing/test_case'
+  autoload :TestProcess,       'action_controller/testing/process'
+  autoload :UrlRewriter,       'action_controller/routing/generation/url_rewriter'
+  autoload :UrlWriter,         'action_controller/routing/generation/url_rewriter'
+
+  autoload :Verification,             'action_controller/base/verification'
+  autoload :Flash,                    'action_controller/base/flash'
+  autoload :RequestForgeryProtection, 'action_controller/base/request_forgery_protection'
+  autoload :Streaming,                'action_controller/base/streaming'
+  autoload :HttpAuthentication,       'action_controller/base/http_authentication'
+  autoload :FilterParameterLogging,   'action_controller/base/filter_parameter_logging'
+  autoload :Translation,              'action_controller/translation'
+  autoload :Cookies,                  'action_controller/base/cookies'
+
+  autoload :ActionControllerError,    'action_controller/base/exceptions'
+  autoload :SessionRestoreError,      'action_controller/base/exceptions'
+  autoload :RenderError,              'action_controller/base/exceptions'
+  autoload :RoutingError,             'action_controller/base/exceptions'
+  autoload :MethodNotAllowed,         'action_controller/base/exceptions'
+  autoload :NotImplemented,           'action_controller/base/exceptions'
+  autoload :UnknownController,        'action_controller/base/exceptions'
+  autoload :MissingFile,              'action_controller/base/exceptions'
+  autoload :RenderError,              'action_controller/base/exceptions'
+  autoload :SessionOverflowError,     'action_controller/base/exceptions'
+  autoload :UnknownHttpMethod,        'action_controller/base/exceptions'
 
-  module Assertions
-    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
+  require 'action_controller/routing'
 end
 
 autoload :HTML, 'action_controller/vendor/html-scanner'
+autoload :AbstractController, 'action_controller/abstract'
 
 require 'action_dispatch'
 require 'action_view'</diff>
      <filename>actionpack/lib/action_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,13 +2,15 @@ require &quot;active_support/core_ext/module/attr_internal&quot;
 require &quot;active_support/core_ext/module/delegation&quot;
 
 module AbstractController
-  autoload :Base,           &quot;action_controller/abstract/base&quot;
-  autoload :Benchmarker,    &quot;action_controller/abstract/benchmarker&quot;
-  autoload :Callbacks,      &quot;action_controller/abstract/callbacks&quot;
-  autoload :Helpers,        &quot;action_controller/abstract/helpers&quot;
-  autoload :Layouts,        &quot;action_controller/abstract/layouts&quot;
-  autoload :Logger,         &quot;action_controller/abstract/logger&quot;
-  autoload :Renderer,       &quot;action_controller/abstract/renderer&quot;
+  autoload :Base,               &quot;action_controller/abstract/base&quot;
+  autoload :Benchmarker,        &quot;action_controller/abstract/benchmarker&quot;
+  autoload :Callbacks,          &quot;action_controller/abstract/callbacks&quot;
+  autoload :Helpers,            &quot;action_controller/abstract/helpers&quot;
+  autoload :Layouts,            &quot;action_controller/abstract/layouts&quot;
+  autoload :Logger,             &quot;action_controller/abstract/logger&quot;
+  autoload :Renderer,           &quot;action_controller/abstract/renderer&quot;
   # === Exceptions
-  autoload :ActionNotFound, &quot;action_controller/abstract/exceptions&quot;
+  autoload :ActionNotFound,     &quot;action_controller/abstract/exceptions&quot;
+  autoload :DoubleRenderError,  &quot;action_controller/abstract/exceptions&quot;
+  autoload :Error,              &quot;action_controller/abstract/exceptions&quot;
 end</diff>
      <filename>actionpack/lib/action_controller/abstract.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,53 +1,65 @@
 require 'active_support/core_ext/module/attr_internal'
 
 module AbstractController
-  class Error &lt; StandardError; end
-
-  class DoubleRenderError &lt; Error
-    DEFAULT_MESSAGE = &quot;Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect, and at most once per action. Also note that neither redirect nor render terminate execution of the action, so if you want to exit an action after redirecting, you need to do something like \&quot;redirect_to(...) and return\&quot;.&quot;
-
-    def initialize(message = nil)
-      super(message || DEFAULT_MESSAGE)
-    end
-  end
 
   class Base
     attr_internal :response_body
-    attr_internal :response_obj
     attr_internal :action_name
 
     class &lt;&lt; self
       attr_reader :abstract
+      alias_method :abstract?, :abstract
 
+      # Define a controller as abstract. See internal_methods for more
+      # details.
       def abstract!
         @abstract = true
       end
 
-      alias_method :abstract?, :abstract
-
       def inherited(klass)
-        ::AbstractController::Base.subclasses &lt;&lt; klass.to_s
+        ::AbstractController::Base.descendants &lt;&lt; klass.to_s
         super
       end
 
-      def subclasses
-        @subclasses ||= []
+      # A list of all descendents of AbstractController::Base. This is
+      # useful for initializers which need to add behavior to all controllers.
+      def descendants
+        @descendants ||= []
       end
 
+      # A list of all internal methods for a controller. This finds the first
+      # abstract superclass of a controller, and gets a list of all public
+      # instance methods on that abstract class. Public instance methods of
+      # a controller would normally be considered action methods, so we
+      # are removing those methods on classes declared as abstract
+      # (ActionController::Http and ActionController::Base are defined
+      # as abstract)
       def internal_methods
         controller = self
         controller = controller.superclass until controller.abstract?
         controller.public_instance_methods(true)
       end
 
-      def process(action)
-        new.process(action.to_s)
-      end
-
+      # The list of hidden actions to an empty Array. Defaults to an
+      # empty Array. This can be modified by other modules or subclasses
+      # to specify particular actions as hidden.
+      #
+      # ==== Returns
+      # Array[String]:: An array of method names that should not be
+      #                 considered actions.
       def hidden_actions
         []
       end
 
+      # A list of method names that should be considered actions. This
+      # includes all public instance methods on a controller, less
+      # any internal methods (see #internal_methods), adding back in
+      # any methods that are internal, but still exist on the class
+      # itself. Finally, #hidden_actions are removed.
+      #
+      # ==== Returns
+      # Array[String]:: A list of all methods that should be considered
+      #                 actions.
       def action_methods
         @action_methods ||=
           # All public instance methods of this class, including ancestors
@@ -63,10 +75,14 @@ module AbstractController
 
     abstract!
 
-    def initialize
-      self.response_obj = {}
-    end
-
+    # Calls the action going through the entire action dispatch stack.
+    # 
+    # The actual method that is called is determined by calling
+    # #method_for_action. If no method can handle the action, then an
+    # ActionNotFound error is raised.
+    #
+    # ==== Returns
+    # self
     def process(action)
       @_action_name = action_name = action.to_s
 
@@ -79,33 +95,63 @@ module AbstractController
     end
 
   private
-    def action_methods
-      self.class.action_methods
-    end
-
-    def action_method?(action)
-      action_methods.include?(action)
+    # Returns true if the name can be considered an action. This can
+    # be overridden in subclasses to modify the semantics of what
+    # can be considered an action.
+    #
+    # ==== Parameters
+    # name&lt;String&gt;:: The name of an action to be tested
+    #
+    # ==== Returns
+    # TrueClass, FalseClass
+    def action_method?(name)
+      self.class.action_methods.include?(name)
     end
 
-    # It is possible for respond_to?(action_name) to be false and
-    # respond_to?(:action_missing) to be false if respond_to_action?
-    # is overridden in a subclass. For instance, ActionController::Base
-    # overrides it to include the case where a template matching the
-    # action_name is found.
+    # Call the action. Override this in a subclass to modify the
+    # behavior around processing an action. This, and not #process,
+    # is the intended way to override action dispatching.
     def process_action(method_name)
       send_action(method_name)
     end
 
+    # Actually call the method associated with the action. Override
+    # this method if you wish to change how action methods are called,
+    # not to add additional behavior around it. For example, you would
+    # override #send_action if you want to inject arguments into the
+    # method.
     alias send_action send
 
+    # If the action name was not found, but a method called &quot;action_missing&quot;
+    # was found, #method_for_action will return &quot;_handle_action_missing&quot;.
+    # This method calls #action_missing with the current action name.
     def _handle_action_missing
       action_missing(@_action_name)
     end
 
-    # Override this to change the conditions that will raise an
-    # ActionNotFound error. If you accept a difference case,
-    # you must handle it by also overriding process_action and
-    # handling the case.
+    # Takes an action name and returns the name of the method that will
+    # handle the action. In normal cases, this method returns the same
+    # name as it receives. By default, if #method_for_action receives
+    # a name that is not an action, it will look for an #action_missing
+    # method and return &quot;_handle_action_missing&quot; if one is found.
+    #
+    # Subclasses may override this method to add additional conditions
+    # that should be considered an action. For instance, an HTTP controller
+    # with a template matching the action name is considered to exist.
+    #
+    # If you override this method to handle additional cases, you may
+    # also provide a method (like _handle_method_missing) to handle
+    # the case.
+    #
+    # If none of these conditions are true, and method_for_action
+    # returns nil, an ActionNotFound exception will be raised.
+    #
+    # ==== Parameters
+    # action_name&lt;String&gt;:: An action name to find a method name for
+    #
+    # ==== Returns
+    # String:: The name of the method that handles the action
+    # nil::    No method name could be found. Raise ActionNotFound.
     def method_for_action(action_name)
       if action_method?(action_name) then action_name
       elsif respond_to?(:action_missing, true) then &quot;_handle_action_missing&quot;</diff>
      <filename>actionpack/lib/action_controller/abstract/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,16 @@ module AbstractController
     include Logger
 
     module ClassMethods
+      # Execute the passed in block, timing the duration of the block in ms.
+      #
+      # ==== Parameters
+      # title&lt;#to_s&gt;:: The title of block to benchmark
+      # log_level&lt;Integer&gt;:: A valid log level. Defaults to Logger::DEBUG
+      # use_silence&lt;TrueClass, FalseClass&gt;:: Whether or not to silence the
+      #   logger for the duration of the block.
+      #
+      # ==== Returns
+      # Object:: The result of the block
       def benchmark(title, log_level = ::Logger::DEBUG, use_silence = true)
         if logger &amp;&amp; logger.level &gt;= log_level
           result = nil</diff>
      <filename>actionpack/lib/action_controller/abstract/benchmarker.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,12 +2,17 @@ module AbstractController
   module Callbacks
     extend ActiveSupport::Concern
 
+    # Uses ActiveSupport::NewCallbacks as the base functionality. For
+    # more details on the whole callback system, read the documentation
+    # for ActiveSupport::NewCallbacks.
     include ActiveSupport::NewCallbacks
 
     included do
       define_callbacks :process_action, &quot;response_body&quot;
     end
 
+    # Override AbstractController::Base's process_action to run the
+    # process_action callbacks around the normal behavior.
     def process_action(method_name)
       _run_process_action_callbacks(method_name) do
         super
@@ -15,6 +20,17 @@ module AbstractController
     end
 
     module ClassMethods
+      # If :only or :accept are used, convert the options into the
+      # primitive form (:per_key) used by ActiveSupport::Callbacks.
+      # The basic idea is that :only =&gt; :index gets converted to
+      # :if =&gt; proc {|c| c.action_name == &quot;index&quot; }, but that the
+      # proc is only evaluated once per action for the lifetime of
+      # a Rails process.
+      #
+      # ==== Options
+      # :only&lt;#to_s&gt;:: The callback should be run only for this action
+      # :except&lt;#to_s&gt;:: The callback should be run for all actions
+      #   except this action
       def _normalize_callback_options(options)
         if only = options[:only]
           only = Array(only).map {|o| &quot;action_name == '#{o}'&quot;}.join(&quot; || &quot;)
@@ -26,35 +42,69 @@ module AbstractController
         end
       end
 
+      # Skip before, after, and around filters matching any of the names
+      #
+      # ==== Parameters
+      # *names&lt;Object&gt;:: A list of valid names that could be used for
+      #   callbacks. Note that skipping uses Ruby equality, so it's
+      #   impossible to skip a callback defined using an anonymous proc
+      #   using #skip_filter
+      def skip_filter(*names, &amp;blk)
+        skip_before_filter(*names)
+        skip_after_filter(*names)
+        skip_around_filter(*names)
+      end
+
+      # Take callback names and an optional callback proc, normalize them,
+      # then call the block with each callback. This allows us to abstract
+      # the normalization across several methods that use it.
+      #
+      # ==== Parameters
+      # callbacks&lt;Array[*Object, Hash]&gt;:: A list of callbacks, with an optional
+      #   options hash as the last parameter.
+      # block&lt;Proc&gt;:: A proc that should be added to the callbacks.
+      #
+      # ==== Block Parameters
+      # name&lt;Symbol&gt;:: The callback to be added
+      # options&lt;Hash&gt;:: A list of options to be used when adding the callback
+      def _insert_callbacks(callbacks, block)
+        options = callbacks.last.is_a?(Hash) ? callbacks.pop : {}
+        _normalize_callback_options(options)
+        callbacks.push(block) if block
+        callbacks.each do |callback|
+          yield callback, options
+        end
+      end
+
+      # set up before_filter, prepend_before_filter, skip_before_filter, etc.
+      # for each of before, after, and around.
       [:before, :after, :around].each do |filter|
         class_eval &lt;&lt;-RUBY_EVAL, __FILE__, __LINE__ + 1
+          # Append a before, after or around filter. See _insert_callbacks
+          # for details on the allowed parameters.
           def #{filter}_filter(*names, &amp;blk)
-            options = names.last.is_a?(Hash) ? names.pop : {}
-            _normalize_callback_options(options)
-            names.push(blk) if block_given?
-            names.each do |name|
-              process_action_callback(:#{filter}, name, options)
+            _insert_callbacks(names, blk) do |name, options|
+              set_callback(:process_action, :#{filter}, name, options)
             end
           end
 
+          # Prepend a before, after or around filter. See _insert_callbacks
+          # for details on the allowed parameters.
           def prepend_#{filter}_filter(*names, &amp;blk)
-            options = names.last.is_a?(Hash) ? names.pop : {}
-            _normalize_callback_options(options)
-            names.push(blk) if block_given?
-            names.each do |name|
-              process_action_callback(:#{filter}, name, options.merge(:prepend =&gt; true))
+            _insert_callbacks(names, blk) do |name, options|
+              set_callback(:process_action, :#{filter}, name, options.merge(:prepend =&gt; true))
             end
           end
 
+          # Skip a before, after or around filter. See _insert_callbacks
+          # for details on the allowed parameters.
           def skip_#{filter}_filter(*names, &amp;blk)
-            options = names.last.is_a?(Hash) ? names.pop : {}
-            _normalize_callback_options(options)
-            names.push(blk) if block_given?
-            names.each do |name|
-              skip_process_action_callback(:#{filter}, name, options)
+            _insert_callbacks(names, blk) do |name, options|
+              skip_callback(:process_action, :#{filter}, name, options)
             end
           end
 
+          # *_filter is the same as append_*_filter
           alias_method :append_#{filter}_filter, :#{filter}_filter
         RUBY_EVAL
       end</diff>
      <filename>actionpack/lib/action_controller/abstract/callbacks.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,12 @@
 module AbstractController
+  class Error &lt; StandardError; end
   class ActionNotFound &lt; StandardError; end
+
+  class DoubleRenderError &lt; Error
+    DEFAULT_MESSAGE = &quot;Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect, and at most once per action. Also note that neither redirect nor render terminate execution of the action, so if you want to exit an action after redirecting, you need to do something like \&quot;redirect_to(...) and return\&quot;.&quot;
+
+    def initialize(message = nil)
+      super(message || DEFAULT_MESSAGE)
+    end
+  end
 end</diff>
      <filename>actionpack/lib/action_controller/abstract/exceptions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,33 +5,26 @@ module AbstractController
     include Renderer
 
     included do
-      extlib_inheritable_accessor :master_helper_module
-      self.master_helper_module = Module.new
+      extlib_inheritable_accessor(:_helpers) { Module.new }
     end
 
+    # Override AbstractController::Renderer's _action_view to include the
+    # helper module for this class into its helpers module.
     def _action_view
-      @_action_view ||= begin
-        av = super
-        av.helpers.send(:include, master_helper_module)
-        av
-      end
+      @_action_view ||= super.tap { |av| av.helpers.include(_helpers) }
     end
 
     module ClassMethods
+      # When a class is inherited, wrap its helper module in a new module.
+      # This ensures that the parent class's module can be changed
+      # independently of the child class's.
       def inherited(klass)
-        klass.master_helper_module = Module.new
-        klass.master_helper_module.__send__ :include, master_helper_module
+        helpers = _helpers
+        klass._helpers = Module.new { include helpers }
 
         super
       end
 
-      # Makes all the (instance) methods in the helper module available to templates rendered through this controller.
-      # See ActionView::Helpers (link:classes/ActionView/Helpers.html) for more about making your own helper modules
-      # available to the templates.
-      def add_template_helper(mod)
-        master_helper_module.module_eval { include mod }
-      end
-
       # Declare a controller method as a helper. For example, the following
       # makes the +current_user+ controller method available to the view:
       #   class ApplicationController &lt; ActionController::Base
@@ -48,9 +41,13 @@ module AbstractController
       #
       # In a view:
       #  &lt;% if logged_in? -%&gt;Welcome, &lt;%= current_user.name %&gt;&lt;% end -%&gt;
+      #
+      # ==== Parameters
+      # meths&lt;Array[#to_s]&gt;:: The name of a method on the controller
+      #   to be made available on the view.
       def helper_method(*meths)
         meths.flatten.each do |meth|
-          master_helper_module.class_eval &lt;&lt;-ruby_eval, __FILE__, __LINE__ + 1
+          _helpers.class_eval &lt;&lt;-ruby_eval, __FILE__, __LINE__ + 1
             def #{meth}(*args, &amp;blk)
               controller.send(%(#{meth}), *args, &amp;blk)
             end
@@ -58,6 +55,14 @@ module AbstractController
         end
       end
 
+      # Make a number of helper modules part of this class' default
+      # helpers.
+      #
+      # ==== Parameters
+      # *args&lt;Array[Module]&gt;:: Modules to be included
+      # block&lt;Block&gt;:: Evalulate the block in the context
+      #   of the helper module. Any methods defined in the block
+      #   will be helpers.
       def helper(*args, &amp;block)
         args.flatten.each do |arg|
           case arg
@@ -65,7 +70,18 @@ module AbstractController
             add_template_helper(arg)
           end
         end
-        master_helper_module.module_eval(&amp;block) if block_given?
+        _helpers.module_eval(&amp;block) if block_given?
+      end
+
+      private
+      # Makes all the (instance) methods in the helper module available to templates
+      # rendered through this controller.
+      #
+      # ==== Parameters
+      # mod&lt;Module&gt;:: The module to include into the current helper module
+      #   for the class
+      def add_template_helper(mod)
+        _helpers.module_eval { include mod }
       end
     end
   end</diff>
      <filename>actionpack/lib/action_controller/abstract/helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,16 +5,31 @@ module AbstractController
     include Renderer
 
     included do
-      extlib_inheritable_accessor :_layout_conditions
-      self._layout_conditions = {}
+      extlib_inheritable_accessor(:_layout_conditions) { Hash.new }
     end
 
     module ClassMethods
-      def layout(layout, conditions = {})
-        unless [String, Symbol, FalseClass, NilClass].include?(layout.class)
-          raise ArgumentError, &quot;Layouts must be specified as a String, Symbol, false, or nil&quot;
-        end
+      def inherited(klass)
+        super
+        klass._write_layout_method
+      end
 
+      # Specify the layout to use for this class.
+      #
+      # If the specified layout is a:
+      # String:: the String is the template name
+      # Symbol:: call the method specified by the symbol, which will return
+      #   the template name
+      # false::  There is no layout
+      # true::   raise an ArgumentError
+      #
+      # ==== Parameters
+      # layout&lt;String, Symbol, false)&gt;:: The layout to use.
+      #
+      # ==== Options (conditions)
+      # :only&lt;#to_s, Array[#to_s]&gt;:: A list of actions to apply this layout to.
+      # :except&lt;#to_s, Array[#to_s]&gt;:: Apply this layout to all actions but this one
+      def layout(layout, conditions = {})
         conditions.each {|k, v| conditions[k] = Array(v).map {|a| a.to_s} }
         self._layout_conditions = conditions
 
@@ -22,6 +37,11 @@ module AbstractController
         _write_layout_method
       end
 
+      # If no layout is supplied, look for a template named the return
+      # value of this method.
+      #
+      # ==== Returns
+      # String:: A template name
       def _implied_layout_name
         name.underscore
       end
@@ -29,23 +49,31 @@ module AbstractController
       # Takes the specified layout and creates a _layout method to be called
       # by _default_layout
       #
-      # If the specified layout is a:
-      # String:: return the string
-      # Symbol:: call the method specified by the symbol
-      # false::  return nil
-      # none::   If a layout is found in the view paths with the controller's
-      #          name, return that string. Otherwise, use the superclass'
-      #          layout (which might also be implied)
+      # If there is no explicit layout specified:
+      # If a layout is found in the view paths with the controller's
+      # name, return that string. Otherwise, use the superclass'
+      # layout (which might also be implied)
       def _write_layout_method
         case @_layout
         when String
           self.class_eval %{def _layout(details) #{@_layout.inspect} end}
         when Symbol
-          self.class_eval %{def _layout(details) #{@_layout} end}
+          self.class_eval &lt;&lt;-ruby_eval, __FILE__, __LINE__ + 1
+            def _layout(details)
+              #{@_layout}.tap do |layout|
+                unless layout.is_a?(String) || !layout
+                  raise ArgumentError, &quot;Your layout method :#{@_layout} returned \#{layout}. It &quot; \
+                    &quot;should have returned a String, false, or nil&quot;
+                end
+              end
+            end
+          ruby_eval
         when false
           self.class_eval %{def _layout(details) end}
-        else
-          self.class_eval %{
+        when true
+          raise ArgumentError, &quot;Layouts must be specified as a String, Symbol, false, or nil&quot;
+        when nil
+          self.class_eval &lt;&lt;-ruby_eval, __FILE__, __LINE__ + 1
             def _layout(details)
               if view_paths.find_by_parts?(&quot;#{_implied_layout_name}&quot;, details, &quot;layouts&quot;)
                 &quot;#{_implied_layout_name}&quot;
@@ -53,33 +81,55 @@ module AbstractController
                 super
               end
             end
-          }
+          ruby_eval
         end
+        self.class_eval { private :_layout }
       end
     end
 
   private
-    # This will be overwritten
-    def _layout(details)
-    end
+    # This will be overwritten by _write_layout_method
+    def _layout(details) end
 
-    # :api: plugin
-    # ====
-    # Override this to mutate the inbound layout name
+    # Determine the layout for a given name and details.
+    #
+    # ==== Parameters
+    # name&lt;String&gt;:: The name of the template
+    # details&lt;Hash{Symbol =&gt; Object}&gt;:: A list of details to restrict
+    #   the lookup to. By default, layout lookup is limited to the
+    #   formats specified for the current request.
     def _layout_for_name(name, details = {:formats =&gt; formats})
-      unless [String, FalseClass, NilClass].include?(name.class)
-        raise ArgumentError, &quot;String, false, or nil expected; you passed #{name.inspect}&quot;
-      end
-
-      name &amp;&amp; view_paths.find_by_parts(name, details, _layout_prefix(name))
+      name &amp;&amp; _find_by_parts(name, details)
     end
 
-    # TODO: Decide if this is the best hook point for the feature
-    def _layout_prefix(name)
-      &quot;layouts&quot;
+    # Take in the name and details and find a Template.
+    #
+    # ==== Parameters
+    # name&lt;String&gt;:: The name of the template to retrieve
+    # details&lt;Hash&gt;:: A list of details to restrict the search by. This
+    #   might include details like the format or locale of the template.
+    #
+    # ==== Returns
+    # Template:: A template object matching the name and details
+    def _find_by_parts(name, details)
+      # TODO: Make prefix actually part of details in ViewPath#find_by_parts
+      prefix = details.key?(:prefix) ? details.delete(:prefix) : &quot;layouts&quot;
+      view_paths.find_by_parts(name, details, prefix)
     end
 
-    def _default_layout(require_layout = false, details = {:formats =&gt; formats})
+    # Returns the default layout for this controller and a given set of details. 
+    # Optionally raises an exception if the layout could not be found.
+    #
+    # ==== Parameters
+    # details&lt;Hash&gt;:: A list of details to restrict the search by. This
+    #   might include details like the format or locale of the template.
+    # require_layout&lt;Boolean&gt;:: If this is true, raise an ArgumentError
+    #   with details about the fact that the exception could not be
+    #   found (defaults to false)
+    #
+    # ==== Returns
+    # Template:: The template object for the default layout (or nil)
+    def _default_layout(details, require_layout = false)
       if require_layout &amp;&amp; _action_has_layout? &amp;&amp; !_layout(details)
         raise ArgumentError,
           &quot;There was no default layout for #{self.class} in #{view_paths.inspect}&quot;
@@ -93,6 +143,12 @@ module AbstractController
       end
     end
 
+    # Determines whether the current action has a layout by checking the
+    # action name against the :only and :except conditions set on the
+    # layout.
+    #
+    # ==== Returns
+    # Boolean:: True if the action has a layout, false otherwise.
     def _action_has_layout?
       conditions = _layout_conditions
       if only = conditions[:only]</diff>
      <filename>actionpack/lib/action_controller/abstract/layouts.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,13 @@ module AbstractController
   module Logger
     extend ActiveSupport::Concern
 
+    # A class that allows you to defer expensive processing
+    # until the logger actually tries to log. Otherwise, you are
+    # forced to do the processing in advance, and send the
+    # entire processed String to the logger, which might
+    # just discard the String if the log level is too low.
+    #
+    # TODO: Require that Rails loggers accept a block.
     class DelayedLog
       def initialize(&amp;blk)
         @blk = blk
@@ -20,8 +27,10 @@ module AbstractController
       cattr_accessor :logger
     end
 
-    def process(action)
-      ret = super
+    # Override process_action in the AbstractController::Base
+    # to log details about the method.
+    def process_action(action)
+      super
 
       if logger
         log = DelayedLog.new do
@@ -32,10 +41,9 @@ module AbstractController
 
         logger.info(log)
       end
-
-      ret
     end
 
+  private
     def request_origin
       # this *needs* to be cached!
       # otherwise you'd get different results if calling it more than once</diff>
      <filename>actionpack/lib/action_controller/abstract/logger.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,10 +14,32 @@ module AbstractController
       self._view_paths ||= ActionView::PathSet.new
     end
 
+    # An instance of a view class. The default view class is ActionView::Base
+    #
+    # The view class must have the following methods:
+    # initialize[paths, assigns_for_first_render, controller]
+    #   paths&lt;Array[ViewPath]&gt;:: A list of resolvers to look for templates in
+    #   controller&lt;AbstractController::Base&gt; A controller
+    # _render_partial_from_controller[options]
+    #   options&lt;Hash&gt;:: see _render_partial in ActionView::Base
+    # _render_template_from_controller[template, layout, options, partial]
+    #   template&lt;ActionView::Template&gt;:: The template to render
+    #   layout&lt;ActionView::Template&gt;:: The layout to render around the template
+    #   options&lt;Hash&gt;:: See _render_template_with_layout in ActionView::Base
+    #   partial&lt;Boolean&gt;:: Whether or not the template to render is a partial
+    # _partial:: If a partial, rather than a template, was rendered, return
+    #   the partial.
+    # helpers:: A module containing the helpers to be used in the view. This
+    #   module should respond_to include.
+    # controller:: The controller that initialized the ActionView
+    #
+    # Override this method in a to change the default behavior.
     def _action_view
       @_action_view ||= ActionView::Base.new(self.class.view_paths, {}, self)
     end
 
+    # Mostly abstracts the fact that calling render twice is a DoubleRenderError.
+    # Delegates render_to_body and sticks the result in self.response_body.
     def render(*args)
       if response_body
         raise AbstractController::DoubleRenderError, &quot;OMG&quot;
@@ -27,9 +49,10 @@ module AbstractController
     end
 
     # Raw rendering of a template to a Rack-compatible body.
-    # ====
-    # @option _prefix&lt;String&gt; The template's path prefix
-    # @option _layout&lt;String&gt; The relative path to the layout template to use
+    #
+    # ==== Options
+    # _partial_object&lt;Object&gt;:: The object that is being rendered. If this
+    #   exists, we are in the special case of rendering an object as a partial.
     #
     # :api: plugin
     def render_to_body(options = {})
@@ -42,21 +65,27 @@ module AbstractController
       end
     end
 
-    # Raw rendering of a template to a string.
-    # ====
-    # @option _prefix&lt;String&gt; The template's path prefix
-    # @option _layout&lt;String&gt; The relative path to the layout template to use
+    # Raw rendering of a template to a string. Just convert the results of
+    # render_to_body into a String.
     #
     # :api: plugin
     def render_to_string(options = {})
       AbstractController::Renderer.body_to_s(render_to_body(options))
     end
 
+    # Renders the template from an object.
+    #
+    # ==== Options
+    # _template&lt;ActionView::Template&gt;:: The template to render
+    # _layout&lt;ActionView::Template&gt;:: The layout to wrap the template in (optional)
+    # _partial&lt;TrueClass, FalseClass&gt;:: Whether or not the template to be rendered is a partial
     def _render_template(options)
       _action_view._render_template_from_controller(options[:_template], options[:_layout], options, options[:_partial])
     end
 
-    def view_paths()
+    # The list of view paths for this controller. See ActionView::ViewPathSet for
+    # more details about writing custom view paths.
+    def view_paths
       _view_paths
     end
 
@@ -73,6 +102,15 @@ module AbstractController
     end
 
   private
+    # Take in a set of options and determine the template to render
+    #
+    # ==== Options
+    # _template&lt;ActionView::Template&gt;:: If this is provided, the search is over
+    # _template_name&lt;#to_s&gt;:: The name of the template to look up. Otherwise,
+    #   use the current action name.
+    # _prefix&lt;String&gt;:: The prefix to look inside of. In a file system, this corresponds
+    #   to a directory.
+    # _partial&lt;TrueClass, FalseClass&gt;:: Whether or not the file to look up is a partial
     def _determine_template(options)
       name = (options[:_template_name] || action_name).to_s
 
@@ -82,18 +120,36 @@ module AbstractController
     end
 
     module ClassMethods
+      # Append a path to the list of view paths for this controller.
+      #
+      # ==== Parameters
+      # path&lt;String, ViewPath&gt;:: If a String is provided, it gets converted into 
+      # the default view path. You may also provide a custom view path 
+      # (see ActionView::ViewPathSet for more information)
       def append_view_path(path)
         self.view_paths &lt;&lt; path
       end
 
+      # Prepend a path to the list of view paths for this controller.
+      #
+      # ==== Parameters
+      # path&lt;String, ViewPath&gt;:: If a String is provided, it gets converted into 
+      # the default view path. You may also provide a custom view path 
+      # (see ActionView::ViewPathSet for more information)
       def prepend_view_path(path)
         self.view_paths.unshift(path)
       end
 
+      # A list of all of the default view paths for this controller.
       def view_paths
         self._view_paths
       end
 
+      # Set the view paths.
+      #
+      # ==== Parameters
+      # paths&lt;ViewPathSet, Object&gt;:: If a ViewPathSet is provided, use that;
+      #   otherwise, process the parameter into a ViewPathSet.
       def view_paths=(paths)
         self._view_paths = paths.is_a?(ActionView::PathSet) ?
                             paths : ActionView::Base.process_view_paths(paths)</diff>
      <filename>actionpack/lib/action_controller/abstract/renderer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,884 +1,167 @@
-require 'action_controller/deprecated'
-require 'set'
-require 'active_support/core_ext/class/inheritable_attributes'
-require 'active_support/core_ext/module/attr_internal'
-
-module ActionController #:nodoc:
-  class ActionControllerError &lt; StandardError #:nodoc:
-  end
-
-  class SessionRestoreError &lt; ActionControllerError #:nodoc:
-  end
-
-  class RenderError &lt; ActionControllerError #:nodoc:
-  end
-
-  class RoutingError &lt; ActionControllerError #:nodoc:
-    attr_reader :failures
-    def initialize(message, failures=[])
-      super(message)
-      @failures = failures
-    end
-  end
-
-  class MethodNotAllowed &lt; ActionControllerError #:nodoc:
-    attr_reader :allowed_methods
-
-    def initialize(*allowed_methods)
-      super(&quot;Only #{allowed_methods.to_sentence(:locale =&gt; :en)} requests are allowed.&quot;)
-      @allowed_methods = allowed_methods
-    end
-
-    def allowed_methods_header
-      allowed_methods.map { |method_symbol| method_symbol.to_s.upcase } * ', '
-    end
-  end
-
-  class NotImplemented &lt; MethodNotAllowed #:nodoc:
-  end
-
-  class UnknownController &lt; ActionControllerError #:nodoc:
-  end
-
-  class UnknownAction &lt; ActionControllerError #:nodoc:
-  end
-
-  class MissingFile &lt; ActionControllerError #:nodoc:
-  end
-
-  class RenderError &lt; ActionControllerError #:nodoc:
-  end
-
-  class SessionOverflowError &lt; ActionControllerError #:nodoc:
-    DEFAULT_MESSAGE = 'Your session data is larger than the data column in which it is to be stored. You must increase the size of your data column if you intend to store large data.'
-
-    def initialize(message = nil)
-      super(message || DEFAULT_MESSAGE)
-    end
-  end
-
-  class UnknownHttpMethod &lt; ActionControllerError #:nodoc:
-  end
-
-  # Action Controllers are the core of a web request in Rails. They are made up of one or more actions that are executed
-  # on request and then either render a template or redirect to another action. An action is defined as a public method
-  # on the controller, which will automatically be made accessible to the web-server through Rails Routes.
-  #
-  # A sample controller could look like this:
-  #
-  #   class GuestBookController &lt; ActionController::Base
-  #     def index
-  #       @entries = Entry.find(:all)
-  #     end
-  #
-  #     def sign
-  #       Entry.create(params[:entry])
-  #       redirect_to :action =&gt; &quot;index&quot;
-  #     end
-  #   end
-  #
-  # Actions, by default, render a template in the &lt;tt&gt;app/views&lt;/tt&gt; directory corresponding to the name of the controller and action
-  # after executing code in the action. For example, the +index+ action of the GuestBookController would render the
-  # template &lt;tt&gt;app/views/guestbook/index.erb&lt;/tt&gt; by default after populating the &lt;tt&gt;@entries&lt;/tt&gt; instance variable.
-  #
-  # Unlike index, the sign action will not render a template. After performing its main purpose (creating a
-  # new entry in the guest book), it initiates a redirect instead. This redirect works by returning an external
-  # &quot;302 Moved&quot; HTTP response that takes the user to the index action.
-  #
-  # The index and sign represent the two basic action archetypes used in Action Controllers. Get-and-show and do-and-redirect.
-  # Most actions are variations of these themes.
-  #
-  # == Requests
-  #
-  # Requests are processed by the Action Controller framework by extracting the value of the &quot;action&quot; key in the request parameters.
-  # This value should hold the name of the action to be performed. Once the action has been identified, the remaining
-  # request parameters, the session (if one is available), and the full request with all the HTTP headers are made available to
-  # the action through instance variables. Then the action is performed.
-  #
-  # The full request object is available with the request accessor and is primarily used to query for HTTP headers. These queries
-  # are made by accessing the environment hash, like this:
-  #
-  #   def server_ip
-  #     location = request.env[&quot;SERVER_ADDR&quot;]
-  #     render :text =&gt; &quot;This server hosted at #{location}&quot;
-  #   end
-  #
-  # == Parameters
-  #
-  # All request parameters, whether they come from a GET or POST request, or from the URL, are available through the params method
-  # which returns a hash. For example, an action that was performed through &lt;tt&gt;/weblog/list?category=All&amp;limit=5&lt;/tt&gt; will include
-  # &lt;tt&gt;{ &quot;category&quot; =&gt; &quot;All&quot;, &quot;limit&quot; =&gt; 5 }&lt;/tt&gt; in params.
-  #
-  # It's also possible to construct multi-dimensional parameter hashes by specifying keys using brackets, such as:
-  #
-  #   &lt;input type=&quot;text&quot; name=&quot;post[name]&quot; value=&quot;david&quot;&gt;
-  #   &lt;input type=&quot;text&quot; name=&quot;post[address]&quot; value=&quot;hyacintvej&quot;&gt;
-  #
-  # A request stemming from a form holding these inputs will include &lt;tt&gt;{ &quot;post&quot; =&gt; { &quot;name&quot; =&gt; &quot;david&quot;, &quot;address&quot; =&gt; &quot;hyacintvej&quot; } }&lt;/tt&gt;.
-  # If the address input had been named &quot;post[address][street]&quot;, the params would have included
-  # &lt;tt&gt;{ &quot;post&quot; =&gt; { &quot;address&quot; =&gt; { &quot;street&quot; =&gt; &quot;hyacintvej&quot; } } }&lt;/tt&gt;. There's no limit to the depth of the nesting.
-  #
-  # == Sessions
-  #
-  # Sessions allows you to store objects in between requests. This is useful for objects that are not yet ready to be persisted,
-  # such as a Signup object constructed in a multi-paged process, or objects that don't change much and are needed all the time, such
-  # as a User object for a system that requires login. The session should not be used, however, as a cache for objects where it's likely
-  # they could be changed unknowingly. It's usually too much work to keep it all synchronized -- something databases already excel at.
-  #
-  # You can place objects in the session by using the &lt;tt&gt;session&lt;/tt&gt; method, which accesses a hash:
-  #
-  #   session[:person] = Person.authenticate(user_name, password)
-  #
-  # And retrieved again through the same hash:
-  #
-  #   Hello #{session[:person]}
-  #
-  # For removing objects from the session, you can either assign a single key to +nil+:
-  #
-  #   # removes :person from session
-  #   session[:person] = nil
-  #
-  # or you can remove the entire session with +reset_session+.
-  #
-  # Sessions are stored by default in a browser cookie that's cryptographically signed, but unencrypted.
-  # This prevents the user from tampering with the session but also allows him to see its contents.
-  #
-  # Do not put secret information in cookie-based sessions!
-  #
-  # Other options for session storage are:
-  #
-  # * ActiveRecord::SessionStore - Sessions are stored in your database, which works better than PStore with multiple app servers and,
-  #   unlike CookieStore, hides your session contents from the user. To use ActiveRecord::SessionStore, set
-  #
-  #     config.action_controller.session_store = :active_record_store
-  #
-  #   in your &lt;tt&gt;config/environment.rb&lt;/tt&gt; and run &lt;tt&gt;rake db:sessions:create&lt;/tt&gt;.
-  #
-  # * MemCacheStore - Sessions are stored as entries in your memcached cache.
-  #   Set the session store type in &lt;tt&gt;config/environment.rb&lt;/tt&gt;:
-  #
-  #     config.action_controller.session_store = :mem_cache_store
-  #
-  #   This assumes that memcached has been installed and configured properly.
-  #   See the MemCacheStore docs for more information.
-  #
-  # == Responses
-  #
-  # Each action results in a response, which holds the headers and document to be sent to the user's browser. The actual response
-  # object is generated automatically through the use of renders and redirects and requires no user intervention.
-  #
-  # == Renders
-  #
-  # Action Controller sends content to the user by using one of five rendering methods. The most versatile and common is the rendering
-  # of a template. Included in the Action Pack is the Action View, which enables rendering of ERb templates. It's automatically configured.
-  # The controller passes objects to the view by assigning instance variables:
-  #
-  #   def show
-  #     @post = Post.find(params[:id])
-  #   end
-  #
-  # Which are then automatically available to the view:
-  #
-  #   Title: &lt;%= @post.title %&gt;
-  #
-  # You don't have to rely on the automated rendering. Especially actions that could result in the rendering of different templates will use
-  # the manual rendering methods:
-  #
-  #   def search
-  #     @results = Search.find(params[:query])
-  #     case @results
-  #       when 0 then render :action =&gt; &quot;no_results&quot;
-  #       when 1 then render :action =&gt; &quot;show&quot;
-  #       when 2..10 then render :action =&gt; &quot;show_many&quot;
-  #     end
-  #   end
-  #
-  # Read more about writing ERb and Builder templates in link:classes/ActionView/Base.html.
-  #
-  # == Redirects
-  #
-  # Redirects are used to move from one action to another. For example, after a &lt;tt&gt;create&lt;/tt&gt; action, which stores a blog entry to a database,
-  # we might like to show the user the new entry. Because we're following good DRY principles (Don't Repeat Yourself), we're going to reuse (and redirect to)
-  # a &lt;tt&gt;show&lt;/tt&gt; action that we'll assume has already been created. The code might look like this:
-  #
-  #   def create
-  #     @entry = Entry.new(params[:entry])
-  #     if @entry.save
-  #       # The entry was saved correctly, redirect to show
-  #       redirect_to :action =&gt; 'show', :id =&gt; @entry.id
-  #     else
-  #       # things didn't go so well, do something else
-  #     end
-  #   end
-  #
-  # In this case, after saving our new entry to the database, the user is redirected to the &lt;tt&gt;show&lt;/tt&gt; method which is then executed.
-  #
-  # == Calling multiple redirects or renders
-  #
-  # An action may contain only a single render or a single redirect. Attempting to try to do either again will result in a DoubleRenderError:
-  #
-  #   def do_something
-  #     redirect_to :action =&gt; &quot;elsewhere&quot;
-  #     render :action =&gt; &quot;overthere&quot; # raises DoubleRenderError
-  #   end
-  #
-  # If you need to redirect on the condition of something, then be sure to add &quot;and return&quot; to halt execution.
-  #
-  #   def do_something
-  #     redirect_to(:action =&gt; &quot;elsewhere&quot;) and return if monkeys.nil?
-  #     render :action =&gt; &quot;overthere&quot; # won't be called if monkeys is nil
-  #   end
-  #
-  class Base
-
+module ActionController
+  class Base &lt; Http
+    abstract!
+
+    include AbstractController::Benchmarker
+    include AbstractController::Callbacks
+    include AbstractController::Logger
+
+    include ActionController::Helpers
+    include ActionController::HideActions
+    include ActionController::UrlFor
+    include ActionController::Redirector
+    include ActionController::Renderer
+    include ActionController::Renderers::All
+    include ActionController::Layouts
+    include ActionController::ConditionalGet
+    include ActionController::RackConvenience
+
+    # Legacy modules
+    include SessionManagement
     include ActionDispatch::StatusCodes
-
-    cattr_reader :protected_instance_variables
-    # Controller specific instance variables which will not be accessible inside views.
-    @@protected_instance_variables = %w(@assigns @performed_redirect @performed_render @variables_added @request_origin @url @parent_controller
-                                        @action_name @before_filter_chain_aborted @action_cache_path @_headers @_params
-                                        @_flash @_response)
-
-    # Prepends all the URL-generating helpers from AssetHelper. This makes it possible to easily move javascripts, stylesheets,
-    # and images to a dedicated asset server away from the main web server. Example:
-    #   ActionController::Base.asset_host = &quot;http://assets.example.com&quot;
-    cattr_accessor :asset_host
-
-    # All requests are considered local by default, so everyone will be exposed to detailed debugging screens on errors.
-    # When the application is ready to go public, this should be set to false, and the protected method &lt;tt&gt;local_request?&lt;/tt&gt;
-    # should instead be implemented in the controller to determine when debugging screens should be shown.
-    @@consider_all_requests_local = true
-    cattr_accessor :consider_all_requests_local
-
-    # Indicates whether to allow concurrent action processing. Your
-    # controller actions and any other code they call must also behave well
-    # when called from concurrent threads. Turned off by default.
-    @@allow_concurrency = false
-    cattr_accessor :allow_concurrency
-
-    # Modern REST web services often need to submit complex data to the web application.
-    # The &lt;tt&gt;@@param_parsers&lt;/tt&gt; hash lets you register handlers which will process the HTTP body and add parameters to the
-    # &lt;tt&gt;params&lt;/tt&gt; hash. These handlers are invoked for POST and PUT requests.
-    #
-    # By default &lt;tt&gt;application/xml&lt;/tt&gt; is enabled. A XmlSimple class with the same param name as the root will be instantiated
-    # in the &lt;tt&gt;params&lt;/tt&gt;. This allows XML requests to mask themselves as regular form submissions, so you can have one
-    # action serve both regular forms and web service requests.
-    #
-    # Example of doing your own parser for a custom content type:
-    #
-    #   ActionController::Base.param_parsers[Mime::Type.lookup('application/atom+xml')] = Proc.new do |data|
-    #      node = REXML::Document.new(post)
-    #     { node.root.name =&gt; node.root }
-    #   end
-    #
-    # Note: Up until release 1.1 of Rails, Action Controller would default to using XmlSimple configured to discard the
-    # root node for such requests. The new default is to keep the root, such that &quot;&lt;r&gt;&lt;name&gt;David&lt;/name&gt;&lt;/r&gt;&quot; results
-    # in &lt;tt&gt;params[:r][:name]&lt;/tt&gt; for &quot;David&quot; instead of &lt;tt&gt;params[:name]&lt;/tt&gt;. To get the old behavior, you can
-    # re-register XmlSimple as application/xml handler ike this:
-    #
-    #   ActionController::Base.param_parsers[Mime::XML] =
-    #     Proc.new { |data| XmlSimple.xml_in(data, 'ForceArray' =&gt; false) }
-    #
-    # A YAML parser is also available and can be turned on with:
-    #
-    #   ActionController::Base.param_parsers[Mime::YAML] = :yaml
-    @@param_parsers = { Mime::MULTIPART_FORM   =&gt; :multipart_form,
-                        Mime::URL_ENCODED_FORM =&gt; :url_encoded_form,
-                        Mime::XML              =&gt; :xml_simple,
-                        Mime::JSON             =&gt; :json }
-    cattr_accessor :param_parsers
-
-    # Controls the default charset for all renders.
-    @@default_charset = &quot;utf-8&quot;
-    cattr_accessor :default_charset
-
-    # The logger is used for generating information on the action run-time (including benchmarking) if available.
-    # Can be set to nil for no logging. Compatible with both Ruby's own Logger and Log4r loggers.
-    cattr_accessor :logger
-
-    # Controls the resource action separator
-    @@resource_action_separator = &quot;/&quot;
-    cattr_accessor :resource_action_separator
-
-    # Allow to override path names for default resources' actions
-    @@resources_path_names = { :new =&gt; 'new', :edit =&gt; 'edit' }
-    cattr_accessor :resources_path_names
-
-    # Sets the token parameter name for RequestForgery. Calling +protect_from_forgery+
-    # sets it to &lt;tt&gt;:authenticity_token&lt;/tt&gt; by default.
-    cattr_accessor :request_forgery_protection_token
-
-    # Controls the IP Spoofing check when determining the remote IP.
-    @@ip_spoofing_check = true
-    cattr_accessor :ip_spoofing_check
-
-    # Indicates whether or not optimise the generated named
-    # route helper methods
-    cattr_accessor :optimise_named_routes
-    self.optimise_named_routes = true
-
-    # Indicates whether the response format should be determined by examining the Accept HTTP header,
-    # or by using the simpler params + ajax rules.
-    #
-    # If this is set to +true+ (the default) then +respond_to+ and +Request#format+ will take the Accept
-    # header into account.  If it is set to false then the request format will be determined solely
-    # by examining params[:format].  If params format is missing, the format will be either HTML or
-    # Javascript depending on whether the request is an AJAX request.
-    cattr_accessor :use_accept_header
-    self.use_accept_header = true
-
-    # Controls whether request forgergy protection is turned on or not. Turned off by default only in test mode.
-    class_inheritable_accessor :allow_forgery_protection
-    self.allow_forgery_protection = true
-
-    # If you are deploying to a subdirectory, you will need to set
-    # &lt;tt&gt;config.action_controller.relative_url_root&lt;/tt&gt;
-    # This defaults to ENV['RAILS_RELATIVE_URL_ROOT']
-    cattr_accessor :relative_url_root
-    self.relative_url_root = ENV['RAILS_RELATIVE_URL_ROOT']
-
-    # Holds the request object that's primarily used to get environment variables through access like
-    # &lt;tt&gt;request.env[&quot;REQUEST_URI&quot;]&lt;/tt&gt;.
-    attr_internal :request
-
-    # Holds a hash of all the GET, POST, and Url parameters passed to the action. Accessed like &lt;tt&gt;params[&quot;post_id&quot;]&lt;/tt&gt;
-    # to get the post_id. No type casts are made, so all values are returned as strings.
-    attr_internal :params
-
-    # Holds the response object that's primarily used to set additional HTTP headers through access like
-    # &lt;tt&gt;response.headers[&quot;Cache-Control&quot;] = &quot;no-cache&quot;&lt;/tt&gt;. Can also be used to access the final body HTML after a template
-    # has been rendered through response.body -- useful for &lt;tt&gt;after_filter&lt;/tt&gt;s that wants to manipulate the output,
-    # such as a OutputCompressionFilter.
-    attr_internal :response
-
-    # Holds a hash of objects in the session. Accessed like &lt;tt&gt;session[:person]&lt;/tt&gt; to get the object tied to the &quot;person&quot;
-    # key. The session will hold any type of object as values, but the key should be a string or symbol.
-    def session
-      request.session
-    end
-
-    # Holds a hash of header names and values. Accessed like &lt;tt&gt;headers[&quot;Cache-Control&quot;]&lt;/tt&gt; to get the value of the Cache-Control
-    # directive. Values should always be specified as strings.
-    attr_internal :headers
-
-    # Returns the name of the action this controller is processing.
-    attr_accessor :action_name
-
-    attr_reader :template
-
-    def action(name, env)
-      request  = ActionDispatch::Request.new(env)
-      response = ActionDispatch::Response.new
-      self.action_name = name &amp;&amp; name.to_s
-      process(request, response).to_a
-    end
-
-
-    class &lt;&lt; self
-      def action(name = nil)
-        @actions ||= {}
-        @actions[name] ||= proc do |env|
-          new.action(name, env)
-        end
-      end
-      
-      # Converts the class name from something like &quot;OneModule::TwoModule::NeatController&quot; to &quot;NeatController&quot;.
-      def controller_class_name
-        @controller_class_name ||= name.demodulize
-      end
-
-      # Converts the class name from something like &quot;OneModule::TwoModule::NeatController&quot; to &quot;neat&quot;.
-      def controller_name
-        @controller_name ||= controller_class_name.sub(/Controller$/, '').underscore
-      end
-
-      # Converts the class name from something like &quot;OneModule::TwoModule::NeatController&quot; to &quot;one_module/two_module/neat&quot;.
-      def controller_path
-        @controller_path ||= name.gsub(/Controller$/, '').underscore
-      end
-
-      # Return an array containing the names of public methods that have been marked hidden from the action processor.
-      # By default, all methods defined in ActionController::Base and included modules are hidden.
-      # More methods can be hidden using &lt;tt&gt;hide_action&lt;/tt&gt;.
-      def hidden_actions
-        read_inheritable_attribute(:hidden_actions) || write_inheritable_attribute(:hidden_actions, [])
-      end
-
-      # Hide each of the given methods from being callable as actions.
-      def hide_action(*names)
-        write_inheritable_attribute(:hidden_actions, hidden_actions | names.map { |name| name.to_s })
-      end
-
-      # View load paths determine the bases from which template references can be made. So a call to
-      # render(&quot;test/template&quot;) will be looked up in the view load paths array and the closest match will be
-      # returned.
-      def view_paths
-        if defined? @view_paths
-          @view_paths
-        else
-          superclass.view_paths
-        end
-      end
-
-      def view_paths=(value)
-        @view_paths = ActionView::Base.process_view_paths(value) if value
-      end
-
-      # Adds a view_path to the front of the view_paths array.
-      # If the current class has no view paths, copy them from
-      # the superclass.  This change will be visible for all future requests.
-      #
-      #   ArticleController.prepend_view_path(&quot;views/default&quot;)
-      #   ArticleController.prepend_view_path([&quot;views/default&quot;, &quot;views/custom&quot;])
-      #
-      def prepend_view_path(path)
-        @view_paths = superclass.view_paths.dup if !defined?(@view_paths) || @view_paths.nil?
-        @view_paths.unshift(*path)
+    include ActionController::Caching
+    include ActionController::MimeResponds
+
+    # Rails 2.x compatibility
+    include ActionController::Rails2Compatibility
+
+    include ActionController::Cookies
+    include ActionController::Session
+    include ActionController::Flash
+    include ActionController::Verification
+    include ActionController::RequestForgeryProtection
+    include ActionController::Streaming
+    include ActionController::HttpAuthentication::Basic::ControllerMethods
+    include ActionController::HttpAuthentication::Digest::ControllerMethods
+    include ActionController::FilterParameterLogging
+    include ActionController::Translation
+
+    # TODO: Extract into its own module
+    # This should be moved together with other normalizing behavior
+    module ImplicitRender
+      def send_action(*)
+        ret = super
+        default_render unless performed?
+        ret
+      end
+
+      def default_render
+        render
       end
 
-      # Adds a view_path to the end of the view_paths array.
-      # If the current class has no view paths, copy them from
-      # the superclass. This change will be visible for all future requests.
-      #
-      #   ArticleController.append_view_path(&quot;views/default&quot;)
-      #   ArticleController.append_view_path([&quot;views/default&quot;, &quot;views/custom&quot;])
-      #
-      def append_view_path(path)
-        @view_paths = superclass.view_paths.dup if @view_paths.nil?
-        @view_paths.push(*path)
-      end
-      
-      @@exempt_from_layout = [ActionView::TemplateHandlers::RJS]
-      
-      def exempt_from_layout(*types)
-        types.each do |type|
-          @@exempt_from_layout &lt;&lt; 
-            ActionView::Template.handler_class_for_extension(type)
+      def method_for_action(action_name)
+        super || begin
+          if view_paths.find_by_parts?(action_name.to_s, {:formats =&gt; formats, :locales =&gt; [I18n.locale]}, controller_path)
+            &quot;default_render&quot;
+          end
         end
-        
-        @@exempt_from_layout
       end
-
     end
 
-    public
-      def call(env)
-        request = ActionDispatch::Request.new(env)
-        response = ActionDispatch::Response.new
-        process(request, response).to_a
-      end
-
-      # Extracts the action_name from the request parameters and performs that action.
-      def process(request, response, method = :perform_action, *arguments) #:nodoc:
-        response.request = request
+    include ImplicitRender
 
-        assign_shortcuts(request, response)
-        initialize_template_class(response)
-        initialize_current_url
+    include ActionController::Rescue
 
-        log_processing
-        send(method, *arguments)
-
-        send_response
-      ensure
-        process_cleanup
-      end
-
-      def send_response
-        response.prepare!
-        response
-      end
-
-      # Returns a URL that has been rewritten according to the options hash and the defined routes.
-      # (For doing a complete redirect, use +redirect_to+).
-      #
-      # &lt;tt&gt;url_for&lt;/tt&gt; is used to:
-      #
-      # All keys given to +url_for+ are forwarded to the Route module, save for the following:
-      # * &lt;tt&gt;:anchor&lt;/tt&gt; - Specifies the anchor name to be appended to the path. For example,
-      #   &lt;tt&gt;url_for :controller =&gt; 'posts', :action =&gt; 'show', :id =&gt; 10, :anchor =&gt; 'comments'&lt;/tt&gt;
-      #   will produce &quot;/posts/show/10#comments&quot;.
-      # * &lt;tt&gt;:only_path&lt;/tt&gt; - If true, returns the relative URL (omitting the protocol, host name, and port) (&lt;tt&gt;false&lt;/tt&gt; by default).
-      # * &lt;tt&gt;:trailing_slash&lt;/tt&gt; - If true, adds a trailing slash, as in &quot;/archive/2005/&quot;. Note that this
-      #   is currently not recommended since it breaks caching.
-      # * &lt;tt&gt;:host&lt;/tt&gt; - Overrides the default (current) host if provided.
-      # * &lt;tt&gt;:protocol&lt;/tt&gt; - Overrides the default (current) protocol if provided.
-      # * &lt;tt&gt;:port&lt;/tt&gt; - Optionally specify the port to connect to.
-      # * &lt;tt&gt;:user&lt;/tt&gt; - Inline HTTP authentication (only plucked out if &lt;tt&gt;:password&lt;/tt&gt; is also present).
-      # * &lt;tt&gt;:password&lt;/tt&gt; - Inline HTTP authentication (only plucked out if &lt;tt&gt;:user&lt;/tt&gt; is also present).
-      # * &lt;tt&gt;:skip_relative_url_root&lt;/tt&gt; - If true, the url is not constructed using the +relative_url_root+
-      #   of the request so the path will include the web server relative installation directory.
-      #
-      # The URL is generated from the remaining keys in the hash. A URL contains two key parts: the &lt;base&gt; and a query string.
-      # Routes composes a query string as the key/value pairs not included in the &lt;base&gt;.
-      #
-      # The default Routes setup supports a typical Rails path of &quot;controller/action/id&quot; where action and id are optional, with
-      # action defaulting to 'index' when not given. Here are some typical url_for statements and their corresponding URLs:
-      #
-      #   url_for :controller =&gt; 'posts', :action =&gt; 'recent'                # =&gt; 'proto://host.com/posts/recent'
-      #   url_for :controller =&gt; 'posts', :action =&gt; 'index'                 # =&gt; 'proto://host.com/posts'
-      #   url_for :controller =&gt; 'posts', :action =&gt; 'index', :port=&gt;'8033'  # =&gt; 'proto://host.com:8033/posts'
-      #   url_for :controller =&gt; 'posts', :action =&gt; 'show', :id =&gt; 10       # =&gt; 'proto://host.com/posts/show/10'
-      #   url_for :controller =&gt; 'posts', :user =&gt; 'd', :password =&gt; '123'   # =&gt; 'proto://d:123@host.com/posts'
-      #
-      # When generating a new URL, missing values may be filled in from the current request's parameters. For example,
-      # &lt;tt&gt;url_for :action =&gt; 'some_action'&lt;/tt&gt; will retain the current controller, as expected. This behavior extends to
-      # other parameters, including &lt;tt&gt;:controller&lt;/tt&gt;, &lt;tt&gt;:id&lt;/tt&gt;, and any other parameters that are placed into a Route's
-      # path.
-      # &#160;
-      # The URL helpers such as &lt;tt&gt;url_for&lt;/tt&gt; have a limited form of memory: when generating a new URL, they can look for
-      # missing values in the current request's parameters. Routes attempts to guess when a value should and should not be
-      # taken from the defaults. There are a few simple rules on how this is performed:
-      #
-      # * If the controller name begins with a slash no defaults are used:
-      #
-      #     url_for :controller =&gt; '/home'
-      #
-      #   In particular, a leading slash ensures no namespace is assumed. Thus,
-      #   while &lt;tt&gt;url_for :controller =&gt; 'users'&lt;/tt&gt; may resolve to
-      #   &lt;tt&gt;Admin::UsersController&lt;/tt&gt; if the current controller lives under
-      #   that module, &lt;tt&gt;url_for :controller =&gt; '/users'&lt;/tt&gt; ensures you link
-      #   to &lt;tt&gt;::UsersController&lt;/tt&gt; no matter what.
-      # * If the controller changes, the action will default to index unless provided
-      #
-      # The final rule is applied while the URL is being generated and is best illustrated by an example. Let us consider the
-      # route given by &lt;tt&gt;map.connect 'people/:last/:first/:action', :action =&gt; 'bio', :controller =&gt; 'people'&lt;/tt&gt;.
-      #
-      # Suppose that the current URL is &quot;people/hh/david/contacts&quot;. Let's consider a few different cases of URLs which are generated
-      # from this page.
-      #
-      # * &lt;tt&gt;url_for :action =&gt; 'bio'&lt;/tt&gt; -- During the generation of this URL, default values will be used for the first and
-      # last components, and the action shall change. The generated URL will be, &quot;people/hh/david/bio&quot;.
-      # * &lt;tt&gt;url_for :first =&gt; 'davids-little-brother'&lt;/tt&gt; This generates the URL 'people/hh/davids-little-brother' -- note
-      #   that this URL leaves out the assumed action of 'bio'.
-      #
-      # However, you might ask why the action from the current request, 'contacts', isn't carried over into the new URL. The
-      # answer has to do with the order in which the parameters appear in the generated path. In a nutshell, since the
-      # value that appears in the slot for &lt;tt&gt;:first&lt;/tt&gt; is not equal to default value for &lt;tt&gt;:first&lt;/tt&gt; we stop using
-      # defaults. On its own, this rule can account for much of the typical Rails URL behavior.
-      # &#160;
-      # Although a convenience, defaults can occasionally get in your way. In some cases a default persists longer than desired.
-      # The default may be cleared by adding &lt;tt&gt;:name =&gt; nil&lt;/tt&gt; to &lt;tt&gt;url_for&lt;/tt&gt;'s options.
-      # This is often required when writing form helpers, since the defaults in play may vary greatly depending upon where the
-      # helper is used from. The following line will redirect to PostController's default action, regardless of the page it is
-      # displayed on:
-      #
-      #   url_for :controller =&gt; 'posts', :action =&gt; nil
-      #
-      # If you explicitly want to create a URL that's almost the same as the current URL, you can do so using the
-      # &lt;tt&gt;:overwrite_params&lt;/tt&gt; options. Say for your posts you have different views for showing and printing them.
-      # Then, in the show view, you get the URL for the print view like this
-      #
-      #   url_for :overwrite_params =&gt; { :action =&gt; 'print' }
-      #
-      # This takes the current URL as is and only exchanges the action. In contrast, &lt;tt&gt;url_for :action =&gt; 'print'&lt;/tt&gt;
-      # would have slashed-off the path components after the changed action.
-      def url_for(options = {})
-        options ||= {}
-        case options
-          when String
-            options
-          when Hash
-            @url.rewrite(rewrite_options(options))
-          else
-            polymorphic_url(options)
-        end
-      end
-
-      # Converts the class name from something like &quot;OneModule::TwoModule::NeatController&quot; to &quot;NeatController&quot;.
-      def controller_class_name
-        self.class.controller_class_name
-      end
-
-      # Converts the class name from something like &quot;OneModule::TwoModule::NeatController&quot; to &quot;neat&quot;.
-      def controller_name
-        self.class.controller_name
-      end
-
-      # Converts the class name from something like &quot;OneModule::TwoModule::NeatController&quot; to &quot;one_module/two_module/neat&quot;.
-      def controller_path
-        self.class.controller_path
-      end
-
-      def session_enabled?
-        ActiveSupport::Deprecation.warn(&quot;Sessions are now lazy loaded. So if you don't access them, consider them disabled.&quot;, caller)
-      end
-
-      self.view_paths = []
-
-      # View load paths for controller.
-      def view_paths
-        @template.view_paths
-      end
-
-      def view_paths=(value)
-        @template.view_paths = ActionView::Base.process_view_paths(value)
-      end
-
-      # Adds a view_path to the front of the view_paths array.
-      # This change affects the current request only.
-      #
-      #   self.prepend_view_path(&quot;views/default&quot;)
-      #   self.prepend_view_path([&quot;views/default&quot;, &quot;views/custom&quot;])
-      #
-      def prepend_view_path(path)
-        @template.view_paths.unshift(*path)
-      end
-
-      # Adds a view_path to the end of the view_paths array.
-      # This change affects the current request only.
-      #
-      #   self.append_view_path(&quot;views/default&quot;)
-      #   self.append_view_path([&quot;views/default&quot;, &quot;views/custom&quot;])
-      #
-      def append_view_path(path)
-        @template.view_paths.push(*path)
-      end
-
-      def rewrite_options(options) #:nodoc:
-        if defaults = default_url_options(options)
-          defaults.merge(options)
-        else
-          options
-        end
-      end
-
-      # Overwrite to implement a number of default options that all url_for-based methods will use. The default options should come in
-      # the form of a hash, just like the one you would use for url_for directly. Example:
-      #
-      #   def default_url_options(options)
-      #     { :project =&gt; @project.active? ? @project.url_name : &quot;unknown&quot; }
-      #   end
-      #
-      # As you can infer from the example, this is mostly useful for situations where you want to centralize dynamic decisions about the
-      # urls as they stem from the business domain. Please note that any individual url_for call can always override the defaults set
-      # by this method.
-      def default_url_options(options = nil)
-      end
-
-      # Sets the etag and/or last_modified on the response and checks it against
-      # the client request. If the request doesn't match the options provided, the
-      # request is considered stale and should be generated from scratch. Otherwise,
-      # it's fresh and we don't need to generate anything and a reply of &quot;304 Not Modified&quot; is sent.
-      #
-      # Parameters:
-      # * &lt;tt&gt;:etag&lt;/tt&gt;
-      # * &lt;tt&gt;:last_modified&lt;/tt&gt; 
-      # * &lt;tt&gt;:public&lt;/tt&gt; By default the Cache-Control header is private, set this to true if you want your application to be cachable by other devices (proxy caches).
-      #
-      # Example:
-      #
-      #   def show
-      #     @article = Article.find(params[:id])
-      #
-      #     if stale?(:etag =&gt; @article, :last_modified =&gt; @article.created_at.utc)
-      #       @statistics = @article.really_expensive_call
-      #       respond_to do |format|
-      #         # all the supported formats
-      #       end
-      #     end
-      #   end
-      def stale?(options)
-        fresh_when(options)
-        !request.fresh?(response)
-      end
-
-      # Sets the etag, last_modified, or both on the response and renders a
-      # &quot;304 Not Modified&quot; response if the request is already fresh.
-      #
-      # Parameters:
-      # * &lt;tt&gt;:etag&lt;/tt&gt;
-      # * &lt;tt&gt;:last_modified&lt;/tt&gt; 
-      # * &lt;tt&gt;:public&lt;/tt&gt; By default the Cache-Control header is private, set this to true if you want your application to be cachable by other devices (proxy caches).
-      #
-      # Example:
-      #
-      #   def show
-      #     @article = Article.find(params[:id])
-      #     fresh_when(:etag =&gt; @article, :last_modified =&gt; @article.created_at.utc, :public =&gt; true)
-      #   end
-      #
-      # This will render the show template if the request isn't sending a matching etag or
-      # If-Modified-Since header and just a &quot;304 Not Modified&quot; response if there's a match.
-      #
-      def fresh_when(options)
-        options.assert_valid_keys(:etag, :last_modified, :public)
-
-        response.etag          = options[:etag]          if options[:etag]
-        response.last_modified = options[:last_modified] if options[:last_modified]
-        
-        if options[:public] 
-          cache_control = response.headers[&quot;Cache-Control&quot;].split(&quot;,&quot;).map {|k| k.strip }
-          cache_control.delete(&quot;private&quot;)
-          cache_control.delete(&quot;no-cache&quot;)
-          cache_control &lt;&lt; &quot;public&quot;
-          response.headers[&quot;Cache-Control&quot;] = cache_control.join(', ')
-        end
-
-        if request.fresh?(response)
-          head :not_modified
-        end
-      end
-
-      # Sets a HTTP 1.1 Cache-Control header. Defaults to issuing a &quot;private&quot; instruction, so that
-      # intermediate caches shouldn't cache the response.
-      #
-      # Examples:
-      #   expires_in 20.minutes
-      #   expires_in 3.hours, :public =&gt; true
-      #   expires in 3.hours, 'max-stale' =&gt; 5.hours, :public =&gt; true
-      #
-      # This method will overwrite an existing Cache-Control header.
-      # See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities.
-      def expires_in(seconds, options = {}) #:doc:
-        cache_control = response.headers[&quot;Cache-Control&quot;].split(&quot;,&quot;).map {|k| k.strip }
-
-        cache_control &lt;&lt; &quot;max-age=#{seconds}&quot;
-        cache_control.delete(&quot;no-cache&quot;)
-        if options[:public]
-          cache_control.delete(&quot;private&quot;)
-          cache_control &lt;&lt; &quot;public&quot;
-        else
-          cache_control &lt;&lt; &quot;private&quot;
-        end
-        
-        # This allows for additional headers to be passed through like 'max-stale' =&gt; 5.hours
-        cache_control += options.symbolize_keys.reject{|k,v| k == :public || k == :private }.map{ |k,v| v == true ? k.to_s : &quot;#{k.to_s}=#{v.to_s}&quot;}
-        
-        response.headers[&quot;Cache-Control&quot;] = cache_control.join(', ')
-      end
-
-      # Sets a HTTP 1.1 Cache-Control header of &quot;no-cache&quot; so no caching should occur by the browser or
-      # intermediate caches (like caching proxy servers).
-      def expires_now #:doc:
-        response.headers[&quot;Cache-Control&quot;] = &quot;no-cache&quot;
-      end
-
-      # Resets the session by clearing out all the objects stored within and initializing a new session object.
-      def reset_session #:doc:
-        request.reset_session
-      end
-
-    private
-      def _process_options(options)
-        if content_type = options[:content_type]
-          response.content_type = content_type.to_s
-        end
-
-        if location = options[:location]
-          response.headers[&quot;Location&quot;] = url_for(location)
-        end
-
-        response.status = interpret_status(options[:status] || DEFAULT_RENDER_STATUS_CODE)
-      end
-
-      def initialize_template_class(response)
-        @template = ActionView::Base.new(self.class.view_paths, {}, self, formats)
-        response.template = @template if response.respond_to?(:template=)
-        @template.helpers.send :include, self.class.master_helper_module
-        @performed_render = @performed_redirect = false
-      end
-
-      def assign_shortcuts(request, response)
-        @_request, @_response, @_params = request, response, request.parameters
-        @_headers = @_response.headers
-      end
-
-      def initialize_current_url
-        @url = UrlRewriter.new(request, params.clone)
-      end
-
-      def log_processing
-        if logger &amp;&amp; logger.info?
-          log_processing_for_request_id
-          log_processing_for_parameters
-        end
-      end
-
-      def log_processing_for_request_id
-        request_id = &quot;\n\nProcessing #{self.class.name}\##{action_name} &quot;
-        request_id &lt;&lt; &quot;to #{params[:format]} &quot; if params[:format]
-        request_id &lt;&lt; &quot;(for #{request_origin}) [#{request.method.to_s.upcase}]&quot;
-
-        logger.info(request_id)
-      end
+    def self.inherited(klass)
+      ::ActionController::Base.subclasses &lt;&lt; klass.to_s
+      super
+    end
 
-      def default_render #:nodoc:
-        render
-      end
+    def self.subclasses
+      @subclasses ||= []
+    end
 
-      def perform_action
-        if called = action_methods.include?(action_name)
-          ret = send(action_name)
-        elsif called = respond_to?(:method_missing)
-          ret = method_missing(action_name)
-        end
-        
-        return (performed? ? ret : default_render) if called
-        
-        begin
-          view_paths.find_by_parts(action_name, {:formats =&gt; formats, :locales =&gt; [I18n.locale]}, controller_path)
-        rescue =&gt; e
-          raise UnknownAction, &quot;No action responded to #{action_name}. Actions: &quot; +
-            &quot;#{action_methods.sort.to_sentence}&quot;, caller
+    def _normalize_options(action = nil, options = {}, &amp;blk)
+      if action.is_a?(Hash)
+        options, action = action, nil
+      elsif action.is_a?(String) || action.is_a?(Symbol)
+        key = case action = action.to_s
+        when %r{^/} then :file
+        when %r{/}  then :template
+        else             :action
         end
-        
-        default_render
+        options.merge! key =&gt; action
+      elsif action
+        options.merge! :partial =&gt; action
       end
 
-      # Returns true if a render or redirect has already been performed.
-      def performed?
-        @performed_render || @performed_redirect
+      if options.key?(:action) &amp;&amp; options[:action].to_s.index(&quot;/&quot;)
+        options[:template] = options.delete(:action)
       end
 
-      def reset_variables_added_to_assigns
-        @template.instance_variable_set(&quot;@assigns_added&quot;, nil)
+      if options[:status]
+        options[:status] = interpret_status(options[:status]).to_i
       end
 
-      def request_origin
-        # this *needs* to be cached!
-        # otherwise you'd get different results if calling it more than once
-        @request_origin ||= &quot;#{request.remote_ip} at #{Time.now.to_s(:db)}&quot;
-      end
-
-      # Returns the request URI used to get to the current location
-      def complete_request_uri
-        &quot;#{request.protocol}#{request.host}#{request.request_uri}&quot;
-      end
-
-      def default_template(action_name = self.action_name)
-        self.view_paths.find_template(default_template_name(action_name), default_template_format)
-      end
-
-      def default_template_name(action_name = self.action_name)
-        if action_name
-          action_name = action_name.to_s
-          if action_name.include?('/') &amp;&amp; template_path_includes_controller?(action_name)
-            action_name = strip_out_controller(action_name)
-          end
-        end
-        &quot;#{controller_path}/#{action_name}&quot;
-      end
-
-      def strip_out_controller(path)
-        path.split('/', 2).last
-      end
+      options[:update] = blk if block_given?
+      options
+    end
 
-      def template_path_includes_controller?(path)
-        self.controller_path.split('/')[-1] == path.split('/')[0]
-      end
+    def render(action = nil, options = {}, &amp;blk)
+      options = _normalize_options(action, options, &amp;blk)
+      super(options)
+    end
 
-      def process_cleanup
-      end
-  end
+    def render_to_string(action = nil, options = {}, &amp;blk)
+      options = _normalize_options(action, options, &amp;blk)
+      super(options)
+    end
 
-  Base.class_eval do
-    [ Filters, Layout, Renderer, Redirector, Responder, Benchmarking, Rescue, Flash, MimeResponds, Helpers,
-      Cookies, Caching, Verification, Streaming, SessionManagement,
-      HttpAuthentication::Basic::ControllerMethods, HttpAuthentication::Digest::ControllerMethods, RecordIdentifier,
-      RequestForgeryProtection, Translation, FilterParameterLogging
-    ].each do |mod|
-      include mod
+    # Redirects the browser to the target specified in +options+. This parameter can take one of three forms:
+    #
+    # * &lt;tt&gt;Hash&lt;/tt&gt; - The URL will be generated by calling url_for with the +options+.
+    # * &lt;tt&gt;Record&lt;/tt&gt; - The URL will be generated by calling url_for with the +options+, which will reference a named URL for that record.
+    # * &lt;tt&gt;String&lt;/tt&gt; starting with &lt;tt&gt;protocol://&lt;/tt&gt; (like &lt;tt&gt;http://&lt;/tt&gt;) - Is passed straight through as the target for redirection.
+    # * &lt;tt&gt;String&lt;/tt&gt; not containing a protocol - The current protocol and host is prepended to the string.
+    # * &lt;tt&gt;:back&lt;/tt&gt; - Back to the page that issued the request. Useful for forms that are triggered from multiple places.
+    #   Short-hand for &lt;tt&gt;redirect_to(request.env[&quot;HTTP_REFERER&quot;])&lt;/tt&gt;
+    #
+    # Examples:
+    #   redirect_to :action =&gt; &quot;show&quot;, :id =&gt; 5
+    #   redirect_to post
+    #   redirect_to &quot;http://www.rubyonrails.org&quot;
+    #   redirect_to &quot;/images/screenshot.jpg&quot;
+    #   redirect_to articles_url
+    #   redirect_to :back
+    #
+    # The redirection happens as a &quot;302 Moved&quot; header unless otherwise specified.
+    #
+    # Examples:
+    #   redirect_to post_url(@post), :status=&gt;:found
+    #   redirect_to :action=&gt;'atom', :status=&gt;:moved_permanently
+    #   redirect_to post_url(@post), :status=&gt;301
+    #   redirect_to :action=&gt;'atom', :status=&gt;302
+    #
+    # When using &lt;tt&gt;redirect_to :back&lt;/tt&gt;, if there is no referrer,
+    # RedirectBackError will be raised. You may specify some fallback
+    # behavior for this case by rescuing RedirectBackError.
+    def redirect_to(options = {}, response_status = {}) #:doc:
+      raise ActionControllerError.new(&quot;Cannot redirect to nil!&quot;) if options.nil?
+
+      status = if options.is_a?(Hash) &amp;&amp; options.key?(:status)
+        interpret_status(options.delete(:status))
+      elsif response_status.key?(:status)
+        interpret_status(response_status[:status])
+      else
+        302
+      end
+
+      url = case options
+      # The scheme name consist of a letter followed by any combination of
+      # letters, digits, and the plus (&quot;+&quot;), period (&quot;.&quot;), or hyphen (&quot;-&quot;)
+      # characters; and is terminated by a colon (&quot;:&quot;).
+      when %r{^\w[\w\d+.-]*:.*}
+        options
+      when String
+        request.protocol + request.host_with_port + options
+      when :back
+        raise RedirectBackError unless refer = request.headers[&quot;Referer&quot;]
+        refer
+      else
+        url_for(options)
+      end
+
+      super(url, status)
     end
   end
 end</diff>
      <filename>actionpack/lib/action_controller/base/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,10 +2,7 @@ module ActionController
   module FilterParameterLogging
     extend ActiveSupport::Concern
 
-    # TODO : Remove the defined? check when new base is the main base
-    if defined?(ActionController::Http)
-      include AbstractController::Logger
-    end
+    include AbstractController::Logger
 
     included do
       include InstanceMethodsForNewBase
@@ -46,6 +43,10 @@ module ActionController
               filtered_parameters[key] = '[FILTERED]'
             elsif value.is_a?(Hash)
               filtered_parameters[key] = filter_parameters(value)
+            elsif value.is_a?(Array)
+              filtered_parameters[key] = value.collect do |item|
+                filter_parameters(item)
+              end
             elsif block_given?
               key = key.dup
               value = value.dup if value</diff>
      <filename>actionpack/lib/action_controller/base/filter_parameter_logging.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,85 +1,80 @@
+require 'active_support/core_ext/load_error'
+require 'active_support/core_ext/name_error'
 require 'active_support/dependencies'
 
-# FIXME: helper { ... } is broken on Ruby 1.9
-module ActionController #:nodoc:
-  module Helpers #:nodoc:
+module ActionController
+  # The Rails framework provides a large number of helpers for working with +assets+, +dates+, +forms+,
+  # +numbers+ and model objects, to name a few. These helpers are available to all templates
+  # by default.
+  #
+  # In addition to using the standard template helpers provided in the Rails framework, creating custom helpers to
+  # extract complicated logic or reusable functionality is strongly encouraged. By default, the controller will
+  # include a helper whose name matches that of the controller, e.g., &lt;tt&gt;MyController&lt;/tt&gt; will automatically
+  # include &lt;tt&gt;MyHelper&lt;/tt&gt;.
+  #
+  # Additional helpers can be specified using the +helper+ class method in &lt;tt&gt;ActionController::Base&lt;/tt&gt; or any
+  # controller which inherits from it.
+  #
+  # ==== Examples
+  # The +to_s+ method from the Time class can be wrapped in a helper method to display a custom message if
+  # the Time object is blank:
+  #
+  #   module FormattedTimeHelper
+  #     def format_time(time, format=:long, blank_message=&quot;&amp;nbsp;&quot;)
+  #       time.blank? ? blank_message : time.to_s(format)
+  #     end
+  #   end
+  #
+  # FormattedTimeHelper can now be included in a controller, using the +helper+ class method:
+  #
+  #   class EventsController &lt; ActionController::Base
+  #     helper FormattedTimeHelper
+  #     def index
+  #       @events = Event.find(:all)
+  #     end
+  #   end
+  #
+  # Then, in any view rendered by &lt;tt&gt;EventController&lt;/tt&gt;, the &lt;tt&gt;format_time&lt;/tt&gt; method can be called:
+  #
+  #   &lt;% @events.each do |event| -%&gt;
+  #     &lt;p&gt;
+  #       &lt;% format_time(event.time, :short, &quot;N/A&quot;) %&gt; | &lt;%= event.name %&gt;
+  #     &lt;/p&gt;
+  #   &lt;% end -%&gt;
+  #
+  # Finally, assuming we have two event instances, one which has a time and one which does not,
+  # the output might look like this:
+  #
+  #   23 Aug 11:30 | Carolina Railhawks Soccer Match
+  #   N/A | Carolina Railhaws Training Workshop
+  #
+  module Helpers
     extend ActiveSupport::Concern
 
-    included do
-      # Initialize the base module to aggregate its helpers.
-      class_inheritable_accessor :master_helper_module
-      self.master_helper_module = Module.new
+    include AbstractController::Helpers
 
+    included do
       # Set the default directory for helpers
-      class_inheritable_accessor :helpers_dir
-      self.helpers_dir = (defined?(RAILS_ROOT) ? &quot;#{RAILS_ROOT}/app/helpers&quot; : &quot;app/helpers&quot;)
-
-      class &lt;&lt; self
-        alias_method_chain :inherited, :helper
+      extlib_inheritable_accessor(:helpers_dir) do
+        defined?(RAILS_ROOT) ? &quot;#{RAILS_ROOT}/app/helpers&quot; : &quot;app/helpers&quot;
       end
     end
 
-    # The Rails framework provides a large number of helpers for working with +assets+, +dates+, +forms+, 
-    # +numbers+ and Active Record objects, to name a few. These helpers are available to all templates
-    # by default.
-    #
-    # In addition to using the standard template helpers provided in the Rails framework, creating custom helpers to
-    # extract complicated logic or reusable functionality is strongly encouraged.  By default, the controller will 
-    # include a helper whose name matches that of the controller, e.g., &lt;tt&gt;MyController&lt;/tt&gt; will automatically
-    # include &lt;tt&gt;MyHelper&lt;/tt&gt;.
-    # 
-    # Additional helpers can be specified using the +helper+ class method in &lt;tt&gt;ActionController::Base&lt;/tt&gt; or any
-    # controller which inherits from it.
-    #
-    # ==== Examples
-    # The +to_s+ method from the Time class can be wrapped in a helper method to display a custom message if 
-    # the Time object is blank:
-    #
-    #   module FormattedTimeHelper
-    #     def format_time(time, format=:long, blank_message=&quot;&amp;nbsp;&quot;)
-    #       time.blank? ? blank_message : time.to_s(format)
-    #     end
-    #   end
-    #
-    # FormattedTimeHelper can now be included in a controller, using the +helper+ class method:
-    #
-    #   class EventsController &lt; ActionController::Base
-    #     helper FormattedTimeHelper
-    #     def index
-    #       @events = Event.find(:all)
-    #     end
-    #   end
-    #
-    # Then, in any view rendered by &lt;tt&gt;EventController&lt;/tt&gt;, the &lt;tt&gt;format_time&lt;/tt&gt; method can be called:
-    #
-    #   &lt;% @events.each do |event| -%&gt;
-    #     &lt;p&gt;
-    #       &lt;% format_time(event.time, :short, &quot;N/A&quot;) %&gt; | &lt;%= event.name %&gt; 
-    #     &lt;/p&gt;
-    #   &lt;% end -%&gt;
-    #
-    # Finally, assuming we have two event instances, one which has a time and one which does not, 
-    # the output might look like this:
-    #
-    #   23 Aug 11:30 | Carolina Railhawks Soccer Match 
-    #   N/A | Carolina Railhaws Training Workshop
-    #
     module ClassMethods
-      # Makes all the (instance) methods in the helper module available to templates rendered through this controller.
-      # See ActionView::Helpers (link:classes/ActionView/Helpers.html) for more about making your own helper modules
-      # available to the templates.
-      def add_template_helper(helper_module) #:nodoc:
-        master_helper_module.module_eval { include helper_module }
+      def inherited(klass)
+        klass.class_eval { default_helper_module! unless name.blank? }
+        super
       end
 
       # The +helper+ class method can take a series of helper module names, a block, or both.
       #
-      # * &lt;tt&gt;*args&lt;/tt&gt;: One or more modules, strings or symbols, or the special symbol &lt;tt&gt;:all&lt;/tt&gt;.
-      # * &lt;tt&gt;&amp;block&lt;/tt&gt;: A block defining helper methods.
-      # 
+      # ==== Parameters
+      # *args&lt;Array[Module, Symbol, String, :all]&gt;
+      # block&lt;Block&gt;:: A block defining helper methods
+      #
       # ==== Examples
-      # When the argument is a string or symbol, the method will provide the &quot;_helper&quot; suffix, require the file 
-      # and include the module in the template class.  The second form illustrates how to include custom helpers 
+      # When the argument is a string or symbol, the method will provide the &quot;_helper&quot; suffix, require the file
+      # and include the module in the template class.  The second form illustrates how to include custom helpers
       # when working with namespaced controllers, or other cases where the file containing the helper definition is not
       # in one of Rails' standard load paths:
       #   helper :foo             # =&gt; requires 'foo_helper' and includes FooHelper
@@ -92,78 +87,23 @@ module ActionController #:nodoc:
       # &lt;tt&gt;ActionController::Base.helpers_dir&lt;/tt&gt; (defaults to &lt;tt&gt;app/helpers/**/*.rb&lt;/tt&gt; under RAILS_ROOT).
       #   helper :all
       #
-      # Additionally, the +helper+ class method can receive and evaluate a block, making the methods defined available 
+      # Additionally, the +helper+ class method can receive and evaluate a block, making the methods defined available
       # to the template.
       #   # One line
       #   helper { def hello() &quot;Hello, world!&quot; end }
       #   # Multi-line
       #   helper do
-      #     def foo(bar) 
-      #       &quot;#{bar} is the very best&quot; 
+      #     def foo(bar)
+      #       &quot;#{bar} is the very best&quot;
       #     end
       #   end
-      # 
+      #
       # Finally, all the above styles can be mixed together, and the +helper+ method can be invoked with a mix of
       # +symbols+, +strings+, +modules+ and blocks.
       #   helper(:three, BlindHelper) { def mice() 'mice' end }
       #
       def helper(*args, &amp;block)
-        args.flatten.each do |arg|
-          case arg
-            when Module
-              add_template_helper(arg)
-            when :all
-              helper(all_application_helpers)
-            when String, Symbol
-              file_name  = arg.to_s.underscore + '_helper'
-              class_name = file_name.camelize
-
-              begin
-                require_dependency(file_name)
-              rescue LoadError =&gt; load_error
-                requiree = / -- (.*?)(\.rb)?$/.match(load_error.message).to_a[1]
-                if requiree == file_name
-                  msg = &quot;Missing helper file helpers/#{file_name}.rb&quot;
-                  raise LoadError.new(msg).copy_blame!(load_error)
-                else
-                  raise
-                end
-              end
-
-              add_template_helper(class_name.constantize)
-            else
-              raise ArgumentError, &quot;helper expects String, Symbol, or Module argument (was: #{args.inspect})&quot;
-          end
-        end
-
-        # Evaluate block in template class if given.
-        master_helper_module.module_eval(&amp;block) if block_given?
-      end
-
-      # Declare a controller method as a helper. For example, the following
-      # makes the +current_user+ controller method available to the view:
-      #   class ApplicationController &lt; ActionController::Base
-      #     helper_method :current_user, :logged_in?
-      #
-      #     def current_user
-      #       @current_user ||= User.find_by_id(session[:user])
-      #     end
-      #
-      #      def logged_in?
-      #        current_user != nil
-      #      end
-      #   end
-      #
-      # In a view:
-      #  &lt;% if logged_in? -%&gt;Welcome, &lt;%= current_user.name %&gt;&lt;% end -%&gt;
-      def helper_method(*methods)
-        methods.flatten.each do |method|
-          master_helper_module.module_eval &lt;&lt;-end_eval
-            def #{method}(*args, &amp;block)                    # def current_user(*args, &amp;block)
-              controller.send(%(#{method}), *args, &amp;block)  #   controller.send(%(current_user), *args, &amp;block)
-            end                                             # end
-          end_eval
-        end
+        super(*_modules_for_helpers(args), &amp;block)
       end
 
       # Declares helper accessors for controller attributes. For example, the
@@ -171,51 +111,68 @@ module ActionController #:nodoc:
       # controller and makes them available to the view:
       #   helper_attr :name
       #   attr_accessor :name
+      #
+      # ==== Parameters
+      # *attrs&lt;Array[String, Symbol]&gt;:: Names of attributes to be converted
+      #   into helpers.
       def helper_attr(*attrs)
         attrs.flatten.each { |attr| helper_method(attr, &quot;#{attr}=&quot;) }
       end
 
       # Provides a proxy to access helpers methods from outside the view.
       def helpers
-        unless @helper_proxy
-          @helper_proxy = ActionView::Base.new
-          @helper_proxy.extend master_helper_module
-        else
-          @helper_proxy
-        end
+        @helper_proxy ||= ActionView::Base.new.extend(_helpers)
       end
 
-      private
-        def default_helper_module!
-          unless name.blank?
-            module_name = name.sub(/Controller$|$/, 'Helper')
-            module_path = module_name.split('::').map { |m| m.underscore }.join('/')
-            require_dependency module_path
-            helper module_name.constantize
+    private
+      # Returns a list of modules, normalized from the acceptable kinds of
+      # helpers with the following behavior:
+      # String or Symbol:: :FooBar or &quot;FooBar&quot; becomes &quot;foo_bar_helper&quot;,
+      #   and &quot;foo_bar_helper.rb&quot; is loaded using require_dependency.
+      # :all:: Loads all modules in the #helpers_dir
+      # Module:: No further processing
+      #
+      # After loading the appropriate files, the corresponding modules
+      # are returned.
+      #
+      # ==== Parameters
+      # args&lt;Array[String, Symbol, Module, all]&gt;:: A list of helpers
+      #
+      # ==== Returns
+      # Array[Module]:: A normalized list of modules for the list of
+      #   helpers provided.
+      def _modules_for_helpers(args)
+        args.flatten.map! do |arg|
+          case arg
+          when :all
+            _modules_for_helpers all_application_helpers
+          when String, Symbol
+            file_name = &quot;#{arg.to_s.underscore}_helper&quot;
+            require_dependency(file_name, &quot;Missing helper file helpers/%s.rb&quot;)
+            file_name.camelize.constantize
+          when Module
+            arg
+          else
+            raise ArgumentError, &quot;helper must be a String, Symbol, or Module&quot;
           end
-        rescue MissingSourceFile =&gt; e
-          raise unless e.is_missing? module_path
-        rescue NameError =&gt; e
-          raise unless e.missing_name? module_name
         end
+      end
 
-        def inherited_with_helper(child)
-          inherited_without_helper(child)
-
-          begin
-            child.master_helper_module = Module.new
-            child.master_helper_module.__send__ :include, master_helper_module
-            child.__send__ :default_helper_module!
-          rescue MissingSourceFile =&gt; e
-            raise unless e.is_missing?(&quot;helpers/#{child.controller_path}_helper&quot;)
-          end
-        end
+      def default_helper_module!
+        module_name = name.sub(/Controller$/, '')
+        module_path = module_name.underscore
+        helper module_path
+      rescue MissingSourceFile =&gt; e
+        raise e unless e.is_missing? &quot;#{module_path}_helper&quot;
+      rescue NameError =&gt; e
+        raise e unless e.missing_name? &quot;#{module_name}Helper&quot;
+      end
 
-        # Extract helper names from files in app/helpers/**/*.rb
-        def all_application_helpers
-          extract = /^#{Regexp.quote(helpers_dir)}\/?(.*)_helper.rb$/
-          Dir[&quot;#{helpers_dir}/**/*_helper.rb&quot;].map { |file| file.sub extract, '\1' }
-        end
+      # Extract helper names from files in app/helpers/**/*.rb
+      def all_application_helpers
+        extract = /^#{Regexp.quote(helpers_dir)}\/?(.*)_helper.rb$/
+        Dir[&quot;#{helpers_dir}/**/*_helper.rb&quot;].map { |file| file.sub extract, '\1' }
+      end
     end
   end
 end</diff>
      <filename>actionpack/lib/action_controller/base/helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -185,7 +185,7 @@ module ActionController
         request.env['REDIRECT_X_HTTP_AUTHORIZATION']
       end
 
-      # Raises error unless the request credentials response value matches the expected value.
+      # Returns false unless the request credentials response value matches the expected value.
       # First try the password as a ha1 digest password. If this fails, then try it as a plain
       # text password.
       def validate_digest_response(request, realm, &amp;password_procedure)
@@ -194,6 +194,8 @@ module ActionController
 
         if valid_nonce &amp;&amp; realm == credentials[:realm] &amp;&amp; opaque == credentials[:opaque]
           password = password_procedure.call(credentials[:username])
+          return false unless password
+
           method = request.env['rack.methodoverride.original_method'] || request.env['REQUEST_METHOD']
 
          [true, false].any? do |password_is_ha1|</diff>
      <filename>actionpack/lib/action_controller/base/http_authentication.rb</filename>
    </modified>
    <modified>
      <diff>@@ -120,12 +120,9 @@ module ActionController #:nodoc:
 
         @responses[mime_type] ||= Proc.new do
           # TODO: Remove this when new base is merged in
-          if defined?(Http)
-            @controller.formats = [mime_type.to_sym]
-          end
-
+          @controller.formats = [mime_type.to_sym]
+          @controller.content_type = mime_type
           @controller.template.formats = [mime_type.to_sym]
-          @response.content_type = mime_type.to_s
 
           block_given? ? block.call : @controller.send(:render, :action =&gt; @controller.action_name)
         end</diff>
      <filename>actionpack/lib/action_controller/base/mime_responds.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,20 +6,16 @@ module ActionController #:nodoc:
     extend ActiveSupport::Concern
 
     # TODO : Remove the defined? check when new base is the main base
-    if defined?(ActionController::Http)
-      include AbstractController::Helpers, Session
-    end
+    include AbstractController::Helpers, Session
 
     included do
-      if defined?(ActionController::Http)
-        # Sets the token parameter name for RequestForgery. Calling +protect_from_forgery+
-        # sets it to &lt;tt&gt;:authenticity_token&lt;/tt&gt; by default.
-        cattr_accessor :request_forgery_protection_token
+      # Sets the token parameter name for RequestForgery. Calling +protect_from_forgery+
+      # sets it to &lt;tt&gt;:authenticity_token&lt;/tt&gt; by default.
+      cattr_accessor :request_forgery_protection_token
 
-        # Controls whether request forgergy protection is turned on or not. Turned off by default only in test mode.
-        class_inheritable_accessor :allow_forgery_protection
-        self.allow_forgery_protection = true
-      end
+      # Controls whether request forgergy protection is turned on or not. Turned off by default only in test mode.
+      class_inheritable_accessor :allow_forgery_protection
+      self.allow_forgery_protection = true
 
       helper_method :form_authenticity_token
       helper_method :protect_against_forgery?</diff>
      <filename>actionpack/lib/action_controller/base/request_forgery_protection.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,10 +4,7 @@ module ActionController #:nodoc:
   module Streaming
     extend ActiveSupport::Concern
 
-    # TODO : Remove the defined? check when new base is the main base
-    if defined?(ActionController::Http)
-      include ActionController::Renderer
-    end
+    include ActionController::Renderer
 
     DEFAULT_SEND_FILE_OPTIONS = {
       :type         =&gt; 'application/octet-stream'.freeze,
@@ -162,15 +159,16 @@ module ActionController #:nodoc:
         disposition &lt;&lt;= %(; filename=&quot;#{options[:filename]}&quot;) if options[:filename]
 
         content_type = options[:type]
+
         if content_type.is_a?(Symbol)
-          raise ArgumentError, &quot;Unknown MIME type #{options[:type]}&quot; unless Mime::EXTENSION_LOOKUP.has_key?(content_type.to_s)
-          content_type = Mime::Type.lookup_by_extension(content_type.to_s)
+          raise ArgumentError, &quot;Unknown MIME type #{options[:type]}&quot; unless Mime::EXTENSION_LOOKUP.key?(content_type.to_s)
+          self.content_type = Mime::Type.lookup_by_extension(content_type.to_s)
+        else
+          self.content_type = content_type
         end
-        content_type = content_type.to_s.strip # fixes a problem with extra '\r' with some browsers
 
         headers.merge!(
-          'Content-Length'            =&gt; options[:length],
-          'Content-Type'              =&gt; content_type,
+          'Content-Length'            =&gt; options[:length].to_s,
           'Content-Disposition'       =&gt; disposition,
           'Content-Transfer-Encoding' =&gt; 'binary'
         )</diff>
      <filename>actionpack/lib/action_controller/base/streaming.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,10 +2,7 @@ module ActionController #:nodoc:
   module Verification #:nodoc:
     extend ActiveSupport::Concern
 
-    # TODO : Remove the defined? check when new base is the main base
-    if defined?(ActionController::Http)
-      include AbstractController::Callbacks, Session, Flash, Renderer
-    end
+    include AbstractController::Callbacks, Session, Flash, Renderer
 
     # This module provides a class-level method for specifying that certain
     # actions are guarded against being called without certain prerequisites</diff>
      <filename>actionpack/lib/action_controller/base/verification.rb</filename>
    </modified>
    <modified>
      <diff>@@ -62,14 +62,7 @@ module ActionController #:nodoc:
 
           cache_filter = ActionCacheFilter.new(:layout =&gt; options.delete(:layout), :cache_path =&gt; options.delete(:cache_path), :store_options =&gt; options)
 
-          # TODO: Remove this once new base is swapped in.
-          if defined?(ActionController::Http)
-            around_filter cache_filter, filter_options
-          else
-            around_filter(filter_options) do |controller, action|
-              cache_filter.filter(controller, action)
-            end
-          end
+          around_filter cache_filter, filter_options
         end
       end
 
@@ -91,19 +84,10 @@ module ActionController #:nodoc:
           @options = options
         end
 
-        # TODO: Remove once New Base is merged
-        if defined?(ActionController::Http)
-          def filter(controller)
-            should_continue = before(controller)
-            yield if should_continue
-            after(controller)
-          end
-        else
-          def filter(controller, action)
-            should_continue = before(controller)
-            action.call if should_continue
-            after(controller)
-          end
+        def filter(controller)
+          should_continue = before(controller)
+          yield if should_continue
+          after(controller)
         end
 
         def before(controller)</diff>
      <filename>actionpack/lib/action_controller/caching/actions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -112,8 +112,7 @@ module ActionController
     # Returns the path component of a URL for the given record. It uses
     # &lt;tt&gt;polymorphic_url&lt;/tt&gt; with &lt;tt&gt;:routing_type =&gt; :path&lt;/tt&gt;.
     def polymorphic_path(record_or_hash_or_array, options = {})
-      options[:routing_type] = :path
-      polymorphic_url(record_or_hash_or_array, options)
+      polymorphic_url(record_or_hash_or_array, options.merge(:routing_type =&gt; :path))
     end
 
     %w(edit new).each do |action|</diff>
      <filename>actionpack/lib/action_controller/routing/generation/polymorphic_routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -150,9 +150,9 @@ module ActionController
           end
 
           if only
-            @allowed_actions[:only] = Array(only).map(&amp;:to_sym)
+            @allowed_actions[:only] = Array(only).map {|a| a.to_sym }
           elsif except
-            @allowed_actions[:except] = Array(except).map(&amp;:to_sym)
+            @allowed_actions[:except] = Array(except).map {|a| a.to_sym }
           end
         end
 </diff>
      <filename>actionpack/lib/action_controller/routing/resources.rb</filename>
    </modified>
    <modified>
      <diff>@@ -305,6 +305,7 @@ module ActionController
       end
 
       def add_route(path, options = {})
+        options.each { |k, v| options[k] = v.to_s if [:controller, :action].include?(k) &amp;&amp; v.is_a?(Symbol) }
         route = builder.build(path, options)
         routes &lt;&lt; route
         route
@@ -436,7 +437,7 @@ module ActionController
       def recognize(request)
         params = recognize_path(request.path, extract_request_environment(request))
         request.path_parameters = params.with_indifferent_access
-        &quot;#{params[:controller].camelize}Controller&quot;.constantize
+        &quot;#{params[:controller].to_s.camelize}Controller&quot;.constantize
       end
 
       def recognize_path(path, environment={})</diff>
      <filename>actionpack/lib/action_controller/routing/route_set.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,49 +1,4 @@
-class Object
-  def to_param
-    to_s
-  end
-end
-
-class TrueClass
-  def to_param
-    self
-  end
-end
-
-class FalseClass
-  def to_param
-    self
-  end
-end
-
-class NilClass
-  def to_param
-    self
-  end
-end
-
-class Regexp #:nodoc:
-  def number_of_captures
-    Regexp.new(&quot;|#{source}&quot;).match('').captures.length
-  end
-
-  def multiline?
-    options &amp; MULTILINE == MULTILINE
-  end
-
-  class &lt;&lt; self
-    def optionalize(pattern)
-      case unoptionalize(pattern)
-        when /\A(.|\(.*\))\Z/ then &quot;#{pattern}?&quot;
-        else &quot;(?:#{pattern})?&quot;
-      end
-    end
-
-    def unoptionalize(pattern)
-      [/\A\(\?:(.*)\)\?\Z/, /\A(.|\(.*\))\?\Z/].each do |regexp|
-        return $1 if regexp =~ pattern
-      end
-      return pattern
-    end
-  end
-end
+require 'active_support/core_ext/object/conversions'
+require 'active_support/core_ext/boolean/conversions'
+require 'active_support/core_ext/nil/conversions'
+require 'active_support/core_ext/regexp'</diff>
      <filename>actionpack/lib/action_controller/routing/routing_ext.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,7 @@
 require 'stringio'
 require 'uri'
 require 'active_support/test_case'
+require 'active_support/core_ext/object/metaclass'
 
 require 'rack/mock_session'
 require 'rack/test/cookie_jar'
@@ -191,7 +192,7 @@ module ActionController
 
         unless defined? @named_routes_configured
           # install the named routes in this session instance.
-          klass = class &lt;&lt; self; self; end
+          klass = metaclass
           Routing::Routes.install_helpers(klass)
 
           # the helpers are made protected by default--we make them public for
@@ -244,7 +245,7 @@ module ActionController
             path = location.query ? &quot;#{location.path}?#{location.query}&quot; : location.path
           end
 
-          [ControllerCapture, ActionController::ProcessWithTest].each do |mod|
+          [ControllerCapture, ActionController::Testing].each do |mod|
             unless ActionController::Base &lt; mod
               ActionController::Base.class_eval { include mod }
             end</diff>
      <filename>actionpack/lib/action_controller/testing/integration.rb</filename>
    </modified>
    <modified>
      <diff>@@ -56,6 +56,8 @@ module ActionController #:nodoc:
       @block = nil
       @length = 0
       @body = []
+      @charset = nil
+      @content_type = nil
 
       @request = @template = nil
     end
@@ -122,30 +124,24 @@ module ActionController #:nodoc:
 
       @request.recycle!
       @response.recycle!
+      @controller.response_body = nil
+      @controller.formats = nil
+      @controller.params = nil
 
       @html_document = nil
-      @request.request_method = http_method
+      @request.env['REQUEST_METHOD'] = http_method
 
       parameters ||= {}
       @request.assign_parameters(@controller.class.controller_path, action.to_s, parameters)
 
       @request.session = ActionController::TestSession.new(session) unless session.nil?
       @request.session[&quot;flash&quot;] = ActionController::Flash::FlashHash.new.update(flash) if flash
-      build_request_uri(action, parameters)
-
-      Base.class_eval { include ProcessWithTest } unless Base &lt; ProcessWithTest
-
-      env = @request.env
-      app = @controller
-
-      # TODO: Enable Lint
-      # app = Rack::Lint.new(app)
 
-      status, headers, body = app.action(action, env)
-      response = Rack::MockResponse.new(status, headers, body)
-
-      @response.request, @response.template = @request, @controller.template
-      @response.status, @response.headers, @response.body = response.status, response.headers, response.body
+      @controller.request = @request
+      @controller.params.merge!(parameters)
+      build_request_uri(action, parameters)
+      Base.class_eval { include Testing }
+      @controller.process_with_new_base_test(@request, @response)
       @response
     end
 
@@ -165,7 +161,7 @@ module ActionController #:nodoc:
         next if ActionController::Base.protected_instance_variables.include?(ivar)
         assigns[ivar[1..-1]] = @controller.instance_variable_get(ivar)
       end
-      
+
       key.nil? ? assigns : assigns[key.to_s]
     end
 
@@ -261,27 +257,4 @@ module ActionController #:nodoc:
       ActionController::Routing.const_set(:Routes, real_routes) if real_routes
     end
   end
-
-  module ProcessWithTest #:nodoc:
-    def self.included(base)
-      base.class_eval {
-        attr_reader :assigns
-        alias_method_chain :process, :test
-      }
-    end
-
-    def process_with_test(*args)
-      process_without_test(*args).tap { set_test_assigns }
-    end
-
-    private
-      def set_test_assigns
-        @assigns = {}
-        (instance_variable_names - self.class.protected_instance_variables).each do |var|
-          name, value = var[1..-1], instance_variable_get(var)
-          @assigns[name] = value
-          @template.assigns[name] = value if response
-        end
-      end
-  end
-end
+end
\ No newline at end of file</diff>
      <filename>actionpack/lib/action_controller/testing/process.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,19 @@ require 'set'
 require 'active_support/core_ext/class/attribute_accessors'
 
 module Mime
-  SET              = []
+  class Mimes &lt; Array
+    def symbols
+      @symbols ||= map {|m| m.to_sym }
+    end
+
+    %w(&lt;&lt; concat shift unshift push pop []= clear compact! collect!
+    delete delete_at delete_if flatten! map! insert reject! reverse!
+    replace slice! sort! uniq!).each do |method|
+      define_method(method) {|*args| @symbols = nil; super(*args) }
+    end
+  end
+
+  SET              = Mimes.new
   EXTENSION_LOOKUP = {}
   LOOKUP           = Hash.new { |h, k| h[k] = Type.new(k) unless k.blank? }
 </diff>
      <filename>actionpack/lib/action_dispatch/http/mime_type.rb</filename>
    </modified>
    <modified>
      <diff>@@ -180,12 +180,10 @@ module ActionDispatch
         else
           accepts.dup
         end.tap do |ret|
-          if defined?(ActionController::Http)
-            if ret == ONLY_ALL
-              ret.replace Mime::SET
-            elsif all = ret.index(Mime::ALL)
-              ret.delete_at(all) &amp;&amp; ret.insert(all, *Mime::SET)
-            end
+          if ret == ONLY_ALL
+            ret.replace Mime::SET
+          elsif all = ret.index(Mime::ALL)
+            ret.delete_at(all) &amp;&amp; ret.insert(all, *Mime::SET)
           end
         end
       else</diff>
      <filename>actionpack/lib/action_dispatch/http/request.rb</filename>
    </modified>
    <modified>
      <diff>@@ -67,12 +67,7 @@ module ActionDispatch # :nodoc:
     end
 
     def body=(body)
-      @body =
-        if body.respond_to?(:to_str)
-          [body]
-        else
-          body
-        end
+      @body = body.respond_to?(:to_str) ? [body] : body
     end
 
     def body_parts
@@ -96,36 +91,7 @@ module ActionDispatch # :nodoc:
     # If a character set has been defined for this response (see charset=) then
     # the character set information will also be included in the content type
     # information.
-    def content_type=(mime_type)
-      self.headers[&quot;Content-Type&quot;] =
-        if mime_type =~ /charset/ || (c = charset).nil?
-          mime_type.to_s
-        else
-          &quot;#{mime_type}; charset=#{c}&quot;
-        end
-    end
-
-    # Returns the response's content MIME type, or nil if content type has been set.
-    def content_type
-      content_type = String(headers[&quot;Content-Type&quot;] || headers[&quot;type&quot;]).split(&quot;;&quot;)[0]
-      content_type.blank? ? nil : content_type
-    end
-
-    # Set the charset of the Content-Type header. Set to nil to remove it.
-    # If no content type is set, it defaults to HTML.
-    def charset=(charset)
-      headers[&quot;Content-Type&quot;] =
-        if charset
-          &quot;#{content_type || Mime::HTML}; charset=#{charset}&quot;
-        else
-          content_type || Mime::HTML.to_s
-        end
-    end
-
-    def charset
-      charset = String(headers[&quot;Content-Type&quot;] || headers[&quot;type&quot;]).split(&quot;;&quot;)[1]
-      charset.blank? ? nil : charset.strip.split(&quot;=&quot;)[1]
-    end
+    attr_accessor :charset, :content_type
 
     def last_modified
       if last = headers['Last-Modified']
@@ -162,15 +128,15 @@ module ActionDispatch # :nodoc:
     end
 
     def assign_default_content_type_and_charset!
-      if type = headers['Content-Type'] || headers['type']
-        unless type =~ /charset=/ || sending_file?
-          headers['Content-Type'] = &quot;#{type}; charset=#{default_charset}&quot;
-        end
-      else
-        type = Mime::HTML.to_s
-        type += &quot;; charset=#{default_charset}&quot; unless sending_file?
-        headers['Content-Type'] = type
-      end
+      return if !headers[&quot;Content-Type&quot;].blank?
+
+      @content_type ||= Mime::HTML
+      @charset      ||= default_charset
+
+      type = @content_type.to_s.dup
+      type &lt;&lt; &quot;; charset=#{@charset}&quot; unless sending_file?
+
+      headers[&quot;Content-Type&quot;] = type
     end
 
     def prepare!</diff>
      <filename>actionpack/lib/action_dispatch/http/response.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,4 @@
+require &quot;active_support/core_ext/kernel/requires&quot;
 begin
   require_library_or_gem 'memcache'
 </diff>
      <filename>actionpack/lib/action_dispatch/middleware/session/mem_cache_store.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,5 @@
+require &quot;active_support/core_ext/exception&quot;
+
 module ActionDispatch
   class ShowExceptions
     include StatusCodes</diff>
      <filename>actionpack/lib/action_dispatch/middleware/show_exceptions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 module ActionPack #:nodoc:
   module VERSION #:nodoc:
-    MAJOR = 2
-    MINOR = 3
-    TINY  = 2
+    MAJOR = 3
+    MINOR = 0
+    TINY  = &quot;pre&quot;
 
     STRING = [MAJOR, MINOR, TINY].join('.')
   end</diff>
      <filename>actionpack/lib/action_pack/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -33,21 +33,22 @@ module ActionView
     [Base, InlineTemplate, TemplateError]
   end
 
-  autoload :Base, 'action_view/base'
-  autoload :Helpers, 'action_view/helpers'
-  autoload :InlineTemplate, 'action_view/template/inline'
-  autoload :Partials, 'action_view/render/partials'
-  autoload :Path, 'action_view/template/path'
-  autoload :PathSet, 'action_view/paths'
-  autoload :Rendering, 'action_view/render/rendering'
-  autoload :Renderable, 'action_view/template/renderable'
+  autoload :Base,              'action_view/base'
+  autoload :Helpers,           'action_view/helpers'
+  autoload :InlineTemplate,    'action_view/template/inline'
+  autoload :Partials,          'action_view/render/partials'
+  autoload :Resolver,          'action_view/template/resolver'
+  autoload :PathSet,           'action_view/paths'
+  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'
+  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'
+  autoload :FileSystemResolverWithFallback, 'action_view/template/resolver'
 end
 
 class ERB</diff>
      <filename>actionpack/lib/action_view.rb</filename>
    </modified>
    <modified>
      <diff>@@ -170,12 +170,13 @@ module ActionView #:nodoc:
 
     attr_accessor :base_path, :assigns, :template_extension, :formats
     attr_accessor :controller
+    attr_internal :captures
 
     attr_accessor :output_buffer
 
     class &lt;&lt; self
       delegate :erb_trim_mode=, :to =&gt; 'ActionView::TemplateHandlers::ERB'
-      delegate :logger, :to =&gt; 'ActionController::Base'
+      delegate :logger, :to =&gt; 'ActionController::Base', :allow_nil =&gt; true
     end
 
     @@debug_rjs = false
@@ -229,38 +230,27 @@ module ActionView #: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
+      @assigns = assigns_for_first_render.each { |key, value| instance_variable_set(&quot;@#{key}&quot;, value) }
       @controller = controller
       @helpers = ProxyModule.new(self)
+      @_content_for = Hash.new {|h,k| h[k] = &quot;&quot; }
       self.view_paths = view_paths
-
-      @_first_render = nil
-      @_current_render = nil
     end
 
+    attr_internal :template
     attr_reader :view_paths
 
     def view_paths=(paths)
       @view_paths = self.class.process_view_paths(paths)
     end
 
-    # Access the current template being rendered.
-    # Returns a ActionView::Template object.
-    def template
-      @_current_render
-    end
-
-    def template=(template) #:nodoc:
-      @_first_render ||= template
-      @_current_render = template
-    end
-
     def with_template(current_template)
+      _evaluate_assigns_and_ivars
       last_template, self.template = template, current_template
+      last_formats, self.formats = formats, [current_template.mime_type.to_sym] + Mime::SET.symbols
       yield
     ensure
-      self.template = last_template
+      self.template, self.formats = last_template, last_formats
     end
 
     def punctuate_body!(part)
@@ -271,30 +261,19 @@ module ActionView #:nodoc:
 
     # Evaluates the local assigns and controller ivars, pushes them to the view.
     def _evaluate_assigns_and_ivars #:nodoc:
-      unless @assigns_added
-        @assigns.each { |key, value| instance_variable_set(&quot;@#{key}&quot;, value) }
-        _copy_ivars_from_controller
-        @assigns_added = true
-      end
+      @assigns_added ||= _copy_ivars_from_controller
     end
 
-    private
+  private
 
-      def _copy_ivars_from_controller #:nodoc:
-        if @controller
-          variables = @controller.instance_variable_names
-          variables -= @controller.protected_instance_variables if @controller.respond_to?(:protected_instance_variables)
-          variables.each { |name| instance_variable_set(name, @controller.instance_variable_get(name)) }
-        end
+    def _copy_ivars_from_controller #:nodoc:
+      if @controller
+        variables = @controller.instance_variable_names
+        variables -= @controller.protected_instance_variables if @controller.respond_to?(:protected_instance_variables)
+        variables.each { |name| instance_variable_set(name, @controller.instance_variable_get(name)) }
       end
+      true
+    end
 
-      def _set_controller_content_type(content_type) #:nodoc:
-        # TODO: Remove this method when new base is switched
-        unless defined?(ActionController::Http)
-          if controller.respond_to?(:response)
-            controller.response.content_type ||= content_type
-          end
-        end
-      end
   end
 end</diff>
      <filename>actionpack/lib/action_view/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,7 +11,7 @@ module ActionView #:nodoc:
     autoload :FormHelper, 'action_view/helpers/form_helper'
     autoload :FormOptionsHelper, 'action_view/helpers/form_options_helper'
     autoload :FormTagHelper, 'action_view/helpers/form_tag_helper'
-    autoload :JavascriptHelper, 'action_view/helpers/javascript_helper'
+    autoload :JavaScriptHelper, 'action_view/helpers/javascript_helper'
     autoload :NumberHelper, 'action_view/helpers/number_helper'
     autoload :PrototypeHelper, 'action_view/helpers/prototype_helper'
     autoload :RecordIdentificationHelper, 'action_view/helpers/record_identification_helper'</diff>
      <filename>actionpack/lib/action_view/helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,8 @@
 require 'cgi'
 require 'action_view/helpers/form_helper'
 require 'active_support/core_ext/class/attribute_accessors'
+require 'active_support/core_ext/enumerable'
+require 'active_support/core_ext/kernel/reporting'
 
 module ActionView
   class Base
@@ -120,9 +122,9 @@ module ActionView
         options.reverse_merge!(:prepend_text =&gt; '', :append_text =&gt; '', :css_class =&gt; 'formError')
 
         if (obj = (object.respond_to?(:errors) ? object : instance_variable_get(&quot;@#{object}&quot;))) &amp;&amp;
-          (errors = obj.errors.on(method))
+          (errors = obj.errors[method])
           content_tag(&quot;div&quot;,
-            &quot;#{options[:prepend_text]}#{ERB::Util.html_escape(errors.is_a?(Array) ? errors.first : errors)}#{options[:append_text]}&quot;,
+            &quot;#{options[:prepend_text]}#{ERB::Util.html_escape(errors.first)}#{options[:append_text]}&quot;,
             :class =&gt; options[:css_class]
           )
         else
@@ -245,59 +247,22 @@ module ActionView
         end
       end
 
-      alias_method :tag_without_error_wrapping, :tag
-      def tag(name, options)
-        if object.respond_to?(:errors) &amp;&amp; object.errors.respond_to?(:on)
-          error_wrapping(tag_without_error_wrapping(name, options), object.errors.on(@method_name))
-        else
-          tag_without_error_wrapping(name, options)
-        end
-      end
-
-      alias_method :content_tag_without_error_wrapping, :content_tag
-      def content_tag(name, value, options)
-        if object.respond_to?(:errors) &amp;&amp; object.errors.respond_to?(:on)
-          error_wrapping(content_tag_without_error_wrapping(name, value, options), object.errors.on(@method_name))
-        else
-          content_tag_without_error_wrapping(name, value, options)
-        end
-      end
-
-      alias_method :to_date_select_tag_without_error_wrapping, :to_date_select_tag
-      def to_date_select_tag(options = {}, html_options = {})
-        if object.respond_to?(:errors) &amp;&amp; object.errors.respond_to?(:on)
-          error_wrapping(to_date_select_tag_without_error_wrapping(options, html_options), object.errors.on(@method_name))
-        else
-          to_date_select_tag_without_error_wrapping(options, html_options)
-        end
-      end
-
-      alias_method :to_datetime_select_tag_without_error_wrapping, :to_datetime_select_tag
-      def to_datetime_select_tag(options = {}, html_options = {})
-        if object.respond_to?(:errors) &amp;&amp; object.errors.respond_to?(:on)
-            error_wrapping(to_datetime_select_tag_without_error_wrapping(options, html_options), object.errors.on(@method_name))
-          else
-            to_datetime_select_tag_without_error_wrapping(options, html_options)
+      %w(tag content_tag to_date_select_tag to_datetime_select_tag to_time_select_tag).each do |meth|
+        without = &quot;#{meth}_without_error_wrapping&quot;
+        define_method &quot;#{meth}_with_error_wrapping&quot; do |*args|
+          error_wrapping(send(without, *args))
         end
+        alias_method_chain meth, :error_wrapping
       end
 
-      alias_method :to_time_select_tag_without_error_wrapping, :to_time_select_tag
-      def to_time_select_tag(options = {}, html_options = {})
-        if object.respond_to?(:errors) &amp;&amp; object.errors.respond_to?(:on)
-          error_wrapping(to_time_select_tag_without_error_wrapping(options, html_options), object.errors.on(@method_name))
+      def error_wrapping(html_tag)
+        if object.respond_to?(:errors) &amp;&amp; object.errors.respond_to?(:full_messages) &amp;&amp; object.errors[@method_name].any?
+          Base.field_error_proc.call(html_tag, self)
         else
-          to_time_select_tag_without_error_wrapping(options, html_options)
+          html_tag
         end
       end
 
-      def error_wrapping(html_tag, has_error)
-        has_error ? Base.field_error_proc.call(html_tag, self) : html_tag
-      end
-
-      def error_message
-        object.errors.on(@method_name)
-      end
-
       def column_type
         object.send(:column_for_attribute, @method_name).type
       end</diff>
      <filename>actionpack/lib/action_view/helpers/active_record_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,7 @@
 require 'cgi'
 require 'action_view/helpers/url_helper'
 require 'action_view/helpers/tag_helper'
+require 'active_support/core_ext/file'
 
 module ActionView
   module Helpers #:nodoc:
@@ -272,17 +273,20 @@ module ActionView
       #   javascript_include_tag :all, :cache =&gt; true, :recursive =&gt; true
       def javascript_include_tag(*sources)
         options = sources.extract_options!.stringify_keys
-        cache   = options.delete(&quot;cache&quot;)
+        concat  = options.delete(&quot;concat&quot;)
+        cache   = concat || options.delete(&quot;cache&quot;)
         recursive = options.delete(&quot;recursive&quot;)
 
-        if ActionController::Base.perform_caching &amp;&amp; cache
+        if concat || (ActionController::Base.perform_caching &amp;&amp; cache)
           joined_javascript_name = (cache == true ? &quot;all&quot; : cache) + &quot;.js&quot;
-          joined_javascript_path = File.join(JAVASCRIPTS_DIR, joined_javascript_name)
+          joined_javascript_path = File.join(joined_javascript_name[/^#{File::SEPARATOR}/] ? ASSETS_DIR : JAVASCRIPTS_DIR, joined_javascript_name)
 
-          write_asset_file_contents(joined_javascript_path, compute_javascript_paths(sources, recursive)) unless File.exists?(joined_javascript_path)
+          unless ActionController::Base.perform_caching &amp;&amp; File.exists?(joined_javascript_path)
+            write_asset_file_contents(joined_javascript_path, compute_javascript_paths(sources, recursive))
+          end
           javascript_src_tag(joined_javascript_name, options)
         else
-          expand_javascript_sources(sources, recursive).collect { |source| javascript_src_tag(source, options) }.join(&quot;\n&quot;)
+          ensure_javascript_sources!(expand_javascript_sources(sources, recursive)).collect { |source| javascript_src_tag(source, options) }.join(&quot;\n&quot;)
         end
       end
 
@@ -410,19 +414,28 @@ module ActionView
       # The &lt;tt&gt;:recursive&lt;/tt&gt; option is also available for caching:
       #
       #   stylesheet_link_tag :all, :cache =&gt; true, :recursive =&gt; true
+      #
+      # To force concatenation (even in development mode) set &lt;tt&gt;:concat&lt;/tt&gt; to true. This is useful if
+      # you have too many stylesheets for IE to load.
+      #
+      #   stylesheet_link_tag :all, :concat =&gt; true
+      #
       def stylesheet_link_tag(*sources)
         options = sources.extract_options!.stringify_keys
-        cache   = options.delete(&quot;cache&quot;)
+        concat  = options.delete(&quot;concat&quot;)
+        cache   = concat || options.delete(&quot;cache&quot;)
         recursive = options.delete(&quot;recursive&quot;)
 
-        if ActionController::Base.perform_caching &amp;&amp; cache
+        if concat || (ActionController::Base.perform_caching &amp;&amp; cache)
           joined_stylesheet_name = (cache == true ? &quot;all&quot; : cache) + &quot;.css&quot;
-          joined_stylesheet_path = File.join(STYLESHEETS_DIR, joined_stylesheet_name)
+          joined_stylesheet_path = File.join(joined_stylesheet_name[/^#{File::SEPARATOR}/] ? ASSETS_DIR : STYLESHEETS_DIR, joined_stylesheet_name)
 
-          write_asset_file_contents(joined_stylesheet_path, compute_stylesheet_paths(sources, recursive)) unless File.exists?(joined_stylesheet_path)
+          unless ActionController::Base.perform_caching &amp;&amp; File.exists?(joined_stylesheet_path)
+            write_asset_file_contents(joined_stylesheet_path, compute_stylesheet_paths(sources, recursive))
+          end
           stylesheet_tag(joined_stylesheet_name, options)
         else
-          expand_stylesheet_sources(sources, recursive).collect { |source| stylesheet_tag(source, options) }.join(&quot;\n&quot;)
+          ensure_stylesheet_sources!(expand_stylesheet_sources(sources, recursive)).collect { |source| stylesheet_tag(source, options) }.join(&quot;\n&quot;)
         end
       end
 
@@ -441,6 +454,21 @@ module ActionView
       end
       alias_method :path_to_image, :image_path # aliased to avoid conflicts with an image_path named route
 
+      # Computes the path to a video asset in the public videos directory.
+      # Full paths from the document root will be passed through.
+      # Used internally by +video_tag+ to build the video path.
+      #
+      # ==== Examples
+      #   video_path(&quot;hd&quot;)                                            # =&gt; /videos/hd
+      #   video_path(&quot;hd.avi&quot;)                                        # =&gt; /videos/hd.avi
+      #   video_path(&quot;trailers/hd.avi&quot;)                               # =&gt; /videos/trailers/hd.avi
+      #   video_path(&quot;/trailers/hd.avi&quot;)                              # =&gt; /videos/hd.avi
+      #   video_path(&quot;http://www.railsapplication.com/vid/hd.avi&quot;) # =&gt; http://www.railsapplication.com/vid/hd.avi
+      def video_path(source)
+        compute_public_path(source, 'videos')
+      end
+      alias_method :path_to_video, :video_path # aliased to avoid conflicts with an video_path named route
+
       # Returns an html image tag for the +source+. The +source+ can be a full
       # path or a file that exists in your public images directory.
       #
@@ -477,8 +505,8 @@ module ActionView
       def image_tag(source, options = {})
         options.symbolize_keys!
 
-        options[:src] = path_to_image(source)
-        options[:alt] ||= File.basename(options[:src], '.*').split('.').first.to_s.capitalize
+        src = options[:src] = path_to_image(source)
+        options[:alt]     ||= File.basename(src, '.*').split('.').first.to_s.capitalize
 
         if size = options.delete(:size)
           options[:width], options[:height] = size.split(&quot;x&quot;) if size =~ %r{^\d+x\d+$}
@@ -486,12 +514,64 @@ module ActionView
 
         if mouseover = options.delete(:mouseover)
           options[:onmouseover] = &quot;this.src='#{image_path(mouseover)}'&quot;
-          options[:onmouseout]  = &quot;this.src='#{image_path(options[:src])}'&quot;
+          options[:onmouseout]  = &quot;this.src='#{src}'&quot;
         end
 
         tag(&quot;img&quot;, options)
       end
 
+      # Returns an html video tag for the +sources+. If +sources+ is a string,
+      # a single video tag will be returned. If +sources+ is an array, a video
+      # tag with nested source tags for each source will be returned. The
+      # +sources+ can be full paths or files that exists in your public videos
+      # directory.
+      #
+      # ==== Options
+      # You can add HTML attributes using the +options+. The +options+ supports
+      # two additional keys for convenience and conformance:
+      #
+      # * &lt;tt&gt;:poster&lt;/tt&gt; - Set an image (like a screenshot) to be shown
+      #   before the video loads. The path is calculated like the +src+ of +image_tag+.
+      # * &lt;tt&gt;:size&lt;/tt&gt; - Supplied as &quot;{Width}x{Height}&quot;, so &quot;30x45&quot; becomes
+      #   width=&quot;30&quot; and height=&quot;45&quot;. &lt;tt&gt;:size&lt;/tt&gt; will be ignored if the
+      #   value is not in the correct format.
+      #
+      # ==== Examples
+      #  video_tag(&quot;trailer&quot;)  # =&gt;
+      #    &lt;video src=&quot;/videos/trailer&quot; /&gt;
+      #  video_tag(&quot;trailer.ogg&quot;)  # =&gt;
+      #    &lt;video src=&quot;/videos/trailer.ogg&quot; /&gt;
+      #  video_tag(&quot;trailer.ogg&quot;, :controls =&gt; true, :autobuffer =&gt; true)  # =&gt;
+      #    &lt;video autobuffer=&quot;autobuffer&quot; controls=&quot;controls&quot; src=&quot;/videos/trailer.ogg&quot; /&gt;
+      #  video_tag(&quot;trailer.m4v&quot;, :size =&gt; &quot;16x10&quot;, :poster =&gt; &quot;screenshot.png&quot;)  # =&gt;
+      #    &lt;video src=&quot;/videos/trailer.m4v&quot; width=&quot;16&quot; height=&quot;10&quot; poster=&quot;/images/screenshot.png&quot; /&gt;
+      #  video_tag(&quot;/trailers/hd.avi&quot;, :size =&gt; &quot;16x16&quot;)  # =&gt;
+      #    &lt;video src=&quot;/trailers/hd.avi&quot; width=&quot;16&quot; height=&quot;16&quot; /&gt;
+      #  video_tag(&quot;/trailers/hd.avi&quot;, :height =&gt; '32', :width =&gt; '32') # =&gt;
+      #    &lt;video height=&quot;32&quot; src=&quot;/trailers/hd.avi&quot; width=&quot;32&quot; /&gt;
+      #  video_tag([&quot;trailer.ogg&quot;, &quot;trailer.flv&quot;]) # =&gt;
+      #    &lt;video&gt;&lt;source src=&quot;trailer.ogg&quot; /&gt;&lt;source src=&quot;trailer.ogg&quot; /&gt;&lt;source src=&quot;trailer.flv&quot; /&gt;&lt;/video&gt;
+      #  video_tag([&quot;trailer.ogg&quot;, &quot;trailer.flv&quot;] :size =&gt; &quot;160x120&quot;) # =&gt;
+      #    &lt;video height=&quot;120&quot; width=&quot;160&quot;&gt;&lt;source src=&quot;trailer.ogg&quot; /&gt;&lt;source src=&quot;trailer.flv&quot; /&gt;&lt;/video&gt;
+      def video_tag(sources, options = {})
+        options.symbolize_keys!
+
+        options[:poster] = path_to_image(options[:poster]) if options[:poster]
+
+        if size = options.delete(:size)
+          options[:width], options[:height] = size.split(&quot;x&quot;) if size =~ %r{^\d+x\d+$}
+        end
+
+        if sources.is_a?(Array)
+          content_tag(&quot;video&quot;, options) do
+            sources.map { |source| tag(&quot;source&quot;, :src =&gt; source) }.join
+          end
+        else
+          options[:src] = path_to_video(sources)
+          tag(&quot;video&quot;, options)
+        end
+      end
+
       def self.cache_asset_timestamps
         @@cache_asset_timestamps
       end
@@ -652,13 +732,28 @@ module ActionView
           end
         end
 
+        def ensure_stylesheet_sources!(sources)
+          sources.each do |source|
+            asset_file_path!(path_to_stylesheet(source))
+          end
+          return sources
+        end
+
+        def ensure_javascript_sources!(sources)
+          sources.each do |source|
+            asset_file_path!(path_to_javascript(source))
+          end
+          return sources
+        end
+
         def join_asset_file_contents(paths)
-          paths.collect { |path| File.read(asset_file_path(path)) }.join(&quot;\n\n&quot;)
+          paths.collect { |path| File.read(asset_file_path!(path)) }.join(&quot;\n\n&quot;)
         end
 
         def write_asset_file_contents(joined_asset_path, asset_paths)
+
           FileUtils.mkdir_p(File.dirname(joined_asset_path))
-          File.open(joined_asset_path, &quot;w+&quot;) { |cache| cache.write(join_asset_file_contents(asset_paths)) }
+          File.atomic_write(joined_asset_path) { |cache| cache.write(join_asset_file_contents(asset_paths)) }
 
           # Set mtime to the latest of the combined files to allow for
           # consistent ETag without a shared filesystem.
@@ -670,6 +765,14 @@ module ActionView
           File.join(ASSETS_DIR, path.split('?').first)
         end
 
+        def asset_file_path!(path)
+          unless path =~ %r{^[-a-z]+://}
+            absolute_path = asset_file_path(path)
+            raise(Errno::ENOENT, &quot;Asset file not found at '#{absolute_path}'&quot; ) unless File.exist?(absolute_path)
+            return absolute_path
+          end
+        end
+
         def collect_asset_files(*path)
           dir = path.first
 
@@ -679,4 +782,4 @@ module ActionView
         end
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>actionpack/lib/action_view/helpers/asset_tag_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-require 'benchmark'
+require 'active_support/core_ext/benchmark'
 
 module ActionView
   module Helpers</diff>
      <filename>actionpack/lib/action_view/helpers/benchmark_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -111,15 +111,32 @@ module ActionView
       #
       # WARNING: content_for is ignored in caches. So you shouldn't use it
       # for elements that will be fragment cached.
-      #
-      # The deprecated way of accessing a content_for block is to use an instance variable
-      # named &lt;tt&gt;@content_for_#{name_of_the_content_block}&lt;/tt&gt;. The preferred usage is now
-      # &lt;tt&gt;&lt;%= yield :footer %&gt;&lt;/tt&gt;.
       def content_for(name, content = nil, &amp;block)
-        ivar = &quot;@content_for_#{name}&quot;
         content = capture(&amp;block) if block_given?
-        instance_variable_set(ivar, &quot;#{instance_variable_get(ivar)}#{content}&quot;)
-        nil
+        return @_content_for[name] &lt;&lt; content if content
+        @_content_for[name]
+      end
+
+      # content_for? simply checks whether any content has been captured yet using content_for
+      # Useful to render parts of your layout differently based on what is in your views.
+      # 
+      # ==== Examples
+      #
+      # Perhaps you will use different css in you layout if no content_for :right_column
+      #
+      #   &lt;%# This is the layout %&gt;
+      #   &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;
+      #   &lt;head&gt;
+      #	    &lt;title&gt;My Website&lt;/title&gt;
+      #	    &lt;%= yield :script %&gt;
+      #   &lt;/head&gt;
+      #   &lt;body class=&quot;&lt;%= content_for?(:right_col) ? 'one-column' : 'two-column' %&gt;&quot;&gt;
+      #     &lt;%= yield %&gt;
+      #     &lt;%= yield :right_col %&gt;
+      #   &lt;/body&gt;
+      #   &lt;/html&gt;
+      def content_for?(name)
+        @_content_for[name].present?
       end
 
       # Use an alternate output buffer for the duration of the block.</diff>
      <filename>actionpack/lib/action_view/helpers/capture_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@ require 'action_view/helpers/date_helper'
 require 'action_view/helpers/tag_helper'
 require 'action_view/helpers/form_tag_helper'
 require 'active_support/core_ext/class/inheritable_attributes'
+require 'active_support/core_ext/hash/slice'
 
 module ActionView
   module Helpers
@@ -494,7 +495,8 @@ module ActionView
       # Returns a label tag tailored for labelling an input field for a specified attribute (identified by +method+) on an object
       # assigned to the template (identified by +object+). The text of label will default to the attribute name unless you specify
       # it explicitly. Additional options on the label tag can be passed as a hash with +options+. These options will be tagged
-      # onto the HTML as an HTML element attribute as in the example shown.
+      # onto the HTML as an HTML element attribute as in the example shown, except for the &lt;tt&gt;:value&lt;/tt&gt; option, which is designed to
+      # target labels for radio_button tags (where the value is used in the ID of the input tag).
       #
       # ==== Examples
       #   label(:post, :title)
@@ -506,6 +508,9 @@ module ActionView
       #   label(:post, :title, &quot;A short title&quot;, :class =&gt; &quot;title_label&quot;)
       #   # =&gt; &lt;label for=&quot;post_title&quot; class=&quot;title_label&quot;&gt;A short title&lt;/label&gt;
       #
+      #   label(:post, :privacy, &quot;Public Post&quot;, :value =&gt; &quot;public&quot;)
+      #   # =&gt; &lt;label for=&quot;post_privacy_public&quot;&gt;Public Post&lt;/label&gt;
+      #
       def label(object_name, method, text = nil, options = {})
         InstanceTag.new(object_name, method, self, options.delete(:object)).to_label_tag(text, options)
       end
@@ -728,8 +733,9 @@ module ActionView
 
       def to_label_tag(text = nil, options = {})
         options = options.stringify_keys
+        tag_value = options.delete(&quot;value&quot;)
         name_and_id = options.dup
-        add_default_name_and_id(name_and_id)
+        add_default_name_and_id_for_value(tag_value, name_and_id)
         options.delete(&quot;index&quot;)
         options[&quot;for&quot;] ||= name_and_id[&quot;id&quot;]
         content = (text.blank? ? nil : text.to_s) || method_name.humanize
@@ -761,11 +767,7 @@ module ActionView
           checked = self.class.radio_button_checked?(value(object), tag_value)
         end
         options[&quot;checked&quot;]  = &quot;checked&quot; if checked
-        pretty_tag_value    = tag_value.to_s.gsub(/\s/, &quot;_&quot;).gsub(/\W/, &quot;&quot;).downcase
-        options[&quot;id&quot;]     ||= defined?(@auto_index) ?
-          &quot;#{tag_id_with_index(@auto_index)}_#{pretty_tag_value}&quot; :
-          &quot;#{tag_id}_#{pretty_tag_value}&quot;
-        add_default_name_and_id(options)
+        add_default_name_and_id_for_value(tag_value, options)
         tag(&quot;input&quot;, options)
       end
 
@@ -866,6 +868,17 @@ module ActionView
       end
 
       private
+        def add_default_name_and_id_for_value(tag_value, options)
+          if tag_value
+            pretty_tag_value    = tag_value.to_s.gsub(/\s/, &quot;_&quot;).gsub(/\W/, &quot;&quot;).downcase
+            specified_id = options[&quot;id&quot;]
+            add_default_name_and_id(options)
+            options[&quot;id&quot;] += &quot;_#{pretty_tag_value}&quot; unless specified_id
+          else
+            add_default_name_and_id(options)
+          end
+        end
+
         def add_default_name_and_id(options)
           if options.has_key?(&quot;index&quot;)
             options[&quot;name&quot;] ||= tag_name_with_index(options[&quot;index&quot;])
@@ -913,6 +926,7 @@ module ActionView
       attr_accessor :object_name, :object, :options
 
       def initialize(object_name, object, template, options, proc)
+        @nested_child_index = {}
         @object_name, @object, @template, @options, @proc = object_name, object, template, options, proc
         @default_options = @options ? @options.slice(:index) : {}
         if @object_name.to_s.match(/\[\]$/)
@@ -1015,7 +1029,7 @@ module ActionView
             explicit_child_index = args.last[:child_index] if args.last.is_a?(Hash)
 
             children.map do |child|
-              fields_for_nested_model(&quot;#{name}[#{explicit_child_index || nested_child_index}]&quot;, child, args, block)
+              fields_for_nested_model(&quot;#{name}[#{explicit_child_index || nested_child_index(name)}]&quot;, child, args, block)
             end.join
           else
             fields_for_nested_model(name, explicit_object || association, args, block)
@@ -1033,9 +1047,9 @@ module ActionView
           end
         end
 
-        def nested_child_index
-          @nested_child_index ||= -1
-          @nested_child_index += 1
+        def nested_child_index(name)
+          @nested_child_index[name] ||= -1
+          @nested_child_index[name] += 1
         end
     end
   end
@@ -1043,5 +1057,6 @@ module ActionView
   class &lt;&lt; Base
     attr_accessor :default_form_builder
   end
+
   Base.default_form_builder = ::ActionView::Helpers::FormBuilder
 end</diff>
      <filename>actionpack/lib/action_view/helpers/form_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
 require 'cgi'
 require 'action_view/helpers/tag_helper'
+require 'active_support/core_ext/object/returning'
 
 module ActionView
   module Helpers
@@ -230,6 +231,8 @@ module ActionView
       # * &lt;tt&gt;:rows&lt;/tt&gt; - Specify the number of rows in the textarea
       # * &lt;tt&gt;:cols&lt;/tt&gt; - Specify the number of columns in the textarea
       # * &lt;tt&gt;:disabled&lt;/tt&gt; - If set to true, the user will not be able to use this input.
+      # * &lt;tt&gt;:escape&lt;/tt&gt; - By default, the contents of the text input are HTML escaped.
+      #   If you need unescaped contents, set this to false.
       # * Any other key creates standard HTML attributes for the tag.
       #
       # ==== Examples
@@ -257,7 +260,10 @@ module ActionView
           options[&quot;cols&quot;], options[&quot;rows&quot;] = size.split(&quot;x&quot;) if size.respond_to?(:split)
         end
 
-        content_tag :textarea, content, { &quot;name&quot; =&gt; name, &quot;id&quot; =&gt; name }.update(options.stringify_keys)
+        escape = options.key?(&quot;escape&quot;) ? options.delete(&quot;escape&quot;) : true
+        content = html_escape(content) if escape
+
+        content_tag :textarea, content, { &quot;name&quot; =&gt; name, &quot;id&quot; =&gt; sanitize_to_id(name) }.update(options.stringify_keys)
       end
 
       # Creates a check box form input tag.
@@ -445,10 +451,10 @@ module ActionView
               ''
             when /^post$/i, &quot;&quot;, nil
               html_options[&quot;method&quot;] = &quot;post&quot;
-              protect_against_forgery? ? content_tag(:div, token_tag, :style =&gt; 'margin:0;padding:0') : ''
+              protect_against_forgery? ? content_tag(:div, token_tag, :style =&gt; 'margin:0;padding:0;display:inline') : ''
             else
               html_options[&quot;method&quot;] = &quot;post&quot;
-              content_tag(:div, tag(:input, :type =&gt; &quot;hidden&quot;, :name =&gt; &quot;_method&quot;, :value =&gt; method) + token_tag, :style =&gt; 'margin:0;padding:0')
+              content_tag(:div, tag(:input, :type =&gt; &quot;hidden&quot;, :name =&gt; &quot;_method&quot;, :value =&gt; method) + token_tag, :style =&gt; 'margin:0;padding:0;display:inline')
           end
         end
 </diff>
      <filename>actionpack/lib/action_view/helpers/form_tag_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,7 @@
 require 'set'
 require 'active_support/json'
 require 'active_support/core_ext/object/extending'
+require 'active_support/core_ext/object/returning'
 
 module ActionView
   module Helpers
@@ -1175,7 +1176,7 @@ module ActionView
 
     class JavaScriptVariableProxy &lt; JavaScriptProxy #:nodoc:
       def initialize(generator, variable)
-        @variable = variable
+        @variable = ::ActiveSupport::JSON::Variable.new(variable)
         @empty    = true # only record lines if we have to.  gets rid of unnecessary linebreaks
         super(generator)
       end
@@ -1186,7 +1187,7 @@ module ActionView
         true
       end
 
-      def rails_to_json(*)
+      def as_json(options = nil)
         @variable
       end
 </diff>
      <filename>actionpack/lib/action_view/helpers/prototype_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,8 @@ module ActionView
     module TagHelper
       include ERB::Util
 
-      BOOLEAN_ATTRIBUTES = %w(disabled readonly multiple checked).to_set
+      BOOLEAN_ATTRIBUTES = %w(disabled readonly multiple checked autobuffer
+                           autoplay controls loop).to_set
       BOOLEAN_ATTRIBUTES.merge(BOOLEAN_ATTRIBUTES.map {|attr| attr.to_sym })
 
       # Returns an empty HTML tag of type +name+ which by default is XHTML</diff>
      <filename>actionpack/lib/action_view/helpers/tag_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'action_view/helpers/javascript_helper'
+require 'active_support/core_ext/hash/keys'
 
 module ActionView
   module Helpers #:nodoc:
@@ -221,9 +222,9 @@ module ActionView
           html_options = args.second
           concat(link_to(capture(&amp;block), options, html_options))
         else
-          name         = args.first
-          options      = args.second || {}
-          html_options = args.third
+          name         = args[0]
+          options      = args[1] || {}
+          html_options = args[2]
 
           url = url_for(options)
 </diff>
      <filename>actionpack/lib/action_view/helpers/url_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ module ActionView #:nodoc:
     def self.type_cast(obj)
       if obj.is_a?(String)
         cache = !defined?(Rails) || !Rails.respond_to?(:configuration) || Rails.configuration.cache_classes
-        Template::FileSystemPathWithFallback.new(obj, :cache =&gt; cache)
+        FileSystemResolverWithFallback.new(obj, :cache =&gt; cache)
       else
         obj
       end</diff>
      <filename>actionpack/lib/action_view/paths.rb</filename>
    </modified>
    <modified>
      <diff>@@ -232,26 +232,7 @@ module ActionView
       ensure
         @_proc_for_layout = nil
       end
-      
-      def _deprecated_ivar_assign(template)
-        if respond_to?(:controller)
-          ivar = :&quot;@#{template.variable_name}&quot;
-          object =
-            if controller.instance_variable_defined?(ivar)
-              ActiveSupport::Deprecation::DeprecatedObjectProxy.new(
-                controller.instance_variable_get(ivar),
-                &quot;#{ivar} will no longer be implicitly assigned to #{template.variable_name}&quot;)
-            end
-        end
-      end
 
-      def _render_partial_with_block(layout, block, options)
-        @_proc_for_layout = block
-        concat(_render_partial(options.merge(:partial =&gt; layout)))
-      ensure
-        @_proc_for_layout = nil
-      end
-  
       def _render_partial_with_layout(layout, options)
         if layout
           prefix = controller &amp;&amp; !layout.include?(&quot;/&quot;) ? controller.controller_path : nil
@@ -260,18 +241,6 @@ module ActionView
         content = _render_partial(options)
         return _render_content_with_layout(content, layout, options[:locals])
       end
-    
-      def _deprecated_ivar_assign(template)
-        if respond_to?(:controller)
-          ivar = :&quot;@#{template.variable_name}&quot;
-          object =
-            if controller.instance_variable_defined?(ivar)
-              ActiveSupport::Deprecation::DeprecatedObjectProxy.new(
-                controller.instance_variable_get(ivar),
-                &quot;#{ivar} will no longer be implicitly assigned to #{template.variable_name}&quot;)
-            end
-        end
-      end
 
       def _array_like_objects
         array_like = [Array]
@@ -297,8 +266,6 @@ module ActionView
       end
 
       def _set_locals(object, locals, template, options)
-        object ||= _deprecated_ivar_assign(template)
-        
         locals[:object] = locals[template.variable_name] = object
         locals[options[:as]] = object if options[:as]
       end</diff>
      <filename>actionpack/lib/action_view/render/partials.rb</filename>
    </modified>
    <modified>
      <diff>@@ -51,32 +51,60 @@ module ActionView
       end
   
       begin
-        original_content_for_layout = @content_for_layout if defined?(@content_for_layout)
-        @content_for_layout = content
+        old_content, @_content_for[:layout] = @_content_for[:layout], content
 
-        @cached_content_for_layout = @content_for_layout
+        @cached_content_for_layout = @_content_for[:layout]
         _render_template(layout, locals)
       ensure
-        @content_for_layout = original_content_for_layout
+        @_content_for[:layout] = old_content
       end
     end
 
+    # You can think of a layout as a method that is called with a block. This method
+    # returns the block that the layout is called with. If the user calls yield :some_name,
+    # the block, by default, returns content_for(:some_name). If the user calls yield,
+    # the default block returns content_for(:layout).
+    #
+    # The user can override this default by passing a block to the layout.
+    #
+    # ==== Example
+    #
+    #   # The template
+    #   &lt;% render :layout =&gt; &quot;my_layout&quot; do %&gt;Content&lt;% end %&gt;
+    #
+    #   # The layout
+    #   &lt;html&gt;&lt;% yield %&gt;&lt;/html&gt;
+    #
+    # In this case, instead of the default block, which would return content_for(:layout),
+    # this method returns the block that was passed in to render layout, and the response
+    # would be &lt;html&gt;Content&lt;/html&gt;.
+    #
+    # Finally, the block can take block arguments, which can be passed in by yield.
+    #
+    # ==== Example
+    #
+    #   # The template
+    #   &lt;% render :layout =&gt; &quot;my_layout&quot; do |customer| %&gt;Hello &lt;%= customer.name %&gt;&lt;% end %&gt;
+    #
+    #   # The layout
+    #   &lt;html&gt;&lt;% yield Struct.new(:name).new(&quot;David&quot;) %&gt;&lt;/html&gt;
+    #
+    # In this case, the layout would receive the block passed into &lt;tt&gt;render :layout&lt;/tt&gt;,
+    # and the Struct specified in the layout would be passed into the block. The result
+    # would be &lt;html&gt;Hello David&lt;/html&gt;.
+    def layout_proc(name)
+      @_default_layout ||= proc { |*names| @_content_for[names.first || :layout] }
+      !@_content_for.key?(name) &amp;&amp; @_proc_for_layout || @_default_layout
+    end
+
     def _render_template(template, local_assigns = {})
       with_template(template) do
-        _evaluate_assigns_and_ivars
-        _set_controller_content_type(template.mime_type) if template.respond_to?(:mime_type)
-
         template.render(self, local_assigns) do |*names|
-          if !instance_variable_defined?(:&quot;@content_for_#{names.first}&quot;) &amp;&amp; 
-          instance_variable_defined?(:@_proc_for_layout) &amp;&amp; (proc = @_proc_for_layout)
-            capture(*names, &amp;proc)
-          elsif instance_variable_defined?(ivar = :&quot;@content_for_#{names.first || :layout}&quot;)
-            instance_variable_get(ivar)
-          end        
+          capture(*names, &amp;layout_proc(names.first))
         end
       end
     rescue Exception =&gt; e
-      if TemplateError === e
+      if e.is_a?(TemplateError)
         e.sub_template_of(template)
         raise e
       else
@@ -101,20 +129,18 @@ module ActionView
     end
 
     def _render_template_with_layout(template, layout = nil, options = {}, partial = false)
-      if controller &amp;&amp; logger
-        logger.info(&quot;Rendering #{template.identifier}&quot; + 
-          (options[:status] ? &quot; (#{options[:status]})&quot; : ''))
-      end
-  
+      logger &amp;&amp; logger.info(&quot;Rendering #{template.identifier}#{' (#{options[:status]})' if options[:status]}&quot;)
+
+      locals = options[:locals] || {}
+
       content = if partial
         object = partial unless partial == true
         _render_partial_object(template, options, object)
       else
-        _render_template(template, options[:locals] || {})
+        _render_template(template, locals)
       end
   
-      return content unless layout
-      _render_content_with_layout(content, layout, options[:locals] || {})
+      layout ? _render_content_with_layout(content, layout, locals) : content
     end
   end
 end
\ No newline at end of file</diff>
      <filename>actionpack/lib/action_view/render/rendering.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,5 @@
+require &quot;active_support/core_ext/enumerable&quot;
+
 module ActionView
   # The TemplateError exception is raised when the compilation of the template fails. This exception then gathers a
   # bunch of intimate details and uses it to report a very precise exception message.</diff>
      <filename>actionpack/lib/action_view/template/error.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,3 @@
-require 'builder'
-
 module ActionView
   module TemplateHandlers
     class Builder &lt; TemplateHandler
@@ -8,8 +6,8 @@ module ActionView
       self.default_format = Mime::XML
 
       def compile(template)
-        &quot;_set_controller_content_type(Mime::XML);&quot; +
-          &quot;xml = ::Builder::XmlMarkup.new(:indent =&gt; 2);&quot; +
+        require 'builder'
+        &quot;xml = ::Builder::XmlMarkup.new(:indent =&gt; 2);&quot; +
           &quot;self.output_buffer = xml.target!;&quot; +
           template.source +
           &quot;;xml.target!;&quot;</diff>
      <filename>actionpack/lib/action_view/template/handlers/builder.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,3 @@
-require 'erb'
 require 'active_support/core_ext/class/attribute_accessors'
 
 module ActionView
@@ -16,7 +15,11 @@ module ActionView
       self.default_format = Mime::HTML
 
       def compile(template)
-        ::ERB.new(&quot;&lt;% __in_erb_template=true %&gt;#{template.source}&quot;, nil, erb_trim_mode, '@output_buffer').src
+        require 'erb'
+
+        magic = $1 if template.source =~ /\A(&lt;%#.*coding[:=]\s*(\S+)\s*-?%&gt;)/
+        erb = &quot;#{magic}&lt;% __in_erb_template=true %&gt;#{template.source}&quot;
+        ::ERB.new(erb, nil, erb_trim_mode, '@output_buffer').src
       end
     end
   end</diff>
      <filename>actionpack/lib/action_view/template/handlers/erb.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,6 @@ module ActionView
       self.default_format = Mime::JS
 
       def compile(template)
-        &quot;@formats = [:html];&quot; +
         &quot;controller.response.content_type ||= Mime::JS;&quot; +
           &quot;update_page do |page|;#{template.source}\nend&quot;
       end</diff>
      <filename>actionpack/lib/action_view/template/handlers/rjs.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@
 # This is so that templates compiled in this file are UTF-8
 
 require 'set'
-require &quot;action_view/template/path&quot;
+require &quot;action_view/template/resolver&quot;
 
 module ActionView
   class Template
@@ -20,7 +20,7 @@ module ActionView
         handler.respond_to?(:default_format) ? handler.default_format.to_sym.to_s : &quot;html&quot;
       end
       @mime_type = Mime::Type.lookup_by_extension(format.to_s)
-      @details[:formats] = Array.wrap(format &amp;&amp; format.to_sym)
+      @details[:formats] = Array.wrap(format.to_sym)
     end
     
     def render(view, locals, &amp;blk)
@@ -53,7 +53,11 @@ module ActionView
       locals_code = locals.keys.map! { |key| &quot;#{key} = local_assigns[:#{key}];&quot; }.join
 
       code = @handler.call(self)
-      encoding_comment = $1 if code.sub!(/\A(#.*coding.*)\n/, '')
+      if code.sub!(/\A(#.*coding.*)\n/, '')
+        encoding_comment = $1
+      elsif defined?(Encoding) &amp;&amp; Encoding.respond_to?(:default_external)
+        encoding_comment = &quot;#coding:#{Encoding.default_external}&quot;
+      end
 
       source = &lt;&lt;-end_src
         def #{method_name}(local_assigns)</diff>
      <filename>actionpack/lib/action_view/template/template.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ module ActionView #:nodoc:
 
     def initialize(string, content_type = Mime[:html])
       super(string.to_s)
-      @content_type = Mime[content_type]
+      @content_type = Mime[content_type] || content_type
     end
 
     def details</diff>
      <filename>actionpack/lib/action_view/template/text.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@ module AbstractController
     
     class TestBasic &lt; ActiveSupport::TestCase
       test &quot;dispatching works&quot; do
-        result = Me.process(:index)
+        result = Me.new.process(:index)
         assert_equal &quot;Hello world&quot;, result.response_body
       end
     end
@@ -68,27 +68,27 @@ module AbstractController
     
     class TestRenderer &lt; ActiveSupport::TestCase
       test &quot;rendering templates works&quot; do
-        result = Me2.process(:index)
+        result = Me2.new.process(:index)
         assert_equal &quot;Hello from index.erb&quot;, result.response_body
       end
       
       test &quot;rendering passes ivars to the view&quot; do
-        result = Me2.process(:action_with_ivars)
+        result = Me2.new.process(:action_with_ivars)
         assert_equal &quot;Hello from index_with_ivars.erb&quot;, result.response_body
       end
       
       test &quot;rendering with no template name&quot; do
-        result = Me2.process(:naked_render)
+        result = Me2.new.process(:naked_render)
         assert_equal &quot;Hello from naked_render.erb&quot;, result.response_body
       end
 
       test &quot;rendering to a rack body&quot; do
-        result = Me2.process(:rendering_to_body)
+        result = Me2.new.process(:rendering_to_body)
         assert_equal &quot;Hello from naked_render.erb&quot;, result.response_body
       end
 
       test &quot;rendering to a string&quot; do
-        result = Me2.process(:rendering_to_string)
+        result = Me2.new.process(:rendering_to_string)
         assert_equal &quot;Hello from naked_render.erb&quot;, result.response_body
       end
     end
@@ -120,12 +120,12 @@ module AbstractController
     
     class TestPrefixedViews &lt; ActiveSupport::TestCase
       test &quot;templates are located inside their 'prefix' folder&quot; do
-        result = Me3.process(:index)
+        result = Me3.new.process(:index)
         assert_equal &quot;Hello from me3/index.erb&quot;, result.response_body
       end
 
       test &quot;templates included their format&quot; do
-        result = Me3.process(:formatted)
+        result = Me3.new.process(:formatted)
         assert_equal &quot;Hello from me3/formatted.html.erb&quot;, result.response_body
       end
     end
@@ -136,11 +136,6 @@ module AbstractController
     class WithLayouts &lt; PrefixedViews
       include Layouts
       
-      def self.inherited(klass)
-        klass._write_layout_method
-        super
-      end
-      
       private
       def self.layout(formats)
         begin
@@ -154,7 +149,7 @@ module AbstractController
       end
 
       def render_to_body(options = {})
-        options[:_layout] = options[:layout] || _default_layout
+        options[:_layout] = options[:layout] || _default_layout({})
         super
       end  
     end
@@ -173,7 +168,7 @@ module AbstractController
     
     class TestLayouts &lt; ActiveSupport::TestCase
       test &quot;layouts are included&quot; do
-        result = Me4.process(:index)
+        result = Me4.new.process(:index)
         assert_equal &quot;Me4 Enter : Hello from me4/index.erb : Exit&quot;, result.response_body
       end
     end
@@ -210,7 +205,7 @@ module AbstractController
     class TestRespondToAction &lt; ActiveSupport::TestCase
       
       def assert_dispatch(klass, body = &quot;success&quot;, action = :index)
-        response = klass.process(action).response_body
+        response = klass.new.process(action).response_body
         assert_equal body, response
       end
       
@@ -219,7 +214,7 @@ module AbstractController
       end
       
       test &quot;raises ActionNotFound when method does not exist and action_missing is not defined&quot; do
-        assert_raise(ActionNotFound) { DefaultRespondToActionController.process(:fail) }
+        assert_raise(ActionNotFound) { DefaultRespondToActionController.new.process(:fail) }
       end
       
       test &quot;dispatches to action_missing when method does not exist and action_missing is defined&quot; do
@@ -231,7 +226,7 @@ module AbstractController
       end
       
       test &quot;raises ActionNotFound if method is defined but respond_to_action? returns false&quot; do
-        assert_raise(ActionNotFound) { RespondToActionController.process(:fail) }
+        assert_raise(ActionNotFound) { RespondToActionController.new.process(:fail) }
       end
     end
     </diff>
      <filename>actionpack/test/abstract_controller/abstract_controller_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ module AbstractController
     end
     
     class Callback1 &lt; ControllerWithCallbacks
-      process_action_callback :before, :first
+      set_callback :process_action, :before, :first
       
       def first
         @text = &quot;Hello world&quot;
@@ -21,7 +21,7 @@ module AbstractController
     
     class TestCallbacks &lt; ActiveSupport::TestCase
       test &quot;basic callbacks work&quot; do
-        result = Callback1.process(:index)
+        result = Callback1.new.process(:index)
         assert_equal &quot;Hello world&quot;, result.response_body
       end
     end
@@ -52,17 +52,17 @@ module AbstractController
     
     class TestCallbacks &lt; ActiveSupport::TestCase
       test &quot;before_filter works&quot; do
-        result = Callback2.process(:index)
+        result = Callback2.new.process(:index)
         assert_equal &quot;Hello world&quot;, result.response_body
       end
       
       test &quot;after_filter works&quot; do
-        result = Callback2.process(:index)
+        result = Callback2.new.process(:index)
         assert_equal &quot;Goodbye&quot;, result.instance_variable_get(&quot;@second&quot;)
       end
       
       test &quot;around_filter works&quot; do
-        result = Callback2.process(:index)
+        result = Callback2.new.process(:index)
         assert_equal &quot;FIRSTSECOND&quot;, result.instance_variable_get(&quot;@aroundz&quot;)
       end
     end
@@ -83,12 +83,12 @@ module AbstractController
 
     class TestCallbacks &lt; ActiveSupport::TestCase
       test &quot;before_filter works with procs&quot; do
-        result = Callback3.process(:index)
+        result = Callback3.new.process(:index)
         assert_equal &quot;Hello world&quot;, result.response_body
       end
       
       test &quot;after_filter works with procs&quot; do
-        result = Callback3.process(:index)
+        result = Callback3.new.process(:index)
         assert_equal &quot;Goodbye&quot;, result.instance_variable_get(&quot;@second&quot;)
       end      
     end
@@ -118,17 +118,17 @@ module AbstractController
     
     class TestCallbacks &lt; ActiveSupport::TestCase
       test &quot;when :only is specified, a before filter is triggered on that action&quot; do
-        result = CallbacksWithConditions.process(:index)
+        result = CallbacksWithConditions.new.process(:index)
         assert_equal &quot;Hello, World&quot;, result.response_body
       end
       
       test &quot;when :only is specified, a before filter is not triggered on other actions&quot; do
-        result = CallbacksWithConditions.process(:sekrit_data)
+        result = CallbacksWithConditions.new.process(:sekrit_data)
         assert_equal &quot;true&quot;, result.response_body
       end
       
       test &quot;when :except is specified, an after filter is not triggered on that action&quot; do
-        result = CallbacksWithConditions.process(:index)
+        result = CallbacksWithConditions.new.process(:index)
         assert_nil result.instance_variable_get(&quot;@authenticated&quot;)
       end
     end
@@ -158,17 +158,17 @@ module AbstractController
     
     class TestCallbacks &lt; ActiveSupport::TestCase
       test &quot;when :only is specified with an array, a before filter is triggered on that action&quot; do
-        result = CallbacksWithArrayConditions.process(:index)
+        result = CallbacksWithArrayConditions.new.process(:index)
         assert_equal &quot;Hello, World&quot;, result.response_body
       end
       
       test &quot;when :only is specified with an array, a before filter is not triggered on other actions&quot; do
-        result = CallbacksWithArrayConditions.process(:sekrit_data)
+        result = CallbacksWithArrayConditions.new.process(:sekrit_data)
         assert_equal &quot;true&quot;, result.response_body
       end
       
       test &quot;when :except is specified with an array, an after filter is not triggered on that action&quot; do
-        result = CallbacksWithArrayConditions.process(:index)
+        result = CallbacksWithArrayConditions.new.process(:index)
         assert_nil result.instance_variable_get(&quot;@authenticated&quot;)
       end
     end    
@@ -183,12 +183,12 @@ module AbstractController
     
     class TestCallbacks &lt; ActiveSupport::TestCase
       test &quot;when a callback is modified in a child with :only, it works for the :only action&quot; do
-        result = ChangedConditions.process(:index)
+        result = ChangedConditions.new.process(:index)
         assert_equal &quot;Hello world&quot;, result.response_body
       end
       
       test &quot;when a callback is modified in a child with :only, it does not work for other actions&quot; do
-        result = ChangedConditions.process(:not_index)
+        result = ChangedConditions.new.process(:not_index)
         assert_equal &quot;&quot;, result.response_body        
       end
     end
@@ -207,7 +207,7 @@ module AbstractController
     
     class TestHalting &lt; ActiveSupport::TestCase
       test &quot;when a callback sets the response body, the action should not be invoked&quot; do
-        result = SetsResponseBody.process(:index)
+        result = SetsResponseBody.new.process(:index)
         assert_equal &quot;Success&quot;, result.response_body
       end
     end</diff>
      <filename>actionpack/test/abstract_controller/callbacks_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -34,7 +34,7 @@ module AbstractController
     
     class TestHelpers &lt; ActiveSupport::TestCase
       def test_helpers
-        result = MyHelpers1.process(:index)
+        result = MyHelpers1.new.process(:index)
         assert_equal &quot;Hello World : Included&quot;, result.response_body
       end
     end</diff>
      <filename>actionpack/test/abstract_controller/helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,7 @@ module AbstractControllerTests
       include AbstractController::Renderer
       include AbstractController::Layouts
 
-      self.view_paths = [ActionView::Template::FixturePath.new(
+      self.view_paths = [ActionView::FixtureResolver.new(
         &quot;layouts/hello.erb&quot;                     =&gt; &quot;With String &lt;%= yield %&gt;&quot;,
         &quot;layouts/hello_override.erb&quot;            =&gt; &quot;With Override &lt;%= yield %&gt;&quot;,
         &quot;layouts/abstract_controller_tests/layouts/with_string_implied_child.erb&quot; =&gt;
@@ -25,7 +25,7 @@ module AbstractControllerTests
       def controller_path() self.class.controller_path end
       
       def render_to_body(options)
-        options[:_layout] = _default_layout
+        options[:_layout] = _default_layout({})
         super
       end
     end
@@ -141,91 +141,82 @@ module AbstractControllerTests
       end
     end
     
-    # TODO Move to bootloader
-    AbstractController::Base.subclasses.each do |klass|
-      klass = klass.constantize
-      next unless klass &lt; AbstractController::Layouts
-      klass.class_eval do
-        _write_layout_method
-      end
-    end
-    
     class TestBase &lt; ActiveSupport::TestCase
       test &quot;when no layout is specified, and no default is available, render without a layout&quot; do
-        result = Blank.process(:index)
+        result = Blank.new.process(:index)
         assert_equal &quot;Hello blank!&quot;, result.response_body
       end
       
       test &quot;when layout is specified as a string, render with that layout&quot; do
-        result = WithString.process(:index)
+        result = WithString.new.process(:index)
         assert_equal &quot;With String Hello string!&quot;, result.response_body
       end
       
       test &quot;when layout is specified as a string, but the layout is missing, raise an exception&quot; do
-        assert_raises(ActionView::MissingTemplate) { WithMissingLayout.process(:index) }
+        assert_raises(ActionView::MissingTemplate) { WithMissingLayout.new.process(:index) }
       end
       
       test &quot;when layout is specified as false, do not use a layout&quot; do
-        result = WithFalseLayout.process(:index)
+        result = WithFalseLayout.new.process(:index)
         assert_equal &quot;Hello false!&quot;, result.response_body
       end
       
       test &quot;when layout is specified as nil, do not use a layout&quot; do
-        result = WithNilLayout.process(:index)
+        result = WithNilLayout.new.process(:index)
         assert_equal &quot;Hello nil!&quot;, result.response_body
       end
       
       test &quot;when layout is specified as a symbol, call the requested method and use the layout returned&quot; do
-        result = WithSymbol.process(:index)
+        result = WithSymbol.new.process(:index)
         assert_equal &quot;OMGHI2U Hello symbol!&quot;, result.response_body
       end
       
       test &quot;when layout is specified as a symbol and the method returns nil, don't use a layout&quot; do
-        result = WithSymbolReturningNil.process(:index)
+        result = WithSymbolReturningNil.new.process(:index)
         assert_equal &quot;Hello nilz!&quot;, result.response_body
       end
       
       test &quot;when the layout is specified as a symbol and the method doesn't exist, raise an exception&quot; do
-        assert_raises(NoMethodError, /:nilz/) { WithSymbolAndNoMethod.process(:index) }
+        assert_raises(NoMethodError, /:nilz/) { WithSymbolAndNoMethod.new.process(:index) }
       end
       
       test &quot;when the layout is specified as a symbol and the method returns something besides a string/false/nil, raise an exception&quot; do
-        assert_raises(ArgumentError) { WithSymbolReturningObj.process(:index) }
+        assert_raises(ArgumentError) { WithSymbolReturningObj.new.process(:index) }
       end
       
       test &quot;when a child controller does not have a layout, use the parent controller layout&quot; do
-        result = WithStringChild.process(:index)
+        result = WithStringChild.new.process(:index)
         assert_equal &quot;With String Hello string!&quot;, result.response_body
       end
       
       test &quot;when a child controller has specified a layout, use that layout and not the parent controller layout&quot; do
-        result = WithStringOverriddenChild.process(:index)
+        result = WithStringOverriddenChild.new.process(:index)
         assert_equal &quot;With Override Hello string!&quot;, result.response_body
       end
       
       test &quot;when a child controller has an implied layout, use that layout and not the parent controller layout&quot; do
-        result = WithStringImpliedChild.process(:index)
+        result = WithStringImpliedChild.new.process(:index)
         assert_equal &quot;With Implied Hello string!&quot;, result.response_body
       end
       
       test &quot;when a child controller specifies layout nil, do not use the parent layout&quot; do
-        result = WithNilChild.process(:index)
+        result = WithNilChild.new.process(:index)
         assert_equal &quot;Hello string!&quot;, result.response_body
       end
             
       test &quot;when a grandchild has no layout specified, the child has an implied layout, and the &quot; \
         &quot;parent has specified a layout, use the child controller layout&quot; do
-          result = WithChildOfImplied.process(:index)
+          result = WithChildOfImplied.new.process(:index)
           assert_equal &quot;With Implied Hello string!&quot;, result.response_body
       end
       
       test &quot;raises an exception when specifying layout true&quot; do
         assert_raises ArgumentError do
-          Object.class_eval &lt;&lt;-RUBY_EVAL, __FILE__, __LINE__ + 1
+          Object.class_eval do
             class ::BadOmgFailLolLayout &lt; AbstractControllerTests::Layouts::Base
               layout true
             end
-          RUBY_EVAL
+          end
         end
       end
     end</diff>
      <filename>actionpack/test/abstract_controller/layouts_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,19 +1,27 @@
-if ENV['new_base']
-  puts *caller
-  raise 'new_base/abstract_unit already loaded'
-end
 $:.unshift(File.dirname(__FILE__) + '/../lib')
 $:.unshift(File.dirname(__FILE__) + '/../../activesupport/lib')
+$:.unshift(File.dirname(__FILE__) + '/../../activemodel/lib')
+$:.unshift(File.dirname(__FILE__) + '/lib')
+
 $:.unshift(File.dirname(__FILE__) + '/fixtures/helpers')
 $:.unshift(File.dirname(__FILE__) + '/fixtures/alternate_helpers')
 
-require 'rubygems'
-require 'yaml'
-require 'stringio'
+ENV['new_base'] = &quot;true&quot;
+$stderr.puts &quot;Running old tests on new_base&quot;
+
 require 'test/unit'
+require 'active_support'
+
+require 'active_support/test_case'
+require 'action_controller/abstract'
+require 'action_controller'
+require 'fixture_template'
+require 'action_controller/testing/process'
+require 'action_view/test_case'
+require 'action_controller/testing/integration'
+require 'active_support/dependencies'
 
-gem 'mocha', '&gt;= 0.9.5'
-require 'mocha'
+$tags[:new_base] = true
 
 begin
   require 'ruby-debug'
@@ -23,24 +31,88 @@ rescue LoadError
   # Debugging disabled. `gem install ruby-debug` to enable.
 end
 
-require 'action_controller'
-require 'action_controller/testing/process'
-require 'action_view/test_case'
-
-$tags[:old_base] = true
+ActiveSupport::Dependencies.hook!
 
 # Show backtraces for deprecated behavior for quicker cleanup.
 ActiveSupport::Deprecation.debug = true
 
-ActionController::Base.logger = nil
-ActionController::Routing::Routes.reload rescue nil
-
-ActionController::Base.session_store = nil
-
 # Register danish language for testing
 I18n.backend.store_translations 'da', {}
 I18n.backend.store_translations 'pt-BR', {}
 ORIGINAL_LOCALES = I18n.available_locales.map {|locale| locale.to_s }.sort
 
 FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures')
-ActionController::Base.view_paths = FIXTURE_LOAD_PATH
+
+module ActionView
+  class TestCase
+    setup do
+      ActionController::Routing::Routes.draw do |map|
+        map.connect ':controller/:action/:id'
+      end
+    end
+  end
+end
+
+module ActionController
+  Base.session = {
+    :key         =&gt; '_testing_session',
+    :secret      =&gt; '8273f16463985e2b3747dc25e30f2528'
+  }
+  Base.session_store = nil
+
+  class Base
+    include ActionController::Testing
+  end
+  
+  Base.view_paths = FIXTURE_LOAD_PATH
+  
+  class TestCase
+    include TestProcess
+    setup do
+      ActionController::Routing::Routes.draw do |map|
+        map.connect ':controller/:action/:id'
+      end
+    end
+    
+    def assert_template(options = {}, message = nil)
+      validate_request!
+
+      hax = @controller._action_view.instance_variable_get(:@_rendered)
+
+      case options
+      when NilClass, String
+        rendered = (hax[:template] || []).map { |t| t.identifier }
+        msg = build_message(message,
+                &quot;expecting &lt;?&gt; but rendering with &lt;?&gt;&quot;,
+                options, rendered.join(', '))
+        assert_block(msg) do
+          if options.nil?
+            hax[:template].blank?
+          else
+            rendered.any? { |t| t.match(options) }
+          end
+        end
+      when Hash
+        if expected_partial = options[:partial]
+          partials = hax[:partials]
+          if expected_count = options[:count]
+            found = partials.detect { |p, _| p.identifier.match(expected_partial) }
+            actual_count = found.nil? ? 0 : found.second
+            msg = build_message(message,
+                    &quot;expecting ? to be rendered ? time(s) but rendered ? time(s)&quot;,
+                     expected_partial, expected_count, actual_count)
+            assert(actual_count == expected_count.to_i, msg)
+          else
+            msg = build_message(message,
+                    &quot;expecting partial &lt;?&gt; but action rendered &lt;?&gt;&quot;,
+                    options[:partial], partials.keys)
+            assert(partials.keys.any? { |p| p.identifier.match(expected_partial) }, msg)
+          end
+        else
+          assert hax[:partials].empty?,
+            &quot;Expected no partials to be rendered&quot;
+        end
+      end
+    end
+  end
+end</diff>
      <filename>actionpack/test/abstract_unit.rb</filename>
    </modified>
    <modified>
      <diff>@@ -234,10 +234,13 @@ class PolymorphicRoutesTest &lt; ActionController::TestCase
     with_admin_test_routes do
       @project.save
       @task.save
+
+      options = {}
       object_array = [:admin, @project, @task]
-      assert_no_difference 'object_array.size' do
-        polymorphic_url(object_array)
-      end
+      original_args = [object_array.dup, options.dup]
+
+      assert_no_difference('object_array.size') { polymorphic_path(object_array, options) }
+      assert_equal original_args, [object_array, options]
     end
   end
   </diff>
      <filename>actionpack/test/activerecord/polymorphic_routes_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -126,6 +126,7 @@ class RenderPartialWithRecordIdentificationController &lt; ActionController::Base
 end
 
 class Game &lt; Struct.new(:name, :id)
+  extend ActiveModel::Naming
   def to_param
     id.to_s
   end</diff>
      <filename>actionpack/test/activerecord/render_partial_with_record_identification_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,6 +13,18 @@ class ActionPackAssertionsController &lt; ActionController::Base
   # a standard template
   def hello_xml_world() render :template =&gt; &quot;test/hello_xml_world&quot;; end
 
+  # a standard template rendering PDF
+  def hello_xml_world_pdf
+    self.content_type = &quot;application/pdf&quot;
+    render :template =&gt; &quot;test/hello_xml_world&quot;
+  end
+
+  # a standard template rendering PDF
+  def hello_xml_world_pdf_header
+    response.headers[&quot;Content-Type&quot;] = &quot;application/pdf; charset=utf-8&quot;
+    render :template =&gt; &quot;test/hello_xml_world&quot;
+  end
+
   # a standard partial
   def partial() render :partial =&gt; 'test/partial'; end
 
@@ -537,11 +549,13 @@ class ActionPackHeaderTest &lt; ActionController::TestCase
   end
 
   def test_rendering_xml_respects_content_type
-    pending do
-      @response.headers['type'] = 'application/pdf'
-      process :hello_xml_world
-      assert_equal('application/pdf; charset=utf-8', @response.headers['Content-Type'])
-    end
+    process :hello_xml_world_pdf
+    assert_equal('application/pdf; charset=utf-8', @response.headers['Content-Type'])
+  end
+
+  def test_rendering_xml_respects_content_type_when_set_in_the_header
+    process :hello_xml_world_pdf_header
+    assert_equal('application/pdf; charset=utf-8', @response.headers['Content-Type'])
   end
 
   def test_render_text_with_custom_content_type</diff>
      <filename>actionpack/test/controller/action_pack_assertions_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -87,11 +87,11 @@ class ControllerInstanceTests &lt; Test::Unit::TestCase
   def test_action_methods
     @empty_controllers.each do |c|
       hide_mocha_methods_from_controller(c)
-      assert_equal Set.new, c.__send__(:action_methods), &quot;#{c.controller_path} should be empty!&quot;
+      assert_equal Set.new, c.class.__send__(:action_methods), &quot;#{c.controller_path} should be empty!&quot;
     end
     @non_empty_controllers.each do |c|
       hide_mocha_methods_from_controller(c)
-      assert_equal Set.new(%w(public_action)), c.__send__(:action_methods), &quot;#{c.controller_path} should not be empty!&quot;
+      assert_equal Set.new(%w(public_action)), c.class.__send__(:action_methods), &quot;#{c.controller_path} should not be empty!&quot;
     end
   end
 
@@ -145,7 +145,8 @@ class PerformActionTest &lt; ActionController::TestCase
   
   def test_method_missing_is_not_an_action_name
     use_controller MethodMissingController
-    assert ! @controller.__send__(:action_methods).include?('method_missing')
+
+    assert ! @controller.__send__(:action_method?, 'method_missing')
     
     get :method_missing
     assert_response :success</diff>
      <filename>actionpack/test/controller/base_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -83,14 +83,14 @@ class ContentTypeTest &lt; ActionController::TestCase
   # :ported:
   def test_content_type_from_body
     get :render_content_type_from_body
-    assert_equal &quot;application/rss+xml&quot;, @response.content_type
+    assert_equal Mime::RSS, @response.content_type
     assert_equal &quot;utf-8&quot;, @response.charset
   end
 
   # :ported:
   def test_content_type_from_render
     get :render_content_type_from_render
-    assert_equal &quot;application/rss+xml&quot;, @response.content_type
+    assert_equal Mime::RSS, @response.content_type
     assert_equal &quot;utf-8&quot;, @response.charset
   end
 </diff>
      <filename>actionpack/test/controller/content_type_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -40,7 +40,8 @@ class FilterParamTest &lt; ActionController::TestCase
     [{'foo'=&gt;'bar', 'bar'=&gt;'foo'},{'foo'=&gt;'[FILTERED]', 'bar'=&gt;'foo'},%w'foo baz'],
     [{'foo'=&gt;'bar', 'baz'=&gt;'foo'},{'foo'=&gt;'[FILTERED]', 'baz'=&gt;'[FILTERED]'},%w'foo baz'],
     [{'bar'=&gt;{'foo'=&gt;'bar','bar'=&gt;'foo'}},{'bar'=&gt;{'foo'=&gt;'[FILTERED]','bar'=&gt;'foo'}},%w'fo'],
-    [{'foo'=&gt;{'foo'=&gt;'bar','bar'=&gt;'foo'}},{'foo'=&gt;'[FILTERED]'},%w'f banana']]
+    [{'foo'=&gt;{'foo'=&gt;'bar','bar'=&gt;'foo'}},{'foo'=&gt;'[FILTERED]'},%w'f banana'],
+    [{'baz'=&gt;[{'foo'=&gt;'baz'}]}, {'baz'=&gt;[{'foo'=&gt;'[FILTERED]'}]}, %w(foo)]]
 
     test_hashes.each do |before_filter, after_filter, filter_words|
       FilterParamController.filter_parameter_logging(*filter_words)</diff>
      <filename>actionpack/test/controller/filter_params_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,24 +9,20 @@ class ActionController::Base
       end unless method_defined?(pending)
     end
 
-    if defined?(ActionController::Http)
-      def before_filters
-        filters = _process_action_callbacks.select { |c| c.kind == :before }
-        filters.map! { |c| c.instance_variable_get(:@raw_filter) }
-      end
+    def before_filters
+      filters = _process_action_callbacks.select { |c| c.kind == :before }
+      filters.map! { |c| c.instance_variable_get(:@raw_filter) }
     end
   end
 
-  if defined?(ActionController::Http)
-    def assigns(key = nil)
-      assigns = {}
-      instance_variable_names.each do |ivar|
-        next if ActionController::Base.protected_instance_variables.include?(ivar)
-        assigns[ivar[1..-1]] = instance_variable_get(ivar)
-      end
-
-      key.nil? ? assigns : assigns[key.to_s]
+  def assigns(key = nil)
+    assigns = {}
+    instance_variable_names.each do |ivar|
+      next if ActionController::Base.protected_instance_variables.include?(ivar)
+      assigns[ivar[1..-1]] = instance_variable_get(ivar)
     end
+
+    key.nil? ? assigns : assigns[key.to_s]
   end
 end
 
@@ -231,24 +227,29 @@ class FilterTest &lt; ActionController::TestCase
   end
 
   class ConditionalParentOfConditionalSkippingController &lt; ConditionalFilterController
-    before_filter :conditional_in_parent, :only =&gt; [:show, :another_action]
-    after_filter  :conditional_in_parent, :only =&gt; [:show, :another_action]
+    before_filter :conditional_in_parent_before, :only =&gt; [:show, :another_action]
+    after_filter  :conditional_in_parent_after, :only =&gt; [:show, :another_action]
 
     private
 
-      def conditional_in_parent
+      def conditional_in_parent_before
+        @ran_filter ||= []
+        @ran_filter &lt;&lt; 'conditional_in_parent_before'
+      end
+
+      def conditional_in_parent_after
         @ran_filter ||= []
-        @ran_filter &lt;&lt; 'conditional_in_parent'
+        @ran_filter &lt;&lt; 'conditional_in_parent_after'
       end
   end
 
   class ChildOfConditionalParentController &lt; ConditionalParentOfConditionalSkippingController
-    skip_before_filter :conditional_in_parent, :only =&gt; :another_action
-    skip_after_filter  :conditional_in_parent, :only =&gt; :another_action
+    skip_before_filter :conditional_in_parent_before, :only =&gt; :another_action
+    skip_after_filter  :conditional_in_parent_after, :only =&gt; :another_action
   end
 
   class AnotherChildOfConditionalParentController &lt; ConditionalParentOfConditionalSkippingController
-    skip_before_filter :conditional_in_parent, :only =&gt; :show
+    skip_before_filter :conditional_in_parent_before, :only =&gt; :show
   end
 
   class ProcController &lt; PrependingController
@@ -596,7 +597,7 @@ class FilterTest &lt; ActionController::TestCase
   def test_prepending_and_appending_around_filter
     controller = test_process(MixedFilterController)
     assert_equal &quot; before aroundfilter  before procfilter  before appended aroundfilter &quot; +
-                 &quot; after appended aroundfilter  after aroundfilter  after procfilter &quot;,
+                 &quot; after appended aroundfilter  after procfilter  after aroundfilter &quot;,
                  MixedFilterController.execution_log
   end
 
@@ -658,18 +659,18 @@ class FilterTest &lt; ActionController::TestCase
 
   def test_conditional_skipping_of_filters_when_parent_filter_is_also_conditional
     test_process(ChildOfConditionalParentController)
-    assert_equal %w( conditional_in_parent conditional_in_parent ), assigns['ran_filter']
+    assert_equal %w( conditional_in_parent_before conditional_in_parent_after ), assigns['ran_filter']
     test_process(ChildOfConditionalParentController, 'another_action')
     assert_nil assigns['ran_filter']
   end
 
   def test_condition_skipping_of_filters_when_siblings_also_have_conditions
     test_process(ChildOfConditionalParentController)
-    assert_equal %w( conditional_in_parent conditional_in_parent ), assigns['ran_filter'], &quot;1&quot;
+    assert_equal %w( conditional_in_parent_before conditional_in_parent_after ), assigns['ran_filter']
     test_process(AnotherChildOfConditionalParentController)
-    assert_equal nil, assigns['ran_filter']
+    assert_equal %w( conditional_in_parent_after ), assigns['ran_filter']
     test_process(ChildOfConditionalParentController)
-    assert_equal %w( conditional_in_parent conditional_in_parent ), assigns['ran_filter']
+    assert_equal %w( conditional_in_parent_before conditional_in_parent_after ), assigns['ran_filter']
   end
 
   def test_changing_the_requirements
@@ -823,7 +824,9 @@ class ControllerWithAllTypesOfFilters &lt; PostsController
 end
 
 class ControllerWithTwoLessFilters &lt; ControllerWithAllTypesOfFilters
+  $vbf = true
   skip_filter :around_again
+  $vbf = false
   skip_filter :after
 end
 
@@ -858,12 +861,6 @@ class YieldingAroundFiltersTest &lt; ActionController::TestCase
     assert_raise(After) { test_process(controller,'raises_after') }
   end
 
-  def test_with_method
-    controller = ControllerWithFilterMethod
-    assert_nothing_raised { test_process(controller,'no_raise') }
-    assert_raise(After) { test_process(controller,'raises_after') }
-  end
-
   def test_with_proc
     test_process(ControllerWithProcFilter,'no_raise')
     assert assigns['before']
@@ -888,7 +885,7 @@ class YieldingAroundFiltersTest &lt; ActionController::TestCase
 
   def test_filter_order_with_all_filter_types
     test_process(ControllerWithAllTypesOfFilters,'no_raise')
-    assert_equal 'before around (before yield) around_again (before yield) around_again (after yield) around (after yield) after', assigns['ran_filter'].join(' ')
+    assert_equal 'before around (before yield) around_again (before yield) around_again (after yield) after around (after yield)', assigns['ran_filter'].join(' ')
   end
 
   def test_filter_order_with_skip_filter_method
@@ -901,7 +898,6 @@ class YieldingAroundFiltersTest &lt; ActionController::TestCase
     response = test_process(controller, 'fail_1')
     assert_equal ' ', response.body
     assert_equal 1, controller.instance_variable_get(:@try)
-    assert controller.instance_variable_get(:@before_filter_chain_aborted)
   end
 
   def test_second_filter_in_multiple_before_filter_chain_halts
@@ -909,7 +905,6 @@ class YieldingAroundFiltersTest &lt; ActionController::TestCase
     response = test_process(controller, 'fail_2')
     assert_equal ' ', response.body
     assert_equal 2, controller.instance_variable_get(:@try)
-    assert controller.instance_variable_get(:@before_filter_chain_aborted)
   end
 
   def test_last_filter_in_multiple_before_filter_chain_halts
@@ -917,7 +912,6 @@ class YieldingAroundFiltersTest &lt; ActionController::TestCase
     response = test_process(controller, 'fail_3')
     assert_equal ' ', response.body
     assert_equal 3, controller.instance_variable_get(:@try)
-    assert controller.instance_variable_get(:@before_filter_chain_aborted)
   end
 
   protected</diff>
      <filename>actionpack/test/controller/filters_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -127,7 +127,7 @@ class HelperTest &lt; Test::Unit::TestCase
   end
 
   def test_all_helpers
-    methods = AllHelpersController.master_helper_module.instance_methods.map(&amp;:to_s)
+    methods = AllHelpersController._helpers.instance_methods.map {|m| m.to_s}
 
     # abc_helper.rb
     assert methods.include?('bare_a')
@@ -143,7 +143,7 @@ class HelperTest &lt; Test::Unit::TestCase
     @controller_class.helpers_dir = File.dirname(__FILE__) + '/../fixtures/alternate_helpers'
 
     # Reload helpers
-    @controller_class.master_helper_module = Module.new
+    @controller_class._helpers = Module.new
     @controller_class.helper :all
 
     # helpers/abc_helper.rb should not be included
@@ -171,11 +171,11 @@ class HelperTest &lt; Test::Unit::TestCase
 
   private
     def expected_helper_methods
-      TestHelper.instance_methods.map(&amp;:to_s)
+      TestHelper.instance_methods.map {|m| m.to_s }
     end
 
     def master_helper_methods
-      @controller_class.master_helper_module.instance_methods.map(&amp;:to_s)
+      @controller_class._helpers.instance_methods.map {|m| m.to_s }
     end
 
     def missing_methods</diff>
      <filename>actionpack/test/controller/helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -76,6 +76,15 @@ class HttpDigestAuthenticationTest &lt; ActionController::TestCase
     assert_equal 'SuperSecret', credentials[:realm]
   end
 
+  test &quot;authentication request with nil credentials&quot; do
+    @request.env['HTTP_AUTHORIZATION'] = encode_credentials(:username =&gt; nil, :password =&gt; nil)
+    get :index
+
+    assert_response :unauthorized
+    assert_equal &quot;HTTP Digest: Access denied.\n&quot;, @response.body, &quot;Authentication didn't fail for request&quot;
+    assert_not_equal 'Hello Secret', @response.body, &quot;Authentication didn't fail for request&quot;
+  end
+
   test &quot;authentication request with invalid password&quot; do
     @request.env['HTTP_AUTHORIZATION'] = encode_credentials(:username =&gt; 'pretty', :password =&gt; 'foo')
     get :display
@@ -168,6 +177,11 @@ class HttpDigestAuthenticationTest &lt; ActionController::TestCase
     assert_equal 'Definitely Maybe', @response.body
   end
 
+  test &quot;validate_digest_response should fail with nil returning password_procedure&quot; do
+    @request.env['HTTP_AUTHORIZATION'] = encode_credentials(:username =&gt; nil, :password =&gt; nil)
+    assert !ActionController::HttpAuthentication::Digest.validate_digest_response(@request, &quot;SuperSecret&quot;){nil}
+  end
+
   private
 
   def encode_credentials(options)</diff>
      <filename>actionpack/test/controller/http_digest_authentication_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -38,15 +38,6 @@ end
 class MultipleExtensions &lt; LayoutTest
 end
 
-if defined?(ActionController::Http)
-  LayoutTest._write_layout_method
-  ProductController._write_layout_method
-  ItemController._write_layout_method
-  ThirdPartyTemplateLibraryController._write_layout_method
-  MultipleExtensions._write_layout_method
-  ControllerNameSpace::NestedController._write_layout_method
-end
-
 class LayoutAutoDiscoveryTest &lt; ActionController::TestCase
   def setup
     super
@@ -174,26 +165,10 @@ class LayoutSetInResponseTest &lt; ActionController::TestCase
     assert_nil @controller.template.layout
   end
 
-  for_tag(:old_base) do
-    # exempt_from_layout is deprecated
-    def test_exempt_from_layout_honored_by_render_template
-      ActionController::Base.exempt_from_layout :erb
-      @controller = RenderWithTemplateOptionController.new
-
-      get :hello
-      assert_equal &quot;alt/hello.rhtml&quot;, @response.body.strip
-
-    ensure
-      ActionController::Base.exempt_from_layout.delete(ERB)
-    end
-  end
-
   def test_layout_is_picked_from_the_controller_instances_view_path
-    pending do
-      @controller = PrependsViewPathController.new
-      get :hello
-      assert_equal 'layouts/alt', @controller.template.layout
-    end
+    @controller = PrependsViewPathController.new
+    get :hello
+    assert @controller.template.layout =~ /layouts\/alt\.\w+/
   end
 
   def test_absolute_pathed_layout</diff>
      <filename>actionpack/test/controller/layout_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -375,11 +375,9 @@ class MimeControllerTest &lt; ActionController::TestCase
   end
 
   def test_rjs_type_skips_layout
-    pending(:new_base) do
-      @request.accept = &quot;text/javascript&quot;
-      get :all_types_with_layout
-      assert_equal 'RJS for all_types_with_layout', @response.body
-    end
+    @request.accept = &quot;text/javascript&quot;
+    get :all_types_with_layout
+    assert_equal 'RJS for all_types_with_layout', @response.body
   end
 
   def test_html_type_with_layout
@@ -467,14 +465,6 @@ class MimeControllerTest &lt; ActionController::TestCase
     assert_equal '&lt;html&gt;&lt;div id=&quot;iphone&quot;&gt;Hello iPhone future from iPhone!&lt;/div&gt;&lt;/html&gt;', @response.body
     assert_equal &quot;text/html&quot;, @response.content_type
   end
-
-  def test_format_with_custom_response_type_and_request_headers_with_only_one_layout_present
-    get :iphone_with_html_response_type_without_layout
-    assert_equal '&lt;html&gt;&lt;div id=&quot;html_missing&quot;&gt;Hello future from Firefox!&lt;/div&gt;&lt;/html&gt;', @response.body
-
-    @request.accept = &quot;text/iphone&quot;
-    assert_raise(ActionView::MissingTemplate) { get :iphone_with_html_response_type_without_layout }
-  end
 end
 
 class AbstractPostController &lt; ActionController::Base
@@ -512,11 +502,6 @@ class SuperPostController &lt; PostController
   end
 end
 
-if defined?(ActionController::Http)
-  PostController._write_layout_method
-  SuperPostController._write_layout_method
-end
-
 class MimeControllerLayoutsTest &lt; ActionController::TestCase
   tests PostController
 
@@ -534,16 +519,14 @@ class MimeControllerLayoutsTest &lt; ActionController::TestCase
     assert_equal 'Hello iPhone', @response.body
   end
 
-  for_tag(:old_base) do
-    def test_format_with_inherited_layouts
-      @controller = SuperPostController.new
+  def test_format_with_inherited_layouts
+    @controller = SuperPostController.new
 
-      get :index
-      assert_equal 'Super Firefox', @response.body
+    get :index
+    assert_equal '&lt;html&gt;&lt;div id=&quot;html&quot;&gt;Super Firefox&lt;/div&gt;&lt;/html&gt;', @response.body
 
-      @request.accept = &quot;text/iphone&quot;
-      get :index
-      assert_equal '&lt;html&gt;&lt;div id=&quot;super_iphone&quot;&gt;Super iPhone&lt;/div&gt;&lt;/html&gt;', @response.body
-    end
+    @request.accept = &quot;text/iphone&quot;
+    get :index
+    assert_equal '&lt;html&gt;&lt;div id=&quot;super_iphone&quot;&gt;Super iPhone&lt;/div&gt;&lt;/html&gt;', @response.body
   end
 end</diff>
      <filename>actionpack/test/controller/mime_responds_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,8 @@
 require 'abstract_unit'
 
 class Comment
+  extend ActiveModel::Naming
+
   attr_reader :id
   def save; @id = 1 end
   def new_record?; @id.nil? end</diff>
      <filename>actionpack/test/controller/record_identifier_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ class WorkshopsController &lt; ActionController::Base
 end
 
 class Workshop
+  extend ActiveModel::Naming
   attr_accessor :id, :new_record
 
   def initialize(id, new_record)</diff>
      <filename>actionpack/test/controller/redirect_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -301,6 +301,9 @@ class TestController &lt; ActionController::Base
   def render_implicit_html_template_from_xhr_request
   end
 
+  def render_implicit_js_template_without_layout
+  end
+
   def formatted_html_erb
   end
 
@@ -928,16 +931,13 @@ class RenderTest &lt; ActionController::TestCase
   end
 
   def test_should_implicitly_render_html_template_from_xhr_request
-    pending
-    # xhr :get, :render_implicit_html_template_from_xhr_request
-    # assert_equal &quot;XHR!\nHello HTML!&quot;, @response.body
+    xhr :get, :render_implicit_html_template_from_xhr_request
+    assert_equal &quot;XHR!\nHello HTML!&quot;, @response.body
   end
 
   def test_should_implicitly_render_js_template_without_layout
-    pending do
-      get :render_implicit_js_template_without_layout, :format =&gt; :js
-      assert_no_match %r{&lt;html&gt;}, @response.body
-    end
+    get :render_implicit_js_template_without_layout, :format =&gt; :js
+    assert_no_match %r{&lt;html&gt;}, @response.body
   end
 
   def test_should_render_formatted_template
@@ -1268,13 +1268,6 @@ class RenderTest &lt; ActionController::TestCase
     assert_equal &quot;Hola: PratikHola: Amy&quot;, @response.body
   end
 
-  def test_partial_with_implicit_local_assignment
-    assert_deprecated do
-      get :partial_with_implicit_local_assignment
-      assert_equal &quot;Hello: Marcel&quot;, @response.body
-    end
-  end
-
   def test_render_missing_partial_template
     assert_raise(ActionView::MissingTemplate) do
       get :missing_partial</diff>
      <filename>actionpack/test/controller/render_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1623,13 +1623,13 @@ class RouteSetTest &lt; Test::Unit::TestCase
     set.draw { |m| m.connect ':controller/:action/:id' }
     path, extras = set.generate_extras(:controller =&gt; &quot;foo&quot;, :action =&gt; &quot;bar&quot;, :id =&gt; 15, :this =&gt; &quot;hello&quot;, :that =&gt; &quot;world&quot;)
     assert_equal &quot;/foo/bar/15&quot;, path
-    assert_equal %w(that this), extras.map(&amp;:to_s).sort
+    assert_equal %w(that this), extras.map { |e| e.to_s }.sort
   end
 
   def test_extra_keys
     set.draw { |m| m.connect ':controller/:action/:id' }
     extras = set.extra_keys(:controller =&gt; &quot;foo&quot;, :action =&gt; &quot;bar&quot;, :id =&gt; 15, :this =&gt; &quot;hello&quot;, :that =&gt; &quot;world&quot;)
-    assert_equal %w(that this), extras.map(&amp;:to_s).sort
+    assert_equal %w(that this), extras.map { |e| e.to_s }.sort
   end
 
   def test_generate_extras_not_first
@@ -1639,7 +1639,7 @@ class RouteSetTest &lt; Test::Unit::TestCase
     end
     path, extras = set.generate_extras(:controller =&gt; &quot;foo&quot;, :action =&gt; &quot;bar&quot;, :id =&gt; 15, :this =&gt; &quot;hello&quot;, :that =&gt; &quot;world&quot;)
     assert_equal &quot;/foo/bar/15&quot;, path
-    assert_equal %w(that this), extras.map(&amp;:to_s).sort
+    assert_equal %w(that this), extras.map { |e| e.to_s }.sort
   end
 
   def test_generate_not_first
@@ -1656,7 +1656,7 @@ class RouteSetTest &lt; Test::Unit::TestCase
       map.connect ':controller/:action/:id'
     end
     extras = set.extra_keys(:controller =&gt; &quot;foo&quot;, :action =&gt; &quot;bar&quot;, :id =&gt; 15, :this =&gt; &quot;hello&quot;, :that =&gt; &quot;world&quot;)
-    assert_equal %w(that this), extras.map(&amp;:to_s).sort
+    assert_equal %w(that this), extras.map { |e| e.to_s }.sort
   end
 
   def test_draw
@@ -1667,6 +1667,17 @@ class RouteSetTest &lt; Test::Unit::TestCase
     assert_equal 1, set.routes.size
   end
 
+  def test_draw_symbol_controller_name
+    assert_equal 0, set.routes.size
+    set.draw do |map|
+      map.connect '/users/index', :controller =&gt; :users, :action =&gt; :index
+    end
+    @request = ActionController::TestRequest.new
+    @request.request_uri = '/users/index'
+    assert_nothing_raised { set.recognize(@request) }
+    assert_equal 1, set.routes.size
+  end
+
   def test_named_draw
     assert_equal 0, set.routes.size
     set.draw do |map|
@@ -2481,6 +2492,16 @@ class RouteSetTest &lt; Test::Unit::TestCase
     end
     assert_equal({:controller =&gt; 'pages', :action =&gt; 'show', :name =&gt; 'JAMIS'}, set.recognize_path('/page/JAMIS'))
   end
+
+  def test_routes_with_symbols
+    set.draw do |map|
+      map.connect 'unnamed', :controller =&gt; :pages, :action =&gt; :show, :name =&gt; :as_symbol
+      map.named   'named',   :controller =&gt; :pages, :action =&gt; :show, :name =&gt; :as_symbol
+    end
+    assert_equal({:controller =&gt; 'pages', :action =&gt; 'show', :name =&gt; :as_symbol}, set.recognize_path('/unnamed'))
+    assert_equal({:controller =&gt; 'pages', :action =&gt; 'show', :name =&gt; :as_symbol}, set.recognize_path('/named'))
+  end
+
 end
 
 class RouteLoadingTest &lt; Test::Unit::TestCase</diff>
      <filename>actionpack/test/controller/routing_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -45,8 +45,8 @@ class SendFileTest &lt; ActionController::TestCase
     assert_equal file_data, response.body
   end
 
-  for_tag(:old_base) do
-    def test_file_stream
+  def test_file_stream
+    pending do
       response = nil
       assert_nothing_raised { response = process('file') }
       assert_not_nil response
@@ -91,10 +91,10 @@ class SendFileTest &lt; ActionController::TestCase
 
   def test_headers_after_send_shouldnt_include_charset
     response = process('data')
-    assert_equal &quot;application/octet-stream&quot;, response.content_type
+    assert_equal &quot;application/octet-stream&quot;, response.headers[&quot;Content-Type&quot;]
 
     response = process('file')
-    assert_equal &quot;application/octet-stream&quot;, response.content_type
+    assert_equal &quot;application/octet-stream&quot;, response.headers[&quot;Content-Type&quot;]
   end
 
   # Test that send_file_headers! is setting the correct HTTP headers.
@@ -115,8 +115,8 @@ class SendFileTest &lt; ActionController::TestCase
     @controller.send(:send_file_headers!, options)
 
     h = @controller.headers
-    assert_equal 1, h['Content-Length']
-    assert_equal 'image/png', h['Content-Type']
+    assert_equal '1', h['Content-Length']
+    assert_equal 'image/png', @controller.content_type
     assert_equal 'disposition; filename=&quot;filename&quot;', h['Content-Disposition']
     assert_equal 'binary', h['Content-Transfer-Encoding']
 
@@ -136,9 +136,7 @@ class SendFileTest &lt; ActionController::TestCase
     @controller.headers = {}
     @controller.send(:send_file_headers!, options)
 
-    headers = @controller.headers
-
-    assert_equal 'image/png', headers['Content-Type']
+    assert_equal 'image/png', @controller.content_type
   end
   
 </diff>
      <filename>actionpack/test/controller/send_file_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -56,7 +56,7 @@ class MimeTypeTest &lt; ActiveSupport::TestCase
 
   test &quot;type convenience methods&quot; do
     # Don't test Mime::ALL, since it Mime::ALL#html? == true
-    types = Mime::SET.to_a.map(&amp;:to_sym).uniq - [:all]
+    types = Mime::SET.symbols.uniq - [:all]
 
     # Remove custom Mime::Type instances set in other tests, like Mime::GIF and Mime::IPHONE
     types.delete_if { |type| !Mime.const_defined?(type.to_s.upcase) }
@@ -76,7 +76,7 @@ class MimeTypeTest &lt; ActiveSupport::TestCase
   end
 
   test &quot;verifiable mime types&quot; do
-    all_types = Mime::SET.to_a.map(&amp;:to_sym)
+    all_types = Mime::SET.symbols
     all_types.uniq!
     # Remove custom Mime::Type instances set in other tests, like Mime::GIF and Mime::IPHONE
     all_types.delete_if { |type| !Mime.const_defined?(type.to_s.upcase) }</diff>
      <filename>actionpack/test/dispatch/mime_type_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,3 @@
 xml.wrapper do
-  xml &lt;&lt; @content_for_layout
+  xml &lt;&lt; yield
 end
\ No newline at end of file</diff>
      <filename>actionpack/test/fixtures/layouts/builder.builder</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1 @@
-&lt;html&gt;&lt;%= @content_for_layout %&gt;&lt;%= @variable_for_layout %&gt;&lt;/html&gt;
\ No newline at end of file
+&lt;html&gt;&lt;%= yield %&gt;&lt;%= @variable_for_layout %&gt;&lt;/html&gt;
\ No newline at end of file</diff>
      <filename>actionpack/test/fixtures/layouts/standard.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,2 +1,2 @@
-&lt;title&gt;&lt;%= @title || @content_for_title %&gt;&lt;/title&gt;
-&lt;%= @content_for_layout -%&gt;
\ No newline at end of file
+&lt;title&gt;&lt;%= @title || yield(:title) %&gt;&lt;/title&gt;
+&lt;%= yield -%&gt;
\ No newline at end of file</diff>
      <filename>actionpack/test/fixtures/layouts/talk_from_action.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1 @@
-&lt;%= local_assigns.keys.map(&amp;:to_s).sort.join(&quot;,&quot;) -%&gt;
\ No newline at end of file
+&lt;%= local_assigns.keys.map {|k| k.to_s }.sort.join(&quot;,&quot;) -%&gt;
\ No newline at end of file</diff>
      <filename>actionpack/test/fixtures/test/_local_inspector.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,3 @@
-&lt;%# encoding: utf-8 -%&gt;
 &#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081; &#1090;&#1077;&#1082;&#1089;&#1090;
 &lt;%= &quot;&#26085;&quot;.encoding %&gt;
 &lt;%= @output_buffer.encoding %&gt;</diff>
      <filename>actionpack/test/fixtures/test/utf8.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,8 @@
+require &quot;active_model&quot;
+
 class Customer &lt; Struct.new(:name, :id)
+  extend ActiveModel::Naming
+
   def to_param
     id.to_s
   end
@@ -12,6 +16,8 @@ end
 
 module Quiz
   class Question &lt; Struct.new(:name, :id)
+    extend ActiveModel::Naming
+
     def to_param
       id.to_s
     end</diff>
      <filename>actionpack/test/lib/controller/fake_models.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,5 @@
 module ActionView #:nodoc:
-class Template
-  class FixturePath &lt; Path
+  class FixtureResolver &lt; Resolver
     def initialize(hash = {}, options = {})
       super(options)
       @hash = hash
@@ -13,7 +12,7 @@ class Template
           @hash.select { |k,v| k =~ regexp }.each do |path, source|
             templates &lt;&lt; Template.new(source, path, *path_to_details(path))
           end
-          templates
+          templates.sort_by {|t| -t.details.values.compact.size }
         end
       end
     end
@@ -22,7 +21,7 @@ class Template
   
     def formats_regexp
       @formats_regexp ||= begin
-        formats = Mime::SET.map { |m| m.symbol }
+        formats = Mime::SET.symbols
         '(?:' + formats.map { |l| &quot;\\.#{Regexp.escape(l.to_s)}&quot; }.join('|') + ')?'
       end
     end
@@ -45,7 +44,7 @@ class Template
           k == :formats ? formats_regexp : ''
         end
       end
-      
+
       %r'^#{Regexp.escape(path)}#{extensions}#{handler_regexp}$'
     end
     
@@ -53,7 +52,7 @@ class Template
     # :api: plugin
     def path_to_details(path)
       # [:erb, :format =&gt; :html, :locale =&gt; :en, :partial =&gt; true/false]
-      if m = path.match(%r'(_)?[\w-]+(\.[\w-]+)*\.(\w+)$')
+      if m = path.match(%r'(_)?[\w-]+((?:\.[\w-]+)*)\.(\w+)$')
         partial = m[1] == '_'
         details = (m[2]||&quot;&quot;).split('.').reject { |e| e.empty? }
         handler = Template.handler_class_for_extension(m[3])
@@ -65,40 +64,4 @@ class Template
       end
     end
   end
-  
-  
-  # class FixtureTemplate &lt; Template
-  #   class FixturePath &lt; Template::Path
-  #     def initialize(hash = {})
-  #       @hash = {}
-  #       
-  #       hash.each do |k, v|
-  #         @hash[k.sub(/\.\w+$/, '')] = FixtureTemplate.new(v, k.split(&quot;/&quot;).last, self)
-  #       end
-  #       
-  #       super(&quot;fixtures://root&quot;)
-  #     end
-  #     
-  #     def find_template(path)
-  #       @hash[path]
-  #     end
-  #   end
-  #   
-  #   def initialize(body, *args)
-  #     @body = body
-  #     super(*args)
-  #   end
-  #   
-  #   def source
-  #     @body
-  #   end
-  # 
-  # private
-  # 
-  #   def find_full_path(path, load_paths)
-  #     return '/', path
-  #   end
-  # 
-  # end
-end
 end
\ No newline at end of file</diff>
      <filename>actionpack/test/lib/fixture_template.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@ module ContentType
   class ImpliedController &lt; ActionController::Base
     # Template's mime type is used if no content_type is specified
 
-    self.view_paths = [ActionView::Template::FixturePath.new(
+    self.view_paths = [ActionView::FixtureResolver.new(
       &quot;content_type/implied/i_am_html_erb.html.erb&quot;         =&gt; &quot;Hello world!&quot;,
       &quot;content_type/implied/i_am_xml_erb.xml.erb&quot;          =&gt; &quot;&lt;xml&gt;Hello world!&lt;/xml&gt;&quot;,
       &quot;content_type/implied/i_am_html_builder.html.builder&quot; =&gt; &quot;xml.p 'Hello'&quot;,</diff>
      <filename>actionpack/test/new_base/content_type_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ require File.join(File.expand_path(File.dirname(__FILE__)), &quot;test_helper&quot;)
 
 module Etags
   class BasicController &lt; ActionController::Base
-    self.view_paths = [ActionView::Template::FixturePath.new(
+    self.view_paths = [ActionView::FixtureResolver.new(
       &quot;etags/basic/base.html.erb&quot; =&gt; &quot;Hello from without_layout.html.erb&quot;,
       &quot;layouts/etags.html.erb&quot;    =&gt; &quot;teh &lt;%= yield %&gt; tagz&quot;
     )]</diff>
      <filename>actionpack/test/new_base/etag_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ require File.join(File.expand_path(File.dirname(__FILE__)), &quot;test_helper&quot;)
 module RenderAction
   # This has no layout and it works
   class BasicController &lt; ActionController::Base
-    self.view_paths = [ActionView::Template::FixturePath.new(
+    self.view_paths = [ActionView::FixtureResolver.new(
       &quot;render_action/basic/hello_world.html.erb&quot; =&gt; &quot;Hello world!&quot;
     )]
 
@@ -117,7 +117,7 @@ module RenderActionWithApplicationLayout
   # # ==== Render actions with layouts ====
   class BasicController &lt; ::ApplicationController
     # Set the view path to an application view structure with layouts
-    self.view_paths = self.view_paths = [ActionView::Template::FixturePath.new(
+    self.view_paths = self.view_paths = [ActionView::FixtureResolver.new(
       &quot;render_action_with_application_layout/basic/hello_world.html.erb&quot; =&gt; &quot;Hello World!&quot;,
       &quot;render_action_with_application_layout/basic/hello.html.builder&quot;   =&gt; &quot;xml.p 'Omg'&quot;,
       &quot;layouts/application.html.erb&quot;                                     =&gt; &quot;OHAI &lt;%= yield %&gt; KTHXBAI&quot;,
@@ -202,7 +202,7 @@ end
 
 module RenderActionWithControllerLayout
   class BasicController &lt; ActionController::Base
-    self.view_paths = self.view_paths = [ActionView::Template::FixturePath.new(
+    self.view_paths = self.view_paths = [ActionView::FixtureResolver.new(
       &quot;render_action_with_controller_layout/basic/hello_world.html.erb&quot; =&gt; &quot;Hello World!&quot;,
       &quot;layouts/render_action_with_controller_layout/basic.html.erb&quot;     =&gt; &quot;With Controller Layout! &lt;%= yield %&gt; KTHXBAI&quot;
     )]
@@ -263,7 +263,7 @@ end
 
 module RenderActionWithBothLayouts
   class BasicController &lt; ActionController::Base
-    self.view_paths = [ActionView::Template::FixturePath.new({
+    self.view_paths = [ActionView::FixtureResolver.new({
       &quot;render_action_with_both_layouts/basic/hello_world.html.erb&quot; =&gt; &quot;Hello World!&quot;,
       &quot;layouts/application.html.erb&quot;                                =&gt; &quot;OHAI &lt;%= yield %&gt; KTHXBAI&quot;,
       &quot;layouts/render_action_with_both_layouts/basic.html.erb&quot;      =&gt; &quot;With Controller Layout! &lt;%= yield %&gt; KTHXBAI&quot;</diff>
      <filename>actionpack/test/new_base/render_action_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ require File.join(File.expand_path(File.dirname(__FILE__)), &quot;test_helper&quot;)
 
 module RenderImplicitAction
   class SimpleController &lt; ::ApplicationController
-    self.view_paths = [ActionView::Template::FixturePath.new(
+    self.view_paths = [ActionView::FixtureResolver.new(
       &quot;render_implicit_action/simple/hello_world.html.erb&quot; =&gt; &quot;Hello world!&quot;,
       &quot;render_implicit_action/simple/hyphen-ated.html.erb&quot; =&gt; &quot;Hello hyphen-ated!&quot;
     )]</diff>
      <filename>actionpack/test/new_base/render_implicit_action_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ require File.join(File.expand_path(File.dirname(__FILE__)), &quot;test_helper&quot;)
 
 module ControllerLayouts
   class ImplicitController &lt; ::ApplicationController
-    self.view_paths = [ActionView::Template::FixturePath.new(
+    self.view_paths = [ActionView::FixtureResolver.new(
       &quot;layouts/application.html.erb&quot; =&gt; &quot;OMG &lt;%= yield %&gt; KTHXBAI&quot;,
       &quot;layouts/override.html.erb&quot;    =&gt; &quot;Override! &lt;%= yield %&gt;&quot;,
       &quot;basic.html.erb&quot;               =&gt; &quot;Hello world!&quot;,
@@ -26,7 +26,7 @@ module ControllerLayouts
   end
 
   class ImplicitNameController &lt; ::ApplicationController
-    self.view_paths = [ActionView::Template::FixturePath.new(
+    self.view_paths = [ActionView::FixtureResolver.new(
       &quot;layouts/controller_layouts/implicit_name.html.erb&quot; =&gt; &quot;OMGIMPLICIT &lt;%= yield %&gt; KTHXBAI&quot;,
       &quot;basic.html.erb&quot; =&gt; &quot;Hello world!&quot;
     )]
@@ -68,7 +68,7 @@ module ControllerLayouts
   end
 
   class MismatchFormatController &lt; ::ApplicationController
-    self.view_paths = [ActionView::Template::FixturePath.new(
+    self.view_paths = [ActionView::FixtureResolver.new(
       &quot;layouts/application.html.erb&quot; =&gt; &quot;&lt;html&gt;&lt;%= yield %&gt;&lt;/html&gt;&quot;,
       &quot;controller_layouts/mismatch_format/index.js.rjs&quot; =&gt; &quot;page[:test].omg&quot;,
       &quot;controller_layouts/mismatch_format/implicit.rjs&quot; =&gt; &quot;page[:test].omg&quot;      </diff>
      <filename>actionpack/test/new_base/render_layout_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ module RenderPartial
   
   class BasicController &lt; ActionController::Base
     
-    self.view_paths = [ActionView::Template::FixturePath.new(
+    self.view_paths = [ActionView::FixtureResolver.new(
       &quot;render_partial/basic/_basic.html.erb&quot;    =&gt; &quot;OMG!&quot;,
       &quot;render_partial/basic/basic.html.erb&quot;      =&gt; &quot;&lt;%= @test_unchanged = 'goodbye' %&gt;&lt;%= render :partial =&gt; 'basic' %&gt;&lt;%= @test_unchanged %&gt;&quot;
     )]</diff>
      <filename>actionpack/test/new_base/render_partial_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ require File.join(File.expand_path(File.dirname(__FILE__)), &quot;test_helper&quot;)
 module RenderTemplate
   class WithoutLayoutController &lt; ActionController::Base
     
-    self.view_paths = [ActionView::Template::FixturePath.new(
+    self.view_paths = [ActionView::FixtureResolver.new(
       &quot;test/basic.html.erb&quot;      =&gt; &quot;Hello from basic.html.erb&quot;,
       &quot;shared.html.erb&quot;          =&gt; &quot;Elastica&quot;,
       &quot;locals.html.erb&quot;          =&gt; &quot;The secret is &lt;%= secret %&gt;&quot;,
@@ -79,7 +79,7 @@ module RenderTemplate
   end
     
   class WithLayoutController &lt; ::ApplicationController
-    self.view_paths = [ActionView::Template::FixturePath.new(
+    self.view_paths = [ActionView::FixtureResolver.new(
       &quot;test/basic.html.erb&quot;          =&gt; &quot;Hello from basic.html.erb&quot;,
       &quot;shared.html.erb&quot;              =&gt; &quot;Elastica&quot;,
       &quot;layouts/application.html.erb&quot; =&gt; &quot;&lt;%= yield %&gt;, I'm here!&quot;,
@@ -148,7 +148,7 @@ module RenderTemplate
 
   module Compatibility
     class WithoutLayoutController &lt; ActionController::Base
-      self.view_paths = [ActionView::Template::FixturePath.new(
+      self.view_paths = [ActionView::FixtureResolver.new(
         &quot;test/basic.html.erb&quot; =&gt; &quot;Hello from basic.html.erb&quot;,
         &quot;shared.html.erb&quot;     =&gt; &quot;Elastica&quot;
       )]</diff>
      <filename>actionpack/test/new_base/render_template_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ require File.join(File.expand_path(File.dirname(__FILE__)), &quot;test_helper&quot;)
 
 module Render
   class BlankRenderController &lt; ActionController::Base
-    self.view_paths = [ActionView::Template::FixturePath.new(
+    self.view_paths = [ActionView::FixtureResolver.new(
       &quot;render/blank_render/index.html.erb&quot;                  =&gt; &quot;Hello world!&quot;,
       &quot;render/blank_render/access_request.html.erb&quot;         =&gt; &quot;The request: &lt;%= request.method.to_s.upcase %&gt;&quot;,
       &quot;render/blank_render/access_action_name.html.erb&quot;     =&gt; &quot;Action Name: &lt;%= action_name %&gt;&quot;,</diff>
      <filename>actionpack/test/new_base/render_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ require File.join(File.expand_path(File.dirname(__FILE__)), &quot;test_helper&quot;)
 
 module RenderText
   class SimpleController &lt; ActionController::Base
-    self.view_paths = [ActionView::Template::FixturePath.new]
+    self.view_paths = [ActionView::FixtureResolver.new]
     
     def index
       render :text =&gt; &quot;hello david&quot;
@@ -10,7 +10,7 @@ module RenderText
   end
 
   class WithLayoutController &lt; ::ApplicationController
-    self.view_paths = [ActionView::Template::FixturePath.new(
+    self.view_paths = [ActionView::FixtureResolver.new(
       &quot;layouts/application.html.erb&quot; =&gt; &quot;&lt;%= yield %&gt;, I'm here!&quot;,
       &quot;layouts/greetings.html.erb&quot;   =&gt; &quot;&lt;%= yield %&gt;, I wish thee well.&quot;,
       &quot;layouts/ivar.html.erb&quot;        =&gt; &quot;&lt;%= yield %&gt;, &lt;%= @ivar %&gt;&quot;
@@ -134,6 +134,4 @@ module RenderText
       assert_status 200
     end
   end
-end
-
-ActionController::Base.app_loaded!
+end
\ No newline at end of file</diff>
      <filename>actionpack/test/new_base/render_text_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ module RenderXml
   
   # This has no layout and it works
   class BasicController &lt; ActionController::Base
-    self.view_paths = [ActionView::Template::FixturePath.new(
+    self.view_paths = [ActionView::FixtureResolver.new(
       &quot;render_xml/basic/with_render_erb&quot; =&gt; &quot;Hello world!&quot;
     )]
   end</diff>
      <filename>actionpack/test/new_base/render_xml_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -16,8 +16,7 @@ rescue LoadError
   # Debugging disabled. `gem install ruby-debug` to enable.
 end
 
-require 'action_controller/abstract'
-require 'action_controller/new_base'
+require 'action_controller'
 require 'pp' # require 'pp' early to prevent hidden_methods from not picking up the pretty-print methods until too late
 
 require 'action_controller/testing/process'
@@ -42,15 +41,6 @@ class Rack::TestCase &lt; ActionController::IntegrationTest
     end
 
     ActionController::Routing.use_controllers!(controllers)
-
-    # Move into a bootloader
-    ActionController::Base.subclasses.each do |klass|
-      klass = klass.constantize
-      next unless klass &lt; AbstractController::Layouts
-      klass.class_eval do
-        _write_layout_method
-      end
-    end
   end
 
   def app</diff>
      <filename>actionpack/test/new_base/test_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -33,8 +33,8 @@ class ActiveRecordHelperTest &lt; ActionView::TestCase
         [&quot;Author name can't be &lt;em&gt;empty&lt;/em&gt;&quot;]
       end
 
-      def on(field)
-        &quot;can't be &lt;em&gt;empty&lt;/em&gt;&quot;
+      def [](field)
+        [&quot;can't be &lt;em&gt;empty&lt;/em&gt;&quot;]
       end
     end
 
@@ -47,14 +47,14 @@ class ActiveRecordHelperTest &lt; ActionView::TestCase
     @post = Post.new
     def @post.errors
       Class.new {
-        def on(field)
+        def [](field)
           case field.to_s
           when &quot;author_name&quot;
-            &quot;can't be empty&quot;
+            [&quot;can't be empty&quot;]
           when &quot;body&quot;
-            true
+            ['foo']
           else
-            false
+            []
           end
         end
         def empty?() false end
@@ -85,7 +85,7 @@ class ActiveRecordHelperTest &lt; ActionView::TestCase
     @user = User.new
     def @user.errors
       Class.new {
-        def on(field) field == &quot;email&quot; end
+        def [](field) field == &quot;email&quot; ? ['nonempty'] : [] end
         def empty?() false end
         def count() 1 end
         def full_messages() [ &quot;User email can't be empty&quot; ] end
@@ -171,7 +171,7 @@ class ActiveRecordHelperTest &lt; ActionView::TestCase
     @request_forgery_protection_token = 'authenticity_token'
     @form_authenticity_token = '123'
     assert_dom_equal(
-      %(&lt;form action=&quot;create&quot; method=&quot;post&quot;&gt;&lt;div style='margin:0;padding:0'&gt;&lt;input type='hidden' name='authenticity_token' value='123' /&gt;&lt;/div&gt;&lt;p&gt;&lt;label for=&quot;post_title&quot;&gt;Title&lt;/label&gt;&lt;br /&gt;&lt;input id=&quot;post_title&quot; name=&quot;post[title]&quot; size=&quot;30&quot; type=&quot;text&quot; value=&quot;Hello World&quot; /&gt;&lt;/p&gt;\n&lt;p&gt;&lt;label for=&quot;post_body&quot;&gt;Body&lt;/label&gt;&lt;br /&gt;&lt;div class=&quot;fieldWithErrors&quot;&gt;&lt;textarea cols=&quot;40&quot; id=&quot;post_body&quot; name=&quot;post[body]&quot; rows=&quot;20&quot;&gt;Back to the hill and over it again!&lt;/textarea&gt;&lt;/div&gt;&lt;/p&gt;&lt;input name=&quot;commit&quot; type=&quot;submit&quot; value=&quot;Create&quot; /&gt;&lt;/form&gt;),
+      %(&lt;form action=&quot;create&quot; method=&quot;post&quot;&gt;&lt;div style='margin:0;padding:0;display:inline'&gt;&lt;input type='hidden' name='authenticity_token' value='123' /&gt;&lt;/div&gt;&lt;p&gt;&lt;label for=&quot;post_title&quot;&gt;Title&lt;/label&gt;&lt;br /&gt;&lt;input id=&quot;post_title&quot; name=&quot;post[title]&quot; size=&quot;30&quot; type=&quot;text&quot; value=&quot;Hello World&quot; /&gt;&lt;/p&gt;\n&lt;p&gt;&lt;label for=&quot;post_body&quot;&gt;Body&lt;/label&gt;&lt;br /&gt;&lt;div class=&quot;fieldWithErrors&quot;&gt;&lt;textarea cols=&quot;40&quot; id=&quot;post_body&quot; name=&quot;post[body]&quot; rows=&quot;20&quot;&gt;Back to the hill and over it again!&lt;/textarea&gt;&lt;/div&gt;&lt;/p&gt;&lt;input name=&quot;commit&quot; type=&quot;submit&quot; value=&quot;Create&quot; /&gt;&lt;/form&gt;),
       form(&quot;post&quot;)
     )
   end</diff>
      <filename>actionpack/test/template/active_record_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -75,22 +75,22 @@ class AssetTagHelperTest &lt; ActionView::TestCase
   }
 
   JavascriptIncludeToTag = {
-    %(javascript_include_tag(&quot;xmlhr&quot;)) =&gt; %(&lt;script src=&quot;/javascripts/xmlhr.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;),
-    %(javascript_include_tag(&quot;xmlhr.js&quot;)) =&gt; %(&lt;script src=&quot;/javascripts/xmlhr.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;),
-    %(javascript_include_tag(&quot;xmlhr&quot;, :lang =&gt; &quot;vbscript&quot;)) =&gt; %(&lt;script lang=&quot;vbscript&quot; src=&quot;/javascripts/xmlhr.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;),
+    %(javascript_include_tag(&quot;bank&quot;)) =&gt; %(&lt;script src=&quot;/javascripts/bank.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;),
+    %(javascript_include_tag(&quot;bank.js&quot;)) =&gt; %(&lt;script src=&quot;/javascripts/bank.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;),
+    %(javascript_include_tag(&quot;bank&quot;, :lang =&gt; &quot;vbscript&quot;)) =&gt; %(&lt;script lang=&quot;vbscript&quot; src=&quot;/javascripts/bank.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;),
     %(javascript_include_tag(&quot;common.javascript&quot;, &quot;/elsewhere/cools&quot;)) =&gt; %(&lt;script src=&quot;/javascripts/common.javascript&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/elsewhere/cools.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;),
     %(javascript_include_tag(:defaults)) =&gt; %(&lt;script src=&quot;/javascripts/prototype.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/effects.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/dragdrop.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/controls.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/application.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;),
     %(javascript_include_tag(:all)) =&gt; %(&lt;script src=&quot;/javascripts/prototype.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/effects.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/dragdrop.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/controls.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/application.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/bank.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/robber.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/version.1.0.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;),
     %(javascript_include_tag(:all, :recursive =&gt; true)) =&gt; %(&lt;script src=&quot;/javascripts/prototype.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/effects.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/dragdrop.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/controls.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/application.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/bank.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/robber.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/subdir/subdir.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/version.1.0.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;),
-    %(javascript_include_tag(:defaults, &quot;test&quot;)) =&gt; %(&lt;script src=&quot;/javascripts/prototype.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/effects.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/dragdrop.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/controls.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/test.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/application.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;),
-    %(javascript_include_tag(&quot;test&quot;, :defaults)) =&gt; %(&lt;script src=&quot;/javascripts/test.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/prototype.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/effects.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/dragdrop.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/controls.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/application.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;)
+    %(javascript_include_tag(:defaults, &quot;bank&quot;)) =&gt; %(&lt;script src=&quot;/javascripts/prototype.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/effects.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/dragdrop.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/controls.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/bank.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/application.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;),
+    %(javascript_include_tag(&quot;bank&quot;, :defaults)) =&gt; %(&lt;script src=&quot;/javascripts/bank.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/prototype.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/effects.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/dragdrop.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/controls.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/application.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;)
   }
 
   StylePathToTag = {
-    %(stylesheet_path(&quot;style&quot;)) =&gt; %(/stylesheets/style.css),
-    %(stylesheet_path(&quot;style.css&quot;)) =&gt; %(/stylesheets/style.css),
-    %(stylesheet_path('dir/file')) =&gt; %(/stylesheets/dir/file.css),
-    %(stylesheet_path('/dir/file.rcss')) =&gt; %(/dir/file.rcss)
+    %(stylesheet_path(&quot;bank&quot;)) =&gt; %(/stylesheets/bank.css),
+    %(stylesheet_path(&quot;bank.css&quot;)) =&gt; %(/stylesheets/bank.css),
+    %(stylesheet_path('subdir/subdir')) =&gt; %(/stylesheets/subdir/subdir.css),
+    %(stylesheet_path('/subdir/subdir.css')) =&gt; %(/subdir/subdir.css)
   }
 
   PathToStyleToTag = {
@@ -101,15 +101,16 @@ class AssetTagHelperTest &lt; ActionView::TestCase
   }
 
   StyleLinkToTag = {
-    %(stylesheet_link_tag(&quot;style&quot;)) =&gt; %(&lt;link href=&quot;/stylesheets/style.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),
-    %(stylesheet_link_tag(&quot;style.css&quot;)) =&gt; %(&lt;link href=&quot;/stylesheets/style.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),
-    %(stylesheet_link_tag(&quot;/dir/file&quot;)) =&gt; %(&lt;link href=&quot;/dir/file.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),
-    %(stylesheet_link_tag(&quot;dir/file&quot;)) =&gt; %(&lt;link href=&quot;/stylesheets/dir/file.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),
-    %(stylesheet_link_tag(&quot;style&quot;, :media =&gt; &quot;all&quot;)) =&gt; %(&lt;link href=&quot;/stylesheets/style.css&quot; media=&quot;all&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),
+    %(stylesheet_link_tag(&quot;bank&quot;)) =&gt; %(&lt;link href=&quot;/stylesheets/bank.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),
+    %(stylesheet_link_tag(&quot;bank.css&quot;)) =&gt; %(&lt;link href=&quot;/stylesheets/bank.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),
+    %(stylesheet_link_tag(&quot;/elsewhere/file&quot;)) =&gt; %(&lt;link href=&quot;/elsewhere/file.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),
+    %(stylesheet_link_tag(&quot;subdir/subdir&quot;)) =&gt; %(&lt;link href=&quot;/stylesheets/subdir/subdir.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),
+    %(stylesheet_link_tag(&quot;bank&quot;, :media =&gt; &quot;all&quot;)) =&gt; %(&lt;link href=&quot;/stylesheets/bank.css&quot; media=&quot;all&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),
     %(stylesheet_link_tag(:all)) =&gt; %(&lt;link href=&quot;/stylesheets/bank.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;\n&lt;link href=&quot;/stylesheets/robber.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;\n&lt;link href=&quot;/stylesheets/version.1.0.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),
     %(stylesheet_link_tag(:all, :recursive =&gt; true)) =&gt; %(&lt;link href=&quot;/stylesheets/bank.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;\n&lt;link href=&quot;/stylesheets/robber.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;\n&lt;link href=&quot;/stylesheets/subdir/subdir.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;\n&lt;link href=&quot;/stylesheets/version.1.0.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),
     %(stylesheet_link_tag(:all, :media =&gt; &quot;all&quot;)) =&gt; %(&lt;link href=&quot;/stylesheets/bank.css&quot; media=&quot;all&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;\n&lt;link href=&quot;/stylesheets/robber.css&quot; media=&quot;all&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;\n&lt;link href=&quot;/stylesheets/version.1.0.css&quot; media=&quot;all&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),
-    %(stylesheet_link_tag(&quot;random.styles&quot;, &quot;/css/stylish&quot;)) =&gt; %(&lt;link href=&quot;/stylesheets/random.styles&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;\n&lt;link href=&quot;/css/stylish.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),
+    %(stylesheet_link_tag(&quot;random.styles&quot;, &quot;/elsewhere/file&quot;)) =&gt; %(&lt;link href=&quot;/stylesheets/random.styles&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;\n&lt;link href=&quot;/elsewhere/file.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),
+
     %(stylesheet_link_tag(&quot;http://www.example.com/styles/style&quot;)) =&gt; %(&lt;link href=&quot;http://www.example.com/styles/style.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;)
   }
 
@@ -137,11 +138,38 @@ class AssetTagHelperTest &lt; ActionView::TestCase
     %(image_tag(&quot;error.png&quot;, &quot;size&quot; =&gt; &quot;45 x 70&quot;)) =&gt; %(&lt;img alt=&quot;Error&quot; src=&quot;/images/error.png&quot; /&gt;),
     %(image_tag(&quot;error.png&quot;, &quot;size&quot; =&gt; &quot;x&quot;)) =&gt; %(&lt;img alt=&quot;Error&quot; src=&quot;/images/error.png&quot; /&gt;),
     %(image_tag(&quot;http://www.rubyonrails.com/images/rails.png&quot;)) =&gt; %(&lt;img alt=&quot;Rails&quot; src=&quot;http://www.rubyonrails.com/images/rails.png&quot; /&gt;),
-    %(image_tag(&quot;http://www.rubyonrails.com/images/rails.png&quot;)) =&gt; %(&lt;img alt=&quot;Rails&quot; src=&quot;http://www.rubyonrails.com/images/rails.png&quot; /&gt;),
     %(image_tag(&quot;mouse.png&quot;, :mouseover =&gt; &quot;/images/mouse_over.png&quot;)) =&gt; %(&lt;img alt=&quot;Mouse&quot; onmouseover=&quot;this.src='/images/mouse_over.png'&quot; onmouseout=&quot;this.src='/images/mouse.png'&quot; src=&quot;/images/mouse.png&quot; /&gt;),
     %(image_tag(&quot;mouse.png&quot;, :mouseover =&gt; image_path(&quot;mouse_over.png&quot;))) =&gt; %(&lt;img alt=&quot;Mouse&quot; onmouseover=&quot;this.src='/images/mouse_over.png'&quot; onmouseout=&quot;this.src='/images/mouse.png'&quot; src=&quot;/images/mouse.png&quot; /&gt;)
   }
 
+  VideoPathToTag = {
+    %(video_path(&quot;xml&quot;))          =&gt; %(/videos/xml),
+    %(video_path(&quot;xml.ogg&quot;))      =&gt; %(/videos/xml.ogg),
+    %(video_path(&quot;dir/xml.ogg&quot;))  =&gt; %(/videos/dir/xml.ogg),
+    %(video_path(&quot;/dir/xml.ogg&quot;)) =&gt; %(/dir/xml.ogg)
+  }
+
+  PathToVideoToTag = {
+    %(path_to_video(&quot;xml&quot;))          =&gt; %(/videos/xml),
+    %(path_to_video(&quot;xml.ogg&quot;))      =&gt; %(/videos/xml.ogg),
+    %(path_to_video(&quot;dir/xml.ogg&quot;))  =&gt; %(/videos/dir/xml.ogg),
+    %(path_to_video(&quot;/dir/xml.ogg&quot;)) =&gt; %(/dir/xml.ogg)
+  }
+
+  VideoLinkToTag = {
+    %(video_tag(&quot;xml.ogg&quot;)) =&gt; %(&lt;video src=&quot;/videos/xml.ogg&quot; /&gt;),
+    %(video_tag(&quot;rss.m4v&quot;, :autoplay =&gt; true, :controls =&gt; true)) =&gt; %(&lt;video autoplay=&quot;autoplay&quot; controls=&quot;controls&quot; src=&quot;/videos/rss.m4v&quot; /&gt;),
+    %(video_tag(&quot;rss.m4v&quot;, :autobuffer =&gt; true)) =&gt; %(&lt;video autobuffer=&quot;autobuffer&quot; src=&quot;/videos/rss.m4v&quot; /&gt;),
+    %(video_tag(&quot;gold.m4v&quot;, :size =&gt; &quot;160x120&quot;)) =&gt; %(&lt;video height=&quot;120&quot; src=&quot;/videos/gold.m4v&quot; width=&quot;160&quot; /&gt;),
+    %(video_tag(&quot;gold.m4v&quot;, &quot;size&quot; =&gt; &quot;320x240&quot;)) =&gt; %(&lt;video height=&quot;240&quot; src=&quot;/videos/gold.m4v&quot; width=&quot;320&quot; /&gt;),
+    %(video_tag(&quot;trailer.ogg&quot;, :poster =&gt; &quot;screenshot.png&quot;)) =&gt; %(&lt;video poster=&quot;/images/screenshot.png&quot; src=&quot;/videos/trailer.ogg&quot; /&gt;),
+    %(video_tag(&quot;error.avi&quot;, &quot;size&quot; =&gt; &quot;100&quot;)) =&gt; %(&lt;video src=&quot;/videos/error.avi&quot; /&gt;),
+    %(video_tag(&quot;error.avi&quot;, &quot;size&quot; =&gt; &quot;100 x 100&quot;)) =&gt; %(&lt;video src=&quot;/videos/error.avi&quot; /&gt;),
+    %(video_tag(&quot;error.avi&quot;, &quot;size&quot; =&gt; &quot;x&quot;)) =&gt; %(&lt;video src=&quot;/videos/error.avi&quot; /&gt;),
+    %(video_tag(&quot;http://media.rubyonrails.org/video/rails_blog_2.mov&quot;)) =&gt; %(&lt;video src=&quot;http://media.rubyonrails.org/video/rails_blog_2.mov&quot; /&gt;),
+    %(video_tag([&quot;multiple.ogg&quot;, &quot;multiple.avi&quot;])) =&gt; %(&lt;video&gt;&lt;source src=&quot;multiple.ogg&quot; /&gt;&lt;source src=&quot;multiple.avi&quot; /&gt;&lt;/video&gt;),
+    %(video_tag([&quot;multiple.ogg&quot;, &quot;multiple.avi&quot;], :size =&gt; &quot;160x120&quot;, :controls =&gt; true)) =&gt; %(&lt;video controls=&quot;controls&quot; height=&quot;120&quot; width=&quot;160&quot;&gt;&lt;source src=&quot;multiple.ogg&quot; /&gt;&lt;source src=&quot;multiple.avi&quot; /&gt;&lt;/video&gt;)
+  }
 
   def test_auto_discovery_link_tag
     AutoDiscoveryToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) }
@@ -160,6 +188,20 @@ class AssetTagHelperTest &lt; ActionView::TestCase
     JavascriptIncludeToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) }
   end
 
+  def test_javascript_include_tag_with_missing_source
+    assert_raise(Errno::ENOENT) {
+      javascript_include_tag('missing_security_guard')
+    }
+
+    assert_raise(Errno::ENOENT) {
+      javascript_include_tag(:defaults, 'missing_security_guard')
+    }
+
+    assert_nothing_raised {
+      javascript_include_tag('http://example.com/css/missing_security_guard')
+    }
+  end
+
   def test_javascript_include_tag_with_given_asset_id
     ENV[&quot;RAILS_ASSET_ID&quot;] = &quot;1&quot;
     assert_dom_equal(%(&lt;script src=&quot;/javascripts/prototype.js?1&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/effects.js?1&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/dragdrop.js?1&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/controls.js?1&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/application.js?1&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;), javascript_include_tag(:defaults))
@@ -167,26 +209,27 @@ class AssetTagHelperTest &lt; ActionView::TestCase
 
   def test_register_javascript_include_default
     ENV[&quot;RAILS_ASSET_ID&quot;] = &quot;&quot;
-    ActionView::Helpers::AssetTagHelper::register_javascript_include_default 'slider'
-    assert_dom_equal  %(&lt;script src=&quot;/javascripts/prototype.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/effects.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/dragdrop.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/controls.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/slider.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/application.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;), javascript_include_tag(:defaults)
+    ActionView::Helpers::AssetTagHelper::register_javascript_include_default 'bank'
+    assert_dom_equal  %(&lt;script src=&quot;/javascripts/prototype.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/effects.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/dragdrop.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/controls.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/bank.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/application.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;), javascript_include_tag(:defaults)
   end
 
   def test_register_javascript_include_default_mixed_defaults
     ENV[&quot;RAILS_ASSET_ID&quot;] = &quot;&quot;
-    ActionView::Helpers::AssetTagHelper::register_javascript_include_default 'slider'
-    ActionView::Helpers::AssetTagHelper::register_javascript_include_default 'lib1', '/elsewhere/blub/lib2'
-    assert_dom_equal  %(&lt;script src=&quot;/javascripts/prototype.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/effects.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/dragdrop.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/controls.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/slider.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/lib1.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/elsewhere/blub/lib2.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/application.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;), javascript_include_tag(:defaults)
+    ActionView::Helpers::AssetTagHelper::register_javascript_include_default 'bank'
+    ActionView::Helpers::AssetTagHelper::register_javascript_include_default 'robber', '/elsewhere/cools.js'
+    assert_dom_equal  %(&lt;script src=&quot;/javascripts/prototype.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/effects.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/dragdrop.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/controls.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/bank.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/robber.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/elsewhere/cools.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/application.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;), javascript_include_tag(:defaults)
   end
 
   def test_custom_javascript_expansions
-    ActionView::Helpers::AssetTagHelper::register_javascript_expansion :monkey =&gt; [&quot;head&quot;, &quot;body&quot;, &quot;tail&quot;]
-    assert_dom_equal  %(&lt;script src=&quot;/javascripts/first.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/head.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/body.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/tail.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/last.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;), javascript_include_tag('first', :monkey, 'last')
+    ENV[&quot;RAILS_ASSET_ID&quot;] = &quot;&quot;
+    ActionView::Helpers::AssetTagHelper::register_javascript_expansion :robbery =&gt; [&quot;bank&quot;, &quot;robber&quot;]
+    assert_dom_equal  %(&lt;script src=&quot;/javascripts/controls.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/bank.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/robber.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/effects.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;), javascript_include_tag('controls', :robbery, 'effects')
   end
 
   def test_custom_javascript_expansions_and_defaults_puts_application_js_at_the_end
     ENV[&quot;RAILS_ASSET_ID&quot;] = &quot;&quot;
-    ActionView::Helpers::AssetTagHelper::register_javascript_expansion :monkey =&gt; [&quot;head&quot;, &quot;body&quot;, &quot;tail&quot;]
-    assert_dom_equal  %(&lt;script src=&quot;/javascripts/first.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/prototype.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/effects.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/dragdrop.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/controls.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/head.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/body.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/tail.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/last.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/application.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;), javascript_include_tag('first', :defaults, :monkey, 'last')
+    ActionView::Helpers::AssetTagHelper::register_javascript_expansion :robbery =&gt; [&quot;bank&quot;, &quot;robber&quot;]
+    assert_dom_equal  %(&lt;script src=&quot;/javascripts/controls.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/prototype.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/effects.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/dragdrop.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/controls.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/bank.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/robber.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/effects.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;\n&lt;script src=&quot;/javascripts/application.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;), javascript_include_tag('controls',:defaults, :robbery, 'effects')
   end
 
   def test_custom_javascript_expansions_with_undefined_symbol
@@ -195,6 +238,7 @@ class AssetTagHelperTest &lt; ActionView::TestCase
   end
 
   def test_stylesheet_path
+    ENV[&quot;RAILS_ASSET_ID&quot;] = &quot;&quot;
     StylePathToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) }
   end
 
@@ -207,9 +251,20 @@ class AssetTagHelperTest &lt; ActionView::TestCase
     StyleLinkToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) }
   end
 
+  def test_stylesheet_link_tag_with_missing_source
+    assert_raise(Errno::ENOENT) {
+      stylesheet_link_tag('missing_security_guard')
+    }
+
+    assert_nothing_raised {
+      stylesheet_link_tag('http://example.com/css/missing_security_guard')
+    }
+  end
+
   def test_custom_stylesheet_expansions
-    ActionView::Helpers::AssetTagHelper::register_stylesheet_expansion :monkey =&gt; [&quot;head&quot;, &quot;body&quot;, &quot;tail&quot;]
-    assert_dom_equal  %(&lt;link href=&quot;/stylesheets/first.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;\n&lt;link href=&quot;/stylesheets/head.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;\n&lt;link href=&quot;/stylesheets/body.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;\n&lt;link href=&quot;/stylesheets/tail.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;\n&lt;link href=&quot;/stylesheets/last.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;), stylesheet_link_tag('first', :monkey, 'last')
+    ENV[&quot;RAILS_ASSET_ID&quot;] = ''
+    ActionView::Helpers::AssetTagHelper::register_stylesheet_expansion :robbery =&gt; [&quot;bank&quot;, &quot;robber&quot;]
+    assert_dom_equal  %(&lt;link href=&quot;/stylesheets/version.1.0.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;\n&lt;link href=&quot;/stylesheets/bank.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;\n&lt;link href=&quot;/stylesheets/robber.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;\n&lt;link href=&quot;/stylesheets/subdir/subdir.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;), stylesheet_link_tag('version.1.0', :robbery, 'subdir/subdir')
   end
 
   def test_custom_stylesheet_expansions_with_undefined_symbol
@@ -244,6 +299,18 @@ class AssetTagHelperTest &lt; ActionView::TestCase
     end
   end
 
+  def test_video_path
+    VideoPathToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) }
+  end
+
+  def test_path_to_video_alias_for_video_path
+    PathToVideoToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) }
+  end
+
+  def test_video_tag
+    VideoLinkToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) }
+  end
+
   def test_timebased_asset_id
     expected_time = File.stat(File.expand_path(File.dirname(__FILE__) + &quot;/../fixtures/public/images/rails.png&quot;)).mtime.to_i.to_s
     assert_equal %(&lt;img alt=&quot;Rails&quot; src=&quot;/images/rails.png?#{expected_time}&quot; /&gt;), image_tag(&quot;rails.png&quot;)
@@ -256,7 +323,7 @@ class AssetTagHelperTest &lt; ActionView::TestCase
     ensure
       ActionController::Base.relative_url_root = &quot;&quot;
   end
-    
+
   def test_should_skip_asset_id_on_complete_url
     assert_equal %(&lt;img alt=&quot;Rails&quot; src=&quot;http://www.example.com/rails.png&quot; /&gt;), image_tag(&quot;http://www.example.com/rails.png&quot;)
   end
@@ -317,9 +384,17 @@ class AssetTagHelperTest &lt; ActionView::TestCase
 
     assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js'))
 
+    assert_dom_equal(
+      %(&lt;script src=&quot;http://a0.example.com/absolute/test.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;),
+      javascript_include_tag(:all, :cache =&gt; &quot;/absolute/test&quot;)
+    )
+
+    assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::ASSETS_DIR, 'absolute', 'test.js'))
+
   ensure
     FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'all.js'))
     FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::JAVASCRIPTS_DIR, 'money.js'))
+    FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::ASSETS_DIR, 'absolute'))
   end
 
   def test_caching_javascript_include_tag_when_caching_on_with_proc_asset_host
@@ -538,8 +613,14 @@ class AssetTagHelperTest &lt; ActionView::TestCase
       stylesheet_link_tag(:all, :cache =&gt; true)
     )
 
-    expected = Dir[&quot;#{ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR}/*.css&quot;].map { |p| File.mtime(p) }.max
-    assert_equal expected, File.mtime(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
+    files_to_be_joined = Dir[&quot;#{ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR}/[^all]*.css&quot;]
+
+    expected_mtime = files_to_be_joined.map { |p| File.mtime(p) }.max
+    assert_equal expected_mtime, File.mtime(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
+
+    bytes_added_by_join = &quot;\n\n&quot;.size * files_to_be_joined.size - &quot;\n\n&quot;.size
+    expected_size = files_to_be_joined.sum { |p| File.size(p) } + bytes_added_by_join
+    assert_equal expected_size, File.size(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
 
     assert_dom_equal(
       %(&lt;link href=&quot;http://a0.example.com/stylesheets/money.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),
@@ -547,6 +628,66 @@ class AssetTagHelperTest &lt; ActionView::TestCase
     )
 
     assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css'))
+
+    assert_dom_equal(
+      %(&lt;link href=&quot;http://a0.example.com/absolute/test.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),
+      stylesheet_link_tag(:all, :cache =&gt; &quot;/absolute/test&quot;)
+    )
+
+    assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::ASSETS_DIR, 'absolute', 'test.css'))
+  ensure
+    FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
+    FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css'))
+    FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::ASSETS_DIR, 'absolute'))
+  end
+
+  def test_concat_stylesheet_link_tag_when_caching_off
+    ENV[&quot;RAILS_ASSET_ID&quot;] = &quot;&quot;
+
+    assert_dom_equal(
+      %(&lt;link href=&quot;/stylesheets/all.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),
+      stylesheet_link_tag(:all, :concat =&gt; true)
+    )
+
+    expected = Dir[&quot;#{ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR}/*.css&quot;].map { |p| File.mtime(p) }.max
+    assert_equal expected, File.mtime(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
+
+    assert_dom_equal(
+      %(&lt;link href=&quot;/stylesheets/money.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),
+      stylesheet_link_tag(:all, :concat =&gt; &quot;money&quot;)
+    )
+
+    assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css'))
+
+    assert_dom_equal(
+      %(&lt;link href=&quot;/absolute/test.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),
+      stylesheet_link_tag(:all, :concat =&gt; &quot;/absolute/test&quot;)
+    )
+
+    assert File.exist?(File.join(ActionView::Helpers::AssetTagHelper::ASSETS_DIR, 'absolute', 'test.css'))
+  ensure
+    FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
+    FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css'))
+    FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::ASSETS_DIR, 'absolute'))
+  end
+
+  def test_caching_stylesheet_link_tag_when_caching_on_and_missing_css_file
+    ENV[&quot;RAILS_ASSET_ID&quot;] = &quot;&quot;
+    ActionController::Base.asset_host = 'http://a0.example.com'
+    ActionController::Base.perform_caching = true
+
+    assert_raise(Errno::ENOENT) {
+      stylesheet_link_tag('bank', 'robber', 'missing_security_guard', :cache =&gt; true)
+    }
+
+    assert ! File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
+
+    assert_raise(Errno::ENOENT) {
+      stylesheet_link_tag('bank', 'robber', 'missing_security_guard', :cache =&gt; &quot;money&quot;)
+    }
+
+    assert ! File.exist?(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css'))
+
   ensure
     FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
     FileUtils.rm_f(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'money.css'))
@@ -579,8 +720,10 @@ class AssetTagHelperTest &lt; ActionView::TestCase
       stylesheet_link_tag(:all, :cache =&gt; true)
     )
 
-    expected = Dir[&quot;#{ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR}/*.css&quot;].map { |p| File.mtime(p) }.max
-    assert_equal expected, File.mtime(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
+    files_to_be_joined = Dir[&quot;#{ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR}/[^all]*.css&quot;]
+
+    expected_mtime = files_to_be_joined.map { |p| File.mtime(p) }.max
+    assert_equal expected_mtime, File.mtime(File.join(ActionView::Helpers::AssetTagHelper::STYLESHEETS_DIR, 'all.css'))
 
     assert_dom_equal(
       %(&lt;link href=&quot;/collaboration/hieraki/stylesheets/money.css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;),</diff>
      <filename>actionpack/test/template/asset_tag_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,7 @@
 require 'abstract_unit'
 
 Scroll = Struct.new(:id, :to_param, :title, :body, :updated_at, :created_at)
+Scroll.extend ActiveModel::Naming
 
 class ScrollsController &lt; ActionController::Base
   FEEDS = {}</diff>
      <filename>actionpack/test/template/atom_feed_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,9 +4,8 @@ class BodyPartsTest &lt; ActionController::TestCase
   RENDERINGS = [Object.new, Object.new, Object.new]
 
   class TestController &lt; ActionController::Base
-    def performed?
-      defined?(ActionController::Http) ? true : super
-    end
+    def performed?() true end
+
     def index
       RENDERINGS.each do |rendering|
         @template.punctuate_body! rendering
@@ -19,11 +18,9 @@ class BodyPartsTest &lt; ActionController::TestCase
 
   def test_body_parts
     get :index
-    pending(:old_base) do
-      # TestProcess buffers body_parts into body
-      # TODO: Rewrite test w/o going through process
-      assert_equal RENDERINGS, @response.body_parts
-    end
+    # TestProcess buffers body_parts into body
+    # TODO: Rewrite test w/o going through process
+    assert_equal RENDERINGS, @response.body_parts
     assert_equal RENDERINGS.join, @response.body
   end
 end</diff>
      <filename>actionpack/test/template/body_parts_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -41,7 +41,7 @@ class CompiledTemplatesTest &lt; Test::Unit::TestCase
     end
 
     def render_without_cache(*args)
-      path = ActionView::Template::FileSystemPathWithFallback.new(FIXTURE_LOAD_PATH)
+      path = ActionView::FileSystemResolverWithFallback.new(FIXTURE_LOAD_PATH)
       view_paths = ActionView::Base.process_view_paths(path)
       ActionView::Base.new(view_paths, {}).render(*args)
     end</diff>
      <filename>actionpack/test/template/compiled_templates_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -16,7 +16,7 @@ class ErbUtilTest &lt; Test::Unit::TestCase
   end
   
   def test_rest_in_ascii
-    (0..127).to_a.map(&amp;:chr).each do |chr|
+    (0..127).to_a.map {|int| int.chr }.each do |chr|
       next if %w(&amp; &quot; &lt; &gt;).include?(chr)
       assert_equal chr, html_escape(chr)
     end</diff>
      <filename>actionpack/test/template/erb_util_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,6 +21,9 @@ silence_warnings do
 
     attr_accessor :comments
     def comments_attributes=(attributes); end
+
+    attr_accessor :tags
+    def tags_attributes=(attributes); end
   end
 
   class Comment
@@ -33,6 +36,50 @@ silence_warnings do
     def name
       @id.nil? ? &quot;new #{self.class.name.downcase}&quot; : &quot;#{self.class.name.downcase} ##{@id}&quot;
     end
+
+    attr_accessor :relevances
+    def relevances_attributes=(attributes); end
+
+  end
+
+  class Tag
+    attr_reader :id
+    attr_reader :post_id
+    def initialize(id = nil, post_id = nil); @id, @post_id = id, post_id end
+    def save; @id = 1; @post_id = 1 end
+    def new_record?; @id.nil? end
+    def to_param; @id; end
+    def value
+      @id.nil? ? &quot;new #{self.class.name.downcase}&quot; : &quot;#{self.class.name.downcase} ##{@id}&quot;
+    end
+
+    attr_accessor :relevances
+    def relevances_attributes=(attributes); end
+
+  end
+
+  class CommentRelevance
+    attr_reader :id
+    attr_reader :comment_id
+    def initialize(id = nil, comment_id = nil); @id, @comment_id = id, comment_id end
+    def save; @id = 1; @comment_id = 1 end
+    def new_record?; @id.nil? end
+    def to_param; @id; end
+    def value
+      @id.nil? ? &quot;new #{self.class.name.downcase}&quot; : &quot;#{self.class.name.downcase} ##{@id}&quot;
+    end
+  end
+
+  class TagRelevance
+    attr_reader :id
+    attr_reader :tag_id
+    def initialize(id = nil, tag_id = nil); @id, @tag_id = id, tag_id end
+    def save; @id = 1; @tag_id = 1 end
+    def new_record?; @id.nil? end
+    def to_param; @id; end
+    def value
+      @id.nil? ? &quot;new #{self.class.name.downcase}&quot; : &quot;#{self.class.name.downcase} ##{@id}&quot;
+    end
   end
 
   class Author &lt; Comment
@@ -50,7 +97,7 @@ class FormHelperTest &lt; ActionView::TestCase
     @comment = Comment.new
     def @post.errors()
       Class.new{
-        def on(field); &quot;can't be empty&quot; if field == &quot;author_name&quot;; end
+        def [](field); field == &quot;author_name&quot; ? [&quot;can't be empty&quot;] : [] end
         def empty?() false end
         def count() 1 end
         def full_messages() [ &quot;Author name can't be empty&quot; ] end
@@ -99,6 +146,11 @@ class FormHelperTest &lt; ActionView::TestCase
     assert_dom_equal('&lt;label for=&quot;my_for&quot;&gt;Title&lt;/label&gt;', label(:post, :title, nil, &quot;for&quot; =&gt; &quot;my_for&quot;))
   end
 
+  def test_label_for_radio_buttons_with_value
+    assert_dom_equal('&lt;label for=&quot;post_title_great_title&quot;&gt;The title goes here&lt;/label&gt;', label(&quot;post&quot;, &quot;title&quot;, &quot;The title goes here&quot;, :value =&gt; &quot;great_title&quot;))
+    assert_dom_equal('&lt;label for=&quot;post_title_great_title&quot;&gt;The title goes here&lt;/label&gt;', label(&quot;post&quot;, &quot;title&quot;, &quot;The title goes here&quot;, :value =&gt; &quot;great title&quot;))
+  end
+
   def test_text_field
     assert_dom_equal(
       '&lt;input id=&quot;post_title&quot; name=&quot;post[title]&quot; size=&quot;30&quot; type=&quot;text&quot; value=&quot;Hello World&quot; /&gt;', text_field(&quot;post&quot;, &quot;title&quot;)
@@ -378,7 +430,7 @@ class FormHelperTest &lt; ActionView::TestCase
 
     expected =
       &quot;&lt;form action='http://www.example.com' id='create-post' method='post'&gt;&quot; +
-      &quot;&lt;div style='margin:0;padding:0'&gt;&lt;input name='_method' type='hidden' value='put' /&gt;&lt;/div&gt;&quot; +
+      &quot;&lt;div style='margin:0;padding:0;display:inline'&gt;&lt;input name='_method' type='hidden' value='put' /&gt;&lt;/div&gt;&quot; +
       &quot;&lt;input name='post[title]' size='30' type='text' id='post_title' value='Hello World' /&gt;&quot; +
       &quot;&lt;textarea name='post[body]' id='post_body' rows='20' cols='40'&gt;Back to the hill and over it again!&lt;/textarea&gt;&quot; +
       &quot;&lt;input name='post[secret]' type='hidden' value='0' /&gt;&quot; +
@@ -532,6 +584,20 @@ class FormHelperTest &lt; ActionView::TestCase
     assert_dom_equal expected, output_buffer
   end
 
+  def test_nested_fields_for_with_index_radio_button
+    form_for(:post, @post) do |f|
+      f.fields_for(:comment, @post, :index =&gt; 5) do |c|
+        concat c.radio_button(:title, &quot;hello&quot;)
+      end
+    end
+
+    expected = &quot;&lt;form action='http://www.example.com' method='post'&gt;&quot; +
+               &quot;&lt;input name='post[comment][5][title]' type='radio' id='post_comment_5_title_hello' value='hello' /&gt;&quot; +
+               &quot;&lt;/form&gt;&quot;
+
+    assert_dom_equal expected, output_buffer
+  end
+
   def test_nested_fields_for_with_auto_index_on_both
     form_for(&quot;post[]&quot;, @post) do |f|
       f.fields_for(&quot;comment[]&quot;, @post) do |c|
@@ -721,6 +787,51 @@ class FormHelperTest &lt; ActionView::TestCase
     assert_dom_equal expected, output_buffer
   end
 
+  def test_nested_fields_uses_unique_indices_for_different_collection_associations
+    @post.comments = [Comment.new(321)]
+    @post.tags = [Tag.new(123), Tag.new(456)]
+    @post.comments[0].relevances = []
+    @post.tags[0].relevances = []
+    @post.tags[1].relevances = []
+    form_for(:post, @post) do |f|
+      f.fields_for(:comments, @post.comments[0]) do |cf|
+        concat cf.text_field(:name)
+        cf.fields_for(:relevances, CommentRelevance.new(314)) do |crf|
+          concat crf.text_field(:value)
+        end
+      end
+      f.fields_for(:tags, @post.tags[0]) do |tf|
+        concat tf.text_field(:value)
+        tf.fields_for(:relevances, TagRelevance.new(3141)) do |trf|
+          concat trf.text_field(:value)
+        end
+      end
+      f.fields_for('tags', @post.tags[1]) do |tf|
+        concat tf.text_field(:value)
+        tf.fields_for(:relevances, TagRelevance.new(31415)) do |trf|
+          concat trf.text_field(:value)
+        end
+      end
+    end
+
+    expected = '&lt;form action=&quot;http://www.example.com&quot; method=&quot;post&quot;&gt;' +
+               '&lt;input id=&quot;post_comments_attributes_0_id&quot; name=&quot;post[comments_attributes][0][id]&quot; type=&quot;hidden&quot; value=&quot;321&quot; /&gt;' +
+               '&lt;input id=&quot;post_comments_attributes_0_name&quot; name=&quot;post[comments_attributes][0][name]&quot; size=&quot;30&quot; type=&quot;text&quot; value=&quot;comment #321&quot; /&gt;' +
+               '&lt;input id=&quot;post_comments_attributes_0_relevances_attributes_0_id&quot; name=&quot;post[comments_attributes][0][relevances_attributes][0][id]&quot; type=&quot;hidden&quot; value=&quot;314&quot; /&gt;' +
+               '&lt;input id=&quot;post_comments_attributes_0_relevances_attributes_0_value&quot; name=&quot;post[comments_attributes][0][relevances_attributes][0][value]&quot; size=&quot;30&quot; type=&quot;text&quot; value=&quot;commentrelevance #314&quot; /&gt;' +
+               '&lt;input id=&quot;post_tags_attributes_0_id&quot; name=&quot;post[tags_attributes][0][id]&quot; type=&quot;hidden&quot; value=&quot;123&quot; /&gt;' +
+               '&lt;input id=&quot;post_tags_attributes_0_value&quot; name=&quot;post[tags_attributes][0][value]&quot; size=&quot;30&quot; type=&quot;text&quot; value=&quot;tag #123&quot; /&gt;' +
+               '&lt;input id=&quot;post_tags_attributes_0_relevances_attributes_0_id&quot; name=&quot;post[tags_attributes][0][relevances_attributes][0][id]&quot; type=&quot;hidden&quot; value=&quot;3141&quot; /&gt;' +
+               '&lt;input id=&quot;post_tags_attributes_0_relevances_attributes_0_value&quot; name=&quot;post[tags_attributes][0][relevances_attributes][0][value]&quot; size=&quot;30&quot; type=&quot;text&quot; value=&quot;tagrelevance #3141&quot; /&gt;' +
+               '&lt;input id=&quot;post_tags_attributes_1_id&quot; name=&quot;post[tags_attributes][1][id]&quot; type=&quot;hidden&quot; value=&quot;456&quot; /&gt;' +
+               '&lt;input id=&quot;post_tags_attributes_1_value&quot; name=&quot;post[tags_attributes][1][value]&quot; size=&quot;30&quot; type=&quot;text&quot; value=&quot;tag #456&quot; /&gt;' +
+               '&lt;input id=&quot;post_tags_attributes_1_relevances_attributes_0_id&quot; name=&quot;post[tags_attributes][1][relevances_attributes][0][id]&quot; type=&quot;hidden&quot; value=&quot;31415&quot; /&gt;' +
+               '&lt;input id=&quot;post_tags_attributes_1_relevances_attributes_0_value&quot; name=&quot;post[tags_attributes][1][relevances_attributes][0][value]&quot; size=&quot;30&quot; type=&quot;text&quot; value=&quot;tagrelevance #31415&quot; /&gt;' +
+               '&lt;/form&gt;'
+
+    assert_dom_equal expected, output_buffer
+  end
+
   def test_fields_for
     fields_for(:post, @post) do |f|
       concat f.text_field(:title)
@@ -1073,7 +1184,7 @@ class FormHelperTest &lt; ActionView::TestCase
   def test_form_for_with_existing_object
     form_for(@post) do |f| end
 
-    expected = &quot;&lt;form action=\&quot;/posts/123\&quot; class=\&quot;edit_post\&quot; id=\&quot;edit_post_123\&quot; method=\&quot;post\&quot;&gt;&lt;div style=\&quot;margin:0;padding:0\&quot;&gt;&lt;input name=\&quot;_method\&quot; type=\&quot;hidden\&quot; value=\&quot;put\&quot; /&gt;&lt;/div&gt;&lt;/form&gt;&quot;
+    expected = &quot;&lt;form action=\&quot;/posts/123\&quot; class=\&quot;edit_post\&quot; id=\&quot;edit_post_123\&quot; method=\&quot;post\&quot;&gt;&lt;div style=\&quot;margin:0;padding:0;display:inline\&quot;&gt;&lt;input name=\&quot;_method\&quot; type=\&quot;hidden\&quot; value=\&quot;put\&quot; /&gt;&lt;/div&gt;&lt;/form&gt;&quot;
     assert_equal expected, output_buffer
   end
 
@@ -1094,7 +1205,7 @@ class FormHelperTest &lt; ActionView::TestCase
 
     form_for([@post, @comment]) {}
 
-    expected = %(&lt;form action=&quot;#{comment_path(@post, @comment)}&quot; class=&quot;edit_comment&quot; id=&quot;edit_comment_1&quot; method=&quot;post&quot;&gt;&lt;div style=&quot;margin:0;padding:0&quot;&gt;&lt;input name=&quot;_method&quot; type=&quot;hidden&quot; value=&quot;put&quot; /&gt;&lt;/div&gt;&lt;/form&gt;)
+    expected = %(&lt;form action=&quot;#{comment_path(@post, @comment)}&quot; class=&quot;edit_comment&quot; id=&quot;edit_comment_1&quot; method=&quot;post&quot;&gt;&lt;div style=&quot;margin:0;padding:0;display:inline&quot;&gt;&lt;input name=&quot;_method&quot; type=&quot;hidden&quot; value=&quot;put&quot; /&gt;&lt;/div&gt;&lt;/form&gt;)
     assert_dom_equal expected, output_buffer
   end
 
@@ -1113,7 +1224,7 @@ class FormHelperTest &lt; ActionView::TestCase
 
     form_for([:admin, @post, @comment]) {}
 
-    expected = %(&lt;form action=&quot;#{admin_comment_path(@post, @comment)}&quot; class=&quot;edit_comment&quot; id=&quot;edit_comment_1&quot; method=&quot;post&quot;&gt;&lt;div style=&quot;margin:0;padding:0&quot;&gt;&lt;input name=&quot;_method&quot; type=&quot;hidden&quot; value=&quot;put&quot; /&gt;&lt;/div&gt;&lt;/form&gt;)
+    expected = %(&lt;form action=&quot;#{admin_comment_path(@post, @comment)}&quot; class=&quot;edit_comment&quot; id=&quot;edit_comment_1&quot; method=&quot;post&quot;&gt;&lt;div style=&quot;margin:0;padding:0;display:inline&quot;&gt;&lt;input name=&quot;_method&quot; type=&quot;hidden&quot; value=&quot;put&quot; /&gt;&lt;/div&gt;&lt;/form&gt;)
     assert_dom_equal expected, output_buffer
   end
 
@@ -1129,7 +1240,7 @@ class FormHelperTest &lt; ActionView::TestCase
   def test_form_for_with_existing_object_and_custom_url
     form_for(@post, :url =&gt; &quot;/super_posts&quot;) do |f| end
 
-    expected = &quot;&lt;form action=\&quot;/super_posts\&quot; class=\&quot;edit_post\&quot; id=\&quot;edit_post_123\&quot; method=\&quot;post\&quot;&gt;&lt;div style=\&quot;margin:0;padding:0\&quot;&gt;&lt;input name=\&quot;_method\&quot; type=\&quot;hidden\&quot; value=\&quot;put\&quot; /&gt;&lt;/div&gt;&lt;/form&gt;&quot;
+    expected = &quot;&lt;form action=\&quot;/super_posts\&quot; class=\&quot;edit_post\&quot; id=\&quot;edit_post_123\&quot; method=\&quot;post\&quot;&gt;&lt;div style=\&quot;margin:0;padding:0;display:inline\&quot;&gt;&lt;input name=\&quot;_method\&quot; type=\&quot;hidden\&quot; value=\&quot;put\&quot; /&gt;&lt;/div&gt;&lt;/form&gt;&quot;
     assert_equal expected, output_buffer
   end
 
@@ -1174,4 +1285,4 @@ class FormHelperTest &lt; ActionView::TestCase
     def protect_against_forgery?
       false
     end
-end
\ No newline at end of file
+end</diff>
      <filename>actionpack/test/template/form_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -40,13 +40,13 @@ class FormTagHelperTest &lt; ActionView::TestCase
 
   def test_form_tag_with_method_put
     actual = form_tag({}, { :method =&gt; :put })
-    expected = %(&lt;form action=&quot;http://www.example.com&quot; method=&quot;post&quot;&gt;&lt;div style='margin:0;padding:0'&gt;&lt;input type=&quot;hidden&quot; name=&quot;_method&quot; value=&quot;put&quot; /&gt;&lt;/div&gt;)
+    expected = %(&lt;form action=&quot;http://www.example.com&quot; method=&quot;post&quot;&gt;&lt;div style='margin:0;padding:0;display:inline'&gt;&lt;input type=&quot;hidden&quot; name=&quot;_method&quot; value=&quot;put&quot; /&gt;&lt;/div&gt;)
     assert_dom_equal expected, actual
   end
 
   def test_form_tag_with_method_delete
     actual = form_tag({}, { :method =&gt; :delete })
-    expected = %(&lt;form action=&quot;http://www.example.com&quot; method=&quot;post&quot;&gt;&lt;div style='margin:0;padding:0'&gt;&lt;input type=&quot;hidden&quot; name=&quot;_method&quot; value=&quot;delete&quot; /&gt;&lt;/div&gt;)
+    expected = %(&lt;form action=&quot;http://www.example.com&quot; method=&quot;post&quot;&gt;&lt;div style='margin:0;padding:0;display:inline'&gt;&lt;input type=&quot;hidden&quot; name=&quot;_method&quot; value=&quot;delete&quot; /&gt;&lt;/div&gt;)
     assert_dom_equal expected, actual
   end
 
@@ -62,7 +62,7 @@ class FormTagHelperTest &lt; ActionView::TestCase
     __in_erb_template = ''
     form_tag(&quot;http://example.com&quot;, :method =&gt; :put) { concat &quot;Hello world!&quot; }
 
-    expected = %(&lt;form action=&quot;http://example.com&quot; method=&quot;post&quot;&gt;&lt;div style='margin:0;padding:0'&gt;&lt;input type=&quot;hidden&quot; name=&quot;_method&quot; value=&quot;put&quot; /&gt;&lt;/div&gt;Hello world!&lt;/form&gt;)
+    expected = %(&lt;form action=&quot;http://example.com&quot; method=&quot;post&quot;&gt;&lt;div style='margin:0;padding:0;display:inline'&gt;&lt;input type=&quot;hidden&quot; name=&quot;_method&quot; value=&quot;put&quot; /&gt;&lt;/div&gt;Hello world!&lt;/form&gt;)
     assert_dom_equal expected, output_buffer
   end
 
@@ -154,6 +154,23 @@ class FormTagHelperTest &lt; ActionView::TestCase
     assert_dom_equal expected, actual
   end
 
+  def test_text_area_tag_id_sanitized
+    input_elem = root_elem(text_area_tag(&quot;item[][description]&quot;))
+    assert_match VALID_HTML_ID, input_elem['id']
+  end
+
+  def test_text_area_tag_escape_content
+    actual = text_area_tag &quot;body&quot;, &quot;&lt;b&gt;hello world&lt;/b&gt;&quot;, :size =&gt; &quot;20x40&quot;
+    expected = %(&lt;textarea cols=&quot;20&quot; id=&quot;body&quot; name=&quot;body&quot; rows=&quot;40&quot;&gt;&amp;lt;b&amp;gt;hello world&amp;lt;/b&amp;gt;&lt;/textarea&gt;)
+    assert_dom_equal expected, actual
+  end
+
+  def test_text_area_tag_unescaped_content
+    actual = text_area_tag &quot;body&quot;, &quot;&lt;b&gt;hello world&lt;/b&gt;&quot;, :size =&gt; &quot;20x40&quot;, :escape =&gt; false
+    expected = %(&lt;textarea cols=&quot;20&quot; id=&quot;body&quot; name=&quot;body&quot; rows=&quot;40&quot;&gt;&lt;b&gt;hello world&lt;/b&gt;&lt;/textarea&gt;)
+    assert_dom_equal expected, actual
+  end
+
   def test_text_field_tag
     actual = text_field_tag &quot;title&quot;, &quot;Hello!&quot;
     expected = %(&lt;input id=&quot;title&quot; name=&quot;title&quot; type=&quot;text&quot; value=&quot;Hello!&quot; /&gt;)</diff>
      <filename>actionpack/test/template/form_tag_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,22 @@ require 'abstract_unit'
 class NumberHelperTest &lt; ActionView::TestCase
   tests ActionView::Helpers::NumberHelper
 
+  def kilobytes(number)
+    number * 1024
+  end
+
+  def megabytes(number)
+    kilobytes(number) * 1024
+  end
+
+  def gigabytes(number)
+    megabytes(number) * 1024
+  end
+
+  def terabytes(number)
+    gigabytes(number) * 1024
+  end
+
   def test_number_to_phone
     assert_equal(&quot;555-1234&quot;, number_to_phone(5551234))
     assert_equal(&quot;800-555-1212&quot;, number_to_phone(8005551212))
@@ -96,16 +112,16 @@ class NumberHelperTest &lt; ActionView::TestCase
     assert_equal '1.2 MB',    number_to_human_size(1234567)
     assert_equal '1.1 GB',    number_to_human_size(1234567890)
     assert_equal '1.1 TB',    number_to_human_size(1234567890123)
-    assert_equal '1025 TB',   number_to_human_size(1025.terabytes)
-    assert_equal '444 KB',    number_to_human_size(444.kilobytes)
-    assert_equal '1023 MB',   number_to_human_size(1023.megabytes)
-    assert_equal '3 TB',      number_to_human_size(3.terabytes)
+    assert_equal '1025 TB',   number_to_human_size(terabytes(1025))
+    assert_equal '444 KB',    number_to_human_size(kilobytes(444))
+    assert_equal '1023 MB',   number_to_human_size(megabytes(1023))
+    assert_equal '3 TB',      number_to_human_size(terabytes(3))
     assert_equal '1.18 MB',   number_to_human_size(1234567, :precision =&gt; 2)
     assert_equal '3 Bytes',   number_to_human_size(3.14159265, :precision =&gt; 4)
     assert_equal(&quot;123 Bytes&quot;, number_to_human_size(&quot;123&quot;))
-    assert_equal '1.01 KB',   number_to_human_size(1.0123.kilobytes, :precision =&gt; 2)
-    assert_equal '1.01 KB',   number_to_human_size(1.0100.kilobytes, :precision =&gt; 4)
-    assert_equal '10 KB',   number_to_human_size(10.000.kilobytes, :precision =&gt; 4)
+    assert_equal '1.01 KB',   number_to_human_size(kilobytes(1.0123), :precision =&gt; 2)
+    assert_equal '1.01 KB',   number_to_human_size(kilobytes(1.0100), :precision =&gt; 4)
+    assert_equal '10 KB',   number_to_human_size(kilobytes(10.000), :precision =&gt; 4)
     assert_equal '1 Byte',   number_to_human_size(1.1)
     assert_equal '10 Bytes', number_to_human_size(10)
     #assert_nil number_to_human_size('x') # fails due to API consolidation
@@ -115,9 +131,9 @@ class NumberHelperTest &lt; ActionView::TestCase
   def test_number_to_human_size_with_options_hash
     assert_equal '1.18 MB',   number_to_human_size(1234567, :precision =&gt; 2)
     assert_equal '3 Bytes',   number_to_human_size(3.14159265, :precision =&gt; 4)
-    assert_equal '1.01 KB',   number_to_human_size(1.0123.kilobytes, :precision =&gt; 2)
-    assert_equal '1.01 KB',   number_to_human_size(1.0100.kilobytes, :precision =&gt; 4)
-    assert_equal '10 KB',     number_to_human_size(10.000.kilobytes, :precision =&gt; 4)
+    assert_equal '1.01 KB',   number_to_human_size(kilobytes(1.0123), :precision =&gt; 2)
+    assert_equal '1.01 KB',   number_to_human_size(kilobytes(1.0100), :precision =&gt; 4)
+    assert_equal '10 KB',     number_to_human_size(kilobytes(10.000), :precision =&gt; 4)
     assert_equal '1 TB', number_to_human_size(1234567890123, :precision =&gt; 0)
     assert_equal '500 MB', number_to_human_size(524288000, :precision=&gt;0)
     assert_equal '40 KB', number_to_human_size(41010, :precision =&gt; 0)
@@ -125,8 +141,8 @@ class NumberHelperTest &lt; ActionView::TestCase
   end
 
   def test_number_to_human_size_with_custom_delimiter_and_separator
-    assert_equal '1,01 KB',     number_to_human_size(1.0123.kilobytes, :precision =&gt; 2, :separator =&gt; ',')
-    assert_equal '1,01 KB',     number_to_human_size(1.0100.kilobytes, :precision =&gt; 4, :separator =&gt; ',')
-    assert_equal '1.000,1 TB',  number_to_human_size(1000.1.terabytes, :delimiter =&gt; '.', :separator =&gt; ',')
+    assert_equal '1,01 KB',     number_to_human_size(kilobytes(1.0123), :precision =&gt; 2, :separator =&gt; ',')
+    assert_equal '1,01 KB',     number_to_human_size(kilobytes(1.0100), :precision =&gt; 4, :separator =&gt; ',')
+    assert_equal '1.000,1 TB',  number_to_human_size(terabytes(1000.1), :delimiter =&gt; '.', :separator =&gt; ',')
   end
 end</diff>
      <filename>actionpack/test/template/number_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,10 @@
 require 'abstract_unit'
 
 Bunny = Struct.new(:Bunny, :id)
+Bunny.extend ActiveModel::Naming
 
 class Author
+  extend ActiveModel::Naming
   attr_reader :id
   def save; @id = 1 end
   def new_record?; @id.nil? end
@@ -12,6 +14,7 @@ class Author
 end
 
 class Article
+  extend ActiveModel::Naming
   attr_reader :id
   attr_reader :author_id
   def save; @id = 1; @author_id = 1 end
@@ -133,7 +136,7 @@ class PrototypeHelperTest &lt; PrototypeHelperBaseTest
   end
 
   def test_form_remote_tag_with_method
-    assert_dom_equal %(&lt;form action=\&quot;http://www.example.com/fast\&quot; method=\&quot;post\&quot; onsubmit=\&quot;new Ajax.Updater('glass_of_beer', 'http://www.example.com/fast', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\&quot;&gt;&lt;div style='margin:0;padding:0'&gt;&lt;input name='_method' type='hidden' value='put' /&gt;&lt;/div&gt;),
+    assert_dom_equal %(&lt;form action=\&quot;http://www.example.com/fast\&quot; method=\&quot;post\&quot; onsubmit=\&quot;new Ajax.Updater('glass_of_beer', 'http://www.example.com/fast', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\&quot;&gt;&lt;div style='margin:0;padding:0;display:inline'&gt;&lt;input name='_method' type='hidden' value='put' /&gt;&lt;/div&gt;),
       form_remote_tag(:update =&gt; &quot;glass_of_beer&quot;, :url =&gt; { :action =&gt; :fast  }, :html =&gt; { :method =&gt; :put })
   end
 
@@ -161,7 +164,7 @@ class PrototypeHelperTest &lt; PrototypeHelperBaseTest
     @record.save
     remote_form_for(@record) {}
 
-    expected = %(&lt;form action='#{author_path(@record)}' id='edit_author_1' method='post' onsubmit=&quot;new Ajax.Request('#{author_path(@record)}', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;&quot; class='edit_author'&gt;&lt;div style='margin:0;padding:0'&gt;&lt;input name='_method' type='hidden' value='put' /&gt;&lt;/div&gt;&lt;/form&gt;)
+    expected = %(&lt;form action='#{author_path(@record)}' id='edit_author_1' method='post' onsubmit=&quot;new Ajax.Request('#{author_path(@record)}', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;&quot; class='edit_author'&gt;&lt;div style='margin:0;padding:0;display:inline'&gt;&lt;input name='_method' type='hidden' value='put' /&gt;&lt;/div&gt;&lt;/form&gt;)
     assert_dom_equal expected, output_buffer
   end
 
@@ -177,7 +180,7 @@ class PrototypeHelperTest &lt; PrototypeHelperBaseTest
     @article.save
     remote_form_for([@author, @article]) {}
 
-    expected = %(&lt;form action='#{author_article_path(@author, @article)}' id='edit_article_1' method='post' onsubmit=&quot;new Ajax.Request('#{author_article_path(@author, @article)}', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;&quot; class='edit_article'&gt;&lt;div style='margin:0;padding:0'&gt;&lt;input name='_method' type='hidden' value='put' /&gt;&lt;/div&gt;&lt;/form&gt;)
+    expected = %(&lt;form action='#{author_article_path(@author, @article)}' id='edit_article_1' method='post' onsubmit=&quot;new Ajax.Request('#{author_article_path(@author, @article)}', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;&quot; class='edit_article'&gt;&lt;div style='margin:0;padding:0;display:inline'&gt;&lt;input name='_method' type='hidden' value='put' /&gt;&lt;/div&gt;&lt;/form&gt;)
     assert_dom_equal expected, output_buffer
   end
 </diff>
      <filename>actionpack/test/template/prototype_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,7 @@
 require 'abstract_unit'
 
 class Post
+  extend ActiveModel::Naming
   def id
      45
   end</diff>
      <filename>actionpack/test/template/record_tag_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,7 +13,7 @@ module RenderTestCases
     I18n.backend.store_translations 'pt-BR', {}
 
     # Ensure original are still the same since we are reindexing view paths
-    assert_equal ORIGINAL_LOCALES, I18n.available_locales.map(&amp;:to_s).sort
+    assert_equal ORIGINAL_LOCALES, I18n.available_locales.map {|l| l.to_s }.sort
   end
 
   def test_render_file
@@ -46,29 +46,6 @@ module RenderTestCases
     I18n.locale = old_locale
   end
 
-  def test_render_implicit_html_template_from_xhr_request
-    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.formats = old_format
-  end
-
-  def test_render_implicit_html_template_from_xhr_request_with_localization
-    old_locale = I18n.locale
-    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.formats = old_format
-  end
-
   def test_render_file_at_top_level
     assert_equal 'Elastica', @view.render(:file =&gt; '/shared')
   end
@@ -247,10 +224,27 @@ module RenderTestCases
   end
 
   if '1.9'.respond_to?(:force_encoding)
-    def test_render_utf8_template
-      result = @view.render(:file =&gt; &quot;test/utf8.html.erb&quot;, :layouts =&gt; &quot;layouts/yield&quot;)
-      assert_equal &quot;&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081; &#1090;&#1077;&#1082;&#1089;&#1090;\nUTF-8\nUTF-8\nUTF-8\n&quot;, result
-      assert_equal Encoding::UTF_8, result.encoding
+    def test_render_utf8_template_with_magic_comment
+      with_external_encoding Encoding::ASCII_8BIT do
+        result = @view.render(:file =&gt; &quot;test/utf8_magic.html.erb&quot;, :layouts =&gt; &quot;layouts/yield&quot;)
+        assert_equal &quot;&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081; &#1090;&#1077;&#1082;&#1089;&#1090;\nUTF-8\nUTF-8\nUTF-8\n&quot;, result
+        assert_equal Encoding::UTF_8, result.encoding
+      end
+    end
+
+    def test_render_utf8_template_with_default_external_encoding
+      with_external_encoding Encoding::UTF_8 do
+        result = @view.render(:file =&gt; &quot;test/utf8.html.erb&quot;, :layouts =&gt; &quot;layouts/yield&quot;)
+        assert_equal &quot;&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081; &#1090;&#1077;&#1082;&#1089;&#1090;\nUTF-8\nUTF-8\nUTF-8\n&quot;, result
+        assert_equal Encoding::UTF_8, result.encoding
+      end
+    end
+
+    def with_external_encoding(encoding)
+      old, Encoding.default_external = Encoding.default_external, encoding
+      yield
+    ensure
+      Encoding.default_external = old
     end
   end
 end
@@ -261,7 +255,7 @@ class CachedViewRenderTest &lt; ActiveSupport::TestCase
   # Ensure view path cache is primed
   def setup
     view_paths = ActionController::Base.view_paths
-    assert_equal ActionView::Template::FileSystemPathWithFallback, view_paths.first.class
+    assert_equal ActionView::FileSystemResolverWithFallback, view_paths.first.class
     setup_view(view_paths)
   end
 end
@@ -272,9 +266,9 @@ class LazyViewRenderTest &lt; ActiveSupport::TestCase
   # Test the same thing as above, but make sure the view path
   # is not eager loaded
   def setup
-    path = ActionView::Template::FileSystemPathWithFallback.new(FIXTURE_LOAD_PATH)
+    path = ActionView::FileSystemResolverWithFallback.new(FIXTURE_LOAD_PATH)
     view_paths = ActionView::Base.process_view_paths(path)
-    assert_equal ActionView::Template::FileSystemPathWithFallback, view_paths.first.class
+    assert_equal ActionView::FileSystemResolverWithFallback, view_paths.first.class
     setup_view(view_paths)
   end
 end</diff>
      <filename>actionpack/test/template/render_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -41,6 +41,7 @@ class PeopleHelperTest &lt; ActionView::TestCase
 
   def test_link_to_person
     person = mock(:name =&gt; &quot;David&quot;)
+    person.class.extend ActiveModel::Naming
     expects(:mocha_mock_path).with(person).returns(&quot;/people/1&quot;)
     assert_equal '&lt;a href=&quot;/people/1&quot;&gt;David&lt;/a&gt;', link_to_person(person)
   end</diff>
      <filename>actionpack/test/template/test_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -494,6 +494,7 @@ class LinkToUnlessCurrentWithControllerTest &lt; ActionView::TestCase
 end
 
 class Workshop
+  extend ActiveModel::Naming
   attr_accessor :id, :new_record
 
   def initialize(id, new_record)
@@ -510,6 +511,7 @@ class Workshop
 end
 
 class Session
+  extend ActiveModel::Naming
   attr_accessor :id, :workshop_id, :new_record
 
   def initialize(id, new_record)</diff>
      <filename>actionpack/test/template/url_helper_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -21,21 +21,27 @@
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #++
 
-activesupport_path = &quot;#{File.dirname(__FILE__)}/../../../activesupport/lib&quot;
+activesupport_path = &quot;#{File.dirname(__FILE__)}/../../activesupport/lib&quot;
 $:.unshift(activesupport_path) if File.directory?(activesupport_path)
 require 'active_support'
 
-require 'active_support/inflector'
-
 module ActiveModel
+  autoload :Attributes, 'active_model/attributes'
   autoload :Base, 'active_model/base'
-  autoload :Observing, 'active_model/observing'
-  autoload :Validations, 'active_model/validations'
-  autoload :Errors, 'active_model/errors'
   autoload :DeprecatedErrorMethods, 'active_model/deprecated_error_methods'
-  autoload :TestCase, 'active_model/test_case'
+  autoload :Errors, 'active_model/errors'
+  autoload :Name, 'active_model/naming'
+  autoload :Naming, 'active_model/naming'
+  autoload :Observer, 'active_model/observing'
+  autoload :Observing, 'active_model/observing'
   autoload :StateMachine, 'active_model/state_machine'
+  autoload :TestCase, 'active_model/test_case'
+  autoload :Validations, 'active_model/validations'
   autoload :ValidationsRepairHelper, 'active_model/validations_repair_helper'
+
+  module Serializers
+    autoload :JSON, 'active_model/serializers/json'
+  end
 end
 
 I18n.load_path &lt;&lt; File.dirname(__FILE__) + '/active_model/locale/en.yml'</diff>
      <filename>activemodel/lib/active_model.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,7 @@ module ActiveModel
       ActiveSupport::Deprecation.warn &quot;Errors#add_to_base(msg) has been deprecated, use Errors#[:base] &lt;&lt; msg instead&quot;
       self[:base] &lt;&lt; msg
     end
-  
+
     def invalid?(attribute)
       ActiveSupport::Deprecation.warn &quot;Errors#invalid?(attribute) has been deprecated, use Errors#[attribute].any? instead&quot;
       self[attribute].any?
@@ -30,4 +30,4 @@ module ActiveModel
       to_a.each { |error| yield error }
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>activemodel/lib/active_model/deprecated_error_methods.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,5 @@
+require 'active_support/core_ext/string/inflections'
+
 module ActiveModel
   class Errors &lt; Hash
     include DeprecatedErrorMethods
@@ -23,7 +25,7 @@ module ActiveModel
     end
 
     def each
-      each_key do |attribute| 
+      each_key do |attribute|
         self[attribute].each { |error| yield attribute, error }
       end
     end
@@ -66,7 +68,7 @@ module ActiveModel
     # Will add an error message to each of the attributes in +attributes+ that is empty.
     def add_on_empty(attributes, custom_message = nil)
       [attributes].flatten.each do |attribute|
-        value = @base.get_attribute_value(attribute)
+        value = @base.send(attribute)
         is_empty = value.respond_to?(:empty?) ? value.empty? : false
         add(attribute, :empty, :default =&gt; custom_message) unless !value.nil? &amp;&amp; !is_empty
       end
@@ -75,7 +77,7 @@ module ActiveModel
     # Will add an error message to each of the attributes in +attributes+ that is blank (using Object#blank?).
     def add_on_blank(attributes, custom_message = nil)
       [attributes].flatten.each do |attribute|
-        value = @base.get_attribute_value(attribute)
+        value = @base.send(attribute)
         add(attribute, :blank, :default =&gt; custom_message) if value.blank?
       end
     end
@@ -94,6 +96,7 @@ module ActiveModel
       full_messages = []
 
       each do |attribute, messages|
+        messages = Array.wrap(messages)
         next if messages.empty?
 
         if attribute == :base
@@ -111,15 +114,15 @@ module ActiveModel
     end
 
     # Translates an error message in it's default scope (&lt;tt&gt;activemodel.errrors.messages&lt;/tt&gt;).
-    # Error messages are first looked up in &lt;tt&gt;models.MODEL.attributes.ATTRIBUTE.MESSAGE&lt;/tt&gt;, if it's not there, 
-    # it's looked up in &lt;tt&gt;models.MODEL.MESSAGE&lt;/tt&gt; and if that is not there it returns the translation of the 
-    # default message (e.g. &lt;tt&gt;activemodel.errors.messages.MESSAGE&lt;/tt&gt;). The translated model name, 
+    # Error messages are first looked up in &lt;tt&gt;models.MODEL.attributes.ATTRIBUTE.MESSAGE&lt;/tt&gt;, if it's not there,
+    # it's looked up in &lt;tt&gt;models.MODEL.MESSAGE&lt;/tt&gt; and if that is not there it returns the translation of the
+    # default message (e.g. &lt;tt&gt;activemodel.errors.messages.MESSAGE&lt;/tt&gt;). The translated model name,
     # translated attribute name and the value are available for interpolation.
     #
     # When using inheritence in your models, it will check all the inherited models too, but only if the model itself
     # hasn't been found. Say you have &lt;tt&gt;class Admin &lt; User; end&lt;/tt&gt; and you wanted the translation for the &lt;tt&gt;:blank&lt;/tt&gt;
     # error +message+ for the &lt;tt&gt;title&lt;/tt&gt; +attribute+, it looks for these translations:
-    # 
+    #
     # &lt;ol&gt;
     # &lt;li&gt;&lt;tt&gt;activemodel.errors.models.admin.attributes.title.blank&lt;/tt&gt;&lt;/li&gt;
     # &lt;li&gt;&lt;tt&gt;activemodel.errors.models.admin.blank&lt;/tt&gt;&lt;/li&gt;
@@ -135,7 +138,7 @@ module ActiveModel
       klass_ancestors += @base.class.ancestors.reject {|x| x.is_a?(Module)}
 
       defaults = klass_ancestors.map do |klass|
-        [ :&quot;models.#{klass.name.underscore}.attributes.#{attribute}.#{message}&quot;, 
+        [ :&quot;models.#{klass.name.underscore}.attributes.#{attribute}.#{message}&quot;,
           :&quot;models.#{klass.name.underscore}.#{message}&quot; ]
       end
 
@@ -143,7 +146,7 @@ module ActiveModel
       defaults = defaults.compact.flatten &lt;&lt; :&quot;messages.#{message}&quot;
 
       key = defaults.shift
-      value = @base.get_attribute_value(attribute)
+      value = @base.send(attribute)
 
       options = { :default =&gt; defaults,
         :model =&gt; @base.class.name.humanize,
@@ -155,4 +158,4 @@ module ActiveModel
       I18n.translate(key, options)
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>activemodel/lib/active_model/errors.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,69 +1,90 @@
 require 'observer'
 require 'singleton'
+require 'active_support/core_ext/string/inflections'
+require 'active_support/core_ext/array/wrap'
 
 module ActiveModel
   module Observing
+    extend ActiveSupport::Concern
+
+    included do
+      extend Observable
+    end
+
     module ClassMethods
-      def observers
-        @observers ||= []
-      end
-      
+      # Activates the observers assigned. Examples:
+      #
+      #   # Calls PersonObserver.instance
+      #   ActiveRecord::Base.observers = :person_observer
+      #
+      #   # Calls Cacher.instance and GarbageCollector.instance
+      #   ActiveRecord::Base.observers = :cacher, :garbage_collector
+      #
+      #   # Same as above, just using explicit class references
+      #   ActiveRecord::Base.observers = Cacher, GarbageCollector
+      #
+      # Note: Setting this does not instantiate the observers yet. +instantiate_observers+ is
+      # called during startup, and before each development request.
       def observers=(*values)
         @observers = values.flatten
       end
-      
+
+      # Gets the current observers.
+      def observers
+        @observers ||= []
+      end
+
+      # Instantiate the global Active Record observers.
       def instantiate_observers
         observers.each { |o| instantiate_observer(o) }
       end
-    
-    protected
-      def instantiate_observer(observer)
-        # string/symbol
-        if observer.respond_to?(:to_sym)
-          observer = observer.to_s.camelize.constantize.instance
-        elsif observer.respond_to?(:instance)
-          observer.instance
-        else
-          raise ArgumentError, &quot;#{observer} must be a lowercase, underscored class name (or an instance of the class itself) responding to the instance method. Example: Person.observers = :big_brother # calls BigBrother.instance&quot;
+
+      protected
+        def instantiate_observer(observer)
+          # string/symbol
+          if observer.respond_to?(:to_sym)
+            observer = observer.to_s.camelize.constantize.instance
+          elsif observer.respond_to?(:instance)
+            observer.instance
+          else
+            raise ArgumentError, &quot;#{observer} must be a lowercase, underscored class name (or an instance of the class itself) responding to the instance method. Example: Person.observers = :big_brother # calls BigBrother.instance&quot;
+          end
+        end
+
+        # Notify observers when the observed class is subclassed.
+        def inherited(subclass)
+          super
+          changed
+          notify_observers :observed_class_inherited, subclass
         end
-      end
-      
-      # Notify observers when the observed class is subclassed.
-      def inherited(subclass)
-        super
-        changed
-        notify_observers :observed_class_inherited, subclass
-      end
-    end
-    
-    def self.included(receiver)
-      receiver.extend Observable, ClassMethods
     end
+
+    private
+      def notify(method) #:nodoc:
+        self.class.changed
+        self.class.notify_observers(method, self)
+      end
   end
 
   class Observer
     include Singleton
-    attr_writer :observed_classes
 
     class &lt;&lt; self
-      attr_accessor :models
       # Attaches the observer to the supplied model classes.
       def observe(*models)
-        @models = models.flatten
-        @models.collect! { |model| model.respond_to?(:to_sym) ? model.to_s.camelize.constantize : model }
+        models.flatten!
+        models.collect! { |model| model.respond_to?(:to_sym) ? model.to_s.camelize.constantize : model }
+        define_method(:observed_classes) { models }
       end
 
-      def observed_class_name
-        @observed_class_name ||= 
-          if guessed_name = name.scan(/(.*)Observer/)[0]
-            @observed_class_name = guessed_name[0]
-          end
+      def observed_classes
+        Array.wrap(observed_class)
       end
 
       # The class observed by default is inferred from the observer's class name:
-      #   assert_equal [Person], PersonObserver.observed_class
+      #   assert_equal Person, PersonObserver.observed_class
       def observed_class
-        if observed_class_name
+        if observed_class_name = name[/(.*)Observer/, 1]
           observed_class_name.constantize
         else
           nil
@@ -73,8 +94,11 @@ module ActiveModel
 
     # Start observing the declared classes and their subclasses.
     def initialize
-      self.observed_classes = self.class.models if self.class.models
-      observed_classes.each { |klass| klass.add_observer(self) }
+      observed_classes.each { |klass| add_observer!(klass) }
+    end
+
+    def observed_classes
+      self.class.observed_classes
     end
 
     # Send observed_method(object) if the method exists.
@@ -86,12 +110,12 @@ module ActiveModel
     # Passes the new subclass.
     def observed_class_inherited(subclass) #:nodoc:
       self.class.observe(observed_classes + [subclass])
-      subclass.add_observer(self)
+      add_observer!(subclass)
     end
 
-  protected
-    def observed_classes
-      @observed_classes ||= [self.class.observed_class]
-    end
+    protected
+      def add_observer!(klass)
+        klass.add_observer(self)
+      end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>activemodel/lib/active_model/observing.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,6 @@
+require 'active_support/core_ext/array/extract_options'
+require 'active_support/core_ext/hash/keys'
+
 module ActiveModel
   module Validations
     extend ActiveSupport::Concern
@@ -61,7 +64,7 @@ module ActiveModel
         # Declare the validation.
         send(validation_method(options[:on]), options) do |record|
           attrs.each do |attr|
-            value = record.get_attribute_value(attr)
+            value = record.send(attr)
             next if (value.nil? &amp;&amp; options[:allow_nil]) || (value.blank? &amp;&amp; options[:allow_blank])
             yield record, attr, value
           end
@@ -69,10 +72,9 @@ module ActiveModel
       end
 
       private
-
-      def validation_method(on)
-        :validate
-      end
+        def validation_method(on)
+          :validate
+        end
     end
 
     # Returns the Errors object that holds all information about attribute error messages.
@@ -91,10 +93,6 @@ module ActiveModel
     def invalid?
       !valid?
     end
-
-    def get_attribute_value(attribute)
-      respond_to?(attribute.to_sym) ? send(attribute.to_sym) : instance_variable_get(:&quot;@#{attribute}&quot;)
-    end
   end
 end
 </diff>
      <filename>activemodel/lib/active_model/validations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -39,10 +39,10 @@ module ActiveModel
 
         validates_each(attr_names,configuration) do |record, attr_name, value|
           unless value == configuration[:accept]
-            record.errors.add(attr_name, :accepted, :default =&gt; configuration[:message]) 
+            record.errors.add(attr_name, :accepted, :default =&gt; configuration[:message])
           end
         end
       end
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>activemodel/lib/active_model/validations/acceptance.rb</filename>
    </modified>
    <modified>
      <diff>@@ -36,10 +36,10 @@ module ActiveModel
 
         validates_each(attr_names, configuration) do |record, attr_name, value|
           unless record.send(&quot;#{attr_name}_confirmation&quot;).nil? or value == record.send(&quot;#{attr_name}_confirmation&quot;)
-            record.errors.add(attr_name, :confirmation, :default =&gt; configuration[:message]) 
+            record.errors.add(attr_name, :confirmation, :default =&gt; configuration[:message])
           end
         end
       end
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>activemodel/lib/active_model/validations/confirmation.rb</filename>
    </modified>
    <modified>
      <diff>@@ -29,10 +29,10 @@ module ActiveModel
 
         validates_each(attr_names, configuration) do |record, attr_name, value|
           if enum.include?(value)
-            record.errors.add(attr_name, :exclusion, :default =&gt; configuration[:message], :value =&gt; value) 
+            record.errors.add(attr_name, :exclusion, :default =&gt; configuration[:message], :value =&gt; value)
           end
         end
       end
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>activemodel/lib/active_model/validations/exclusion.rb</filename>
    </modified>
    <modified>
      <diff>@@ -32,10 +32,10 @@ module ActiveModel
 
         validates_each(attr_names, configuration) do |record, attr_name, value|
           unless value.to_s =~ configuration[:with]
-            record.errors.add(attr_name, :invalid, :default =&gt; configuration[:message], :value =&gt; value) 
+            record.errors.add(attr_name, :invalid, :default =&gt; configuration[:message], :value =&gt; value)
           end
         end
       end
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>activemodel/lib/active_model/validations/format.rb</filename>
    </modified>
    <modified>
      <diff>@@ -29,10 +29,10 @@ module ActiveModel
 
         validates_each(attr_names, configuration) do |record, attr_name, value|
           unless enum.include?(value)
-            record.errors.add(attr_name, :inclusion, :default =&gt; configuration[:message], :value =&gt; value) 
+            record.errors.add(attr_name, :inclusion, :default =&gt; configuration[:message], :value =&gt; value)
           end
         end
       end
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>activemodel/lib/active_model/validations/inclusion.rb</filename>
    </modified>
    <modified>
      <diff>@@ -81,7 +81,7 @@ module ActiveModel
           validates_each(attrs, options) do |record, attr, value|
             value = options[:tokenizer].call(value) if value.kind_of?(String)
             unless !value.nil? and value.size.method(validity_checks[option])[option_value]
-              record.errors.add(attr, key, :default =&gt; custom_message, :count =&gt; option_value) 
+              record.errors.add(attr, key, :default =&gt; custom_message, :count =&gt; option_value)
             end
           end
         end
@@ -90,4 +90,4 @@ module ActiveModel
       alias_method :validates_size_of, :validates_length_of
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>activemodel/lib/active_model/validations/length.rb</filename>
    </modified>
    <modified>
      <diff>@@ -71,7 +71,7 @@ module ActiveModel
             case option
             when :odd, :even
               unless raw_value.to_i.method(ALL_NUMERICALITY_CHECKS[option])[]
-                record.errors.add(attr_name, option, :value =&gt; raw_value, :default =&gt; configuration[:message]) 
+                record.errors.add(attr_name, option, :value =&gt; raw_value, :default =&gt; configuration[:message])
               end
             else
               unless raw_value.method(ALL_NUMERICALITY_CHECKS[option])[configuration[option]]
@@ -83,4 +83,4 @@ module ActiveModel
       end
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>activemodel/lib/active_model/validations/numericality.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,5 @@
+require 'active_support/core_ext/object/blank'
+
 module ActiveModel
   module Validations
     module ClassMethods
@@ -16,7 +18,7 @@ module ActiveModel
       #
       # Configuration options:
       # * &lt;tt&gt;message&lt;/tt&gt; - A custom error message (default is: &quot;can't be blank&quot;).
-      # * &lt;tt&gt;on&lt;/tt&gt; - Specifies when this validation is active (default is &lt;tt&gt;:save&lt;/tt&gt;, other options &lt;tt&gt;:create&lt;/tt&gt;, 
+      # * &lt;tt&gt;on&lt;/tt&gt; - Specifies when this validation is active (default is &lt;tt&gt;:save&lt;/tt&gt;, other options &lt;tt&gt;:create&lt;/tt&gt;,
       #   &lt;tt&gt;:update&lt;/tt&gt;).
       # * &lt;tt&gt;if&lt;/tt&gt; - Specifies a method, proc or string to call to determine if the validation should
       #   occur (e.g. &lt;tt&gt;:if =&gt; :allow_validation&lt;/tt&gt;, or &lt;tt&gt;:if =&gt; Proc.new { |user| user.signup_step &gt; 2 }&lt;/tt&gt;).
@@ -36,4 +38,4 @@ module ActiveModel
       end
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>activemodel/lib/active_model/validations/presence.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,8 +10,6 @@ ActiveSupport::Deprecation.debug = true
 
 require 'rubygems'
 require 'test/unit'
-gem 'mocha', '&gt;= 0.9.5'
-require 'mocha'
 
 begin
   require 'ruby-debug'</diff>
      <filename>activemodel/test/cases/helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,7 @@ class FooObserver &lt; ActiveModel::Observer
   class &lt;&lt; self
     public :new
   end
-  
+
   attr_accessor :stub
 
   def on_spec(record)
@@ -28,12 +28,12 @@ class ObservingTest &lt; ActiveModel::TestCase
   test &quot;initializes model with no cached observers&quot; do
     assert ObservedModel.observers.empty?, &quot;Not empty: #{ObservedModel.observers.inspect}&quot;
   end
-  
+
   test &quot;stores cached observers in an array&quot; do
     ObservedModel.observers &lt;&lt; :foo
     assert ObservedModel.observers.include?(:foo), &quot;:foo not in #{ObservedModel.observers.inspect}&quot;
   end
-  
+
   test &quot;flattens array of assigned cached observers&quot; do
     ObservedModel.observers = [[:foo], :bar]
     assert ObservedModel.observers.include?(:foo), &quot;:foo not in #{ObservedModel.observers.inspect}&quot;
@@ -57,22 +57,30 @@ class ObservingTest &lt; ActiveModel::TestCase
     ObservedModel::Observer.expects(:instance)
     ObservedModel.instantiate_observers
   end
-  
+
   test &quot;passes observers to subclasses&quot; do
     FooObserver.instance
     bar = Class.new(Foo)
     assert_equal Foo.count_observers, bar.count_observers
   end
 end
-  
+
 class ObserverTest &lt; ActiveModel::TestCase
   def setup
     ObservedModel.observers = :foo_observer
-    FooObserver.models = nil
+    FooObserver.instance_eval do
+      alias_method :original_observed_classes, :observed_classes
+    end
+  end
+
+  def teardown
+    FooObserver.instance_eval do
+      alias_method :observed_classes, :original_observed_classes
+    end
   end
 
   test &quot;guesses implicit observable model name&quot; do
-    assert_equal 'Foo', FooObserver.observed_class_name
+    assert_equal Foo, FooObserver.observed_class
   end
 
   test &quot;tracks implicit observable models&quot; do
@@ -80,7 +88,7 @@ class ObserverTest &lt; ActiveModel::TestCase
     assert  instance.send(:observed_classes).include?(Foo), &quot;Foo not in #{instance.send(:observed_classes).inspect}&quot;
     assert !instance.send(:observed_classes).include?(ObservedModel), &quot;ObservedModel in #{instance.send(:observed_classes).inspect}&quot;
   end
-  
+
   test &quot;tracks explicit observed model class&quot; do
     old_instance = FooObserver.new
     assert !old_instance.send(:observed_classes).include?(ObservedModel), &quot;ObservedModel in #{old_instance.send(:observed_classes).inspect}&quot;
@@ -88,7 +96,7 @@ class ObserverTest &lt; ActiveModel::TestCase
     instance = FooObserver.new
     assert instance.send(:observed_classes).include?(ObservedModel), &quot;ObservedModel not in #{instance.send(:observed_classes).inspect}&quot;
   end
-  
+
   test &quot;tracks explicit observed model as string&quot; do
     old_instance = FooObserver.new
     assert !old_instance.send(:observed_classes).include?(ObservedModel), &quot;ObservedModel in #{old_instance.send(:observed_classes).inspect}&quot;
@@ -96,7 +104,7 @@ class ObserverTest &lt; ActiveModel::TestCase
     instance = FooObserver.new
     assert instance.send(:observed_classes).include?(ObservedModel), &quot;ObservedModel not in #{instance.send(:observed_classes).inspect}&quot;
   end
-  
+
   test &quot;tracks explicit observed model as symbol&quot; do
     old_instance = FooObserver.new
     assert !old_instance.send(:observed_classes).include?(ObservedModel), &quot;ObservedModel in #{old_instance.send(:observed_classes).inspect}&quot;
@@ -104,7 +112,7 @@ class ObserverTest &lt; ActiveModel::TestCase
     instance = FooObserver.new
     assert instance.send(:observed_classes).include?(ObservedModel), &quot;ObservedModel not in #{instance.send(:observed_classes).inspect}&quot;
   end
-  
+
   test &quot;calls existing observer event&quot; do
     foo = Foo.new
     FooObserver.instance.stub = stub
@@ -112,7 +120,7 @@ class ObserverTest &lt; ActiveModel::TestCase
     Foo.send(:changed)
     Foo.send(:notify_observers, :on_spec, foo)
   end
-  
+
   test &quot;skips nonexistent observer event&quot; do
     foo = Foo.new
     Foo.send(:changed)</diff>
      <filename>activemodel/test/cases/observing_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -31,15 +31,15 @@ class PresenceValidationTest &lt; ActiveModel::TestCase
     assert t.save
   end
 
-  def test_validates_presence_of_with_custom_message_using_quotes
-    repair_validations(Developer) do
-      Developer.validates_presence_of :non_existent, :message=&gt; &quot;This string contains 'single' and \&quot;double\&quot; quotes&quot;
-      d = Developer.new
-      d.name = &quot;Joe&quot;
-      assert !d.valid?
-      assert_equal [&quot;This string contains 'single' and \&quot;double\&quot; quotes&quot;], d.errors[:non_existent]
-    end
-  end
+  # def test_validates_presence_of_with_custom_message_using_quotes
+  #   repair_validations(Developer) do
+  #     Developer.validates_presence_of :non_existent, :message=&gt; &quot;This string contains 'single' and \&quot;double\&quot; quotes&quot;
+  #     d = Developer.new
+  #     d.name = &quot;Joe&quot;
+  #     assert !d.valid?
+  #     assert_equal [&quot;This string contains 'single' and \&quot;double\&quot; quotes&quot;], d.errors[:non_existent]
+  #   end
+  # end
 
   def test_validates_presence_of_for_ruby_class
     repair_validations(Person) do</diff>
      <filename>activemodel/test/cases/validations/presence_validation_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -187,7 +187,7 @@ spec = Gem::Specification.new do |s|
     s.files = s.files + Dir.glob( &quot;#{dir}/**/*&quot; ).delete_if { |item| item.include?( &quot;\.svn&quot; ) }
   end
 
-  s.add_dependency('activesupport', '= 2.3.2' + PKG_BUILD)
+  s.add_dependency('activesupport', '= 3.0.pre' + PKG_BUILD)
 
   s.files.delete FIXTURES_ROOT + &quot;/fixture_database.sqlite&quot;
   s.files.delete FIXTURES_ROOT + &quot;/fixture_database_2.sqlite&quot;</diff>
      <filename>activerecord/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -59,7 +59,7 @@ module ActiveRecord
   autoload :Migrator, 'active_record/migration'
   autoload :NamedScope, 'active_record/named_scope'
   autoload :NestedAttributes, 'active_record/nested_attributes'
-  autoload :Observing, 'active_record/observer'
+  autoload :Observer, 'active_record/observer'
   autoload :QueryCache, 'active_record/query_cache'
   autoload :Reflection, 'active_record/reflection'
   autoload :Schema, 'active_record/schema'</diff>
      <filename>activerecord/lib/active_record.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1242,13 +1242,8 @@ module ActiveRecord
               association = association_proxy_class.new(self, reflection)
             end
 
-            if association_proxy_class == HasOneThroughAssociation
-              association.create_through_record(new_value)
-              self.send(reflection.name, new_value)
-            else
-              association.replace(new_value)
-              association_instance_set(reflection.name, new_value.nil? ? nil : association)
-            end
+            association.replace(new_value)
+            association_instance_set(reflection.name, new_value.nil? ? nil : association)
           end
 
           define_method(&quot;set_#{reflection.name}_target&quot;) do |target|</diff>
      <filename>activerecord/lib/active_record/associations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -351,7 +351,19 @@ module ActiveRecord
       protected
         def construct_find_options!(options)
         end
-        
+
+        def construct_counter_sql
+          if @reflection.options[:counter_sql]
+            @counter_sql = interpolate_sql(@reflection.options[:counter_sql])
+          elsif @reflection.options[:finder_sql]
+            # replace the SELECT clause with COUNT(*), preserving any hints within /* ... */
+            @reflection.options[:counter_sql] = @reflection.options[:finder_sql].sub(/SELECT\b(\/\*.*?\*\/ )?(.*)\bFROM\b/im) { &quot;SELECT #{$1}COUNT(*) FROM&quot; }
+            @counter_sql = interpolate_sql(@reflection.options[:counter_sql])
+          else
+            @counter_sql = @finder_sql
+          end
+        end
+
         def load_target
           if !@owner.new_record? || foreign_key_present
             begin</diff>
      <filename>activerecord/lib/active_record/associations/association_collection.rb</filename>
    </modified>
    <modified>
      <diff>@@ -85,15 +85,7 @@ module ActiveRecord
 
           @join_sql = &quot;INNER JOIN #{@owner.connection.quote_table_name @reflection.options[:join_table]} ON #{@reflection.quoted_table_name}.#{@reflection.klass.primary_key} = #{@owner.connection.quote_table_name @reflection.options[:join_table]}.#{@reflection.association_foreign_key}&quot;
 
-          if @reflection.options[:counter_sql]
-            @counter_sql = interpolate_sql(@reflection.options[:counter_sql])
-          elsif @reflection.options[:finder_sql]
-            # replace the SELECT clause with COUNT(*), preserving any hints within /* ... */
-            @reflection.options[:counter_sql] = @reflection.options[:finder_sql].sub(/SELECT (\/\*.*?\*\/ )?(.*)\bFROM\b/im) { &quot;SELECT #{$1}COUNT(*) FROM&quot; }
-            @counter_sql = interpolate_sql(@reflection.options[:counter_sql])
-          else
-            @counter_sql = @finder_sql
-          end
+          construct_counter_sql
         end
 
         def construct_scope</diff>
      <filename>activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb</filename>
    </modified>
    <modified>
      <diff>@@ -97,15 +97,7 @@ module ActiveRecord
               @finder_sql &lt;&lt; &quot; AND (#{conditions})&quot; if conditions
           end
 
-          if @reflection.options[:counter_sql]
-            @counter_sql = interpolate_sql(@reflection.options[:counter_sql])
-          elsif @reflection.options[:finder_sql]
-            # replace the SELECT clause with COUNT(*), preserving any hints within /* ... */
-            @reflection.options[:counter_sql] = @reflection.options[:finder_sql].sub(/SELECT (\/\*.*?\*\/ )?(.*)\bFROM\b/im) { &quot;SELECT #{$1}COUNT(*) FROM&quot; }
-            @counter_sql = interpolate_sql(@reflection.options[:counter_sql])
-          else
-            @counter_sql = @finder_sql
-          end
+          construct_counter_sql
         end
 
         def construct_scope</diff>
      <filename>activerecord/lib/active_record/associations/has_many_association.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,10 @@
+require &quot;active_record/associations/through_association_scope&quot;
+
 module ActiveRecord
   module Associations
     class HasManyThroughAssociation &lt; HasManyAssociation #:nodoc:
+      include ThroughAssociationScope
+
       alias_method :new, :build
 
       def create!(attrs = nil)
@@ -72,114 +76,7 @@ module ActiveRecord
 
         def find_target
           return [] unless target_reflection_has_associated_record?
-          @reflection.klass.find(:all,
-            :select     =&gt; construct_select,
-            :conditions =&gt; construct_conditions,
-            :from       =&gt; construct_from,
-            :joins      =&gt; construct_joins,
-            :order      =&gt; @reflection.options[:order],
-            :limit      =&gt; @reflection.options[:limit],
-            :group      =&gt; @reflection.options[:group],
-            :readonly   =&gt; @reflection.options[:readonly],
-            :include    =&gt; @reflection.options[:include] || @reflection.source_reflection.options[:include]
-          )
-        end
-
-        # Construct attributes for associate pointing to owner.
-        def construct_owner_attributes(reflection)
-          if as = reflection.options[:as]
-            { &quot;#{as}_id&quot; =&gt; @owner.id,
-              &quot;#{as}_type&quot; =&gt; @owner.class.base_class.name.to_s }
-          else
-            { reflection.primary_key_name =&gt; @owner.id }
-          end
-        end
-
-        # Construct attributes for :through pointing to owner and associate.
-        def construct_join_attributes(associate)
-          # TODO: revist this to allow it for deletion, supposing dependent option is supported
-          raise ActiveRecord::HasManyThroughCantAssociateThroughHasManyReflection.new(@owner, @reflection) if @reflection.source_reflection.macro == :has_many
-          join_attributes = construct_owner_attributes(@reflection.through_reflection).merge(@reflection.source_reflection.primary_key_name =&gt; associate.id)
-          if @reflection.options[:source_type]
-            join_attributes.merge!(@reflection.source_reflection.options[:foreign_type] =&gt; associate.class.base_class.name.to_s)
-          end
-          join_attributes
-        end
-
-        # Associate attributes pointing to owner, quoted.
-        def construct_quoted_owner_attributes(reflection)
-          if as = reflection.options[:as]
-            { &quot;#{as}_id&quot; =&gt; owner_quoted_id,
-              &quot;#{as}_type&quot; =&gt; reflection.klass.quote_value(
-                @owner.class.base_class.name.to_s,
-                reflection.klass.columns_hash[&quot;#{as}_type&quot;]) }
-          elsif reflection.macro == :belongs_to
-            { reflection.klass.primary_key =&gt; @owner[reflection.primary_key_name] }
-          else
-            { reflection.primary_key_name =&gt; owner_quoted_id }
-          end
-        end
-
-        # Build SQL conditions from attributes, qualified by table name.
-        def construct_conditions
-          table_name = @reflection.through_reflection.quoted_table_name
-          conditions = construct_quoted_owner_attributes(@reflection.through_reflection).map do |attr, value|
-            &quot;#{table_name}.#{attr} = #{value}&quot;
-          end
-          conditions &lt;&lt; sql_conditions if sql_conditions
-          &quot;(&quot; + conditions.join(') AND (') + &quot;)&quot;
-        end
-
-        def construct_from
-          @reflection.quoted_table_name
-        end
-
-        def construct_select(custom_select = nil)
-          distinct = &quot;DISTINCT &quot; if @reflection.options[:uniq]
-          selected = custom_select || @reflection.options[:select] || &quot;#{distinct}#{@reflection.quoted_table_name}.*&quot;
-        end
-
-        def construct_joins(custom_joins = nil)
-          polymorphic_join = nil
-          if @reflection.source_reflection.macro == :belongs_to
-            reflection_primary_key = @reflection.klass.primary_key
-            source_primary_key     = @reflection.source_reflection.primary_key_name
-            if @reflection.options[:source_type]
-              polymorphic_join = &quot;AND %s.%s = %s&quot; % [
-                @reflection.through_reflection.quoted_table_name, &quot;#{@reflection.source_reflection.options[:foreign_type]}&quot;,
-                @owner.class.quote_value(@reflection.options[:source_type])
-              ]
-            end
-          else
-            reflection_primary_key = @reflection.source_reflection.primary_key_name
-            source_primary_key     = @reflection.through_reflection.klass.primary_key
-            if @reflection.source_reflection.options[:as]
-              polymorphic_join = &quot;AND %s.%s = %s&quot; % [
-                @reflection.quoted_table_name, &quot;#{@reflection.source_reflection.options[:as]}_type&quot;,
-                @owner.class.quote_value(@reflection.through_reflection.klass.name)
-              ]
-            end
-          end
-
-          &quot;INNER JOIN %s ON %s.%s = %s.%s %s #{@reflection.options[:joins]} #{custom_joins}&quot; % [
-            @reflection.through_reflection.quoted_table_name,
-            @reflection.quoted_table_name, reflection_primary_key,
-            @reflection.through_reflection.quoted_table_name, source_primary_key,
-            polymorphic_join
-          ]
-        end
-
-        def construct_scope
-          { :create =&gt; construct_owner_attributes(@reflection),
-            :find   =&gt; { :from        =&gt; construct_from,
-                         :conditions  =&gt; construct_conditions,
-                         :joins       =&gt; construct_joins,
-                         :include     =&gt; @reflection.options[:include],
-                         :select      =&gt; construct_select,
-                         :order       =&gt; @reflection.options[:order],
-                         :limit       =&gt; @reflection.options[:limit],
-                         :readonly    =&gt; @reflection.options[:readonly],
-             } }
+          with_scope(construct_scope) { @reflection.klass.find(:all) }
         end
 
         def construct_sql
@@ -193,59 +90,9 @@ module ActiveRecord
               @finder_sql = construct_conditions
           end
 
-          if @reflection.options[:counter_sql]
-            @counter_sql = interpolate_sql(@reflection.options[:counter_sql])
-          elsif @reflection.options[:finder_sql]
-            # replace the SELECT clause with COUNT(*), preserving any hints within /* ... */
-            @reflection.options[:counter_sql] = @reflection.options[:finder_sql].sub(/SELECT (\/\*.*?\*\/ )?(.*)\bFROM\b/im) { &quot;SELECT #{$1}COUNT(*) FROM&quot; }
-            @counter_sql = interpolate_sql(@reflection.options[:counter_sql])
-          else
-            @counter_sql = @finder_sql
-          end
-        end
-
-        def conditions
-          @conditions = build_conditions unless defined?(@conditions)
-          @conditions
+          construct_counter_sql
         end
 
-        def build_conditions
-          association_conditions = @reflection.options[:conditions]
-          through_conditions = build_through_conditions
-          source_conditions = @reflection.source_reflection.options[:conditions]
-          uses_sti = !@reflection.through_reflection.klass.descends_from_active_record?
-
-          if association_conditions || through_conditions || source_conditions || uses_sti
-            all = []
-
-            [association_conditions, source_conditions].each do |conditions|
-              all &lt;&lt; interpolate_sql(sanitize_sql(conditions)) if conditions
-            end
-
-            all &lt;&lt; through_conditions  if through_conditions
-            all &lt;&lt; build_sti_condition if uses_sti
-
-            all.map { |sql| &quot;(#{sql})&quot; } * ' AND '
-          end
-        end
-
-        def build_through_conditions
-          conditions = @reflection.through_reflection.options[:conditions]
-          if conditions.is_a?(Hash)
-            interpolate_sql(sanitize_sql(conditions)).gsub(
-              @reflection.quoted_table_name,
-              @reflection.through_reflection.quoted_table_name)
-          elsif conditions
-            interpolate_sql(sanitize_sql(conditions))
-          end
-        end
-        
-        def build_sti_condition
-          @reflection.through_reflection.klass.send(:type_condition)
-        end
-
-        alias_method :sql_conditions, :conditions
-
         def has_cached_counter?
           @owner.attribute_present?(cached_counter_attribute_name)
         end</diff>
      <filename>activerecord/lib/active_record/associations/has_many_through_association.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 module ActiveRecord
   module Associations
-    class HasOneAssociation &lt; BelongsToAssociation #:nodoc:
+    class HasOneAssociation &lt; AssociationProxy #:nodoc:
       def initialize(owner, reflection)
         super
         construct_sql
@@ -77,7 +77,7 @@ module ActiveRecord
           the_target = @reflection.klass.find(:first,
             :conditions =&gt; @finder_sql,
             :select     =&gt; @reflection.options[:select],
-            :order      =&gt; @reflection.options[:order], 
+            :order      =&gt; @reflection.options[:order],
             :include    =&gt; @reflection.options[:include],
             :readonly   =&gt; @reflection.options[:readonly]
           )
@@ -88,7 +88,7 @@ module ActiveRecord
         def construct_sql
           case
             when @reflection.options[:as]
-              @finder_sql = 
+              @finder_sql =
                 &quot;#{@reflection.quoted_table_name}.#{@reflection.options[:as]}_id = #{owner_quoted_id} AND &quot; +
                 &quot;#{@reflection.quoted_table_name}.#{@reflection.options[:as]}_type = #{@owner.class.quote_value(@owner.class.base_class.name.to_s)}&quot;
             else
@@ -96,7 +96,7 @@ module ActiveRecord
           end
           @finder_sql &lt;&lt; &quot; AND (#{conditions})&quot; if conditions
         end
-        
+
         def construct_scope
           create_scoping = {}
           set_belongs_to_association_for(create_scoping)
@@ -113,7 +113,7 @@ module ActiveRecord
           end
 
           if replace_existing
-            replace(record, true) 
+            replace(record, true)
           else
             record[@reflection.primary_key_name] = @owner.id unless @owner.new_record?
             self.target = record</diff>
      <filename>activerecord/lib/active_record/associations/has_one_association.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,16 @@
+require &quot;active_record/associations/through_association_scope&quot;
+
 module ActiveRecord
   module Associations
-    class HasOneThroughAssociation &lt; HasManyThroughAssociation
+    class HasOneThroughAssociation &lt; HasOneAssociation
+      include ThroughAssociationScope
+
+      def replace(new_value)
+        create_through_record(new_value)
+        @target = new_value
+      end
+
+      private
 
       def create_through_record(new_value) #nodoc:
         klass = @reflection.through_reflection.klass
@@ -15,16 +25,8 @@ module ActiveRecord
       end
 
     private
-      def find(*args)
-        super(args.merge(:limit =&gt; 1))
-      end
-
       def find_target
-        super.first
-      end
-
-      def reset_target!
-        @target = nil
+        with_scope(construct_scope) { @reflection.klass.find(:first) }
       end
     end
   end</diff>
      <filename>activerecord/lib/active_record/associations/has_one_through_association.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,6 +11,7 @@ require 'active_support/core_ext/hash/indifferent_access'
 require 'active_support/core_ext/hash/slice'
 require 'active_support/core_ext/string/behavior'
 require 'active_support/core_ext/symbol'
+require 'active_support/core_ext/object/metaclass'
 
 module ActiveRecord #:nodoc:
   # Generic Active Record exception class.
@@ -66,6 +67,25 @@ module ActiveRecord #:nodoc:
   class StatementInvalid &lt; ActiveRecordError
   end
 
+  # Parent class for all specific exceptions which wrap database driver exceptions
+  # provides access to the original exception also.
+  class WrappedDatabaseException &lt; StatementInvalid
+    attr_reader :original_exception
+
+    def initialize(message, original_exception)
+      super(message)
+      @original_exception, = original_exception
+    end
+  end
+
+  # Raised when a record cannot be inserted because it would violate a uniqueness constraint.
+  class RecordNotUnique &lt; WrappedDatabaseException
+  end
+
+  # Raised when a record cannot be inserted or updated because it references a non-existent record.
+  class InvalidForeignKey &lt; WrappedDatabaseException
+  end
+
   # Raised when number of bind variables in statement given to &lt;tt&gt;:condition&lt;/tt&gt; key (for example, when using +find+ method)
   # does not match number of expected variables.
   #
@@ -1384,14 +1404,14 @@ module ActiveRecord #:nodoc:
       end
 
       # Transform the modelname into a more humane format, using I18n.
-      # Defaults to the basic humanize method.
+      # By default, it will underscore then humanize the class name (BlogPost.human_name #=&gt; &quot;Blog post&quot;).
       # Default scope of the translation is activerecord.models
       # Specify +options+ with additional translating options.
       def human_name(options = {})
         defaults = self_and_descendants_from_active_record.map do |klass|
           :&quot;#{klass.name.underscore}&quot;
-        end 
-        defaults &lt;&lt; self.name.humanize
+        end
+        defaults &lt;&lt; self.name.underscore.humanize
         I18n.translate(defaults.shift, {:scope =&gt; [:activerecord, :models], :count =&gt; 1, :default =&gt; defaults}.merge(options))
       end
 
@@ -2040,7 +2060,7 @@ module ActiveRecord #:nodoc:
         #     end
         #   end
         def define_attr_method(name, value=nil, &amp;block)
-          sing = class &lt;&lt; self; self; end
+          sing = metaclass
           sing.send :alias_method, &quot;original_#{name}&quot;, name
           if block_given?
             sing.send :define_method, name, &amp;block
@@ -2850,6 +2870,13 @@ module ActiveRecord #:nodoc:
         @attributes.frozen?
       end
 
+      # Returns duplicated record with unfreezed attributes.
+      def dup
+        obj = super
+        obj.instance_variable_set('@attributes', instance_variable_get('@attributes').dup)
+        obj
+      end
+
       # Returns +true+ if the record is read only. Records loaded through joins with piggy-back
       # attributes will be marked as read only since they cannot be saved.
       def readonly?
@@ -3043,11 +3070,11 @@ module ActiveRecord #:nodoc:
       def execute_callstack_for_multiparameter_attributes(callstack)
         errors = []
         callstack.each do |name, values|
-          klass = (self.class.reflect_on_aggregation(name.to_sym) || column_for_attribute(name)).klass
-          if values.empty?
-            send(name + &quot;=&quot;, nil)
-          else
-            begin
+          begin
+            klass = (self.class.reflect_on_aggregation(name.to_sym) || column_for_attribute(name)).klass
+            if values.empty?
+              send(name + &quot;=&quot;, nil)
+            else
               value = if Time == klass
                 instantiate_time_object(name, values)
               elsif Date == klass
@@ -3061,9 +3088,9 @@ module ActiveRecord #:nodoc:
               end
 
               send(name + &quot;=&quot;, value)
-            rescue =&gt; ex
-              errors &lt;&lt; AttributeAssignmentError.new(&quot;error on assignment #{values.inspect} to #{name}&quot;, ex, name)
             end
+          rescue =&gt; ex
+            errors &lt;&lt; AttributeAssignmentError.new(&quot;error on assignment #{values.inspect} to #{name}&quot;, ex, name)
           end
         end
         unless errors.empty?
@@ -3089,7 +3116,7 @@ module ActiveRecord #:nodoc:
       end
 
       def type_cast_attribute_value(multiparameter_name, value)
-        multiparameter_name =~ /\([0-9]*([a-z])\)/ ? value.send(&quot;to_&quot; + $1) : value
+        multiparameter_name =~ /\([0-9]*([if])\)/ ? value.send(&quot;to_&quot; + $1) : value
       end
 
       def find_parameter_position(multiparameter_name)
@@ -3144,12 +3171,13 @@ module ActiveRecord #:nodoc:
   end
 
   Base.class_eval do
+    extend ActiveModel::Naming
     extend QueryCache::ClassMethods
     include Validations
     include Locking::Optimistic, Locking::Pessimistic
     include AttributeMethods
     include Dirty
-    include Callbacks, Observing, Timestamp
+    include Callbacks, ActiveModel::Observing, Timestamp
     include Associations, AssociationPreload, NamedScope
 
     # AutosaveAssociation needs to be included before Transactions, because we want</diff>
      <filename>activerecord/lib/active_record/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -353,10 +353,5 @@ module ActiveRecord
 
         return result
       end
-
-      def notify(method) #:nodoc:
-        self.class.changed
-        self.class.notify_observers(method, self)
-      end
   end
 end</diff>
      <filename>activerecord/lib/active_record/callbacks.rb</filename>
    </modified>
    <modified>
      <diff>@@ -101,7 +101,7 @@ module ActiveRecord
         table_definition = TableDefinition.new(self)
         table_definition.primary_key(options[:primary_key] || Base.get_primary_key(table_name)) unless options[:id] == false
 
-        yield table_definition
+        yield table_definition if block_given?
 
         if options[:force] &amp;&amp; table_exists?(table_name)
           drop_table(table_name, options)</diff>
      <filename>activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb</filename>
    </modified>
    <modified>
      <diff>@@ -211,9 +211,14 @@ module ActiveRecord
           @last_verification = 0
           message = &quot;#{e.class.name}: #{e.message}: #{sql}&quot;
           log_info(message, name, 0)
-          raise ActiveRecord::StatementInvalid, message
+          raise translate_exception(e, message)
         end
 
+      def translate_exception(e, message)
+        # override in derived class
+        ActiveRecord::StatementInvalid.new(message)
+      end
+
         def format_log_entry(message, dump = nil)
           if ActiveRecord::Base.colorize_logging
             if @@row_even</diff>
      <filename>activerecord/lib/active_record/connection_adapters/abstract_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -563,6 +563,19 @@ module ActiveRecord
         where_sql
       end
 
+      protected
+
+        def translate_exception(exception, message)
+          case exception.errno
+          when 1062
+            RecordNotUnique.new(message, exception)
+          when 1452
+            InvalidForeignKey.new(message, exception)
+          else
+            super
+          end
+        end
+
       private
         def connect
           encoding = @config[:encoding]</diff>
      <filename>activerecord/lib/active_record/connection_adapters/mysql_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -288,7 +288,13 @@ module ActiveRecord
 
       # Escapes binary strings for bytea input to the database.
       def escape_bytea(value)
-        if PGconn.respond_to?(:escape_bytea)
+        if @connection.respond_to?(:escape_bytea)
+          self.class.instance_eval do
+            define_method(:escape_bytea) do |value|
+              @connection.escape_bytea(value) if value
+            end
+          end
+        elsif PGconn.respond_to?(:escape_bytea)
           self.class.instance_eval do
             define_method(:escape_bytea) do |value|
               PGconn.escape_bytea(value) if value
@@ -377,7 +383,13 @@ module ActiveRecord
 
       # Quotes strings for use in SQL input in the postgres driver for better performance.
       def quote_string(s) #:nodoc:
-        if PGconn.respond_to?(:escape)
+        if @connection.respond_to?(:escape)
+          self.class.instance_eval do
+            define_method(:quote_string) do |s|
+              @connection.escape(s)
+            end
+          end
+        elsif PGconn.respond_to?(:escape)
           self.class.instance_eval do
             define_method(:quote_string) do |s|
               PGconn.escape(s)
@@ -929,6 +941,17 @@ module ActiveRecord
             end
         end
 
+        def translate_exception(exception, message)
+          case exception.message
+          when /duplicate key value violates unique constraint/
+            RecordNotUnique.new(message, exception)
+          when /violates foreign key constraint/
+            InvalidForeignKey.new(message, exception)
+          else
+            super
+          end
+        end
+
       private
         # The internal PostgreSQL identifier of the money data type.
         MONEY_COLUMN_TYPE_OID = 790 #:nodoc:</diff>
      <filename>activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -245,7 +245,7 @@ module ActiveRecord
       end
 
       def rename_table(name, new_name)
-        execute &quot;ALTER TABLE #{name} RENAME TO #{new_name}&quot;
+        execute &quot;ALTER TABLE #{quote_table_name(name)} RENAME TO #{quote_table_name(new_name)}&quot;
       end
 
       # See: http://www.sqlite.org/lang_altertable.html
@@ -431,6 +431,16 @@ module ActiveRecord
             'INTEGER PRIMARY KEY NOT NULL'.freeze
           end
         end
+
+        def translate_exception(exception, message)
+          case exception.message
+          when /column(s)? .* (is|are) not unique/
+            RecordNotUnique.new(message, exception)
+          else
+            super
+          end
+        end
+
     end
 
     class SQLite2Adapter &lt; SQLiteAdapter # :nodoc:</diff>
      <filename>activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,5 @@
+require 'active_support/core_ext/object/metaclass'
+
 module ActiveRecord
   class IrreversibleMigration &lt; ActiveRecordError#:nodoc:
   end
@@ -300,8 +302,7 @@ module ActiveRecord
 
           case sym
             when :up, :down
-              klass = (class &lt;&lt; self; self; end)
-              klass.send(:alias_method_chain, sym, &quot;benchmarks&quot;)
+              metaclass.send(:alias_method_chain, sym, &quot;benchmarks&quot;)
           end
         ensure
           @ignore_new_methods = false</diff>
      <filename>activerecord/lib/active_record/migration.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
 require 'active_support/core_ext/array'
 require 'active_support/core_ext/hash/except'
+require 'active_support/core_ext/object/metaclass'
 
 module ActiveRecord
   module NamedScope
@@ -99,7 +100,7 @@ module ActiveRecord
               end
           end, &amp;block)
         end
-        (class &lt;&lt; self; self end).instance_eval do
+        metaclass.instance_eval do
           define_method name do |*args|
             scopes[name].call(self, *args)
           end</diff>
      <filename>activerecord/lib/active_record/named_scope.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,56 +2,6 @@ require 'singleton'
 require 'set'
 
 module ActiveRecord
-  module Observing # :nodoc:
-    extend ActiveSupport::Concern
-
-    module ClassMethods
-      # Activates the observers assigned. Examples:
-      #
-      #   # Calls PersonObserver.instance
-      #   ActiveRecord::Base.observers = :person_observer
-      #
-      #   # Calls Cacher.instance and GarbageCollector.instance
-      #   ActiveRecord::Base.observers = :cacher, :garbage_collector
-      #
-      #   # Same as above, just using explicit class references
-      #   ActiveRecord::Base.observers = Cacher, GarbageCollector
-      #
-      # Note: Setting this does not instantiate the observers yet. +instantiate_observers+ is
-      # called during startup, and before each development request.
-      def observers=(*observers)
-        @observers = observers.flatten
-      end
-
-      # Gets the current observers.
-      def observers
-        @observers ||= []
-      end
-
-      # Instantiate the global Active Record observers.
-      def instantiate_observers
-        return if @observers.blank?
-        @observers.each do |observer|
-          if observer.respond_to?(:to_sym) # Symbol or String
-            observer.to_s.camelize.constantize.instance
-          elsif observer.respond_to?(:instance)
-            observer.instance
-          else
-            raise ArgumentError, &quot;#{observer} must be a lowercase, underscored class name (or an instance of the class itself) responding to the instance method. Example: Person.observers = :big_brother # calls BigBrother.instance&quot;
-          end
-        end
-      end
-
-      protected
-        # Notify observers when the observed class is subclassed.
-        def inherited(subclass)
-          super
-          changed
-          notify_observers :observed_class_inherited, subclass
-        end
-    end
-  end
-
   # Observer classes respond to lifecycle callbacks to implement trigger-like
   # behavior outside the original class. This is a great way to reduce the
   # clutter that normally comes when the model class is burdened with
@@ -137,56 +87,19 @@ module ActiveRecord
   # load their observers by calling &lt;tt&gt;ModelObserver.instance&lt;/tt&gt; before. Observers are
   # singletons and that call instantiates and registers them.
   #
-  class Observer
-    include Singleton
-
-    class &lt;&lt; self
-      # Attaches the observer to the supplied model classes.
-      def observe(*models)
-        models.flatten!
-        models.collect! { |model| model.is_a?(Symbol) ? model.to_s.camelize.constantize : model }
-        define_method(:observed_classes) { Set.new(models) }
-      end
-
-      # The class observed by default is inferred from the observer's class name:
-      #   assert_equal Person, PersonObserver.observed_class
-      def observed_class
-        if observed_class_name = name[/(.*)Observer/, 1]
-          observed_class_name.constantize
-        else
-          nil
-        end
-      end
-    end
-
-    # Start observing the declared classes and their subclasses.
+  class Observer &lt; ActiveModel::Observer
     def initialize
-      Set.new(observed_classes + observed_subclasses).each { |klass| add_observer! klass }
-    end
-
-    # Send observed_method(object) if the method exists.
-    def update(observed_method, object) #:nodoc:
-      send(observed_method, object) if respond_to?(observed_method)
-    end
-
-    # Special method sent by the observed class when it is inherited.
-    # Passes the new subclass.
-    def observed_class_inherited(subclass) #:nodoc:
-      self.class.observe(observed_classes + [subclass])
-      add_observer!(subclass)
+      super
+      observed_subclasses.each { |klass| add_observer!(klass) }
     end
 
     protected
-      def observed_classes
-        Set.new([self.class.observed_class].compact.flatten)
-      end
-
       def observed_subclasses
         observed_classes.sum([]) { |klass| klass.send(:subclasses) }
       end
 
       def add_observer!(klass)
-        klass.add_observer(self)
+        super
         if respond_to?(:after_find) &amp;&amp; !klass.method_defined?(:after_find)
           klass.class_eval 'def after_find() end'
         end</diff>
      <filename>activerecord/lib/active_record/observer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,8 +3,9 @@ module ActiveRecord #:nodoc:
     class Serializer #:nodoc:
       attr_reader :options
 
-      def initialize(record, options = {})
-        @record, @options = record, options.dup
+      def initialize(record, options = nil)
+        @record = record
+        @options = options ? options.dup : {}
       end
 
       # To replicate the behavior in ActiveRecord#attributes,</diff>
      <filename>activerecord/lib/active_record/serialization.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 require 'active_support/json'
+require 'active_model/naming'
 
 module ActiveRecord #:nodoc:
   module Serialization
@@ -74,36 +75,17 @@ module ActiveRecord #:nodoc:
     #                    &quot;title&quot;: &quot;Welcome to the weblog&quot;},
     #                   {&quot;comments&quot;: [{&quot;body&quot;: &quot;Don't think too hard&quot;}],
     #                    &quot;title&quot;: &quot;So I was thinking&quot;}]}
-    def to_json(options = {})
-      json = JsonSerializer.new(self, options).to_s
-      if include_root_in_json
-        &quot;{#{self.class.json_class_name}:#{json}}&quot;
-      else
-        json
-      end
+    def encode_json(encoder)
+      hash = Serializer.new(self, encoder.options).serializable_record
+      hash = { self.class.model_name.element =&gt; hash } if include_root_in_json
+      ActiveSupport::JSON.encode(hash)
     end
 
+    def as_json(options = nil) self end #:nodoc:
+
     def from_json(json)
       self.attributes = ActiveSupport::JSON.decode(json)
       self
     end
-
-    private
-      # For compatibility with ActiveSupport::JSON.encode
-      def rails_to_json(options, *args)
-        to_json(options)
-      end
-
-    class JsonSerializer &lt; ActiveRecord::Serialization::Serializer #:nodoc:
-      def serialize
-        ActiveSupport::JSON.encode(serializable_record)
-      end
-    end
-
-    module ClassMethods
-      def json_class_name
-        @json_class_name ||= name.demodulize.underscore.inspect
-      end
-    end
   end
 end</diff>
      <filename>activerecord/lib/active_record/serializers/json_serializer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -40,6 +40,7 @@ module ActiveRecord
       full_messages = []
 
       each do |attribute, messages|
+        messages = Array.wrap(messages)
         next if messages.empty?
 
         if attribute == :base
@@ -193,10 +194,6 @@ module ActiveRecord
       def errors
         @errors ||= Errors.new(self)
       end
-
-      def get_attribute_value(attribute)
-        respond_to?(attribute.to_sym) ? send(attribute.to_sym) : self[attribute.to_sym]
-      end
     end
   end
 end</diff>
      <filename>activerecord/lib/active_record/validations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 module ActiveRecord
   module VERSION #:nodoc:
-    MAJOR = 2
-    MINOR = 3
-    TINY  = 2
+    MAJOR = 3
+    MINOR = 0
+    TINY  = &quot;pre&quot;
 
     STRING = [MAJOR, MINOR, TINY].join('.')
   end</diff>
      <filename>activerecord/lib/active_record/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -130,4 +130,19 @@ class AdapterTest &lt; ActiveRecord::TestCase
       assert_equal &quot; LIMIT 1,7 OFFSET 7&quot;, @connection.add_limit_offset!(&quot;&quot;, :limit=&gt;sql_inject, :offset=&gt;7)
     end
   end
+
+  def test_uniqueness_violations_are_translated_to_specific_exception
+    @connection.execute &quot;INSERT INTO subscribers(nick) VALUES('me')&quot;
+    assert_raises(ActiveRecord::RecordNotUnique) do
+      @connection.execute &quot;INSERT INTO subscribers(nick) VALUES('me')&quot;
+    end
+  end
+
+  def test_foreign_key_violations_are_translated_to_specific_exception
+    unless @connection.adapter_name == 'SQLite'
+      assert_raises(ActiveRecord::InvalidForeignKey) do
+        @connection.execute &quot;INSERT INTO fk_test_has_fk (fk_id) VALUES (0)&quot;
+      end
+    end
+  end
 end</diff>
      <filename>activerecord/test/cases/adapter_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -803,6 +803,13 @@ class HasAndBelongsToManyAssociationsTest &lt; ActiveRecord::TestCase
     assert_equal 1, developer.projects.count
   end
 
+  unless current_adapter?(:PostgreSQLAdapter)
+    def test_count_with_finder_sql
+      assert_equal 3, projects(:active_record).developers_with_finder_sql.count
+      assert_equal 3, projects(:active_record).developers_with_multiline_finder_sql.count
+    end
+  end
+
   def test_association_proxy_transaction_method_starts_transaction_in_association_class
     Post.expects(:transaction)
     Category.find(:first).posts.transaction do</diff>
      <filename>activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -163,6 +163,11 @@ class HasManyAssociationsTest &lt; ActiveRecord::TestCase
     assert_equal 0, Firm.find(:first).no_clients_using_counter_sql.size
   end
 
+  def test_counting_using_finder_sql
+    assert_equal 2, Firm.find(4).clients_using_sql.count
+    assert_equal 2, Firm.find(4).clients_using_multiline_sql.count
+  end
+
   def test_belongs_to_sanity
     c = Client.new
     assert_nil c.firm</diff>
      <filename>activerecord/test/cases/associations/has_many_associations_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -157,6 +157,12 @@ class HasManyThroughAssociationsTest &lt; ActiveRecord::TestCase
     assert_equal peeps + 1, posts(:thinking).people.count
   end
 
+  def test_associate_with_create_with_through_having_conditions
+    impatient_people = posts(:thinking).impatient_people.count
+    posts(:thinking).impatient_people.create!(:first_name =&gt; 'foo')
+    assert_equal impatient_people + 1, posts(:thinking).impatient_people.count
+  end
+
   def test_associate_with_create_exclamation_and_no_options
     peeps = posts(:thinking).people.count
     posts(:thinking).people.create!(:first_name =&gt; 'foo')</diff>
      <filename>activerecord/test/cases/associations/has_many_through_associations_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -146,7 +146,12 @@ class BasicsTest &lt; ActiveRecord::TestCase
 
   def test_read_attributes_before_type_cast_on_datetime
     developer = Developer.find(:first)
-    assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast[&quot;created_at&quot;]
+    # Oracle adapter returns Time before type cast
+    unless current_adapter?(:OracleAdapter)
+      assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast[&quot;created_at&quot;]
+    else
+      assert_equal developer.created_at.to_s(:db) , developer.attributes_before_type_cast[&quot;created_at&quot;].to_s(:db)
+    end
   end
 
   def test_hash_content
@@ -594,9 +599,9 @@ class BasicsTest &lt; ActiveRecord::TestCase
   end
 
   def test_destroy_many
-    assert_equal 3, Client.count
-    Client.destroy([2, 3])
-    assert_equal 1, Client.count
+    assert_difference('Client.count', -2) do
+      Client.destroy([2, 3])
+    end
   end
 
   def test_delete_many
@@ -682,21 +687,24 @@ class BasicsTest &lt; ActiveRecord::TestCase
     end
   end
 
-  def test_update_all_ignores_order_without_limit_from_association
-    author = authors(:david)
-    assert_nothing_raised do
-      assert_equal author.posts_with_comments_and_categories.length, author.posts_with_comments_and_categories.update_all([ &quot;body = ?&quot;, &quot;bulk update!&quot; ])
+  # Oracle UPDATE does not support ORDER BY
+  unless current_adapter?(:OracleAdapter)
+    def test_update_all_ignores_order_without_limit_from_association
+      author = authors(:david)
+      assert_nothing_raised do
+        assert_equal author.posts_with_comments_and_categories.length, author.posts_with_comments_and_categories.update_all([ &quot;body = ?&quot;, &quot;bulk update!&quot; ])
+      end
     end
-  end
 
-  def test_update_all_with_order_and_limit_updates_subset_only
-    author = authors(:david)
-    assert_nothing_raised do
-      assert_equal 1, author.posts_sorted_by_id_limited.size
-      assert_equal 2, author.posts_sorted_by_id_limited.find(:all, :limit =&gt; 2).size
-      assert_equal 1, author.posts_sorted_by_id_limited.update_all([ &quot;body = ?&quot;, &quot;bulk update!&quot; ])
-      assert_equal &quot;bulk update!&quot;, posts(:welcome).body
-      assert_not_equal &quot;bulk update!&quot;, posts(:thinking).body
+    def test_update_all_with_order_and_limit_updates_subset_only
+      author = authors(:david)
+      assert_nothing_raised do
+        assert_equal 1, author.posts_sorted_by_id_limited.size
+        assert_equal 2, author.posts_sorted_by_id_limited.find(:all, :limit =&gt; 2).size
+        assert_equal 1, author.posts_sorted_by_id_limited.update_all([ &quot;body = ?&quot;, &quot;bulk update!&quot; ])
+        assert_equal &quot;bulk update!&quot;, posts(:welcome).body
+        assert_not_equal &quot;bulk update!&quot;, posts(:thinking).body
+      end
     end
   end
 
@@ -1117,22 +1125,25 @@ class BasicsTest &lt; ActiveRecord::TestCase
     Topic.skip_time_zone_conversion_for_attributes = []
   end
 
-  def test_multiparameter_attributes_on_time_only_column_with_time_zone_aware_attributes_does_not_do_time_zone_conversion
-    ActiveRecord::Base.time_zone_aware_attributes = true
-    ActiveRecord::Base.default_timezone = :utc
-    Time.zone = ActiveSupport::TimeZone[-28800]
-    attributes = {
-      &quot;bonus_time(1i)&quot; =&gt; &quot;2000&quot;, &quot;bonus_time(2i)&quot; =&gt; &quot;1&quot;, &quot;bonus_time(3i)&quot; =&gt; &quot;1&quot;,
-      &quot;bonus_time(4i)&quot; =&gt; &quot;16&quot;, &quot;bonus_time(5i)&quot; =&gt; &quot;24&quot;
-    }
-    topic = Topic.find(1)
-    topic.attributes = attributes
-    assert_equal Time.utc(2000, 1, 1, 16, 24, 0), topic.bonus_time
-    assert topic.bonus_time.utc?
-  ensure
-    ActiveRecord::Base.time_zone_aware_attributes = false
-    ActiveRecord::Base.default_timezone = :local
-    Time.zone = nil
+  # Oracle, and Sybase do not have a TIME datatype.
+  unless current_adapter?(:OracleAdapter, :SybaseAdapter)
+    def test_multiparameter_attributes_on_time_only_column_with_time_zone_aware_attributes_does_not_do_time_zone_conversion
+      ActiveRecord::Base.time_zone_aware_attributes = true
+      ActiveRecord::Base.default_timezone = :utc
+      Time.zone = ActiveSupport::TimeZone[-28800]
+      attributes = {
+        &quot;bonus_time(1i)&quot; =&gt; &quot;2000&quot;, &quot;bonus_time(2i)&quot; =&gt; &quot;1&quot;, &quot;bonus_time(3i)&quot; =&gt; &quot;1&quot;,
+        &quot;bonus_time(4i)&quot; =&gt; &quot;16&quot;, &quot;bonus_time(5i)&quot; =&gt; &quot;24&quot;
+      }
+      topic = Topic.find(1)
+      topic.attributes = attributes
+      assert_equal Time.utc(2000, 1, 1, 16, 24, 0), topic.bonus_time
+      assert topic.bonus_time.utc?
+    ensure
+      ActiveRecord::Base.time_zone_aware_attributes = false
+      ActiveRecord::Base.default_timezone = :local
+      Time.zone = nil
+    end
   end
 
   def test_multiparameter_attributes_on_time_with_empty_seconds
@@ -2105,4 +2116,8 @@ class BasicsTest &lt; ActiveRecord::TestCase
       assert_equal custom_datetime, parrot[attribute]
     end
   end
+
+  def test_dup
+    assert !Minimalistic.new.freeze.dup.frozen?
+  end
 end</diff>
      <filename>activerecord/test/cases/base_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -203,7 +203,7 @@ class CalculationsTest &lt; ActiveRecord::TestCase
     c = Company.count(:all, :group =&gt; &quot;UPPER(#{QUOTED_TYPE})&quot;)
     assert_equal 2, c[nil]
     assert_equal 1, c['DEPENDENTFIRM']
-    assert_equal 3, c['CLIENT']
+    assert_equal 4, c['CLIENT']
     assert_equal 2, c['FIRM']
   end
 
@@ -211,7 +211,7 @@ class CalculationsTest &lt; ActiveRecord::TestCase
     c = Company.count(:all, :group =&gt; &quot;UPPER(companies.#{QUOTED_TYPE})&quot;)
     assert_equal 2, c[nil]
     assert_equal 1, c['DEPENDENTFIRM']
-    assert_equal 3, c['CLIENT']
+    assert_equal 4, c['CLIENT']
     assert_equal 2, c['FIRM']
   end
 </diff>
      <filename>activerecord/test/cases/calculations_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1044,8 +1044,8 @@ class FinderTest &lt; ActiveRecord::TestCase
   end
 
   def test_select_values
-    assert_equal [&quot;1&quot;,&quot;2&quot;,&quot;3&quot;,&quot;4&quot;,&quot;5&quot;,&quot;6&quot;,&quot;7&quot;,&quot;8&quot;,&quot;9&quot;], Company.connection.select_values(&quot;SELECT id FROM companies ORDER BY id&quot;).map! { |i| i.to_s }
-    assert_equal [&quot;37signals&quot;,&quot;Summit&quot;,&quot;Microsoft&quot;, &quot;Flamboyant Software&quot;, &quot;Ex Nihilo&quot;, &quot;RailsCore&quot;, &quot;Leetsoft&quot;, &quot;Jadedpixel&quot;, &quot;Odegy&quot;], Company.connection.select_values(&quot;SELECT name FROM companies ORDER BY id&quot;)
+    assert_equal [&quot;1&quot;,&quot;2&quot;,&quot;3&quot;,&quot;4&quot;,&quot;5&quot;,&quot;6&quot;,&quot;7&quot;,&quot;8&quot;,&quot;9&quot;, &quot;10&quot;], Company.connection.select_values(&quot;SELECT id FROM companies ORDER BY id&quot;).map! { |i| i.to_s }
+    assert_equal [&quot;37signals&quot;,&quot;Summit&quot;,&quot;Microsoft&quot;, &quot;Flamboyant Software&quot;, &quot;Ex Nihilo&quot;, &quot;RailsCore&quot;, &quot;Leetsoft&quot;, &quot;Jadedpixel&quot;, &quot;Odegy&quot;, &quot;Ex Nihilo Part Deux&quot;], Company.connection.select_values(&quot;SELECT name FROM companies ORDER BY id&quot;)
   end
 
   def test_select_rows</diff>
      <filename>activerecord/test/cases/finder_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,8 +6,6 @@ require 'config'
 require 'rubygems'
 require 'test/unit'
 require 'stringio'
-gem 'mocha', '&gt;= 0.9.5'
-require 'mocha'
 
 require 'active_record'
 require 'active_record/test_case'</diff>
      <filename>activerecord/test/cases/helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -112,9 +112,9 @@ class InheritanceTest &lt; ActiveRecord::TestCase
   end
 
   def test_inheritance_condition
-    assert_equal 9, Company.count
+    assert_equal 10, Company.count
     assert_equal 2, Firm.count
-    assert_equal 3, Client.count
+    assert_equal 4, Client.count
   end
 
   def test_alt_inheritance_condition</diff>
      <filename>activerecord/test/cases/inheritance_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -170,18 +170,18 @@ class DatabaseConnectedJsonEncodingTest &lt; ActiveRecord::TestCase
   def test_should_allow_only_option_for_list_of_authors
     authors = [@david, @mary]
 
-    assert_equal %([{&quot;name&quot;:&quot;David&quot;},{&quot;name&quot;:&quot;Mary&quot;}]), authors.to_json(:only =&gt; :name)
+    assert_equal %([{&quot;name&quot;:&quot;David&quot;},{&quot;name&quot;:&quot;Mary&quot;}]), ActiveSupport::JSON.encode(authors, :only =&gt; :name)
   end
 
   def test_should_allow_except_option_for_list_of_authors
     authors = [@david, @mary]
 
-    assert_equal %([{&quot;id&quot;:1},{&quot;id&quot;:2}]), authors.to_json(:except =&gt; [:name, :author_address_id, :author_address_extra_id])
+    assert_equal %([{&quot;id&quot;:1},{&quot;id&quot;:2}]), ActiveSupport::JSON.encode(authors, :except =&gt; [:name, :author_address_id, :author_address_extra_id])
   end
 
   def test_should_allow_includes_for_list_of_authors
     authors = [@david, @mary]
-    json = authors.to_json(
+    json = ActiveSupport::JSON.encode(authors,
       :only =&gt; :name,
       :include =&gt; {
         :posts =&gt; { :only =&gt; :id }
@@ -200,6 +200,6 @@ class DatabaseConnectedJsonEncodingTest &lt; ActiveRecord::TestCase
       2 =&gt; @mary
     }
 
-    assert_equal %({&quot;1&quot;:{&quot;name&quot;:&quot;David&quot;}}), authors_hash.to_json(:only =&gt; [1, :name])
+    assert_equal %({&quot;1&quot;:{&quot;name&quot;:&quot;David&quot;}}), ActiveSupport::JSON.encode(authors_hash, :only =&gt; [1, :name])
   end
 end</diff>
      <filename>activerecord/test/cases/json_serialization_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -293,6 +293,13 @@ if ActiveRecord::Base.connection.supports_migrations?
       Person.connection.drop_table table_name rescue nil
     end
 
+    def test_create_table_without_a_block
+      table_name = :testings
+      Person.connection.create_table table_name
+    ensure
+      Person.connection.drop_table table_name rescue nil
+    end
+
     # Sybase, and SQLite3 will not allow you to add a NOT NULL
     # column to a table without a default value.
     unless current_adapter?(:SybaseAdapter, :SQLiteAdapter)
@@ -635,6 +642,32 @@ if ActiveRecord::Base.connection.supports_migrations?
       end
     end
 
+    if current_adapter?(:SQLiteAdapter)
+      def test_rename_table_for_sqlite_should_work_with_reserved_words
+        begin
+          assert_nothing_raised do
+            ActiveRecord::Base.connection.rename_table :references, :old_references
+            ActiveRecord::Base.connection.create_table :octopuses do |t|
+              t.column :url, :string
+            end
+          end
+
+          assert_nothing_raised { ActiveRecord::Base.connection.rename_table :octopuses, :references }
+
+          # Using explicit id in insert for compatibility across all databases
+          con = ActiveRecord::Base.connection
+          assert_nothing_raised do
+            con.execute &quot;INSERT INTO 'references' (#{con.quote_column_name('id')}, #{con.quote_column_name('url')}) VALUES (1, 'http://rubyonrails.com')&quot;
+          end
+          assert_equal 'http://rubyonrails.com', ActiveRecord::Base.connection.select_value(&quot;SELECT url FROM 'references' WHERE id=1&quot;)
+
+        ensure
+          ActiveRecord::Base.connection.drop_table :references
+          ActiveRecord::Base.connection.rename_table :old_references, :references
+        end
+      end
+    end
+
     def test_rename_table
       begin
         ActiveRecord::Base.connection.create_table :octopuses do |t|</diff>
      <filename>activerecord/test/cases/migration_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,14 +5,20 @@ require 'models/company'
 require 'models/company_in_module'
 require 'models/subscriber'
 require 'models/pirate'
+require 'models/price_estimate'
 
 class ReflectionTest &lt; ActiveRecord::TestCase
-  fixtures :topics, :customers, :companies, :subscribers
+  fixtures :topics, :customers, :companies, :subscribers, :price_estimates
 
   def setup
     @first = Topic.find(1)
   end
 
+  def test_human_name
+    assert_equal &quot;Price estimate&quot;, PriceEstimate.human_name
+    assert_equal &quot;Subscriber&quot;, Subscriber.human_name
+  end
+
   def test_column_null_not_null
     subscriber = Subscriber.find(:first)
     assert subscriber.column_for_attribute(&quot;name&quot;).null
@@ -170,8 +176,8 @@ class ReflectionTest &lt; ActiveRecord::TestCase
 
   def test_reflection_of_all_associations
     # FIXME these assertions bust a lot
-    assert_equal 28, Firm.reflect_on_all_associations.size
-    assert_equal 21, Firm.reflect_on_all_associations(:has_many).size
+    assert_equal 29, Firm.reflect_on_all_associations.size
+    assert_equal 22, Firm.reflect_on_all_associations(:has_many).size
     assert_equal 7, Firm.reflect_on_all_associations(:has_one).size
     assert_equal 0, Firm.reflect_on_all_associations(:belongs_to).size
   end</diff>
      <filename>activerecord/test/cases/reflection_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -35,6 +35,14 @@ another_client:
   name: Ex Nihilo
   ruby_type: Client
 
+a_third_client:
+  id: 10
+  type: Client
+  firm_id: 4
+  client_of: 4
+  name: Ex Nihilo Part Deux
+  ruby_type: Client
+
 rails_core:
   id: 6          
   name: RailsCore</diff>
      <filename>activerecord/test/fixtures/companies.yml</filename>
    </modified>
    <modified>
      <diff>@@ -48,6 +48,10 @@ class Firm &lt; Company
   has_many :clients_with_interpolated_conditions, :class_name =&gt; &quot;Client&quot;, :conditions =&gt; 'rating &gt; #{rating}'
   has_many :clients_like_ms_with_hash_conditions, :conditions =&gt; { :name =&gt; 'Microsoft' }, :class_name =&gt; &quot;Client&quot;, :order =&gt; &quot;id&quot;
   has_many :clients_using_sql, :class_name =&gt; &quot;Client&quot;, :finder_sql =&gt; 'SELECT * FROM companies WHERE client_of = #{id}'
+  has_many :clients_using_multiline_sql, :class_name =&gt; &quot;Client&quot;, :finder_sql =&gt; '
+  SELECT
+  companies.*
+  FROM companies WHERE companies.client_of = #{id}'
   has_many :clients_using_counter_sql, :class_name =&gt; &quot;Client&quot;,
            :finder_sql  =&gt; 'SELECT * FROM companies WHERE client_of = #{id}',
            :counter_sql =&gt; 'SELECT COUNT(*) FROM companies WHERE client_of = #{id}'</diff>
      <filename>activerecord/test/models/company.rb</filename>
    </modified>
    <modified>
      <diff>@@ -69,6 +69,8 @@ class Post &lt; ActiveRecord::Base
               :after_add     =&gt; lambda {|owner, reader| log(:added,   :after,  reader.first_name) },
               :before_remove =&gt; lambda {|owner, reader| log(:removed, :before, reader.first_name) },
               :after_remove  =&gt; lambda {|owner, reader| log(:removed, :after,  reader.first_name) }
+  has_many :skimmers, :class_name =&gt; 'Reader', :conditions =&gt; { :skimmer =&gt; true }
+  has_many :impatient_people, :through =&gt; :skimmers, :source =&gt; :person
 
   def self.top(limit)
     ranked_by_comments.limit(limit)</diff>
      <filename>activerecord/test/models/post.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,6 +8,12 @@ class Project &lt; ActiveRecord::Base
   has_and_belongs_to_many :developers_named_david_with_hash_conditions, :class_name =&gt; &quot;Developer&quot;, :conditions =&gt; { :name =&gt; 'David' }, :uniq =&gt; true
   has_and_belongs_to_many :salaried_developers, :class_name =&gt; &quot;Developer&quot;, :conditions =&gt; &quot;salary &gt; 0&quot;
   has_and_belongs_to_many :developers_with_finder_sql, :class_name =&gt; &quot;Developer&quot;, :finder_sql =&gt; 'SELECT t.*, j.* FROM developers_projects j, developers t WHERE t.id = j.developer_id AND j.project_id = #{id} ORDER BY t.id'
+  has_and_belongs_to_many :developers_with_multiline_finder_sql, :class_name =&gt; &quot;Developer&quot;, :finder_sql =&gt; '
+    SELECT
+      t.*, j.*
+    FROM
+      developers_projects j,
+      developers t WHERE t.id = j.developer_id AND j.project_id = #{id} ORDER BY t.id'
   has_and_belongs_to_many :developers_by_sql, :class_name =&gt; &quot;Developer&quot;, :delete_sql =&gt; &quot;DELETE FROM developers_projects WHERE project_id = \#{id} AND developer_id = \#{record.id}&quot;
   has_and_belongs_to_many :developers_with_callbacks, :class_name =&gt; &quot;Developer&quot;, :before_add =&gt; Proc.new {|o, r| o.developers_log &lt;&lt; &quot;before_adding#{r.id || '&lt;new&gt;'}&quot;},
                             :after_add =&gt; Proc.new {|o, r| o.developers_log &lt;&lt; &quot;after_adding#{r.id || '&lt;new&gt;'}&quot;},</diff>
      <filename>activerecord/test/models/project.rb</filename>
    </modified>
    <modified>
      <diff>@@ -364,6 +364,7 @@ ActiveRecord::Schema.define do
   create_table :readers, :force =&gt; true do |t|
     t.integer :post_id, :null =&gt; false
     t.integer :person_id, :null =&gt; false
+    t.boolean :skimmer, :default =&gt; false
   end
 
   create_table :shape_expressions, :force =&gt; true do |t|</diff>
      <filename>activerecord/test/schema/schema.rb</filename>
    </modified>
    <modified>
      <diff>@@ -73,7 +73,7 @@ spec = Gem::Specification.new do |s|
     s.files = s.files + Dir.glob( &quot;#{dir}/**/*&quot; ).delete_if { |item| item.include?( &quot;\.svn&quot; ) }
   end
   
-  s.add_dependency('activesupport', '= 2.3.2' + PKG_BUILD)
+  s.add_dependency('activesupport', '= 3.0.pre' + PKG_BUILD)
 
   s.require_path = 'lib'
   s.autorequire = 'active_resource'</diff>
      <filename>activeresource/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,5 @@
 $LOAD_PATH.unshift &quot;#{File.dirname(__FILE__)}/../lib&quot;
 require 'active_resource'
-require 'active_resource/http_mock'
 require 'active_support/core_ext/hash/conversions'
 
 ActiveSupport::XmlMini.backend = ENV['XMLMINI'] || 'REXML'</diff>
      <filename>activeresource/examples/simple.rb</filename>
    </modified>
    <modified>
      <diff>@@ -25,18 +25,15 @@ activesupport_path = &quot;#{File.dirname(__FILE__)}/../../activesupport/lib&quot;
 $:.unshift(activesupport_path) if File.directory?(activesupport_path)
 require 'active_support'
 
-begin
-  require 'active_model'
-rescue LoadError
-  $:.unshift &quot;#{File.dirname(__FILE__)}/../../activemodel/lib&quot;
-  require 'active_model'  
-end
-
-require 'active_resource/formats'
-require 'active_resource/base'
-require 'active_resource/validations'
-require 'active_resource/custom_methods'
+activemodel_path = &quot;#{File.dirname(__FILE__)}/../../activemodel/lib&quot;
+$:.unshift(activemodel_path) if File.directory?(activemodel_path)
+require 'active_model'
 
 module ActiveResource
   autoload :Base, 'active_resource/base'
+  autoload :Connection, 'active_resource/connection'
+  autoload :CustomMethods, 'active_resource/custom_methods'
+  autoload :Formats, 'active_resource/formats'
+  autoload :Validations, 'active_resource/validations'
+  autoload :HttpMock, 'active_resource/http_mock'
 end</diff>
      <filename>activeresource/lib/active_resource.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,10 +10,9 @@ require 'active_support/core_ext/object/misc'
 require 'set'
 require 'uri'
 
-module ActiveResource
-  autoload :Formats, 'active_resource/formats'
-  autoload :Connection, 'active_resource/connection'
+require 'active_resource/exceptions'
 
+module ActiveResource
   # ActiveResource::Base is the main class for mapping RESTful resources as models in a Rails application.
   #
   # For an outline of what Active Resource is capable of, see link:files/vendor/rails/activeresource/README.html.
@@ -873,7 +872,7 @@ module ActiveResource
       attributes.to_xml({:root =&gt; self.class.element_name}.merge(options))
     end
 
-    # Converts the resource to a JSON string representation.
+    # Coerces to a hash for JSON encoding.
     #
     # ==== Options
     # The +options+ are passed to the +to_json+ method on each
@@ -897,8 +896,8 @@ module ActiveResource
     #
     #   person.to_json(:except =&gt; [&quot;first_name&quot;])
     #   # =&gt; {&quot;last_name&quot;: &quot;Smith&quot;}
-    def to_json(options={})
-      ActiveSupport::JSON.encode(attributes, options)
+    def as_json(options = nil)
+      attributes.as_json(options)
     end
 
     # Returns the serialized string representation of the resource in the configured
@@ -1072,11 +1071,6 @@ module ActiveResource
         self.class.__send__(:split_options, options)
       end
 
-      # For compatibility with ActiveSupport::JSON.encode
-      def rails_to_json(options, *args)
-        to_json(options)
-      end
-
       def method_missing(method_symbol, *arguments) #:nodoc:
         method_name = method_symbol.to_s
 
@@ -1090,7 +1084,9 @@ module ActiveResource
         end
       end
   end
-end
 
-require 'active_resource/validations'
-require 'active_resource/custom_methods'
+  class Base
+    extend ActiveModel::Naming
+    include CustomMethods, Validations
+  end
+end</diff>
      <filename>activeresource/lib/active_resource/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,3 @@
-require 'active_resource/exceptions'
-require 'active_resource/formats'
 require 'active_support/core_ext/benchmark'
 require 'net/https'
 require 'date'</diff>
      <filename>activeresource/lib/active_resource/connection.rb</filename>
    </modified>
    <modified>
      <diff>@@ -31,47 +31,44 @@ module ActiveResource
   #   # =&gt; [{:id =&gt; 1, :name =&gt; 'Ryan'}, {:id =&gt; 2, :name =&gt; 'Joe'}]
   #
   module CustomMethods
-    def self.included(base)
-      base.class_eval do
-        extend ActiveResource::CustomMethods::ClassMethods
-        include ActiveResource::CustomMethods::InstanceMethods
+    extend ActiveSupport::Concern
 
-        class &lt;&lt; self
-          alias :orig_delete :delete
+    included do
+      class &lt;&lt; self
+        alias :orig_delete :delete
 
-          # Invokes a GET to a given custom REST method. For example:
-          #
-          #   Person.get(:active)  # GET /people/active.xml
-          #   # =&gt; [{:id =&gt; 1, :name =&gt; 'Ryan'}, {:id =&gt; 2, :name =&gt; 'Joe'}]
-          #
-          #   Person.get(:active, :awesome =&gt; true)  # GET /people/active.xml?awesome=true
-          #   # =&gt; [{:id =&gt; 1, :name =&gt; 'Ryan'}]
-          #
-          # Note: the objects returned from this method are not automatically converted
-          # into ActiveResource::Base instances - they are ordinary Hashes. If you are expecting
-          # ActiveResource::Base instances, use the &lt;tt&gt;find&lt;/tt&gt; class method with the
-          # &lt;tt&gt;:from&lt;/tt&gt; option. For example:
-          #
-          #   Person.find(:all, :from =&gt; :active)
-          def get(custom_method_name, options = {})
-            connection.get(custom_method_collection_url(custom_method_name, options), headers)
-          end
+        # Invokes a GET to a given custom REST method. For example:
+        #
+        #   Person.get(:active)  # GET /people/active.xml
+        #   # =&gt; [{:id =&gt; 1, :name =&gt; 'Ryan'}, {:id =&gt; 2, :name =&gt; 'Joe'}]
+        #
+        #   Person.get(:active, :awesome =&gt; true)  # GET /people/active.xml?awesome=true
+        #   # =&gt; [{:id =&gt; 1, :name =&gt; 'Ryan'}]
+        #
+        # Note: the objects returned from this method are not automatically converted
+        # into ActiveResource::Base instances - they are ordinary Hashes. If you are expecting
+        # ActiveResource::Base instances, use the &lt;tt&gt;find&lt;/tt&gt; class method with the
+        # &lt;tt&gt;:from&lt;/tt&gt; option. For example:
+        #
+        #   Person.find(:all, :from =&gt; :active)
+        def get(custom_method_name, options = {})
+          connection.get(custom_method_collection_url(custom_method_name, options), headers)
+        end
 
-          def post(custom_method_name, options = {}, body = '')
-            connection.post(custom_method_collection_url(custom_method_name, options), body, headers)
-          end
+        def post(custom_method_name, options = {}, body = '')
+          connection.post(custom_method_collection_url(custom_method_name, options), body, headers)
+        end
 
-          def put(custom_method_name, options = {}, body = '')
-            connection.put(custom_method_collection_url(custom_method_name, options), body, headers)
-          end
+        def put(custom_method_name, options = {}, body = '')
+          connection.put(custom_method_collection_url(custom_method_name, options), body, headers)
+        end
 
-          def delete(custom_method_name, options = {})
-            # Need to jump through some hoops to retain the original class 'delete' method
-            if custom_method_name.is_a?(Symbol)
-              connection.delete(custom_method_collection_url(custom_method_name, options), headers)
-            else
-              orig_delete(custom_method_name, options)
-            end
+        def delete(custom_method_name, options = {})
+          # Need to jump through some hoops to retain the original class 'delete' method
+          if custom_method_name.is_a?(Symbol)
+            connection.delete(custom_method_collection_url(custom_method_name, options), headers)
+          else
+            orig_delete(custom_method_name, options)
           end
         end
       end
@@ -117,8 +114,4 @@ module ActiveResource
         end
     end
   end
-
-  class Base
-    include CustomMethods
-  end
 end</diff>
      <filename>activeresource/lib/active_resource/custom_methods.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,8 +13,8 @@ module ActiveResource
         &quot;application/json&quot;
       end
 
-      def encode(hash, options={})
-        hash.to_json(options)
+      def encode(hash, options = nil)
+        ActiveSupport::JSON.encode(hash, options)
       end
 
       def decode(json)</diff>
      <filename>activeresource/lib/active_resource/formats/json_format.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,3 @@
-require 'active_resource/connection'
 require 'active_support/core_ext/kernel/reporting'
 
 module ActiveResource</diff>
      <filename>activeresource/lib/active_resource/http_mock.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,3 @@
-require 'active_resource/exceptions'
 require 'active_support/core_ext/array/wrap'
 
 module ActiveResource
@@ -46,10 +45,10 @@ module ActiveResource
   #   person.save                   # =&gt; true (and person is now saved to the remote service)
   #
   module Validations
-    def self.included(base) # :nodoc:
-      base.class_eval do
-        alias_method_chain :save, :validation
-      end
+    extend ActiveSupport::Concern
+
+    included do
+      alias_method_chain :save, :validation
     end
 
     # Validate a resource and save (POST) it to the remote web service.
@@ -80,8 +79,4 @@ module ActiveResource
       @errors ||= Errors.new(self)
     end
   end
-
-  class Base
-    include Validations
-  end
 end</diff>
      <filename>activeresource/lib/active_resource/validations.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 module ActiveResource
   module VERSION #:nodoc:
-    MAJOR = 2
-    MINOR = 3
-    TINY  = 2
+    MAJOR = 3
+    MINOR = 0
+    TINY  = &quot;pre&quot;
 
     STRING = [MAJOR, MINOR, TINY].join('.')
   end</diff>
      <filename>activeresource/lib/active_resource/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,9 @@
 require 'rubygems'
 require 'test/unit'
-
-gem 'mocha', '&gt;= 0.9.5'
-require 'mocha'
+require 'active_support/test_case'
 
 $:.unshift &quot;#{File.dirname(__FILE__)}/../lib&quot;
 require 'active_resource'
-require 'active_resource/http_mock'
 
 $:.unshift &quot;#{File.dirname(__FILE__)}/../test&quot;
 require 'setter_trap'</diff>
      <filename>activeresource/test/abstract_unit.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,11 @@
 *Edge*
 
+* JSON: +Object#to_json+ calls +as_json+ to coerce itself into something natively encodable like +Hash+, +Integer+, or +String+. Override +as_json+ instead of +to_json+ so you're JSON library agnostic.  [Jeremy Kemper]
+
+* String #to_time and #to_datetime: handle fractional seconds #864 [Jason Frey]
+
+* Update bundled TZInfo to v0.3.13 [Geoff Buesing]
+
 * Allow MemCacheStore to be initialized with a MemCache-like object instead of addresses and options [Bryan Helmkamp]
 
 * Change spelling of Kyev timezone to Kyiv #2613 [Alexander Dymo]</diff>
      <filename>activesupport/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -101,6 +101,16 @@ 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;
   task :update =&gt; ['tzinfo:copy_classes', 'tzinfo:copy_definitions'] do
     Rake::Task['tzinfo:cleanup_tmp'].invoke
+    puts &lt;&lt;-EOV
+    *** FINAL TZINFO BUNDLING STEPS ***
+    
+    1. Update TZInfo version in lib/active_support/vendor.rb
+    2. gem uninstall tzinfo on local system before running tests, to ensure tests are running against bundled version
+    
+    If a test fails because a particular zone can't be found, it's likely because the TZInfo identifier in the
+    ActiveSupport::TimeZone::MAPPING hash is referencing a linked timezone instead of referencing the timezone directly.
+    In this case, just change the MAPPING value to the correct identifier, and unpack TZInfo again.
+    EOV
   end
   
   task :unpack_gem do</diff>
      <filename>activesupport/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,12 @@ require 'benchmark'
 require 'active_support/core_ext/benchmark'
 require 'active_support/core_ext/exception'
 require 'active_support/core_ext/class/attribute_accessors'
-require 'active_support/core_ext' # FIXME: pulling in all to_param extensions
+
+%w(hash nil string time date date_time array big_decimal range object boolean).each do |library|
+  require &quot;active_support/core_ext/#{library}/conversions&quot;
+end
+
+# require 'active_support/core_ext' # FIXME: pulling in all to_param extensions
 
 module ActiveSupport
   # See ActiveSupport::Cache::Store for documentation.
@@ -94,11 +99,16 @@ module ActiveSupport
     class Store
       cattr_accessor :logger
 
+      attr_reader :silence, :logger_off
+
       def silence!
         @silence = true
         self
       end
 
+      alias silence? silence
+      alias logger_off? logger_off
+
       # Fetches data from the cache, using the given key. If there is data in
       # the cache with the given key, then that data is returned.
       #
@@ -129,8 +139,8 @@ module ActiveSupport
       #
       # For example, MemCacheStore's #write method supports the +:expires_in+
       # option, which tells the memcached server to automatically expire the
-      # cache item after a certain period. We can use this option with #fetch
-      # too:
+      # cache item after a certain period. This options is also supported by
+      # FileStore's #read method. We can use this option with #fetch too:
       #
       #   cache = ActiveSupport::Cache::MemCacheStore.new
       #   cache.fetch(&quot;foo&quot;, :force =&gt; true, :expires_in =&gt; 5.seconds) do
@@ -169,6 +179,10 @@ module ActiveSupport
       # You may also specify additional options via the +options+ argument.
       # The specific cache store implementation will decide what to do with
       # +options+.
+      #
+      # For example, FileStore supports the +:expires_in+ option, which
+      # makes the method return nil for cache items older than the specified
+      # period.
       def read(key, options = nil)
         log(&quot;read&quot;, key, options)
       end
@@ -223,8 +237,16 @@ module ActiveSupport
       end
 
       private
+        def expires_in(options)
+          expires_in = options &amp;&amp; options[:expires_in]
+
+          raise &quot;:expires_in must be a number&quot; if expires_in &amp;&amp; !expires_in.is_a?(Numeric)
+
+          expires_in || 0
+        end
+
         def log(operation, key, options)
-          logger.debug(&quot;Cache #{operation}: #{key}#{options ? &quot; (#{options.inspect})&quot; : &quot;&quot;}&quot;) if logger &amp;&amp; !@silence &amp;&amp; !@logger_off
+          logger.debug(&quot;Cache #{operation}: #{key}#{options ? &quot; (#{options.inspect})&quot; : &quot;&quot;}&quot;) if logger &amp;&amp; !silence? &amp;&amp; !logger_off?
         end
     end
   end</diff>
      <filename>activesupport/lib/active_support/cache.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,11 +10,23 @@ module ActiveSupport
         @cache_path = cache_path
       end
 
+      # Reads a value from the cache.
+      #
+      # Possible options:
+      # - +:expires_in+ - the number of seconds that this value may stay in
+      #   the cache.
       def read(name, options = nil)
         super
-        File.open(real_file_path(name), 'rb') { |f| Marshal.load(f) } rescue nil
+
+        file_name = real_file_path(name)
+        expires = expires_in(options)
+
+        if File.exist?(file_name) &amp;&amp; (expires &lt;= 0 || Time.now - File.mtime(file_name) &lt; expires)
+          File.open(file_name, 'rb') { |f| Marshal.load(f) }
+        end
       end
 
+      # Writes a value to the cache.
       def write(name, value, options = nil)
         super
         ensure_cache_path(File.dirname(real_file_path(name)))</diff>
      <filename>activesupport/lib/active_support/cache/file_store.rb</filename>
    </modified>
    <modified>
      <diff>@@ -130,10 +130,6 @@ module ActiveSupport
       end
 
       private
-        def expires_in(options)
-          (options &amp;&amp; options[:expires_in]) || 0
-        end
-
         def raw?(options)
           options &amp;&amp; options[:raw]
         end</diff>
      <filename>activesupport/lib/active_support/cache/mem_cache_store.rb</filename>
    </modified>
    <modified>
      <diff>@@ -26,7 +26,7 @@ module ActiveSupport
 
       def write(name, value, options = nil)
         super
-        @data[name] = value.freeze
+        @data[name] = (value.duplicable? ? value.dup : value).freeze
       end
 
       def delete(name, options = nil)</diff>
      <filename>activesupport/lib/active_support/cache/memory_store.rb</filename>
    </modified>
    <modified>
      <diff>@@ -202,6 +202,8 @@ class Class
           def #{ivar}=(obj) self.class.#{ivar} = obj end
         RUBY
       end
+
+      self.send(&quot;#{ivar}=&quot;, yield) if block_given?
     end
   end
 
@@ -214,8 +216,8 @@ class Class
   # @return &lt;Array[#to_s]&gt; An Array of attributes turned into inheritable accessors.
   #
   # @api public
-  def extlib_inheritable_accessor(*syms)
+  def extlib_inheritable_accessor(*syms, &amp;block)
     extlib_inheritable_reader(*syms)
-    extlib_inheritable_writer(*syms)
+    extlib_inheritable_writer(*syms, &amp;block)
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,12 +2,14 @@ module Kernel
   unless respond_to?(:debugger)
     # Starts a debugging session if ruby-debug has been loaded (call script/server --debugger to do load it).
     def debugger
-      Rails.logger.info &quot;\n***** Debugger requested, but was not available: Start server with --debugger to enable *****\n&quot;
+      message = &quot;\n***** Debugger requested, but was not available: Start server with --debugger to enable *****\n&quot;
+      defined?(Rails) ? Rails.logger.info(message) : $stderr.puts(message)
     end
   end
 
   def breakpoint
-    Rails.logger.info &quot;\n***** The 'breakpoint' command has been renamed 'debugger' -- please change *****\n&quot;
+    message = &quot;\n***** The 'breakpoint' command has been renamed 'debugger' -- please change *****\n&quot;
+    defined?(Rails) ? Rails.logger.info(message) : $stderr.puts(message)
     debugger
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/kernel/debugger.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,5 +7,4 @@ 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/loading'
-require 'active_support/core_ext/module/model_naming'
 require 'active_support/core_ext/module/synchronization'</diff>
      <filename>activesupport/lib/active_support/core_ext/module.rb</filename>
    </modified>
    <modified>
      <diff>@@ -108,14 +108,21 @@ class Module
 
     prefix = options[:prefix] &amp;&amp; &quot;#{options[:prefix] == true ? to : options[:prefix]}_&quot;
 
-    allow_nil = options[:allow_nil] &amp;&amp; &quot;#{to} &amp;&amp; &quot;
-
-    file, line = caller[0].split(&quot;:&quot;)
+    file, line = caller.first.split(':', 2)
+    line = line.to_i
 
     methods.each do |method|
-      module_eval(&lt;&lt;-EOS, file, line.to_i)
+      on_nil =
+        if options[:allow_nil]
+          'return'
+        else
+          %(raise &quot;#{self}##{prefix}#{method} delegated to #{to}.#{method}, but #{to} is nil: \#{self.inspect}&quot;)
+        end
+
+      module_eval(&lt;&lt;-EOS, file, line)
         def #{prefix}#{method}(*args, &amp;block)                           # def customer_name(*args, &amp;block)
-          #{allow_nil}#{to}.__send__(#{method.inspect}, *args, &amp;block)  #   client &amp;&amp; client.__send__(:name, *args, &amp;block)
+          #{on_nil} if #{to}.nil?
+          #{to}.__send__(#{method.inspect}, *args, &amp;block)  #   client &amp;&amp; client.__send__(:name, *args, &amp;block)
         end                                                             # end
       EOS
     end</diff>
      <filename>activesupport/lib/active_support/core_ext/module/delegation.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,11 @@
 class Numeric
+  KILOBYTE = 1024
+  MEGABYTE = KILOBYTE * 1024
+  GIGABYTE = MEGABYTE * 1024
+  TERABYTE = GIGABYTE * 1024
+  PETABYTE = TERABYTE * 1024
+  EXABYTE  = PETABYTE * 1024
+
   # Enables the use of byte calculations and declarations, like 45.bytes + 2.6.megabytes
   def bytes
     self
@@ -6,32 +13,32 @@ class Numeric
   alias :byte :bytes
 
   def kilobytes
-    self * 1024
+    self * KILOBYTE
   end
   alias :kilobyte :kilobytes
 
   def megabytes
-    self * 1024.kilobytes
+    self * MEGABYTE
   end
   alias :megabyte :megabytes
 
   def gigabytes
-    self * 1024.megabytes 
+    self * GIGABYTE
   end
   alias :gigabyte :gigabytes
 
   def terabytes
-    self * 1024.gigabytes
+    self * TERABYTE
   end
   alias :terabyte :terabytes
-  
+
   def petabytes
-    self * 1024.terabytes
+    self * PETABYTE
   end
   alias :petabyte :petabytes
-  
+
   def exabytes
-    self * 1024.petabytes
+    self * EXABYTE
   end
   alias :exabyte :exabytes
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/numeric/bytes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,9 @@
+require &quot;active_support/core_ext/object&quot;
+
 class Proc #:nodoc:
   def bind(object)
     block, time = self, Time.now
-    (class &lt;&lt; object; self end).class_eval do
+    object.class_eval do
       method_name = &quot;__bind_#{time.to_i}_#{time.usec}&quot;
       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;)</diff>
      <filename>activesupport/lib/active_support/core_ext/proc.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,9 @@ class String
 
   # 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 })
+    d = ::Date._parse(self, false).values_at(:year, :mon, :mday, :hour, :min, :sec, :sec_fraction).map { |arg| arg || 0 }
+    d[6] *= 1000000
+    ::Time.send(&quot;#{form}_time&quot;, *d)
   end
 
   def to_date
@@ -17,6 +19,8 @@ class String
   end
 
   def to_datetime
-    ::DateTime.civil(*::Date._parse(self, false).values_at(:year, :mon, :mday, :hour, :min, :sec).map { |arg| arg || 0 })
+    d = ::Date._parse(self, false).values_at(:year, :mon, :mday, :hour, :min, :sec, :zone, :sec_fraction).map { |arg| arg || 0 }
+    d[5] += d.pop
+    ::DateTime.civil(*d)
   end
 end</diff>
      <filename>activesupport/lib/active_support/core_ext/string/conversions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -143,8 +143,8 @@ module ActiveSupport #:nodoc:
         Dependencies.require_or_load(file_name)
       end
 
-      def require_dependency(file_name)
-        Dependencies.depend_on(file_name)
+      def require_dependency(file_name, message = &quot;No such file to load -- %s&quot;)
+        Dependencies.depend_on(file_name, false, message)
       end
 
       def require_association(file_name)
@@ -230,11 +230,16 @@ module ActiveSupport #:nodoc:
       mechanism == :load
     end
 
-    def depend_on(file_name, swallow_load_errors = false)
+    def depend_on(file_name, swallow_load_errors = false, message = &quot;No such file to load -- %s.rb&quot;)
       path = search_for_file(file_name)
       require_or_load(path || file_name)
-    rescue LoadError
-      raise unless swallow_load_errors
+    rescue LoadError =&gt; load_error
+      unless swallow_load_errors
+        if file_name = load_error.message[/ -- (.*?)(\.rb)?$/, 1]
+          raise MissingSourceFile.new(message % file_name, load_error.path).copy_blame!(load_error)
+        end
+        raise
+      end
     end
 
     def associate_with(file_name)</diff>
      <filename>activesupport/lib/active_support/dependencies.rb</filename>
    </modified>
    <modified>
      <diff>@@ -68,10 +68,12 @@ module ActiveSupport
 
     def inspect #:nodoc:
       consolidated = parts.inject(::Hash.new(0)) { |h,part| h[part.first] += part.last; h }
-      [:years, :months, :days, :minutes, :seconds].map do |length|
+      parts = [:years, :months, :days, :minutes, :seconds].map do |length|
         n = consolidated[length]
         &quot;#{n} #{n == 1 ? length.to_s.singularize : length.to_s}&quot; if n.nonzero?
-      end.compact.to_sentence(:locale =&gt; :en)
+      end.compact
+      parts = [&quot;0 seconds&quot;] if parts.empty?
+      parts.to_sentence(:locale =&gt; :en)
     end
 
     protected</diff>
      <filename>activesupport/lib/active_support/duration.rb</filename>
    </modified>
    <modified>
      <diff>@@ -183,7 +183,7 @@ module ActiveSupport
       if first_letter_in_uppercase
         lower_case_and_underscored_word.to_s.gsub(/\/(.?)/) { &quot;::#{$1.upcase}&quot; }.gsub(/(?:^|_)(.)/) { $1.upcase }
       else
-        lower_case_and_underscored_word.first.downcase + camelize(lower_case_and_underscored_word)[1..-1]
+        lower_case_and_underscored_word.to_s.first.downcase + camelize(lower_case_and_underscored_word)[1..-1]
       end
     end
 </diff>
      <filename>activesupport/lib/active_support/inflector.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,87 +1,2 @@
-require 'active_support/core_ext/module/delegation'
-require 'active_support/core_ext/module/attribute_accessors'
-
-module ActiveSupport
-  # If true, use ISO 8601 format for dates and times. Otherwise, fall back to the Active Support legacy format.
-  mattr_accessor :use_standard_json_time_format
-  # Look for and parse json strings that look like ISO 8601 times.
-  mattr_accessor :parse_json_times
-
-  module JSON
-    # matches YAML-formatted dates
-    DATE_REGEX = /^(?:\d{4}-\d{2}-\d{2}|\d{4}-\d{1,2}-\d{1,2}[ \t]+\d{1,2}:\d{2}:\d{2}(\.[0-9]*)?(([ \t]*)Z|[-+]\d{2}?(:\d{2})?))$/
-
-    module Encoding #:nodoc:
-      mattr_accessor :escape_regex
-
-      ESCAPED_CHARS = {
-        &quot;\010&quot; =&gt;  '\b',
-        &quot;\f&quot;   =&gt;  '\f',
-        &quot;\n&quot;   =&gt;  '\n',
-        &quot;\r&quot;   =&gt;  '\r',
-        &quot;\t&quot;   =&gt;  '\t',
-        '&quot;'    =&gt;  '\&quot;',
-        '\\'   =&gt;  '\\\\',
-        '&gt;'    =&gt;  '\u003E',
-        '&lt;'    =&gt;  '\u003C',
-        '&amp;'    =&gt;  '\u0026'
-      }
-
-      def self.escape(string)
-        string = string.dup.force_encoding(::Encoding::BINARY) if string.respond_to?(:force_encoding)
-        json = string.gsub(escape_regex) { |s| ESCAPED_CHARS[s] }.
-          gsub(/([\xC0-\xDF][\x80-\xBF]|
-                 [\xE0-\xEF][\x80-\xBF]{2}|
-                 [\xF0-\xF7][\x80-\xBF]{3})+/nx) { |s|
-            s.unpack(&quot;U*&quot;).pack(&quot;n*&quot;).unpack(&quot;H*&quot;)[0].gsub(/.{4}/, '\\\\u\&amp;')
-          }
-        %(&quot;#{json}&quot;)
-      end
-    end
-
-    class &lt;&lt; self
-      delegate :decode, :to =&gt; :backend
-
-      def backend
-        unless defined? @backend
-          self.backend = defined?(::JSON) ? &quot;JSONGem&quot; : &quot;Yaml&quot;
-        end
-        @backend
-      end
-
-      def backend=(name)
-        if name.is_a?(Module)
-          @backend = name
-        else
-          require &quot;active_support/json/backends/#{name.to_s.downcase}.rb&quot;
-          @backend = ActiveSupport::JSON::Backends::const_get(name)
-        end
-      end
-    
-      def with_backend(name)
-        old_backend, self.backend = backend, name
-        yield
-      ensure
-        self.backend = old_backend
-      end
-    end
-  end
-
-  class &lt;&lt; self
-    attr_reader :escape_html_entities_in_json
-
-    def escape_html_entities_in_json=(value)
-      ActiveSupport::JSON::Encoding.escape_regex = \
-        if value
-          /[\010\f\n\r\t&quot;\\&gt;&lt;&amp;]/
-        else
-          /[\010\f\n\r\t&quot;\\]/
-        end
-      @escape_html_entities_in_json = value
-    end
-  end
-end
-
-ActiveSupport.escape_html_entities_in_json = true
-
+require 'active_support/json/decoding'
 require 'active_support/json/encoding'</diff>
      <filename>activesupport/lib/active_support/json.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,33 +1,224 @@
+# encoding: utf-8
+require 'active_support/core_ext/array/wrap'
+require 'active_support/core_ext/hash/except'
+require 'active_support/core_ext/hash/slice'
+require 'active_support/core_ext/module/delegation'
+require 'active_support/core_ext/object/instance_variables'
+require 'active_support/deprecation'
+
+require 'active_support/core_ext/date_time/conversions'
+require 'active_support/core_ext/time/conversions'
+require 'active_support/time_with_zone'
+require 'active_support/values/time_zone'
+
+# Hack to load json gem first so we can overwrite its to_json.
+begin
+  require 'json'
+rescue LoadError
+end
+
 module ActiveSupport
+  class &lt;&lt; self
+    delegate :use_standard_json_time_format, :use_standard_json_time_format=,
+      :escape_html_entities_in_json, :escape_html_entities_in_json=,
+      :to =&gt; :'ActiveSupport::JSON::Encoding'
+  end
+
   module JSON
-    class CircularReferenceError &lt; StandardError
+    # matches YAML-formatted dates
+    DATE_REGEX = /^(?:\d{4}-\d{2}-\d{2}|\d{4}-\d{1,2}-\d{1,2}[ \t]+\d{1,2}:\d{2}:\d{2}(\.[0-9]*)?(([ \t]*)Z|[-+]\d{2}?(:\d{2})?))$/
+
+    # Dumps object in JSON (JavaScript Object Notation). See www.json.org for more info.
+    def self.encode(value, options = nil)
+      Encoding::Encoder.new(options).encode(value)
     end
 
-    # Converts a Ruby object into a JSON string.
-    def self.encode(value, options = nil, seen = nil)
-      seen ||= []
-      if seen.any? { |object| object.equal?(value) }
-        raise CircularReferenceError, 'object references itself'
+    module Encoding #:nodoc:
+      class CircularReferenceError &lt; StandardError; end
+
+      class Encoder
+        attr_reader :options
+
+        def initialize(options = nil)
+          @options = options
+          @seen = []
+        end
+
+        def encode(value)
+          check_for_circular_references(value) do
+            value.as_json(options).encode_json(self)
+          end
+        end
+
+        def escape(string)
+          Encoding.escape(string)
+        end
+
+        private
+          def check_for_circular_references(value)
+            if @seen.any? { |object| object.equal?(value) }
+              raise CircularReferenceError, 'object references itself'
+            end
+            @seen.unshift value
+            yield
+          ensure
+            @seen.shift
+          end
+      end
+
+
+      ESCAPED_CHARS = {
+        &quot;\010&quot; =&gt;  '\b',
+        &quot;\f&quot;   =&gt;  '\f',
+        &quot;\n&quot;   =&gt;  '\n',
+        &quot;\r&quot;   =&gt;  '\r',
+        &quot;\t&quot;   =&gt;  '\t',
+        '&quot;'    =&gt;  '\&quot;',
+        '\\'   =&gt;  '\\\\',
+        '&gt;'    =&gt;  '\u003E',
+        '&lt;'    =&gt;  '\u003C',
+        '&amp;'    =&gt;  '\u0026' }
+
+      class &lt;&lt; self
+        # If true, use ISO 8601 format for dates and times. Otherwise, fall back to the Active Support legacy format.
+        attr_accessor :use_standard_json_time_format
+
+        attr_accessor :escape_regex
+        attr_reader :escape_html_entities_in_json
+
+        def escape_html_entities_in_json=(value)
+          self.escape_regex = \
+            if @escape_html_entities_in_json = value
+              /[\010\f\n\r\t&quot;\\&gt;&lt;&amp;]/
+            else
+              /[\010\f\n\r\t&quot;\\]/
+            end
+        end
+
+        def escape(string)
+          string = string.dup.force_encoding(::Encoding::BINARY) if string.respond_to?(:force_encoding)
+          json = string.
+            gsub(escape_regex) { |s| ESCAPED_CHARS[s] }.
+            gsub(/([\xC0-\xDF][\x80-\xBF]|
+                   [\xE0-\xEF][\x80-\xBF]{2}|
+                   [\xF0-\xF7][\x80-\xBF]{3})+/nx) { |s|
+            s.unpack(&quot;U*&quot;).pack(&quot;n*&quot;).unpack(&quot;H*&quot;)[0].gsub(/.{4}/n, '\\\\u\&amp;')
+          }
+          %(&quot;#{json}&quot;)
+        end
       end
-      seen &lt;&lt; value
-      value.__send__(:rails_to_json, options, seen)
-    ensure
-      seen.pop
+
+      self.escape_html_entities_in_json = true
     end
+
+    CircularReferenceError = Deprecation::DeprecatedConstantProxy.new('ActiveSupport::JSON::CircularReferenceError', Encoding::CircularReferenceError)
+  end
+end
+
+class Object
+  # Dumps object in JSON (JavaScript Object Notation). See www.json.org for more info.
+  def to_json(options = nil)
+    ActiveSupport::JSON.encode(self, options)
   end
+
+  def as_json(options = nil) instance_values end #:nodoc:
+end
+
+# A string that returns itself as its JSON-encoded form.
+class ActiveSupport::JSON::Variable &lt; String
+  def as_json(options = nil) self end #:nodoc:
+  def encode_json(encoder) self end #:nodoc:
+end
+
+class TrueClass
+  AS_JSON = ActiveSupport::JSON::Variable.new('true').freeze
+  def as_json(options = nil) AS_JSON end #:nodoc:
+end
+
+class FalseClass
+  AS_JSON = ActiveSupport::JSON::Variable.new('false').freeze
+  def as_json(options = nil) AS_JSON end #:nodoc:
 end
 
-require 'active_support/json/variable'
-require 'active_support/json/encoders/date'
-require 'active_support/json/encoders/date_time'
-require 'active_support/json/encoders/enumerable'
-require 'active_support/json/encoders/false_class'
-require 'active_support/json/encoders/hash'
-require 'active_support/json/encoders/nil_class'
-require 'active_support/json/encoders/numeric'
-require 'active_support/json/encoders/object'
-require 'active_support/json/encoders/regexp'
-require 'active_support/json/encoders/string'
-require 'active_support/json/encoders/symbol'
-require 'active_support/json/encoders/time'
-require 'active_support/json/encoders/true_class'
+class NilClass
+  AS_JSON = ActiveSupport::JSON::Variable.new('null').freeze
+  def as_json(options = nil) AS_JSON end #:nodoc:
+end
+
+class String
+  def as_json(options = nil) self end #:nodoc:
+  def encode_json(encoder) encoder.escape(self) end #:nodoc:
+end
+
+class Symbol
+  def as_json(options = nil) to_s end #:nodoc:
+end
+
+class Numeric
+  def as_json(options = nil) self end #:nodoc:
+  def encode_json(encoder) to_s end #:nodoc:
+end
+
+class Regexp
+  def as_json(options = nil) self end #:nodoc:
+  def encode_json(encoder) inspect end #:nodoc:
+end
+
+module Enumerable
+  def as_json(options = nil) to_a end #:nodoc:
+end
+
+class Array
+  def as_json(options = nil) self end #:nodoc:
+  def encode_json(encoder) &quot;[#{map { |v| encoder.encode(v) } * ','}]&quot; end #:nodoc:
+end
+
+class Hash
+  def as_json(options = nil) #:nodoc:
+    if options
+      if attrs = options[:only]
+        slice(*Array.wrap(attrs))
+      elsif attrs = options[:except]
+        except(*Array.wrap(attrs))
+      else
+        self
+      end
+    else
+      self
+    end
+  end
+
+  def encode_json(encoder)
+    &quot;{#{map { |k,v| &quot;#{encoder.encode(k.to_s)}:#{encoder.encode(v)}&quot; } * ','}}&quot;
+  end
+end
+
+class Time
+  def as_json(options = nil) #:nodoc:
+    if ActiveSupport.use_standard_json_time_format
+      xmlschema
+    else
+      %(#{strftime(&quot;%Y/%m/%d %H:%M:%S&quot;)} #{formatted_offset(false)})
+    end
+  end
+end
+
+class Date
+  def as_json(options = nil) #:nodoc:
+    if ActiveSupport.use_standard_json_time_format
+      strftime(&quot;%Y-%m-%d&quot;)
+    else
+      strftime(&quot;%Y/%m/%d&quot;)
+    end
+  end
+end
+
+class DateTime
+  def as_json(options = nil) #:nodoc:
+    if ActiveSupport.use_standard_json_time_format
+      xmlschema
+    else
+      strftime('%Y/%m/%d %H:%M:%S %z')
+    end
+  end
+end</diff>
      <filename>activesupport/lib/active_support/json/encoding.rb</filename>
    </modified>
    <modified>
      <diff>@@ -91,9 +91,8 @@ module ActiveSupport
       @@_callback_sequence = 0
       
       attr_accessor :filter, :kind, :name, :options, :per_key, :klass
-      def initialize(filter, kind, options, klass, name)
+      def initialize(filter, kind, options, klass)
         @kind, @klass = kind, klass
-        @name         = name
         
         normalize_options!(options)
 
@@ -131,9 +130,8 @@ module ActiveSupport
         @@_callback_sequence += 1
       end
       
-      def matches?(_kind, _name, _filter)
+      def matches?(_kind, _filter)
         @kind   == _kind &amp;&amp;
-        @name   == _name &amp;&amp;
         @filter == _filter
       end
 
@@ -182,9 +180,10 @@ module ActiveSupport
             filter = &lt;&lt;-RUBY_EVAL
               unless halted
                 result = #{@filter}
-                halted ||= (#{terminator})
+                halted = (#{terminator})
               end
             RUBY_EVAL
+            
             [@compiled_options[0], filter, @compiled_options[1]].compact.join(&quot;\n&quot;)
           else
             # Compile around filters with conditions into proxy methods
@@ -203,7 +202,7 @@ module ActiveSupport
             # end
             
             name = &quot;_conditional_callback_#{@kind}_#{next_id}&quot;
-            txt = &lt;&lt;-RUBY_EVAL
+            txt, line = &lt;&lt;-RUBY_EVAL, __LINE__ + 1
               def #{name}(halted)
                 #{@compiled_options[0] || &quot;if true&quot;} &amp;&amp; !halted
                   #{@filter} do
@@ -214,7 +213,7 @@ module ActiveSupport
                 end
               end
             RUBY_EVAL
-            @klass.class_eval(txt)
+            @klass.class_eval(txt, __FILE__, line)
             &quot;#{name}(halted) do&quot;
           end
         end
@@ -284,59 +283,42 @@ module ActiveSupport
           filter.map {|f| _compile_filter(f)}
         when Symbol
           filter
+        when String
+          &quot;(#{filter})&quot;
         when Proc
           @klass.send(:define_method, method_name, &amp;filter)
-          method_name &lt;&lt; (filter.arity == 1 ? &quot;(self)&quot; : &quot;&quot;)
-        when Method
-          @klass.send(:define_method, &quot;#{method_name}_method&quot;) { filter }
+          return method_name if filter.arity == 0
+
+          method_name &lt;&lt; (filter.arity == 1 ? &quot;(self)&quot; : &quot; self, Proc.new &quot;)
+        else
+          @klass.send(:define_method, &quot;#{method_name}_object&quot;) { filter }
+
+          _normalize_legacy_filter(kind, filter)
+
           @klass.class_eval &lt;&lt;-RUBY_EVAL, __FILE__, __LINE__ + 1
             def #{method_name}(&amp;blk)
-              #{method_name}_method.call(self, &amp;blk)
-            end
-          RUBY_EVAL
-          method_name
-        when String
-          @klass.class_eval &lt;&lt;-RUBY_EVAL
-            def #{method_name}
-              #{filter}
+              #{method_name}_object.send(:#{kind}, self, &amp;blk)
             end
           RUBY_EVAL
+
           method_name
-        else
-          kind, name = @kind, @name
-          @klass.send(:define_method, &quot;#{method_name}_object&quot;) { filter }
+        end
+      end
 
-          if kind == :around
-            @klass.class_eval &lt;&lt;-RUBY_EVAL, __FILE__, __LINE__ + 1
-              def #{method_name}(&amp;blk)
-                if :#{kind} == :around &amp;&amp; #{method_name}_object.respond_to?(:filter)
-                  #{method_name}_object.send(&quot;filter&quot;, self, &amp;blk)
-                # TODO: Deprecate this
-                elsif #{method_name}_object.respond_to?(:before) &amp;&amp; #{method_name}_object.respond_to?(:after)
-                  should_continue = #{method_name}_object.before(self)
-                  yield if should_continue
-                  #{method_name}_object.after(self)
-                else
-                  #{method_name}_object.send(&quot;#{kind}_#{name}&quot;, self, &amp;blk)
-                end
-              end
-            RUBY_EVAL
-          else
-            @klass.class_eval &lt;&lt;-RUBY_EVAL, __FILE__, __LINE__ + 1
-              def #{method_name}(&amp;blk)
-                if #{method_name}_object.respond_to?(:#{kind})
-                  #{method_name}_object.#{kind}(self, &amp;blk)
-                elsif #{method_name}_object.respond_to?(:filter)
-                  #{method_name}_object.send(&quot;filter&quot;, self, &amp;blk)
-                else
-                  #{method_name}_object.send(&quot;#{kind}_#{name}&quot;, self, &amp;blk)
-                end
-              end
-            RUBY_EVAL
+      def _normalize_legacy_filter(kind, filter)
+        if !filter.respond_to?(kind) &amp;&amp; filter.respond_to?(:filter)
+          filter.metaclass.class_eval(
+            &quot;def #{kind}(context, &amp;block) filter(context, &amp;block) end&quot;,
+            __FILE__, __LINE__ - 1)
+        elsif filter.respond_to?(:before) &amp;&amp; filter.respond_to?(:after) &amp;&amp; kind == :around
+          def filter.around(context)
+            should_continue = before(context)
+            yield if should_continue
+            after(context)
           end
-          method_name
         end
       end
+
     end
 
     # An Array with a compile method
@@ -378,51 +360,43 @@ module ActiveSupport
       # The _run_save_callbacks method can optionally take a key, which
       # will be used to compile an optimized callback method for each
       # key. See #define_callbacks for more information.
-      def _define_runner(symbol, str, options)        
-        str = &lt;&lt;-RUBY_EVAL
-          def _run_#{symbol}_callbacks(key = nil)
+      def _define_runner(symbol)
+        body = send(&quot;_#{symbol}_callbacks&quot;).
+          compile(nil, :terminator =&gt; send(&quot;_#{symbol}_terminator&quot;))
+
+        body, line = &lt;&lt;-RUBY_EVAL, __LINE__
+          def _run_#{symbol}_callbacks(key = nil, &amp;blk)
             if key
-              key = key.hash.to_s.gsub(/-/, '_')
-              name = &quot;_run__\#{self.class.name.split(&quot;::&quot;).last}__#{symbol}__\#{key}__callbacks&quot;
+              name = &quot;_run__\#{self.class.name.hash.abs}__#{symbol}__\#{key.hash.abs}__callbacks&quot;
               
-              if respond_to?(name)
-                send(name) { yield if block_given? }
-              else
-                self.class._create_and_run_keyed_callback(
-                  self.class.name.split(&quot;::&quot;).last,
-                  :#{symbol}, key, self) { yield if block_given? }
+              unless respond_to?(name)
+                self.class._create_keyed_callback(name, :#{symbol}, self, &amp;blk)
               end
+
+              send(name, &amp;blk)
             else
-              #{str}
+              #{body}
             end
           end
         RUBY_EVAL
   
         undef_method &quot;_run_#{symbol}_callbacks&quot; if method_defined?(&quot;_run_#{symbol}_callbacks&quot;)
-        class_eval str, __FILE__, __LINE__
-        
-        before_name, around_name, after_name = 
-          options.values_at(:before, :after, :around)
+        class_eval body, __FILE__, line
       end
       
       # This is called the first time a callback is called with a particular
       # key. It creates a new callback method for the key, calculating
       # which callbacks can be omitted because of per_key conditions.
-      def _create_and_run_keyed_callback(klass, kind, key, obj, &amp;blk)
+      def _create_keyed_callback(name, kind, obj, &amp;blk)
         @_keyed_callbacks ||= {}
-        @_keyed_callbacks[[kind, key]] ||= begin
-          str = self.send(&quot;_#{kind}_callbacks&quot;).compile(key, :object =&gt; obj, :terminator =&gt; self.send(&quot;_#{kind}_terminator&quot;))
+        @_keyed_callbacks[name] ||= begin
+          str = send(&quot;_#{kind}_callbacks&quot;).
+            compile(name, :object =&gt; obj, :terminator =&gt; send(&quot;_#{kind}_terminator&quot;))
 
-          self.class_eval &lt;&lt;-RUBY_EVAL, __FILE__, __LINE__ + 1
-            def _run__#{klass.split(&quot;::&quot;).last}__#{kind}__#{key}__callbacks
-              #{str}
-            end
-          RUBY_EVAL
+          class_eval &quot;def #{name}() #{str} end&quot;, __FILE__, __LINE__
                     
           true
         end
-                                  
-        obj.send(&quot;_run__#{klass.split(&quot;::&quot;).last}__#{kind}__#{key}__callbacks&quot;, &amp;blk)
       end
       
       # Define callbacks.
@@ -456,61 +430,57 @@ module ActiveSupport
       # In that case, each action_name would get its own compiled callback
       # method that took into consideration the per_key conditions. This
       # is a speed improvement for ActionPack.
+      def _update_callbacks(name, filters = CallbackChain.new(name), block = nil)
+        type = [:before, :after, :around].include?(filters.first) ? filters.shift : :before
+        options = filters.last.is_a?(Hash) ? filters.pop : {}
+        filters.unshift(block) if block
+
+        callbacks = send(&quot;_#{name}_callbacks&quot;)
+        yield callbacks, type, filters, options if block_given?
+
+        _define_runner(name)
+      end
+
+      alias_method :_reset_callbacks, :_update_callbacks
+
+      def set_callback(name, *filters, &amp;block)
+        _update_callbacks(name, filters, block) do |callbacks, type, filters, options|        
+          filters.map! do |filter|
+            # overrides parent class
+            callbacks.delete_if {|c| c.matches?(type, filter) }
+            Callback.new(filter, type, options.dup, self)
+          end
+
+          options[:prepend] ? callbacks.unshift(*filters) : callbacks.push(*filters)
+        end
+      end
+
+      def skip_callback(name, *filters, &amp;block)
+        _update_callbacks(name, filters, block) do |callbacks, type, filters, options|
+          filters.each do |filter|
+            callbacks = send(&quot;_#{name}_callbacks=&quot;, callbacks.clone(self))
+
+            filter = callbacks.find {|c| c.matches?(type, filter) }
+
+            if filter &amp;&amp; options.any?
+              filter.recompile!(options, options[:per_key] || {})
+            else
+              callbacks.delete(filter)
+            end
+          end
+        end
+      end
+
       def define_callbacks(*symbols)
         terminator = symbols.pop if symbols.last.is_a?(String)
         symbols.each do |symbol|
-          self.extlib_inheritable_accessor(&quot;_#{symbol}_terminator&quot;)
-          self.send(&quot;_#{symbol}_terminator=&quot;, terminator)
-          self.class_eval &lt;&lt;-RUBY_EVAL, __FILE__, __LINE__ + 1
-            extlib_inheritable_accessor :_#{symbol}_callbacks
-            self._#{symbol}_callbacks = CallbackChain.new(:#{symbol})
+          extlib_inheritable_accessor(&quot;_#{symbol}_terminator&quot;) { terminator }
 
-            def self.#{symbol}_callback(*filters, &amp;blk)
-              type = [:before, :after, :around].include?(filters.first) ? filters.shift : :before
-              options = filters.last.is_a?(Hash) ? filters.pop : {}
-              filters.unshift(blk) if block_given?
-              
-              filters.map! do |filter| 
-                # overrides parent class
-                self._#{symbol}_callbacks.delete_if {|c| c.matches?(type, :#{symbol}, filter)}
-                Callback.new(filter, type, options.dup, self, :#{symbol})
-              end
-              options[:prepend] ?
-                self._#{symbol}_callbacks.unshift(*filters) :
-                self._#{symbol}_callbacks.push(*filters)
-              _define_runner(:#{symbol}, 
-                self._#{symbol}_callbacks.compile(nil, :terminator =&gt; _#{symbol}_terminator), 
-                options)
-            end
-            
-            def self.skip_#{symbol}_callback(*filters, &amp;blk)
-              type = [:before, :after, :around].include?(filters.first) ? filters.shift : :before
-              options = filters.last.is_a?(Hash) ? filters.pop : {}
-              filters.unshift(blk) if block_given?
-              filters.each do |filter|
-                self._#{symbol}_callbacks = self._#{symbol}_callbacks.clone(self)
-                
-                filter = self._#{symbol}_callbacks.find {|c| c.matches?(type, :#{symbol}, filter) }
-                per_key = options[:per_key] || {}
-                if filter
-                  filter.recompile!(options, per_key)
-                else
-                  self._#{symbol}_callbacks.delete(filter)
-                end
-                _define_runner(:#{symbol}, 
-                  self._#{symbol}_callbacks.compile(nil, :terminator =&gt; _#{symbol}_terminator), 
-                  options)
-              end
-              
-            end
-            
-            def self.reset_#{symbol}_callbacks
-              self._#{symbol}_callbacks = CallbackChain.new(:#{symbol})
-              _define_runner(:#{symbol}, self._#{symbol}_callbacks.compile, {})
-            end
-            
-            self.#{symbol}_callback(:before)
-          RUBY_EVAL
+          extlib_inheritable_accessor(&quot;_#{symbol}_callbacks&quot;) do
+            CallbackChain.new(symbol)
+          end
+
+          _define_runner(symbol)
         end
       end
     end</diff>
      <filename>activesupport/lib/active_support/new_callbacks.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,11 +12,25 @@ module ActiveSupport
 
       def self.[](*args)
         ordered_hash = new
-        args.each_with_index { |val,ind|
-          # Only every second value is a key.
-          next if ind % 2 != 0
+
+        if (args.length == 1 &amp;&amp; args.first.is_a?(Array))
+          args.first.each do |key_value_pair|
+            next unless (key_value_pair.is_a?(Array))
+            ordered_hash[key_value_pair[0]] = key_value_pair[1]
+          end
+
+          return ordered_hash
+        end
+
+        unless (args.size % 2 == 0)
+          raise ArgumentError.new(&quot;odd number of arguments for Hash&quot;)
+        end
+
+        args.each_with_index do |val, ind|
+          next if (ind % 2 != 0)
           ordered_hash[val] = args[ind + 1]
-        }
+        end
+
         ordered_hash
       end
 </diff>
      <filename>activesupport/lib/active_support/ordered_hash.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,13 @@
+require 'test/unit/testcase'
+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'
+require 'active_support/testing/isolation'
+
 begin
-  gem 'mocha', '&gt;= 0.9.3'
+  gem 'mocha', &quot;&gt;= 0.9.7&quot;
   require 'mocha'
 rescue LoadError
   # Fake Mocha::ExpectationError so we can rescue it in #run. Bleh.
@@ -7,13 +15,6 @@ rescue LoadError
   Mocha.const_set :ExpectationError, Class.new(StandardError)
 end
 
-require 'test/unit/testcase'
-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
     if defined? MiniTest</diff>
      <filename>activesupport/lib/active_support/test_case.rb</filename>
    </modified>
    <modified>
      <diff>@@ -15,12 +15,6 @@ module ActiveSupport
             end
           end
           
-          if defined?(Spec)
-            class &lt;&lt; self
-              alias_method :test, :it
-            end
-          end          
-          
         end
       end 
 </diff>
      <filename>activesupport/lib/active_support/testing/declarative.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,8 +10,6 @@ module ActiveSupport
 
           if defined?(MiniTest::Assertions) &amp;&amp; TestCase &lt; MiniTest::Assertions
             include ForMiniTest
-          elsif defined? Spec
-            include ForRspec
           else
             include ForClassicTestUnit
           end</diff>
      <filename>activesupport/lib/active_support/testing/setup_and_teardown.rb</filename>
    </modified>
    <modified>
      <diff>@@ -118,6 +118,27 @@ module ActiveSupport
     end
     alias_method :iso8601, :xmlschema
 
+    # Coerces the date to a string for JSON encoding.
+    #
+    # ISO 8601 format is used if ActiveSupport::JSON::Encoding.use_standard_json_time_format is set.
+    #
+    # ==== Examples
+    #
+    #   # With ActiveSupport::JSON::Encoding.use_standard_json_time_format = true
+    #   Time.utc(2005,2,1,15,15,10).in_time_zone.to_json
+    #   # =&gt; &quot;2005-02-01T15:15:10Z&quot;
+    #
+    #   # With ActiveSupport::JSON::Encoding.use_standard_json_time_format = false
+    #   Time.utc(2005,2,1,15,15,10).in_time_zone.to_json
+    #   # =&gt; &quot;2005/02/01 15:15:10 +0000&quot;
+    def as_json(options = nil)
+      if ActiveSupport::JSON::Encoding.use_standard_json_time_format
+        xmlschema
+      else
+        %(#{time.strftime(&quot;%Y/%m/%d %H:%M:%S&quot;)} #{formatted_offset(false)})
+      end
+    end
+
     def to_yaml(options = {})
       if options.kind_of?(YAML::Emitter)
         utc.to_yaml(options)
@@ -301,26 +322,6 @@ module ActiveSupport
     end
 
     private
-      # Returns a JSON string representing the TimeWithZone. If ActiveSupport.use_standard_json_time_format is set to
-      # true, the ISO 8601 format is used.
-      #
-      # ==== Examples
-      #
-      #   # With ActiveSupport.use_standard_json_time_format = true
-      #   Time.utc(2005,2,1,15,15,10).in_time_zone.to_json
-      #   # =&gt; &quot;2005-02-01T15:15:10Z&quot;
-      #
-      #   # With ActiveSupport.use_standard_json_time_format = false
-      #   Time.utc(2005,2,1,15,15,10).in_time_zone.to_json
-      #   # =&gt; &quot;2005/02/01 15:15:10 +0000&quot;
-      def rails_to_json(*)
-        if !ActiveSupport.respond_to?(:use_standard_json_time_format) || ActiveSupport.use_standard_json_time_format
-          xmlschema.inspect
-        else
-          %(&quot;#{time.strftime(&quot;%Y/%m/%d %H:%M:%S&quot;)} #{formatted_offset(false)}&quot;)
-        end
-      end
-
       def get_period_and_ensure_valid_local_time
         # we don't want a Time.local instance enforcing its own DST rules as well,
         # so transfer time values to a utc constructor if necessary</diff>
      <filename>activesupport/lib/active_support/time_with_zone.rb</filename>
    </modified>
    <modified>
      <diff>@@ -125,7 +125,7 @@ module ActiveSupport
         &quot;Kolkata&quot;                      =&gt; &quot;Asia/Kolkata&quot;,
         &quot;Mumbai&quot;                       =&gt; &quot;Asia/Kolkata&quot;,
         &quot;New Delhi&quot;                    =&gt; &quot;Asia/Kolkata&quot;,
-        &quot;Kathmandu&quot;                    =&gt; &quot;Asia/Katmandu&quot;,
+        &quot;Kathmandu&quot;                    =&gt; &quot;Asia/Kathmandu&quot;,
         &quot;Astana&quot;                       =&gt; &quot;Asia/Dhaka&quot;,
         &quot;Dhaka&quot;                        =&gt; &quot;Asia/Dhaka&quot;,
         &quot;Sri Jayawardenepura&quot;          =&gt; &quot;Asia/Colombo&quot;,</diff>
      <filename>activesupport/lib/active_support/values/time_zone.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,9 +14,9 @@ rescue Gem::LoadError
 end
 
 begin
-  gem 'tzinfo', '~&gt; 0.3.12'
+  gem 'tzinfo', '~&gt; 0.3.13'
 rescue Gem::LoadError
-  $:.unshift &quot;#{File.dirname(__FILE__)}/vendor/tzinfo-0.3.12&quot;
+  $:.unshift &quot;#{File.dirname(__FILE__)}/vendor/tzinfo-0.3.13&quot;
 end
 
 # TODO I18n gem has not been released yet</diff>
      <filename>activesupport/lib/active_support/vendor.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,6 @@ $:.unshift &quot;lib&quot;
 
 require 'rubygems'
 require 'test/unit'
-require 'mocha'
 require 'i18n'
 require 'active_support'
 </diff>
      <filename>activesupport/lib/active_support/vendor/i18n-0.1.3/test/i18n_exceptions_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,6 @@ $:.unshift &quot;lib&quot;
 
 require 'rubygems'
 require 'test/unit'
-require 'mocha'
 require 'i18n'
 require 'active_support'
 </diff>
      <filename>activesupport/lib/active_support/vendor/i18n-0.1.3/test/i18n_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,6 @@ $:.unshift &quot;lib&quot;
 
 require 'rubygems'
 require 'test/unit'
-require 'mocha'
 require 'i18n'
 require 'time'
 require 'yaml'</diff>
      <filename>activesupport/lib/active_support/vendor/i18n-0.1.3/test/simple_backend_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 module ActiveSupport
   module VERSION #:nodoc:
-    MAJOR = 2
-    MINOR = 3
-    TINY  = 2
+    MAJOR = 3
+    MINOR = 0
+    TINY  = &quot;pre&quot;
 
     STRING = [MAJOR, MINOR, TINY].join('.')
   end</diff>
      <filename>activesupport/lib/active_support/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,16 +9,18 @@ module ActiveSupport
     # data::
     #   XML Document string or IO to parse
     def parse(data)
-      if data.respond_to?(:read)
-        data = data.read
+      if !data.respond_to?(:read)
+        data = StringIO.new(data || '')
       end
-
+      
       LibXML::XML.default_keep_blanks = false
-
-      if data.blank?
+      
+      char = data.getc
+      if char.nil?
         {}
       else
-        LibXML::XML::Parser.string(data.strip).parse.to_hash
+        data.ungetc(char)
+        LibXML::XML::Parser.io(data).parse.to_hash
       end
     end
 </diff>
      <filename>activesupport/lib/active_support/xml_mini/libxml.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,13 +9,15 @@ module ActiveSupport
     # data::
     #   XML Document string or IO to parse
     def parse(data)
-      if data.respond_to?(:read)
-        data = data.read
+      if !data.respond_to?(:read)
+        data = StringIO.new(data || '')
       end
-
-      if data.blank?
+      
+      char = data.getc
+      if char.nil?
         {}
       else
+        data.ungetc(char)
         doc = Nokogiri::XML(data)
         raise doc.errors.first if doc.errors.length &gt; 0
         doc.to_hash</diff>
      <filename>activesupport/lib/active_support/xml_mini/nokogiri.rb</filename>
    </modified>
    <modified>
      <diff>@@ -15,13 +15,19 @@ module ActiveSupport
     # data::
     #   XML Document string or IO to parse
     def parse(data)
-      if data.respond_to?(:read)
-        data = data.read
+      if !data.respond_to?(:read)
+        data = StringIO.new(data || '')
+      end
+      
+      char = data.getc
+      if char.nil?
+        {}
+      else
+        data.ungetc(char)
+        require 'rexml/document' unless defined?(REXML::Document)
+        doc = REXML::Document.new(data)
+        merge_element!({}, doc.root)
       end
-
-      require 'rexml/document' unless defined?(REXML::Document)
-      doc = REXML::Document.new(data)
-      merge_element!({}, doc.root)
     end
 
     private</diff>
      <filename>activesupport/lib/active_support/xml_mini/rexml.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,8 @@
+ORIG_ARGV = ARGV.dup
+
 require 'rubygems'
 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'</diff>
      <filename>activesupport/test/abstract_unit.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,4 @@
+require 'logger'
 require 'abstract_unit'
 require 'active_support/cache'
 
@@ -146,6 +147,22 @@ class FileStoreTest &lt; ActiveSupport::TestCase
   end
 
   include CacheStoreBehavior
+
+  def test_expires_in
+    time = Time.local(2008, 4, 24)
+    Time.stubs(:now).returns(time)
+    File.stubs(:mtime).returns(time)
+
+    @cache.write('foo', 'bar')
+    cache_read = lambda { @cache.read('foo', :expires_in =&gt; 1.minute) }
+    assert_equal 'bar', cache_read.call
+
+    Time.stubs(:now).returns(time + 30.seconds)
+    assert_equal 'bar', cache_read.call
+
+    Time.stubs(:now).returns(time + 2.minutes)
+    assert_nil cache_read.call
+  end
 end
 
 class MemoryStoreTest &lt; ActiveSupport::TestCase
@@ -160,6 +177,12 @@ class MemoryStoreTest &lt; ActiveSupport::TestCase
     assert_raise(ActiveSupport::FrozenObjectError) { @cache.read('foo').gsub!(/.*/, 'baz') }
     assert_equal 'bar', @cache.read('foo')
   end
+
+  def test_original_store_objects_should_not_be_immutable
+    bar = 'bar'
+    @cache.write('foo', bar)
+    assert_nothing_raised { bar.gsub!(/.*/, 'baz') }
+  end
 end
 
 uses_memcached 'memcached backed store' do
@@ -168,6 +191,8 @@ uses_memcached 'memcached backed store' do
       @cache = ActiveSupport::Cache.lookup_store(:mem_cache_store)
       @data = @cache.instance_variable_get(:@data)
       @cache.clear
+      @cache.silence!
+      @cache.logger = Logger.new(&quot;/dev/null&quot;)
     end
 
     include CacheStoreBehavior
@@ -290,6 +315,22 @@ uses_memcached 'memcached backed store' do
       app = @cache.middleware.new(app)
       app.call({})
     end
+
+    def test_expires_in
+      result = @cache.write('foo', 'bar', :expires_in =&gt; 1)
+      assert_equal 'bar', @cache.read('foo')
+      sleep 2
+      assert_equal nil, @cache.read('foo')
+    end
+
+    def test_expires_in_with_invalid_value
+      @cache.write('baz', 'bat')
+      assert_raise(RuntimeError) do
+        @cache.write('foo', 'bar', :expires_in =&gt; 'Mon Jun 29 13:10:40 -0700 2150')
+      end
+      assert_equal 'bat', @cache.read('baz')
+      assert_equal nil, @cache.read('foo')
+    end
   end
 
   class CompressedMemCacheStore &lt; ActiveSupport::TestCase</diff>
      <filename>activesupport/test/caching_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@ require 'active_support/time'
 
 class DurationTest &lt; ActiveSupport::TestCase
   def test_inspect
+    assert_equal '0 seconds',                       0.seconds.inspect
     assert_equal '1 month',                         1.month.inspect
     assert_equal '1 month and 1 day',               (1.month + 1.day).inspect
     assert_equal '6 months and -2 days',            (6.months - 2.days).inspect</diff>
      <filename>activesupport/test/core_ext/duration_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -142,7 +142,7 @@ class ModuleTest &lt; Test::Unit::TestCase
 
   def test_delegation_without_allow_nil_and_nil_value
     david = Someone.new(&quot;David&quot;)
-    assert_raise(NoMethodError) { david.street }
+    assert_raise(RuntimeError) { david.street }
   end
 
   def test_parent</diff>
      <filename>activesupport/test/core_ext/module_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,4 +5,10 @@ class ObjectExtTest &lt; Test::Unit::TestCase
     foo = Object.new
     assert_equal foo, foo.tap { |x| assert_equal foo, x; :bar }
   end
+
+  def test_to_param
+    foo = Object.new
+    foo.class_eval(&quot;def to_s; 'foo'; end&quot;)
+    assert_equal 'foo', foo.to_param
+  end
 end</diff>
      <filename>activesupport/test/core_ext/object_ext_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -112,6 +112,8 @@ class StringInflectionsTest &lt; Test::Unit::TestCase
   def test_string_to_time
     assert_equal Time.utc(2005, 2, 27, 23, 50), &quot;2005-02-27 23:50&quot;.to_time
     assert_equal Time.local(2005, 2, 27, 23, 50), &quot;2005-02-27 23:50&quot;.to_time(:local)
+    assert_equal Time.utc(2005, 2, 27, 23, 50, 19, 275038), &quot;2005-02-27T23:50:19.275038&quot;.to_time
+    assert_equal Time.local(2005, 2, 27, 23, 50, 19, 275038), &quot;2005-02-27T23:50:19.275038&quot;.to_time(:local)
     assert_equal DateTime.civil(2039, 2, 27, 23, 50), &quot;2039-02-27 23:50&quot;.to_time
     assert_equal Time.local_time(2039, 2, 27, 23, 50), &quot;2039-02-27 23:50&quot;.to_time(:local)
   end
@@ -120,6 +122,7 @@ class StringInflectionsTest &lt; Test::Unit::TestCase
     assert_equal DateTime.civil(2039, 2, 27, 23, 50), &quot;2039-02-27 23:50&quot;.to_datetime
     assert_equal 0, &quot;2039-02-27 23:50&quot;.to_datetime.offset # use UTC offset
     assert_equal ::Date::ITALY, &quot;2039-02-27 23:50&quot;.to_datetime.start # use Ruby's default start value
+    assert_equal DateTime.civil(2039, 2, 27, 23, 50, 19 + Rational(275038, 1000000), &quot;-04:00&quot;), &quot;2039-02-27T23:50:19.275038-04:00&quot;.to_datetime
   end
   
   def test_string_to_date</diff>
      <filename>activesupport/test/core_ext/string_ext_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 require 'abstract_unit'
-require 'active_support/time_with_zone'
+require 'active_support/time'
 require 'active_support/json'
 
 class TimeWithZoneTest &lt; Test::Unit::TestCase</diff>
      <filename>activesupport/test/core_ext/time_with_zone_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -202,6 +202,12 @@ class InflectorTest &lt; Test::Unit::TestCase
     end
   end
 
+  def test_symbol_to_lower_camel
+    SymbolToLowerCamel.each do |symbol, lower_camel|
+      assert_equal(lower_camel, ActiveSupport::Inflector.camelize(symbol, false))
+    end
+  end
+
   %w{plurals singulars uncountables humans}.each do |inflection_type|
     class_eval &quot;
       def test_clear_#{inflection_type}</diff>
      <filename>activesupport/test/inflector_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -117,6 +117,13 @@ module InflectorTestCases
     &quot;area51_controller&quot;      =&gt; &quot;area51Controller&quot;
   }
 
+  SymbolToLowerCamel = {
+    :product                =&gt; 'product',
+    :special_guest          =&gt; 'specialGuest',
+    :application_controller =&gt; 'applicationController',
+    :area51_controller      =&gt; 'area51Controller'
+  }
+
   CamelToUnderscoreWithoutReverse = {
     &quot;HTMLTidy&quot;              =&gt; &quot;html_tidy&quot;,
     &quot;HTMLTidyGenerator&quot;     =&gt; &quot;html_tidy_generator&quot;,</diff>
      <filename>activesupport/test/inflector_test_cases.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,6 +9,12 @@ class TestJSONEncoding &lt; Test::Unit::TestCase
     end
   end
 
+  class Custom
+    def as_json(options)
+      'custom'
+    end
+  end
+
   TrueTests     = [[ true,  %(true)  ]]
   FalseTests    = [[ false, %(false) ]]
   NilTests      = [[ nil,   %(null)  ]]
@@ -27,6 +33,7 @@ class TestJSONEncoding &lt; Test::Unit::TestCase
                    [ :&quot;a b&quot;, %(&quot;a b&quot;)  ]]
 
   ObjectTests   = [[ Foo.new(1, 2), %({\&quot;a\&quot;:1,\&quot;b\&quot;:2}) ]]
+  CustomTests   = [[ Custom.new, '&quot;custom&quot;' ]]
 
   VariableTests = [[ ActiveSupport::JSON::Variable.new('foo'), 'foo'],
                    [ ActiveSupport::JSON::Variable.new('alert(&quot;foo&quot;)'), 'alert(&quot;foo&quot;)']]
@@ -68,15 +75,20 @@ class TestJSONEncoding &lt; Test::Unit::TestCase
 
   def test_utf8_string_encoded_properly_when_kcode_is_utf8
     with_kcode 'UTF8' do
-      assert_equal '&quot;\\u20ac2.99&quot;', ActiveSupport::JSON.encode('&#8364;2.99')
-      assert_equal '&quot;\\u270e\\u263a&quot;', ActiveSupport::JSON.encode('&#9998;&#9786;')
+      result = ActiveSupport::JSON.encode('&#8364;2.99')
+      assert_equal '&quot;\\u20ac2.99&quot;', result
+      assert_equal(Encoding::UTF_8, result.encoding) if result.respond_to?(:encoding)
+
+      result = ActiveSupport::JSON.encode('&#9998;&#9786;')
+      assert_equal '&quot;\\u270e\\u263a&quot;', result
+      assert_equal(Encoding::UTF_8, result.encoding) if result.respond_to?(:encoding)
     end
   end
 
   def test_exception_raised_when_encoding_circular_reference
     a = [1]
     a &lt;&lt; a
-    assert_raise(ActiveSupport::JSON::CircularReferenceError) { ActiveSupport::JSON.encode(a) }
+    assert_raise(ActiveSupport::JSON::Encoding::CircularReferenceError) { ActiveSupport::JSON.encode(a) }
   end
 
   def test_hash_key_identifiers_are_always_quoted
@@ -129,11 +141,9 @@ end
 
 class JsonOptionsTests &lt; Test::Unit::TestCase
   def test_enumerable_should_passthrough_options_to_elements
-    json_options = { :include =&gt; :posts }
-    ActiveSupport::JSON.expects(:encode).with(1, json_options)
-    ActiveSupport::JSON.expects(:encode).with(2, json_options)
-    ActiveSupport::JSON.expects(:encode).with('foo', json_options)
-
-    [1, 2, 'foo'].send(:rails_to_json, json_options)
+    value, options = Object.new, Object.new
+    def value.as_json(options) options end
+    def options.encode_json(encoder) self end
+    assert_equal options, ActiveSupport::JSON.encode(value, options)
   end
 end</diff>
      <filename>activesupport/test/json/encoding_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,8 +11,8 @@ class GrandParent
   end
   
   define_callbacks :dispatch
-  dispatch_callback :before, :before1, :before2, :per_key =&gt; {:if =&gt; proc {|c| c.action_name == &quot;index&quot; || c.action_name == &quot;update&quot; }}
-  dispatch_callback :after, :after1, :after2, :per_key =&gt; {:if =&gt; proc {|c| c.action_name == &quot;update&quot; || c.action_name == &quot;delete&quot; }}  
+  set_callback :dispatch, :before, :before1, :before2, :per_key =&gt; {:if =&gt; proc {|c| c.action_name == &quot;index&quot; || c.action_name == &quot;update&quot; }}
+  set_callback :dispatch, :after, :after1, :after2, :per_key =&gt; {:if =&gt; proc {|c| c.action_name == &quot;update&quot; || c.action_name == &quot;delete&quot; }}  
   
   def before1
     @log &lt;&lt; &quot;before1&quot;
@@ -39,12 +39,12 @@ class GrandParent
 end
 
 class Parent &lt; GrandParent
-  skip_dispatch_callback :before, :before2, :per_key =&gt; {:unless =&gt; proc {|c| c.action_name == &quot;update&quot; }}
-  skip_dispatch_callback :after, :after2, :per_key =&gt; {:unless =&gt; proc {|c| c.action_name == &quot;delete&quot; }}
+  skip_callback :dispatch, :before, :before2, :per_key =&gt; {:unless =&gt; proc {|c| c.action_name == &quot;update&quot; }}
+  skip_callback :dispatch, :after, :after2, :per_key =&gt; {:unless =&gt; proc {|c| c.action_name == &quot;delete&quot; }}
 end
 
 class Child &lt; GrandParent
-  skip_dispatch_callback :before, :before2, :per_key =&gt; {:unless =&gt; proc {|c| c.action_name == &quot;update&quot; }}, :if =&gt; :state_open?
+  skip_callback :dispatch, :before, :before2, :per_key =&gt; {:unless =&gt; proc {|c| c.action_name == &quot;update&quot; }}, :if =&gt; :state_open?
   
   def state_open?
     @state == :open</diff>
      <filename>activesupport/test/new_callback_inheritance_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,11 +10,11 @@ module NewCallbacksTest
     define_callbacks :save
   
     def self.before_save(*filters, &amp;blk)
-      save_callback(:before, *filters, &amp;blk)
+      set_callback(:save, :before, *filters, &amp;blk)
     end
   
     def self.after_save(*filters, &amp;blk)
-      save_callback(:after, *filters, &amp;blk)
+      set_callback(:save, :after, *filters, &amp;blk)
     end
 
     class &lt;&lt; self
@@ -37,7 +37,7 @@ module NewCallbacksTest
       def callback_object(callback_method)
         klass = Class.new
         klass.send(:define_method, callback_method) do |model|
-          model.history &lt;&lt; [callback_method, :object]
+          model.history &lt;&lt; [:&quot;#{callback_method}_save&quot;, :object]
         end
         klass.new
       end
@@ -54,7 +54,7 @@ module NewCallbacksTest
       send(callback_method, callback_symbol(callback_method_sym))
       send(callback_method, callback_string(callback_method_sym))
       send(callback_method, callback_proc(callback_method_sym))
-      send(callback_method, callback_object(callback_method_sym))
+      send(callback_method, callback_object(callback_method_sym.to_s.gsub(/_save/, '')))
       send(callback_method) { |model| model.history &lt;&lt; [callback_method_sym, :block] }
     end
 
@@ -64,10 +64,10 @@ module NewCallbacksTest
   end
 
   class PersonSkipper &lt; Person
-    skip_save_callback :before, :before_save_method, :if =&gt; :yes
-    skip_save_callback :after, :before_save_method, :unless =&gt; :yes
-    skip_save_callback :after, :before_save_method, :if =&gt; :no
-    skip_save_callback :before, :before_save_method, :unless =&gt; :no
+    skip_callback :save, :before, :before_save_method, :if =&gt; :yes
+    skip_callback :save, :after, :before_save_method, :unless =&gt; :yes
+    skip_callback :save, :after, :before_save_method, :if =&gt; :no
+    skip_callback :save, :before, :before_save_method, :unless =&gt; :no
     def yes; true; end
     def no; false; end
   end
@@ -77,8 +77,8 @@ module NewCallbacksTest
 
     define_callbacks :dispatch
     
-    dispatch_callback :before, :log, :per_key =&gt; {:unless =&gt; proc {|c| c.action_name == :index || c.action_name == :show }}
-    dispatch_callback :after, :log2
+    set_callback :dispatch, :before, :log, :per_key =&gt; {:unless =&gt; proc {|c| c.action_name == :index || c.action_name == :show }}
+    set_callback :dispatch, :after, :log2
   
     attr_reader :action_name, :logger
     def initialize(action_name)
@@ -102,8 +102,8 @@ module NewCallbacksTest
   end
 
   class Child &lt; ParentController
-    skip_dispatch_callback :before, :log, :per_key =&gt; {:if =&gt; proc {|c| c.action_name == :update} }
-    skip_dispatch_callback :after, :log2
+    skip_callback :dispatch, :before, :log, :per_key =&gt; {:if =&gt; proc {|c| c.action_name == :update} }
+    skip_callback :dispatch, :after, :log2
   end
 
   class OneTimeCompile &lt; Record
@@ -188,19 +188,19 @@ module NewCallbacksTest
   class AroundPerson &lt; MySuper
     attr_reader :history
   
-    save_callback :before, :nope,           :if =&gt;     :no
-    save_callback :before, :nope,           :unless =&gt; :yes
-    save_callback :after,  :tweedle
-    save_callback :before, &quot;tweedle_dee&quot;
-    save_callback :before, proc {|m| m.history &lt;&lt; &quot;yup&quot; }
-    save_callback :before, :nope,           :if =&gt;     proc { false }
-    save_callback :before, :nope,           :unless =&gt; proc { true }
-    save_callback :before, :yup,            :if =&gt;     proc { true }
-    save_callback :before, :yup,            :unless =&gt; proc { false }
-    save_callback :around, :tweedle_dum
-    save_callback :around, :w0tyes,         :if =&gt;     :yes
-    save_callback :around, :w0tno,          :if =&gt;     :no
-    save_callback :around, :tweedle_deedle
+    set_callback :save, :before, :nope,           :if =&gt;     :no
+    set_callback :save, :before, :nope,           :unless =&gt; :yes
+    set_callback :save, :after,  :tweedle
+    set_callback :save, :before, &quot;tweedle_dee&quot;
+    set_callback :save, :before, proc {|m| m.history &lt;&lt; &quot;yup&quot; }
+    set_callback :save, :before, :nope,           :if =&gt;     proc { false }
+    set_callback :save, :before, :nope,           :unless =&gt; proc { true }
+    set_callback :save, :before, :yup,            :if =&gt;     proc { true }
+    set_callback :save, :before, :yup,            :unless =&gt; proc { false }
+    set_callback :save, :around, :tweedle_dum
+    set_callback :save, :around, :w0tyes,         :if =&gt;     :yes
+    set_callback :save, :around, :w0tno,          :if =&gt;     :no
+    set_callback :save, :around, :tweedle_deedle
   
     def no; false; end
     def yes; true; end
@@ -260,7 +260,7 @@ module NewCallbacksTest
     define_callbacks :save
     attr_reader :stuff
     
-    save_callback :before, :omg, :per_key =&gt; {:if =&gt; :yes}
+    set_callback :save, :before, :omg, :per_key =&gt; {:if =&gt; :yes}
     
     def yes() true end
       
@@ -354,15 +354,15 @@ module NewCallbacksTest
   
     define_callbacks :save, &quot;result == :halt&quot;
   
-    save_callback :before, :first
-    save_callback :before, :second
-    save_callback :around, :around_it  
-    save_callback :before, :third
-    save_callback :after, :first
-    save_callback :around, :around_it
-    save_callback :after, :second
-    save_callback :around, :around_it
-    save_callback :after, :third
+    set_callback :save, :before, :first
+    set_callback :save, :before, :second
+    set_callback :save, :around, :around_it  
+    set_callback :save, :before, :third
+    set_callback :save, :after, :first
+    set_callback :save, :around, :around_it
+    set_callback :save, :after, :second
+    set_callback :save, :around, :around_it
+    set_callback :save, :after, :third
 
   
     attr_reader :history, :saved
@@ -397,11 +397,11 @@ module NewCallbacksTest
   end
 
   class CallbackObject
-    def before_save(caller)
+    def before(caller)
       caller.record &lt;&lt; &quot;before&quot;
     end
     
-    def around_save(caller)
+    def around(caller)
       caller.record &lt;&lt; &quot;around before&quot;
       yield
       caller.record &lt;&lt; &quot;around after&quot;
@@ -412,7 +412,7 @@ module NewCallbacksTest
     include ActiveSupport::NewCallbacks
     
     define_callbacks :save
-    save_callback :before, CallbackObject.new
+    set_callback :save, :before, CallbackObject.new
     
     attr_accessor :record
     def initialize
@@ -430,7 +430,7 @@ module NewCallbacksTest
     include ActiveSupport::NewCallbacks
     
     define_callbacks :save
-    save_callback :around, CallbackObject.new
+    set_callback :save, :around, CallbackObject.new
     
     attr_accessor :record
     def initialize</diff>
      <filename>activesupport/test/new_callbacks_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -163,9 +163,32 @@ class OrderedHashTest &lt; Test::Unit::TestCase
     assert @ordered_hash.inspect.include?(@hash.inspect)
   end
 
-  def test_alternate_initialization
+  def test_alternate_initialization_with_splat
     alternate = ActiveSupport::OrderedHash[1,2,3,4]
     assert_kind_of ActiveSupport::OrderedHash, alternate
     assert_equal [1, 3], alternate.keys
   end
+
+  def test_alternate_initialization_with_array
+    alternate = ActiveSupport::OrderedHash[ [
+      [1, 2],
+      [3, 4],
+      &quot;bad key value pair&quot;,
+      [ 'missing value' ]
+    ]]
+
+    assert_kind_of ActiveSupport::OrderedHash, alternate
+    assert_equal [1, 3, 'missing value'], alternate.keys
+    assert_equal [2, 4, nil ], alternate.values
+  end
+
+  def test_alternate_initialization_raises_exception_on_odd_length_args
+    begin
+      alternate = ActiveSupport::OrderedHash[1,2,3,4,5]
+      flunk &quot;Hash::[] should have raised an exception on initialization &quot; +
+          &quot;with an odd number of parameters&quot;
+    rescue
+      assert_equal &quot;odd number of arguments for Hash&quot;, $!.message
+    end
+  end
 end</diff>
      <filename>activesupport/test/ordered_hash_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ gems:
 - name: memcache-client
   version: &gt;= 1.5.0
 - name: mocha
-  version: &gt;= 0.9.5
+  version: &gt;= 0.9.7
 - name: mysql
   #version: &gt;= 2.7
   version: = 2.7</diff>
      <filename>ci/geminstaller.yml</filename>
    </modified>
    <modified>
      <diff>@@ -316,11 +316,11 @@ spec = Gem::Specification.new do |s|
   EOF
 
   s.add_dependency('rake', '&gt;= 0.8.3')
-  s.add_dependency('activesupport',    '= 2.3.2' + PKG_BUILD)
-  s.add_dependency('activerecord',     '= 2.3.2' + PKG_BUILD)
-  s.add_dependency('actionpack',       '= 2.3.2' + PKG_BUILD)
-  s.add_dependency('actionmailer',     '= 2.3.2' + PKG_BUILD)
-  s.add_dependency('activeresource',   '= 2.3.2' + PKG_BUILD)
+  s.add_dependency('activesupport',    '= 3.0.pre' + PKG_BUILD)
+  s.add_dependency('activerecord',     '= 3.0.pre' + PKG_BUILD)
+  s.add_dependency('actionpack',       '= 3.0.pre' + PKG_BUILD)
+  s.add_dependency('actionmailer',     '= 3.0.pre' + PKG_BUILD)
+  s.add_dependency('activeresource',   '= 3.0.pre' + PKG_BUILD)
 
   s.rdoc_options &lt;&lt; '--exclude' &lt;&lt; '.'
   s.has_rdoc = false</diff>
      <filename>railties/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,596 +1,394 @@
-require 'logger'
-require 'set'
-require 'pathname'
+require &quot;pathname&quot;
 
 $LOAD_PATH.unshift File.dirname(__FILE__)
 require 'railties_path'
 require 'rails/version'
 require 'rails/gem_dependency'
 require 'rails/rack'
+require 'rails/paths'
+require 'rails/core'
+require 'rails/configuration'
 
 RAILS_ENV = (ENV['RAILS_ENV'] || 'development').dup unless defined?(RAILS_ENV)
 
 module Rails
-  class &lt;&lt; self
-    # The Configuration instance used to configure the Rails environment
-    def configuration
-      @@configuration
-    end
+  class Initializer
+    class Error &lt; StandardError ; end
 
-    def configuration=(configuration)
-      @@configuration = configuration
-    end
+    class Base
+      class &lt;&lt; self
+        def run(&amp;blk)
+          define_method(:run, &amp;blk)
+        end
 
-    def initialized?
-      @initialized || false
-    end
+        def config=(config)
+          @@config = config
+        end
 
-    def initialized=(initialized)
-      @initialized ||= initialized
-    end
+        def config
+          @@config
+        end
+        alias configuration config
 
-    def logger
-      if defined?(RAILS_DEFAULT_LOGGER)
-        RAILS_DEFAULT_LOGGER
-      else
-        nil
-      end
-    end
+        def gems_dependencies_loaded
+          config.gems_dependencies_loaded
+        end
 
-    def backtrace_cleaner
-      @@backtrace_cleaner ||= begin
-        # Relies on ActiveSupport, so we have to lazy load to postpone definition until AS has been loaded
-        require 'rails/backtrace_cleaner'
-        Rails::BacktraceCleaner.new
+        def plugin_loader
+          @plugin_loader ||= configuration.plugin_loader.new(self)
+        end
       end
-    end
-
-    def root
-      Pathname.new(RAILS_ROOT) if defined?(RAILS_ROOT)
-    end
-
-    def env
-      @_env ||= ActiveSupport::StringInquirer.new(RAILS_ENV)
-    end
 
-    def cache
-      RAILS_CACHE
-    end
-
-    def version
-      VERSION::STRING
-    end
-
-    def public_path
-      @@public_path ||= self.root ? File.join(self.root, &quot;public&quot;) : &quot;public&quot;
-    end
-
-    def public_path=(path)
-      @@public_path = path
-    end
-  end
-
-  # The Initializer is responsible for processing the Rails configuration, such
-  # as setting the $LOAD_PATH, requiring the right frameworks, initializing
-  # logging, and more. It can be run either as a single command that'll just
-  # use the default configuration, like this:
-  #
-  #   Rails::Initializer.run
-  #
-  # But normally it's more interesting to pass in a custom configuration
-  # through the block running:
-  #
-  #   Rails::Initializer.run do |config|
-  #     config.frameworks -= [ :action_mailer ]
-  #   end
-  #
-  # This will use the default configuration options from Rails::Configuration,
-  # but allow for overwriting on select areas.
-  class Initializer
-    # The Configuration instance used by this Initializer instance.
-    attr_reader :configuration
-
-    # The set of loaded plugins.
-    attr_reader :loaded_plugins
-
-    # Whether or not all the gem dependencies have been met
-    attr_reader :gems_dependencies_loaded
-
-    # Runs the initializer. By default, this will invoke the #process method,
-    # which simply executes all of the initialization routines. Alternately,
-    # you can specify explicitly which initialization routine you want:
-    #
-    #   Rails::Initializer.run(:set_load_path)
-    #
-    # This is useful if you only want the load path initialized, without
-    # incurring the overhead of completely loading the entire environment.
-    def self.run(command = :process, configuration = Configuration.new)
-      yield configuration if block_given?
-      initializer = new configuration
-      initializer.send(command)
-      initializer
-    end
+      def gems_dependencies_loaded
+        self.class.gems_dependencies_loaded
+      end
 
-    # Create a new Initializer instance that references the given Configuration
-    # instance.
-    def initialize(configuration)
-      @configuration = configuration
-      @loaded_plugins = []
+      def plugin_loader
+        self.class.plugin_loader
+      end
     end
 
-    # Sequentially step through all of the available initialization routines,
-    # in order (view execution order in source).
-    def process
-      Rails.configuration = configuration
-
-      check_ruby_version
-      install_gem_spec_stubs
-      set_load_path
-      add_gem_load_paths
+    class Runner
 
-      require_frameworks
-      set_autoload_paths
-      add_plugin_load_paths
-      load_environment
-      preload_frameworks
+      attr_reader :names, :initializers
+      attr_accessor :config
+      alias configuration config
 
-      initialize_encoding
-      initialize_database
-
-      initialize_cache
-      initialize_framework_caches
-
-      initialize_logger
-      initialize_framework_logging
-
-      initialize_dependency_mechanism
-      initialize_whiny_nils
-
-      initialize_time_zone
-      initialize_i18n
-
-      initialize_framework_settings
-      initialize_framework_views
-
-      initialize_metal
-
-      add_support_load_paths
-
-      check_for_unbuilt_gems
-
-      load_gems
-      load_plugins
-
-      # pick up any gems that plugins depend on
-      add_gem_load_paths
-      load_gems
-      check_gem_dependencies
-
-      # bail out if gems are missing - note that check_gem_dependencies will have
-      # already called abort() unless $gems_rake_task is set
-      return unless gems_dependencies_loaded
-
-      load_application_initializers
-
-      # the framework is now fully initialized
-      after_initialize
-
-      # Setup database middleware after initializers have run
-      initialize_database_middleware
+      def initialize(parent = nil)
+        @names        = parent ? parent.names.dup        : {}
+        @initializers = parent ? parent.initializers.dup : []
+      end
 
-      # Prepare dispatcher callbacks and run 'prepare' callbacks
-      prepare_dispatcher
+      def add(name, options = {}, &amp;block)
+        # If :before or :after is specified, set the index to the right spot
+        if other = options[:before] || options[:after]
+          raise Error, &quot;The #{other.inspect} initializer does not exist&quot; unless @names[other]
+          index = @initializers.index(@names[other])
+          index += 1 if options[:after]
+        end
 
-      # Routing must be initialized after plugins to allow the former to extend the routes
-      initialize_routing
+        @initializers.insert(index || -1, block)
+        @names[name] = block
+      end
 
-      # Observers are loaded after plugins in case Observers or observed models are modified by plugins.
-      load_observers
+      def delete(name)
+        @names[name].tap do |initializer|
+          @initializers.delete(initializer)
+          @names.delete(name)
+        end
+      end
 
-      # Load view path cache
-      load_view_paths
+      def run_initializer(initializer)
+        init_block = initializer.is_a?(Proc) ? initializer : @names[initializer]
+        container = Class.new(Base, &amp;init_block).new
+        container.run if container.respond_to?(:run)
+      end
 
-      # Load application classes
-      load_application_classes
+      def run(initializer = nil)
+        Rails.configuration = Base.config = @config
 
-      # Disable dependency loading during request cycle
-      disable_dependency_loading
+        if initializer
+          run_initializer(initializer)
+        else
+          @initializers.each {|block| run_initializer(block) }
+        end
+      end
+    end
 
-      # Flag initialized
-      Rails.initialized = true
+    def self.default
+      @default ||= Runner.new
     end
 
-    # Check for valid Ruby version
-    # This is done in an external file, so we can use it
-    # from the `rails` program as well without duplication.
-    def check_ruby_version
-      require 'ruby_version_check'
+    def self.run(initializer = nil, config = nil)
+      default.config = config if config
+      default.config ||= Configuration.new
+      yield default.config if block_given?
+      default.run(initializer)
     end
+  end
 
-    # If Rails is vendored and RubyGems is available, install stub GemSpecs
-    # for Rails, Active Support, Active Record, Action Pack, Action Mailer, and
-    # Active Resource. This allows Gem plugins to depend on Rails even when
-    # the Gem version of Rails shouldn't be loaded.
-    def install_gem_spec_stubs
-      unless Rails.respond_to?(:vendor_rails?)
-        abort %{Your config/boot.rb is outdated: Run &quot;rake rails:update&quot;.}
-      end
+  # Check for valid Ruby version (1.8.2 or 1.8.4 or higher). This is done in an
+  # external file, so we can use it from the `rails` program as well without duplication.
+  Initializer.default.add :check_ruby_version do
+    require 'ruby_version_check'
+  end
 
-      if Rails.vendor_rails?
-        begin; require &quot;rubygems&quot;; rescue LoadError; return; end
+  # If Rails is vendored and RubyGems is available, install stub GemSpecs
+  # for Rails, Active Support, Active Record, Action Pack, Action Mailer, and
+  # Active Resource. This allows Gem plugins to depend on Rails even when
+  # the Gem version of Rails shouldn't be loaded.
+  Initializer.default.add :install_gem_spec_stubs do
+    unless Rails.respond_to?(:vendor_rails?)
+      abort %{Your config/boot.rb is outdated: Run &quot;rake rails:update&quot;.}
+    end
 
-        stubs = %w(rails activesupport activerecord actionpack actionmailer activeresource)
-        stubs.reject! { |s| Gem.loaded_specs.key?(s) }
+    if Rails.vendor_rails?
+      begin; require &quot;rubygems&quot;; rescue LoadError; return; end
 
-        stubs.each do |stub|
-          Gem.loaded_specs[stub] = Gem::Specification.new do |s|
-            s.name = stub
-            s.version = Rails::VERSION::STRING
-            s.loaded_from = &quot;&quot;
-          end
+      %w(rails activesupport activerecord actionpack actionmailer activeresource).each do |stub|
+        Gem.loaded_specs[stub] ||= Gem::Specification.new do |s|
+          s.name = stub
+          s.version = Rails::VERSION::STRING
+          s.loaded_from = &quot;&quot;
         end
       end
     end
+  end
 
-    # Set the &lt;tt&gt;$LOAD_PATH&lt;/tt&gt; based on the value of
-    # Configuration#load_paths. Duplicates are removed.
-    def set_load_path
-      load_paths = configuration.load_paths + configuration.framework_paths
-      load_paths.reverse_each { |dir| $LOAD_PATH.unshift(dir) if File.directory?(dir) }
-      $LOAD_PATH.uniq!
-    end
-
-    # Set the paths from which Rails will automatically load source files, and
-    # the load_once paths.
-    def set_autoload_paths
-      require 'active_support/dependencies'
-      ActiveSupport::Dependencies.load_paths = configuration.load_paths.uniq
-      ActiveSupport::Dependencies.load_once_paths = configuration.load_once_paths.uniq
-
-      extra = ActiveSupport::Dependencies.load_once_paths - ActiveSupport::Dependencies.load_paths
-      unless extra.empty?
-        abort &lt;&lt;-end_error
-          load_once_paths must be a subset of the load_paths.
-          Extra items in load_once_paths: #{extra * ','}
-        end_error
-      end
+  # Set the &lt;tt&gt;$LOAD_PATH&lt;/tt&gt; based on the value of
+  # Configuration#load_paths. Duplicates are removed.
+  Initializer.default.add :set_load_path do
+    # TODO: Think about unifying this with the general Rails paths
+    configuration.framework_paths.reverse_each { |dir| $LOAD_PATH.unshift(dir) if File.directory?(dir) }
+    configuration.paths.add_to_load_path
+    $LOAD_PATH.uniq!
+  end
 
-      # Freeze the arrays so future modifications will fail rather than do nothing mysteriously
-      configuration.load_once_paths.freeze
+  Initializer.default.add :add_gem_load_paths do
+    require 'rails/gem_dependency'
+    Rails::GemDependency.add_frozen_gem_path
+    unless config.gems.empty?
+      require &quot;rubygems&quot;
+      config.gems.each { |gem| gem.add_load_paths }
     end
+  end
 
-    # Requires all frameworks specified by the Configuration#frameworks
-    # list. By default, all frameworks (Active Record, Active Support,
-    # Action Pack, Action Mailer, and Active Resource) are loaded.
-    def require_frameworks
-      require 'active_support/all'
+  # Requires all frameworks specified by the Configuration#frameworks
+  # list. By default, all frameworks (Active Record, Active Support,
+  # Action Pack, Action Mailer, and Active Resource) are loaded.
+  Initializer.default.add :require_frameworks do
+    begin
+      require 'active_support'
+      require 'active_support/core_ext/kernel/reporting'
+      require 'active_support/core_ext/logger'
+
+      # TODO: This is here to make Sam Ruby's tests pass. Needs discussion.
+      require 'active_support/core_ext/numeric/bytes'
       configuration.frameworks.each { |framework| require(framework.to_s) }
     rescue LoadError =&gt; e
       # Re-raise as RuntimeError because Mongrel would swallow LoadError.
       raise e.to_s
     end
+  end
 
-    # Preload all frameworks specified by the Configuration#frameworks.
-    # Used by Passenger to ensure everything's loaded before forking and
-    # to avoid autoload race conditions in JRuby.
-    def preload_frameworks
-      if configuration.preload_frameworks
-        configuration.frameworks.each do |framework|
-          # String#classify and #constantize aren't available yet.
-          toplevel = Object.const_get(framework.to_s.gsub(/(?:^|_)(.)/) { $1.upcase })
-          toplevel.load_all! if toplevel.respond_to?(:load_all!)
-        end
-      end
-    end
+  # Set the paths from which Rails will automatically load source files, and
+  # the load_once paths.
+  Initializer.default.add :set_autoload_paths do
+    require 'active_support/dependencies'
+    ActiveSupport::Dependencies.load_paths = configuration.load_paths.uniq
+    ActiveSupport::Dependencies.load_once_paths = configuration.load_once_paths.uniq
 
-    # Add the load paths used by support functions such as the info controller
-    def add_support_load_paths
+    extra = ActiveSupport::Dependencies.load_once_paths - ActiveSupport::Dependencies.load_paths
+    unless extra.empty?
+      abort &lt;&lt;-end_error
+        load_once_paths must be a subset of the load_paths.
+        Extra items in load_once_paths: #{extra * ','}
+      end_error
     end
 
-    # Adds all load paths from plugins to the global set of load paths, so that
-    # code from plugins can be required (explicitly or automatically via ActiveSupport::Dependencies).
-    def add_plugin_load_paths
-      require 'active_support/dependencies'
-      plugin_loader.add_plugin_load_paths
-    end
+    # Freeze the arrays so future modifications will fail rather than do nothing mysteriously
+    configuration.load_once_paths.freeze
+  end
 
-    def add_gem_load_paths
-      require 'rails/gem_dependency'
-      Rails::GemDependency.add_frozen_gem_path
-      unless @configuration.gems.empty?
-        require &quot;rubygems&quot;
-        @configuration.gems.each { |gem| gem.add_load_paths }
-      end
-    end
+  # Adds all load paths from plugins to the global set of load paths, so that
+  # code from plugins can be required (explicitly or automatically via ActiveSupport::Dependencies).
+  Initializer.default.add :add_plugin_load_paths do
+    require 'active_support/dependencies'
+    plugin_loader.add_plugin_load_paths
+  end
 
-    def load_gems
-      unless $gems_build_rake_task
-        @configuration.gems.each { |gem| gem.load }
-      end
-    end
+  # Loads the environment specified by Configuration#environment_path, which
+  # is typically one of development, test, or production.
+  Initializer.default.add :load_environment do
+    silence_warnings do
+      next if @environment_loaded
+      next unless File.file?(configuration.environment_path)
 
-    def check_for_unbuilt_gems
-      unbuilt_gems = @configuration.gems.select {|gem| gem.frozen? &amp;&amp; !gem.built? }
-      if unbuilt_gems.size &gt; 0
-        # don't print if the gems:build rake tasks are being run
-        unless $gems_build_rake_task
-          abort &lt;&lt;-end_error
-The following gems have native components that need to be built
-  #{unbuilt_gems.map { |gem| &quot;#{gem.name}  #{gem.requirement}&quot; } * &quot;\n  &quot;}
+      @environment_loaded = true
 
-You're running:
-  ruby #{Gem.ruby_version} at #{Gem.ruby}
-  rubygems #{Gem::RubyGemsVersion} at #{Gem.path * ', '}
+      config = configuration
+      constants = self.class.constants
 
-Run `rake gems:build` to build the unbuilt gems.
-          end_error
-        end
+      eval(IO.read(configuration.environment_path), binding, configuration.environment_path)
+
+      (self.class.constants - constants).each do |const|
+        Object.const_set(const, self.class.const_get(const))
       end
     end
+  end
 
-    def check_gem_dependencies
-      unloaded_gems = @configuration.gems.reject { |g| g.loaded? }
-      if unloaded_gems.size &gt; 0
-        @gems_dependencies_loaded = false
-        # don't print if the gems rake tasks are being run
-        unless $gems_rake_task
-          abort &lt;&lt;-end_error
-Missing these required gems:
-  #{unloaded_gems.map { |gem| &quot;#{gem.name}  #{gem.requirement}&quot; } * &quot;\n  &quot;}
-
-You're running:
-  ruby #{Gem.ruby_version} at #{Gem.ruby}
-  rubygems #{Gem::RubyGemsVersion} at #{Gem.path * ', '}
-
-Run `rake gems:install` to install the missing gems.
-          end_error
-        end
-      else
-        @gems_dependencies_loaded = true
+  # Preload all frameworks specified by the Configuration#frameworks.
+  # Used by Passenger to ensure everything's loaded before forking and
+  # to avoid autoload race conditions in JRuby.
+  Initializer.default.add :preload_frameworks do
+    if configuration.preload_frameworks
+      configuration.frameworks.each do |framework|
+        # String#classify and #constantize aren't available yet.
+        toplevel = Object.const_get(framework.to_s.gsub(/(?:^|_)(.)/) { $1.upcase })
+        toplevel.load_all! if toplevel.respond_to?(:load_all!)
       end
     end
+  end
 
-    # Loads all plugins in &lt;tt&gt;config.plugin_paths&lt;/tt&gt;.  &lt;tt&gt;plugin_paths&lt;/tt&gt;
-    # defaults to &lt;tt&gt;vendor/plugins&lt;/tt&gt; but may also be set to a list of
-    # paths, such as
-    #   config.plugin_paths = [&quot;#{RAILS_ROOT}/lib/plugins&quot;, &quot;#{RAILS_ROOT}/vendor/plugins&quot;]
-    #
-    # In the default implementation, as each plugin discovered in &lt;tt&gt;plugin_paths&lt;/tt&gt; is initialized:
-    # * its +lib+ directory, if present, is added to the load path (immediately after the applications lib directory)
-    # * &lt;tt&gt;init.rb&lt;/tt&gt; is evaluated, if present
-    #
-    # After all plugins are loaded, duplicates are removed from the load path.
-    # If an array of plugin names is specified in config.plugins, only those plugins will be loaded
-    # and they plugins will be loaded in that order. Otherwise, plugins are loaded in alphabetical
-    # order.
-    #
-    # if config.plugins ends contains :all then the named plugins will be loaded in the given order and all other
-    # plugins will be loaded in alphabetical order
-    def load_plugins
-      plugin_loader.load_plugins
+  # For Ruby 1.8, this initialization sets $KCODE to 'u' to enable the
+  # multibyte safe operations. Plugin authors supporting other encodings
+  # should override this behaviour and set the relevant +default_charset+
+  # on ActionController::Base.
+  #
+  # For Ruby 1.9, UTF-8 is the default internal and external encoding.
+  Initializer.default.add :initialize_encoding do
+    if RUBY_VERSION &lt; '1.9'
+      $KCODE='u'
+    else
+      Encoding.default_internal = Encoding::UTF_8
+      Encoding.default_external = Encoding::UTF_8
     end
+  end
 
-    def plugin_loader
-      @plugin_loader ||= configuration.plugin_loader.new(self)
+  # This initialization routine does nothing unless &lt;tt&gt;:active_record&lt;/tt&gt;
+  # is one of the frameworks to load (Configuration#frameworks). If it is,
+  # this sets the database configuration from Configuration#database_configuration
+  # and then establishes the connection.
+  Initializer.default.add :initialize_database do
+    if configuration.frameworks.include?(:active_record)
+      ActiveRecord::Base.configurations = configuration.database_configuration
+      ActiveRecord::Base.establish_connection
     end
+  end
 
-    # Loads the environment specified by Configuration#environment_path, which
-    # is typically one of development, test, or production.
-    def load_environment
-      silence_warnings do
-        return if @environment_loaded
-        @environment_loaded = true
-
-        config = configuration
-        constants = self.class.constants
-
-        eval(IO.read(configuration.environment_path), binding, configuration.environment_path)
+  Initializer.default.add :initialize_cache do
+    unless defined?(RAILS_CACHE)
+      silence_warnings { Object.const_set &quot;RAILS_CACHE&quot;, ActiveSupport::Cache.lookup_store(configuration.cache_store) }
 
-        (self.class.constants - constants).each do |const|
-          Object.const_set(const, self.class.const_get(const))
-        end
+      if RAILS_CACHE.respond_to?(:middleware)
+        # Insert middleware to setup and teardown local cache for each request
+        configuration.middleware.insert_after(:&quot;Rack::Lock&quot;, RAILS_CACHE.middleware)
       end
     end
+  end
 
-    def load_observers
-      if gems_dependencies_loaded &amp;&amp; configuration.frameworks.include?(:active_record)
-        ActiveRecord::Base.instantiate_observers
-      end
+  Initializer.default.add :initialize_framework_caches do
+    if configuration.frameworks.include?(:action_controller)
+      ActionController::Base.cache_store ||= RAILS_CACHE
     end
+  end
 
-    def load_view_paths
-      if configuration.frameworks.include?(:action_view)
-        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
+  Initializer.default.add :initialize_logger do
+    # if the environment has explicitly defined a logger, use it
+    next if Rails.logger
 
-    # Eager load application classes
-    def load_application_classes
-      return if $rails_rake_task
-      if configuration.cache_classes
-        configuration.eager_load_paths.each do |load_path|
-          matcher = /\A#{Regexp.escape(load_path)}(.*)\.rb\Z/
-          Dir.glob(&quot;#{load_path}/**/*.rb&quot;).sort.each do |file|
-            require_dependency file.sub(matcher, '\1')
-          end
+    unless logger = configuration.logger
+      begin
+        logger = ActiveSupport::BufferedLogger.new(configuration.log_path)
+        logger.level = ActiveSupport::BufferedLogger.const_get(configuration.log_level.to_s.upcase)
+        if RAILS_ENV == &quot;production&quot;
+          logger.auto_flushing = false
         end
+      rescue StandardError =&gt; e
+        logger = ActiveSupport::BufferedLogger.new(STDERR)
+        logger.level = ActiveSupport::BufferedLogger::WARN
+        logger.warn(
+          &quot;Rails Error: Unable to access log file. Please ensure that #{configuration.log_path} exists and is chmod 0666. &quot; +
+          &quot;The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.&quot;
+        )
       end
     end
 
-    # For Ruby 1.8, this initialization sets $KCODE to 'u' to enable the
-    # multibyte safe operations. Plugin authors supporting other encodings
-    # should override this behaviour and set the relevant +default_charset+
-    # on ActionController::Base.
-    #
-    # For Ruby 1.9, UTF-8 is the default internal and external encoding.
-    def initialize_encoding
-      if RUBY_VERSION &lt; '1.9'
-        $KCODE='u'
-      else
-        Encoding.default_internal = Encoding::UTF_8
-        Encoding.default_external = Encoding::UTF_8
-      end
-    end
+    # TODO: Why are we silencing warning here?
+    silence_warnings { Object.const_set &quot;RAILS_DEFAULT_LOGGER&quot;, logger }
+  end
 
-    # This initialization routine does nothing unless &lt;tt&gt;:active_record&lt;/tt&gt;
-    # is one of the frameworks to load (Configuration#frameworks). If it is,
-    # this sets the database configuration from Configuration#database_configuration
-    # and then establishes the connection.
-    def initialize_database
-      if configuration.frameworks.include?(:active_record)
-        ActiveRecord::Base.configurations = configuration.database_configuration
-        ActiveRecord::Base.establish_connection
-      end
+  # Sets the logger for Active Record, Action Controller, and Action Mailer
+  # (but only for those frameworks that are to be loaded). If the framework's
+  # logger is already set, it is not changed, otherwise it is set to use
+  # RAILS_DEFAULT_LOGGER.
+  Initializer.default.add :initialize_framework_logging do
+    for framework in ([ :active_record, :action_controller, :action_mailer ] &amp; configuration.frameworks)
+      framework.to_s.camelize.constantize.const_get(&quot;Base&quot;).logger ||= Rails.logger
     end
 
-    def initialize_database_middleware
-      if configuration.frameworks.include?(:active_record)
-        if configuration.frameworks.include?(:action_controller) &amp;&amp;
-            ActionController::Base.session_store.name == 'ActiveRecord::SessionStore'
-          configuration.middleware.insert_before :&quot;ActiveRecord::SessionStore&quot;, ActiveRecord::ConnectionAdapters::ConnectionManagement
-          configuration.middleware.insert_before :&quot;ActiveRecord::SessionStore&quot;, ActiveRecord::QueryCache
-        else
-          configuration.middleware.use ActiveRecord::ConnectionAdapters::ConnectionManagement
-          configuration.middleware.use ActiveRecord::QueryCache
-        end
-      end
-    end
+    ActiveSupport::Dependencies.logger ||= Rails.logger
+    Rails.cache.logger ||= Rails.logger
+  end
 
-    def initialize_cache
-      unless defined?(RAILS_CACHE)
-        silence_warnings { Object.const_set &quot;RAILS_CACHE&quot;, ActiveSupport::Cache.lookup_store(configuration.cache_store) }
+  # Sets the dependency loading mechanism based on the value of
+  # Configuration#cache_classes.
+  Initializer.default.add :initialize_dependency_mechanism do
+    # TODO: Remove files from the $&quot; and always use require
+    ActiveSupport::Dependencies.mechanism = configuration.cache_classes ? :require : :load
+  end
 
-        if RAILS_CACHE.respond_to?(:middleware)
-          # Insert middleware to setup and teardown local cache for each request
-          configuration.middleware.insert_after(:&quot;Rack::Lock&quot;, RAILS_CACHE.middleware)
-        end
-      end
-    end
+  # Loads support for &quot;whiny nil&quot; (noisy warnings when methods are invoked
+  # on +nil+ values) if Configuration#whiny_nils is true.
+  Initializer.default.add :initialize_whiny_nils do
+    require('active_support/whiny_nil') if configuration.whiny_nils
+  end
 
-    def initialize_framework_caches
-      if configuration.frameworks.include?(:action_controller)
-        ActionController::Base.cache_store ||= RAILS_CACHE
-      end
-    end
 
-    # If the RAILS_DEFAULT_LOGGER constant is already set, this initialization
-    # routine does nothing. If the constant is not set, and Configuration#logger
-    # is not +nil+, this also does nothing. Otherwise, a new logger instance
-    # is created at Configuration#log_path, with a default log level of
-    # Configuration#log_level.
-    #
-    # If the log could not be created, the log will be set to output to
-    # +STDERR+, with a log level of +WARN+.
-    def initialize_logger
-      # if the environment has explicitly defined a logger, use it
-      return if Rails.logger
-
-      unless logger = configuration.logger
-        begin
-          logger = ActiveSupport::BufferedLogger.new(configuration.log_path)
-          logger.level = ActiveSupport::BufferedLogger.const_get(configuration.log_level.to_s.upcase)
-          if configuration.environment == &quot;production&quot;
-            logger.auto_flushing = false
-          end
-        rescue StandardError =&gt; e
-          logger = ActiveSupport::BufferedLogger.new(STDERR)
-          logger.level = ActiveSupport::BufferedLogger::WARN
-          logger.warn(
-            &quot;Rails Error: Unable to access log file. Please ensure that #{configuration.log_path} exists and is chmod 0666. &quot; +
-            &quot;The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.&quot;
-          )
-        end
-      end
-
-      silence_warnings { Object.const_set &quot;RAILS_DEFAULT_LOGGER&quot;, logger }
-    end
+  # Sets the default value for Time.zone, and turns on ActiveRecord::Base#time_zone_aware_attributes.
+  # If assigned value cannot be matched to a TimeZone, an exception will be raised.
+  Initializer.default.add :initialize_time_zone do
+    if configuration.time_zone
+      zone_default = Time.__send__(:get_zone, configuration.time_zone)
 
-    # Sets the logger for Active Record, Action Controller, and Action Mailer
-    # (but only for those frameworks that are to be loaded). If the framework's
-    # logger is already set, it is not changed, otherwise it is set to use
-    # RAILS_DEFAULT_LOGGER.
-    def initialize_framework_logging
-      for framework in ([ :active_record, :action_controller, :action_mailer ] &amp; configuration.frameworks)
-        framework.to_s.camelize.constantize.const_get(&quot;Base&quot;).logger ||= Rails.logger
+      unless zone_default
+        raise \
+          'Value assigned to config.time_zone not recognized.' +
+          'Run &quot;rake -D time&quot; for a list of tasks for finding appropriate time zone names.'
       end
 
-      ActiveSupport::Dependencies.logger ||= Rails.logger
-      Rails.cache.logger ||= Rails.logger
-    end
+      Time.zone_default = zone_default
 
-    # Sets +ActionController::Base#view_paths+ and +ActionMailer::Base#template_root+
-    # (but only for those frameworks that are to be loaded). If the framework's
-    # paths have already been set, it is not changed, otherwise it is
-    # set to use Configuration#view_path.
-    def initialize_framework_views
-      if configuration.frameworks.include?(:action_view)
-        view_path = ActionView::PathSet.type_cast(configuration.view_path)
-        ActionMailer::Base.template_root  = view_path if configuration.frameworks.include?(:action_mailer) &amp;&amp; ActionMailer::Base.view_paths.blank?
-        ActionController::Base.view_paths = view_path if configuration.frameworks.include?(:action_controller) &amp;&amp; ActionController::Base.view_paths.blank?
+      if configuration.frameworks.include?(:active_record)
+        ActiveRecord::Base.time_zone_aware_attributes = true
+        ActiveRecord::Base.default_timezone = :utc
       end
     end
+  end
 
-    # If Action Controller is not one of the loaded frameworks (Configuration#frameworks)
-    # this does nothing. Otherwise, it loads the routing definitions and sets up
-    # loading module used to lazily load controllers (Configuration#controller_paths).
-    def initialize_routing
-      return unless configuration.frameworks.include?(:action_controller)
-
-      ActionController::Routing.controller_paths += configuration.controller_paths
-      ActionController::Routing::Routes.add_configuration_file(configuration.routes_configuration_file)
-      ActionController::Routing::Routes.reload!
-    end
-
-    # Sets the dependency loading mechanism based on the value of
-    # Configuration#cache_classes.
-    def initialize_dependency_mechanism
-      ActiveSupport::Dependencies.mechanism = configuration.cache_classes ? :require : :load
-    end
-
-    # Loads support for &quot;whiny nil&quot; (noisy warnings when methods are invoked
-    # on +nil+ values) if Configuration#whiny_nils is true.
-    def initialize_whiny_nils
-      require('active_support/whiny_nil') if configuration.whiny_nils
+  # Set the i18n configuration from config.i18n but special-case for the load_path which should be
+  # appended to what's already set instead of overwritten.
+  Initializer.default.add :initialize_i18n do
+    configuration.i18n.each do |setting, value|
+      if setting == :load_path
+        I18n.load_path += value
+      else
+        I18n.send(&quot;#{setting}=&quot;, value)
+      end
     end
+  end
 
-    # Sets the default value for Time.zone, and turns on ActiveRecord::Base#time_zone_aware_attributes.
-    # If assigned value cannot be matched to a TimeZone, an exception will be raised.
-    def initialize_time_zone
-      if configuration.time_zone
-        zone_default = Time.__send__(:get_zone, configuration.time_zone)
-
-        unless zone_default
-          raise \
-            'Value assigned to config.time_zone not recognized.' +
-            'Run &quot;rake -D time&quot; for a list of tasks for finding appropriate time zone names.'
-        end
-
-        Time.zone_default = zone_default
+  # Initializes framework-specific settings for each of the loaded frameworks
+  # (Configuration#frameworks). The available settings map to the accessors
+  # on each of the corresponding Base classes.
+  Initializer.default.add :initialize_framework_settings do
+    configuration.frameworks.each do |framework|
+      base_class = framework.to_s.camelize.constantize.const_get(&quot;Base&quot;)
 
-        if configuration.frameworks.include?(:active_record)
-          ActiveRecord::Base.time_zone_aware_attributes = true
-          ActiveRecord::Base.default_timezone = :utc
-        end
+      configuration.send(framework).each do |setting, value|
+        base_class.send(&quot;#{setting}=&quot;, value)
       end
     end
+    configuration.active_support.each do |setting, value|
+      ActiveSupport.send(&quot;#{setting}=&quot;, value)
+    end
+  end
 
-    # Set the i18n configuration from config.i18n but special-case for the load_path which should be
-    # appended to what's already set instead of overwritten.
-    def initialize_i18n
-      configuration.i18n.each do |setting, value|
-        if setting == :load_path
-          I18n.load_path += value
-        else
-          I18n.send(&quot;#{setting}=&quot;, value)
-        end
-      end
+  # Sets +ActionController::Base#view_paths+ and +ActionMailer::Base#template_root+
+  # (but only for those frameworks that are to be loaded). If the framework's
+  # paths have already been set, it is not changed, otherwise it is
+  # set to use Configuration#view_path.
+  Initializer.default.add :initialize_framework_views do
+    if configuration.frameworks.include?(:action_view)
+      view_path = ActionView::PathSet.type_cast(configuration.view_path)
+      ActionMailer::Base.template_root  = view_path if configuration.frameworks.include?(:action_mailer) &amp;&amp; ActionMailer::Base.view_paths.blank?
+      ActionController::Base.view_paths = view_path if configuration.frameworks.include?(:action_controller) &amp;&amp; ActionController::Base.view_paths.blank?
     end
+  end
 
-    def initialize_metal
+  Initializer.default.add :initialize_metal do
+    # TODO: Make Rails and metal work without ActionController
+    if defined?(ActionController)
       Rails::Rack::Metal.requested_metals = configuration.metals
       Rails::Rack::Metal.metal_paths += plugin_loader.engine_metal_paths
 
@@ -598,540 +396,172 @@ Run `rake gems:install` to install the missing gems.
         :&quot;ActionDispatch::ParamsParser&quot;,
         Rails::Rack::Metal, :if =&gt; Rails::Rack::Metal.metals.any?)
     end
+  end
 
-    # Initializes framework-specific settings for each of the loaded frameworks
-    # (Configuration#frameworks). The available settings map to the accessors
-    # on each of the corresponding Base classes.
-    def initialize_framework_settings
-      configuration.frameworks.each do |framework|
-        base_class = framework.to_s.camelize.constantize.const_get(&quot;Base&quot;)
-
-        configuration.send(framework).each do |setting, value|
-          base_class.send(&quot;#{setting}=&quot;, value)
-        end
-      end
-      configuration.active_support.each do |setting, value|
-        ActiveSupport.send(&quot;#{setting}=&quot;, value)
-      end
-    end
+  Initializer.default.add :check_for_unbuilt_gems do
+    unbuilt_gems = config.gems.select {|gem| gem.frozen? &amp;&amp; !gem.built? }
+    if unbuilt_gems.size &gt; 0
+      # don't print if the gems:build rake tasks are being run
+      unless $gems_build_rake_task
+        abort &lt;&lt;-end_error
+The following gems have native components that need to be built
+#{unbuilt_gems.map { |gemm| &quot;#{gemm.name}  #{gemm.requirement}&quot; } * &quot;\n  &quot;}
 
-    # Fires the user-supplied after_initialize block (Configuration#after_initialize)
-    def after_initialize
-      if gems_dependencies_loaded
-        configuration.after_initialize_blocks.each do |block|
-          block.call
-        end
-      end
-    end
+You're running:
+ruby #{Gem.ruby_version} at #{Gem.ruby}
+rubygems #{Gem::RubyGemsVersion} at #{Gem.path * ', '}
 
-    def load_application_initializers
-      if gems_dependencies_loaded
-        Dir[&quot;#{configuration.root_path}/config/initializers/**/*.rb&quot;].sort.each do |initializer|
-          load(initializer)
-        end
+Run `rake gems:build` to build the unbuilt gems.
+        end_error
       end
     end
+  end
 
-    def prepare_dispatcher
-      return unless configuration.frameworks.include?(:action_controller)
-      require 'dispatcher' unless defined?(::Dispatcher)
-      Dispatcher.define_dispatcher_callbacks(configuration.cache_classes)
-    end
-
-    def disable_dependency_loading
-      if configuration.cache_classes &amp;&amp; !configuration.dependency_loading
-        ActiveSupport::Dependencies.unhook!
-      end
+  Initializer.default.add :load_gems do
+    unless $gems_rake_task
+      config.gems.each { |gem| gem.load }
     end
   end
 
-  # The Configuration class holds all the parameters for the Initializer and
-  # ships with defaults that suites most Rails applications. But it's possible
-  # to overwrite everything. Usually, you'll create an Configuration file
-  # implicitly through the block running on the Initializer, but it's also
-  # possible to create the Configuration instance in advance and pass it in
-  # like this:
+  # Loads all plugins in &lt;tt&gt;config.plugin_paths&lt;/tt&gt;.  &lt;tt&gt;plugin_paths&lt;/tt&gt;
+  # defaults to &lt;tt&gt;vendor/plugins&lt;/tt&gt; but may also be set to a list of
+  # paths, such as
+  #   config.plugin_paths = [&quot;#{RAILS_ROOT}/lib/plugins&quot;, &quot;#{RAILS_ROOT}/vendor/plugins&quot;]
   #
-  #   config = Rails::Configuration.new
-  #   Rails::Initializer.run(:process, config)
-  class Configuration
-    # The application's base directory.
-    attr_reader :root_path
-
-    # A stub for setting options on ActionController::Base.
-    attr_accessor :action_controller
-
-    # A stub for setting options on ActionMailer::Base.
-    attr_accessor :action_mailer
-
-    # A stub for setting options on ActionView::Base.
-    attr_accessor :action_view
-
-    # A stub for setting options on ActiveRecord::Base.
-    attr_accessor :active_record
-
-    # A stub for setting options on ActiveResource::Base.
-    attr_accessor :active_resource
-
-    # A stub for setting options on ActiveSupport.
-    attr_accessor :active_support
-
-    # Whether to preload all frameworks at startup.
-    attr_accessor :preload_frameworks
-
-    # Whether or not classes should be cached (set to false if you want
-    # application classes to be reloaded on each request)
-    attr_accessor :cache_classes
-
-    # The list of paths that should be searched for controllers. (Defaults
-    # to &lt;tt&gt;app/controllers&lt;/tt&gt;.)
-    attr_accessor :controller_paths
-
-    # The path to the database configuration file to use. (Defaults to
-    # &lt;tt&gt;config/database.yml&lt;/tt&gt;.)
-    attr_accessor :database_configuration_file
-
-    # The path to the routes configuration file to use. (Defaults to
-    # &lt;tt&gt;config/routes.rb&lt;/tt&gt;.)
-    attr_accessor :routes_configuration_file
-
-    # The list of rails framework components that should be loaded. (Defaults
-    # to &lt;tt&gt;:active_record&lt;/tt&gt;, &lt;tt&gt;:action_controller&lt;/tt&gt;,
-    # &lt;tt&gt;:action_view&lt;/tt&gt;, &lt;tt&gt;:action_mailer&lt;/tt&gt;, and
-    # &lt;tt&gt;:active_resource&lt;/tt&gt;).
-    attr_accessor :frameworks
-
-    # An array of additional paths to prepend to the load path. By default,
-    # all +app+, +lib+, +vendor+ and mock paths are included in this list.
-    attr_accessor :load_paths
-
-    # An array of paths from which Rails will automatically load from only once.
-    # All elements of this array must also be in +load_paths+.
-    attr_accessor :load_once_paths
-
-    # An array of paths from which Rails will eager load on boot if cache
-    # classes is enabled. All elements of this array must also be in
-    # +load_paths+.
-    attr_accessor :eager_load_paths
-
-    # The log level to use for the default Rails logger. In production mode,
-    # this defaults to &lt;tt&gt;:info&lt;/tt&gt;. In development mode, it defaults to
-    # &lt;tt&gt;:debug&lt;/tt&gt;.
-    attr_accessor :log_level
-
-    # The path to the log file to use. Defaults to log/#{environment}.log
-    # (e.g. log/development.log or log/production.log).
-    attr_accessor :log_path
-
-    # The specific logger to use. By default, a logger will be created and
-    # initialized using #log_path and #log_level, but a programmer may
-    # specifically set the logger to use via this accessor and it will be
-    # used directly.
-    attr_accessor :logger
-
-    # The specific cache store to use. By default, the ActiveSupport::Cache::Store will be used.
-    attr_accessor :cache_store
-
-    # The root of the application's views. (Defaults to &lt;tt&gt;app/views&lt;/tt&gt;.)
-    attr_accessor :view_path
-
-    # Set to +true+ if you want to be warned (noisily) when you try to invoke
-    # any method of +nil+. Set to +false+ for the standard Ruby behavior.
-    attr_accessor :whiny_nils
-
-    # The list of plugins to load. If this is set to &lt;tt&gt;nil&lt;/tt&gt;, all plugins will
-    # be loaded. If this is set to &lt;tt&gt;[]&lt;/tt&gt;, no plugins will be loaded. Otherwise,
-    # plugins will be loaded in the order specified.
-    attr_reader :plugins
-    def plugins=(plugins)
-      @plugins = plugins.nil? ? nil : plugins.map { |p| p.to_sym }
-    end
-
-    # The list of metals to load. If this is set to &lt;tt&gt;nil&lt;/tt&gt;, all metals will
-    # be loaded in alphabetical order. If this is set to &lt;tt&gt;[]&lt;/tt&gt;, no metals will
-    # be loaded. Otherwise metals will be loaded in the order specified
-    attr_accessor :metals
-
-    # The path to the root of the plugins directory. By default, it is in
-    # &lt;tt&gt;vendor/plugins&lt;/tt&gt;.
-    attr_accessor :plugin_paths
-
-    # The classes that handle finding the desired plugins that you'd like to load for
-    # your application. By default it is the Rails::Plugin::FileSystemLocator which finds
-    # plugins to load in &lt;tt&gt;vendor/plugins&lt;/tt&gt;. You can hook into gem location by subclassing
-    # Rails::Plugin::Locator and adding it onto the list of &lt;tt&gt;plugin_locators&lt;/tt&gt;.
-    attr_accessor :plugin_locators
-
-    # The class that handles loading each plugin. Defaults to Rails::Plugin::Loader, but
-    # a sub class would have access to fine grained modification of the loading behavior. See
-    # the implementation of Rails::Plugin::Loader for more details.
-    attr_accessor :plugin_loader
-
-    # Enables or disables plugin reloading.  You can get around this setting per plugin.
-    # If &lt;tt&gt;reload_plugins?&lt;/tt&gt; is false, add this to your plugin's &lt;tt&gt;init.rb&lt;/tt&gt;
-    # to make it reloadable:
-    #
-    #   ActiveSupport::Dependencies.load_once_paths.delete lib_path
-    #
-    # If &lt;tt&gt;reload_plugins?&lt;/tt&gt; is true, add this to your plugin's &lt;tt&gt;init.rb&lt;/tt&gt;
-    # to only load it once:
-    #
-    #   ActiveSupport::Dependencies.load_once_paths &lt;&lt; lib_path
-    #
-    attr_accessor :reload_plugins
-
-    # Returns true if plugin reloading is enabled.
-    def reload_plugins?
-      !!@reload_plugins
-    end
-
-    # Enables or disables dependency loading during the request cycle. Setting
-    # &lt;tt&gt;dependency_loading&lt;/tt&gt; to true will allow new classes to be loaded
-    # during a request. Setting it to false will disable this behavior.
-    #
-    # Those who want to run in a threaded environment should disable this
-    # option and eager load or require all there classes on initialization.
-    #
-    # If &lt;tt&gt;cache_classes&lt;/tt&gt; is disabled, dependency loaded will always be
-    # on.
-    attr_accessor :dependency_loading
-
-    # An array of gems that this rails application depends on.  Rails will automatically load
-    # these gems during installation, and allow you to install any missing gems with:
-    #
-    #   rake gems:install
-    #
-    # You can add gems with the #gem method.
-    attr_accessor :gems
-
-    # Adds a single Gem dependency to the rails application. By default, it will require
-    # the library with the same name as the gem. Use :lib to specify a different name.
-    #
-    #   # gem 'aws-s3', '&gt;= 0.4.0'
-    #   # require 'aws/s3'
-    #   config.gem 'aws-s3', :lib =&gt; 'aws/s3', :version =&gt; '&gt;= 0.4.0', \
-    #     :source =&gt; &quot;http://code.whytheluckystiff.net&quot;
-    #
-    # To require a library be installed, but not attempt to load it, pass :lib =&gt; false
-    #
-    #   config.gem 'qrp', :version =&gt; '0.4.1', :lib =&gt; false
-    def gem(name, options = {})
-      @gems &lt;&lt; Rails::GemDependency.new(name, options)
-    end
-
-    # Deprecated options:
-    def breakpoint_server(_ = nil)
-      $stderr.puts %(
-      *******************************************************************
-      * config.breakpoint_server has been deprecated and has no effect. *
-      *******************************************************************
-      )
-    end
-    alias_method :breakpoint_server=, :breakpoint_server
-
-    # Sets the default +time_zone+.  Setting this will enable +time_zone+
-    # awareness for Active Record models and set the Active Record default
-    # timezone to &lt;tt&gt;:utc&lt;/tt&gt;.
-    attr_accessor :time_zone
-
-    # Accessor for i18n settings.
-    attr_accessor :i18n
-
-    # Create a new Configuration instance, initialized with the default
-    # values.
-    def initialize
-      set_root_path!
-
-      self.frameworks                   = default_frameworks
-      self.load_paths                   = default_load_paths
-      self.load_once_paths              = default_load_once_paths
-      self.eager_load_paths             = default_eager_load_paths
-      self.log_path                     = default_log_path
-      self.log_level                    = default_log_level
-      self.view_path                    = default_view_path
-      self.controller_paths             = default_controller_paths
-      self.preload_frameworks           = default_preload_frameworks
-      self.cache_classes                = default_cache_classes
-      self.dependency_loading           = default_dependency_loading
-      self.whiny_nils                   = default_whiny_nils
-      self.plugins                      = default_plugins
-      self.plugin_paths                 = default_plugin_paths
-      self.plugin_locators              = default_plugin_locators
-      self.plugin_loader                = default_plugin_loader
-      self.database_configuration_file  = default_database_configuration_file
-      self.routes_configuration_file    = default_routes_configuration_file
-      self.gems                         = default_gems
-      self.i18n                         = default_i18n
-
-      for framework in default_frameworks
-        self.send(&quot;#{framework}=&quot;, Rails::OrderedOptions.new)
-      end
-      self.active_support = Rails::OrderedOptions.new
-    end
-
-    # Set the root_path to RAILS_ROOT and canonicalize it.
-    def set_root_path!
-      raise 'RAILS_ROOT is not set' unless defined?(::RAILS_ROOT)
-      raise 'RAILS_ROOT is not a directory' unless File.directory?(::RAILS_ROOT)
-
-      @root_path =
-        # Pathname is incompatible with Windows, but Windows doesn't have
-        # real symlinks so File.expand_path is safe.
-        if RUBY_PLATFORM =~ /(:?mswin|mingw)/
-          File.expand_path(::RAILS_ROOT)
-
-        # Otherwise use Pathname#realpath which respects symlinks.
-        else
-          Pathname.new(::RAILS_ROOT).realpath.to_s
-        end
-
-      Object.const_set(:RELATIVE_RAILS_ROOT, ::RAILS_ROOT.dup) unless defined?(::RELATIVE_RAILS_ROOT)
-      ::RAILS_ROOT.replace @root_path
-    end
-
-    # Enable threaded mode. Allows concurrent requests to controller actions and
-    # multiple database connections. Also disables automatic dependency loading
-    # after boot, and disables reloading code on every request, as these are
-    # fundamentally incompatible with thread safety.
-    def threadsafe!
-      self.preload_frameworks = true
-      self.cache_classes = true
-      self.dependency_loading = false
-      self.action_controller.allow_concurrency = true
-      self
-    end
-
-    # Loads and returns the contents of the #database_configuration_file. The
-    # contents of the file are processed via ERB before being sent through
-    # YAML::load.
-    def database_configuration
-      require 'erb'
-      YAML::load(ERB.new(IO.read(database_configuration_file)).result)
-    end
+  # In the default implementation, as each plugin discovered in &lt;tt&gt;plugin_paths&lt;/tt&gt; is initialized:
+  # * its +lib+ directory, if present, is added to the load path (immediately after the applications lib directory)
+  # * &lt;tt&gt;init.rb&lt;/tt&gt; is evaluated, if present
+  #
+  # After all plugins are loaded, duplicates are removed from the load path.
+  # If an array of plugin names is specified in config.plugins, only those plugins will be loaded
+  # and they plugins will be loaded in that order. Otherwise, plugins are loaded in alphabetical
+  # order.
+  #
+  # if config.plugins ends contains :all then the named plugins will be loaded in the given order and all other
+  # plugins will be loaded in alphabetical order
+  Initializer.default.add :load_plugins do
+    plugin_loader.load_plugins
+  end
 
-    # The path to the current environment's file (&lt;tt&gt;development.rb&lt;/tt&gt;, etc.). By
-    # default the file is at &lt;tt&gt;config/environments/#{environment}.rb&lt;/tt&gt;.
-    def environment_path
-      &quot;#{root_path}/config/environments/#{environment}.rb&quot;
+  #
+  # # pick up any gems that plugins depend on
+  Initializer.default.add :add_gem_load_paths do
+    require 'rails/gem_dependency'
+    # TODO: This seems extraneous
+    Rails::GemDependency.add_frozen_gem_path
+    unless config.gems.empty?
+      require &quot;rubygems&quot;
+      config.gems.each { |gem| gem.add_load_paths }
     end
+  end
 
-    # Return the currently selected environment. By default, it returns the
-    # value of the RAILS_ENV constant.
-    def environment
-      ::RAILS_ENV
-    end
+  # TODO: Figure out if this needs to run a second time
+  # load_gems
 
-    # Adds a block which will be executed after rails has been fully initialized.
-    # Useful for per-environment configuration which depends on the framework being
-    # fully initialized.
-    def after_initialize(&amp;after_initialize_block)
-      after_initialize_blocks &lt;&lt; after_initialize_block if after_initialize_block
-    end
+  Initializer.default.add :check_gem_dependencies do
+    unloaded_gems = config.gems.reject { |g| g.loaded? }
+    if unloaded_gems.size &gt; 0
+      configuration.gems_dependencies_loaded = false
+      # don't print if the gems rake tasks are being run
+      unless $gems_rake_task
+        abort &lt;&lt;-end_error
+Missing these required gems:
+#{unloaded_gems.map { |gemm| &quot;#{gemm.name}  #{gemm.requirement}&quot; } * &quot;\n  &quot;}
 
-    # Returns the blocks added with Configuration#after_initialize
-    def after_initialize_blocks
-      @after_initialize_blocks ||= []
-    end
+You're running:
+ruby #{Gem.ruby_version} at #{Gem.ruby}
+rubygems #{Gem::RubyGemsVersion} at #{Gem.path * ', '}
 
-    # Add a preparation callback that will run before every request in development
-    # mode, or before the first request in production.
-    #
-    # See Dispatcher#to_prepare.
-    def to_prepare(&amp;callback)
-      after_initialize do
-        require 'dispatcher' unless defined?(::Dispatcher)
-        Dispatcher.to_prepare(&amp;callback)
+Run `rake gems:install` to install the missing gems.
+        end_error
       end
+    else
+      configuration.gems_dependencies_loaded = true
     end
+  end
 
-    def middleware
-      require 'action_controller'
-      ActionController::Dispatcher.middleware
-    end
-
-    def builtin_directories
-      # Include builtins only in the development environment.
-      (environment == 'development') ? Dir[&quot;#{RAILTIES_PATH}/builtin/*/&quot;] : []
-    end
-
-    def framework_paths
-      paths = %w(railties railties/lib activesupport/lib)
-      paths &lt;&lt; 'actionpack/lib' if frameworks.include?(:action_controller) || frameworks.include?(:action_view)
+  # # bail out if gems are missing - note that check_gem_dependencies will have
+  # # already called abort() unless $gems_rake_task is set
+  # return unless gems_dependencies_loaded
 
-      [:active_record, :action_mailer, :active_resource, :action_web_service].each do |framework|
-        paths &lt;&lt; &quot;#{framework.to_s.gsub('_', '')}/lib&quot; if frameworks.include?(framework)
+  Initializer.default.add :load_application_initializers do
+    if gems_dependencies_loaded
+      Dir[&quot;#{configuration.root_path}/config/initializers/**/*.rb&quot;].sort.each do |initializer|
+        load(initializer)
       end
-
-      paths.map { |dir| &quot;#{framework_root_path}/#{dir}&quot; }.select { |dir| File.directory?(dir) }
     end
+  end
 
-    private
-      def framework_root_path
-        defined?(::RAILS_FRAMEWORK_ROOT) ? ::RAILS_FRAMEWORK_ROOT : &quot;#{root_path}/vendor/rails&quot;
-      end
-
-      def default_frameworks
-        [ :active_record, :action_controller, :action_view, :action_mailer, :active_resource ]
-      end
-
-      def default_load_paths
-        paths = []
-
-        # Add the old mock paths only if the directories exists
-        paths.concat(Dir[&quot;#{root_path}/test/mocks/#{environment}&quot;]) if File.exists?(&quot;#{root_path}/test/mocks/#{environment}&quot;)
-
-        # Add the app's controller directory
-        paths.concat(Dir[&quot;#{root_path}/app/controllers/&quot;])
-
-        # Followed by the standard includes.
-        paths.concat %w(
-          app
-          app/metal
-          app/models
-          app/controllers
-          app/helpers
-          app/services
-          lib
-          vendor
-        ).map { |dir| &quot;#{root_path}/#{dir}&quot; }.select { |dir| File.directory?(dir) }
-
-        paths.concat builtin_directories
-      end
-
-      # Doesn't matter since plugins aren't in load_paths yet.
-      def default_load_once_paths
-        []
-      end
-
-      def default_eager_load_paths
-        %w(
-          app/metal
-          app/models
-          app/controllers
-          app/helpers
-        ).map { |dir| &quot;#{root_path}/#{dir}&quot; }.select { |dir| File.directory?(dir) }
-      end
-
-      def default_log_path
-        File.join(root_path, 'log', &quot;#{environment}.log&quot;)
-      end
-
-      def default_log_level
-        environment == 'production' ? :info : :debug
-      end
-
-      def default_database_configuration_file
-        File.join(root_path, 'config', 'database.yml')
-      end
-
-      def default_routes_configuration_file
-        File.join(root_path, 'config', 'routes.rb')
-      end
-
-      def default_view_path
-        File.join(root_path, 'app', 'views')
-      end
-
-      def default_controller_paths
-        paths = [File.join(root_path, 'app', 'controllers')]
-        paths.concat builtin_directories
-        paths
-      end
-
-      def default_dependency_loading
-        true
-      end
-
-      def default_preload_frameworks
-        false
-      end
-
-      def default_cache_classes
-        true
-      end
-
-      def default_whiny_nils
-        false
-      end
-
-      def default_plugins
-        nil
-      end
-
-      def default_plugin_paths
-        [&quot;#{root_path}/vendor/plugins&quot;]
-      end
-
-      def default_plugin_locators
-        require 'rails/plugin/locator'
-        locators = []
-        locators &lt;&lt; Plugin::GemLocator if defined? Gem
-        locators &lt;&lt; Plugin::FileSystemLocator
-      end
-
-      def default_plugin_loader
-        require 'rails/plugin/loader'
-        Plugin::Loader
-      end
-
-      def default_cache_store
-        if File.exist?(&quot;#{root_path}/tmp/cache/&quot;)
-          [ :file_store, &quot;#{root_path}/tmp/cache/&quot; ]
-        else
-          :memory_store
-        end
+  # Fires the user-supplied after_initialize block (Configuration#after_initialize)
+  Initializer.default.add :after_initialize do
+    if gems_dependencies_loaded
+      configuration.after_initialize_blocks.each do |block|
+        block.call
       end
+    end
+  end
 
-      def default_gems
-        []
+  # # Setup database middleware after initializers have run
+  Initializer.default.add :initialize_database_middleware do
+    if configuration.frameworks.include?(:active_record)
+      if configuration.frameworks.include?(:action_controller) &amp;&amp;
+          ActionController::Base.session_store.name == 'ActiveRecord::SessionStore'
+        configuration.middleware.insert_before :&quot;ActiveRecord::SessionStore&quot;, ActiveRecord::ConnectionAdapters::ConnectionManagement
+        configuration.middleware.insert_before :&quot;ActiveRecord::SessionStore&quot;, ActiveRecord::QueryCache
+      else
+        configuration.middleware.use ActiveRecord::ConnectionAdapters::ConnectionManagement
+        configuration.middleware.use ActiveRecord::QueryCache
       end
+    end
+  end
 
-      def default_i18n
-        i18n = Rails::OrderedOptions.new
-        i18n.load_path = []
-
-        if File.exist?(File.join(RAILS_ROOT, 'config', 'locales'))
-          i18n.load_path &lt;&lt; Dir[File.join(RAILS_ROOT, 'config', 'locales', '*.{rb,yml}')]
-          i18n.load_path.flatten!
-        end
+  # TODO: Make a DSL way to limit an initializer to a particular framework
 
-        i18n
-      end
+  # # Prepare dispatcher callbacks and run 'prepare' callbacks
+  Initializer.default.add :prepare_dispatcher do
+    next unless configuration.frameworks.include?(:action_controller)
+    require 'dispatcher' unless defined?(::Dispatcher)
+    Dispatcher.define_dispatcher_callbacks(configuration.cache_classes)
   end
-end
 
-# Needs to be duplicated from Active Support since its needed before Active
-# Support is available. Here both Options and Hash are namespaced to prevent
-# conflicts with other implementations AND with the classes residing in Active Support.
-class Rails::OrderedOptions &lt; Array #:nodoc:
-  def []=(key, value)
-    key = key.to_sym
-
-    if pair = find_pair(key)
-      pair.pop
-      pair &lt;&lt; value
-    else
-      self &lt;&lt; [key, value]
+  # Routing must be initialized after plugins to allow the former to extend the routes
+  # ---
+  # If Action Controller is not one of the loaded frameworks (Configuration#frameworks)
+  # this does nothing. Otherwise, it loads the routing definitions and sets up
+  # loading module used to lazily load controllers (Configuration#controller_paths).
+  Initializer.default.add :initialize_routing do
+    next unless configuration.frameworks.include?(:action_controller)
+
+    ActionController::Routing.controller_paths += configuration.controller_paths
+    ActionController::Routing::Routes.add_configuration_file(configuration.routes_configuration_file)
+    ActionController::Routing::Routes.reload!
+  end
+  #
+  # # Observers are loaded after plugins in case Observers or observed models are modified by plugins.
+  Initializer.default.add :load_observers do
+    if gems_dependencies_loaded &amp;&amp; configuration.frameworks.include?(:active_record)
+      ActiveRecord::Base.instantiate_observers
     end
   end
 
-  def [](key)
-    pair = find_pair(key.to_sym)
-    pair ? pair.last : nil
-  end
+  # Eager load application classes
+  Initializer.default.add :load_application_classes do
+    next if $rails_rake_task
 
-  def method_missing(name, *args)
-    if name.to_s =~ /(.*)=$/
-      self[$1.to_sym] = args.first
-    else
-      self[name]
+    if configuration.cache_classes
+      configuration.eager_load_paths.each do |load_path|
+        matcher = /\A#{Regexp.escape(load_path)}(.*)\.rb\Z/
+        Dir.glob(&quot;#{load_path}/**/*.rb&quot;).sort.each do |file|
+          require_dependency file.sub(matcher, '\1')
+        end
+      end
     end
   end
 
-  private
-    def find_pair(key)
-      self.each { |i| return i if i.first == key }
-      return false
+  # Disable dependency loading during request cycle
+  Initializer.default.add :disable_dependency_loading do
+    if configuration.cache_classes &amp;&amp; !configuration.dependency_loading
+      ActiveSupport::Dependencies.unhook!
     end
+  end
 end
-</diff>
      <filename>railties/lib/initializer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-require 'action_controller/performance_test'
+require 'action_controller/testing/performance_test'
 
 ActionController::Base.perform_caching = true
 ActiveSupport::Dependencies.mechanism = :require</diff>
      <filename>railties/lib/performance_test_help.rb</filename>
    </modified>
    <modified>
      <diff>@@ -29,11 +29,18 @@ module Rails
       end
     end
 
-    def self.from_directory_name(directory_name)
+    def self.from_directory_name(directory_name, load_spec=true)
       directory_name_parts = File.basename(directory_name).split('-')
       name    = directory_name_parts[0..-2].join('-')
       version = directory_name_parts.last
-      self.new(name, :version =&gt; version)
+      result = self.new(name, :version =&gt; version)
+      spec_filename = File.join(directory_name, '.specification')
+      if load_spec
+        raise &quot;Missing specification file in #{File.dirname(spec_filename)}. Perhaps you need to do a 'rake gems:refresh_specs'?&quot; unless File.exists?(spec_filename)
+        spec = YAML::load_file(spec_filename)
+        result.specification = spec
+      end
+      result
     rescue ArgumentError =&gt; e
       raise &quot;Unable to determine gem name and version from '#{directory_name}'&quot;
     end
@@ -104,6 +111,10 @@ module Rails
       end
     end
 
+    def specification=(s)
+      @spec = s
+    end
+
     def requirement
       r = version_requirements
       (r == Gem::Requirement.default) ? nil : r
@@ -111,10 +122,14 @@ module Rails
 
     def built?
       return false unless frozen?
-      specification.extensions.each do |ext|
-        makefile = File.join(unpacked_gem_directory, File.dirname(ext), 'Makefile')
-        return false unless File.exists?(makefile)
+
+      if vendor_gem?
+        specification.extensions.each do |ext|
+          makefile = File.join(unpacked_gem_directory, File.dirname(ext), 'Makefile')
+          return false unless File.exists?(makefile)
+        end
       end
+
       true
     end
 
@@ -170,13 +185,14 @@ module Rails
 
     def build(options={})
       require 'rails/gem_builder'
+      return if specification.nil?
       if options[:force] || !built?
         return unless File.exists?(unpacked_specification_filename)
         spec = YAML::load_file(unpacked_specification_filename)
         Rails::GemBuilder.new(spec, unpacked_gem_directory).build_extensions
         puts &quot;Built gem: '#{unpacked_gem_directory}'&quot;
       end
-      dependencies.each { |dep| dep.build }
+      dependencies.each { |dep| dep.build(options) }
     end
 
     def install
@@ -236,7 +252,7 @@ module Rails
         real_spec = Gem::Specification.load(specification.loaded_from)
         write_specification(real_spec)
       end
-      dependencies.each { |dep| dep.unpack } if options[:recursive]
+      dependencies.each { |dep| dep.unpack(options) } if options[:recursive]
     end
 
     def write_specification(spec)</diff>
      <filename>railties/lib/rails/gem_dependency.rb</filename>
    </modified>
    <modified>
      <diff>@@ -105,7 +105,7 @@ module Rails
         end
 
         def register_plugin_as_loaded(plugin)
-          initializer.loaded_plugins &lt;&lt; plugin
+          initializer.config.loaded_plugins &lt;&lt; plugin
         end
 
         def configuration
@@ -174,7 +174,7 @@ module Rails
         end
 
         def loaded?(plugin_name)
-          initializer.loaded_plugins.detect { |plugin| plugin.name == plugin_name.to_s }
+          initializer.config.loaded_plugins.detect { |plugin| plugin.name == plugin_name.to_s }
         end
 
         def ensure_all_registered_plugins_are_loaded!</diff>
      <filename>railties/lib/rails/plugin/loader.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 module Rails
   module VERSION #:nodoc:
-    MAJOR = 2
-    MINOR = 3
-    TINY  = 2
+    MAJOR = 3
+    MINOR = 0
+    TINY  = &quot;pre&quot;
 
     STRING = [MAJOR, MINOR, TINY].join('.')
   end</diff>
      <filename>railties/lib/rails/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1 @@
-RAILTIES_PATH = File.join(File.dirname(__FILE__), '..')
+RAILTIES_PATH = File.expand_path(File.join(File.dirname(__FILE__), '..'))</diff>
      <filename>railties/lib/railties_path.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,7 @@ namespace :gems do
   desc &quot;Build any native extensions for unpacked gems&quot;
   task :build do
     $gems_build_rake_task = true
-    frozen_gems.each {|gem| gem.build }
+    frozen_gems.each { |gem| gem.build }
   end
 
   namespace :build do
@@ -33,12 +33,12 @@ namespace :gems do
 
   desc &quot;Installs all required gems.&quot;
   task :install =&gt; :base do
-    current_gems.each {|gem| gem.install }
+    current_gems.each { |gem| gem.install }
   end
 
   desc &quot;Unpacks all required gems into vendor/gems.&quot;
   task :unpack =&gt; :install do
-    current_gems.each {|gem| gem.unpack }
+    current_gems.each { |gem| gem.unpack }
   end
 
   namespace :unpack do
@@ -49,8 +49,8 @@ namespace :gems do
   end
 
   desc &quot;Regenerate gem specifications in correct format.&quot;
-  task :refresh_specs =&gt; :base do
-    current_gems.each {|gem| gem.refresh }
+  task :refresh_specs do
+    frozen_gems(false).each { |gem| gem.refresh }
   end
 end
 
@@ -60,9 +60,9 @@ def current_gems
   gems
 end
 
-def frozen_gems
+def frozen_gems(load_specs=true)
   Dir[File.join(RAILS_ROOT, 'vendor', 'gems', '*-*')].map do |gem_dir|
-    Rails::GemDependency.from_directory_name(gem_dir)
+    Rails::GemDependency.from_directory_name(gem_dir, load_specs)
   end
 end
 </diff>
      <filename>railties/lib/tasks/gems.rake</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,7 @@
 silence_warnings { RAILS_ENV = &quot;test&quot; }
 
 require 'test/unit'
+require 'active_support/core_ext/kernel/requires'
 require 'action_controller/testing/test_case'
 require 'action_view/test_case'
 require 'action_controller/testing/integration'
@@ -29,7 +30,10 @@ end
 begin
   require_library_or_gem 'ruby-debug'
   Debugger.start
-  Debugger.settings[:autoeval] = true if Debugger.respond_to?(:settings)
+  if Debugger.respond_to?(:settings)
+    Debugger.settings[:autoeval] = true
+    Debugger.settings[:autolist] = 1
+  end
 rescue LoadError
   # ruby-debug wasn't available so neither can the debugging be
 end</diff>
      <filename>railties/lib/test_help.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,10 @@
+ORIG_ARGV = ARGV.dup
+
 $:.unshift File.dirname(__FILE__) + &quot;/../../activesupport/lib&quot;
 $:.unshift File.dirname(__FILE__) + &quot;/../../activerecord/lib&quot;
 $:.unshift File.dirname(__FILE__) + &quot;/../../actionpack/lib&quot;
 $:.unshift File.dirname(__FILE__) + &quot;/../../actionmailer/lib&quot;
+$:.unshift File.dirname(__FILE__) + &quot;/../../activeresource/lib&quot;
 $:.unshift File.dirname(__FILE__) + &quot;/../lib&quot;
 $:.unshift File.dirname(__FILE__) + &quot;/../builtin/rails_info&quot;
 
@@ -9,9 +12,6 @@ require 'stringio'
 require 'rubygems'
 require 'test/unit'
 
-gem 'mocha', '&gt;= 0.9.5'
-require 'mocha'
-
 require 'active_support'
 require 'active_support/test_case'
 </diff>
      <filename>railties/test/abstract_unit.rb</filename>
    </modified>
    <modified>
      <diff>@@ -166,12 +166,25 @@ class GemDependencyTest &lt; Test::Unit::TestCase
     dummy_gem.unpack
   end
 
+  def test_gem_from_directory_name_attempts_to_load_specification
+    assert_raises RuntimeError do
+      dummy_gem = Rails::GemDependency.from_directory_name('dummy-gem-1.1')
+    end
+  end
+
   def test_gem_from_directory_name
-    dummy_gem = Rails::GemDependency.from_directory_name('dummy-gem-1.1')
+    dummy_gem = Rails::GemDependency.from_directory_name('dummy-gem-1.1', false)
     assert_equal 'dummy-gem', dummy_gem.name
     assert_equal '= 1.1',     dummy_gem.version_requirements.to_s
   end
 
+  def test_gem_from_directory_name_loads_specification_successfully
+    assert_nothing_raised do
+      dummy_gem = Rails::GemDependency.from_directory_name(File.join(Rails::GemDependency.unpacked_path, 'dummy-gem-g-1.0.0'))
+      assert_not_nil dummy_gem.specification
+    end
+  end
+
   def test_gem_from_invalid_directory_name
     assert_raises RuntimeError do
       dummy_gem = Rails::GemDependency.from_directory_name('dummy-gem')
@@ -186,5 +199,22 @@ class GemDependencyTest &lt; Test::Unit::TestCase
     assert_equal true,  Rails::GemDependency.new(&quot;dummy-gem-i&quot;).built?
     assert_equal false, Rails::GemDependency.new(&quot;dummy-gem-j&quot;).built?
   end
+  
+  def test_gem_determines_build_status_only_on_vendor_gems
+    framework_gem = Rails::GemDependency.new('dummy-framework-gem')
+    framework_gem.stubs(:framework_gem?).returns(true)  # already loaded
+    framework_gem.stubs(:vendor_rails?).returns(false)  # but not in vendor/rails
+    framework_gem.stubs(:vendor_gem?).returns(false)  # and not in vendor/gems
+    framework_gem.add_load_paths  # freeze framework gem early 
+    assert framework_gem.built?
+  end
+
+  def test_gem_build_passes_options_to_dependencies
+    start_gem = Rails::GemDependency.new(&quot;dummy-gem-g&quot;)
+    dep_gem = Rails::GemDependency.new(&quot;dummy-gem-f&quot;)
+    start_gem.stubs(:dependencies).returns([dep_gem])
+    dep_gem.expects(:build).with({ :force =&gt; true }).once
+    start_gem.build(:force =&gt; true)
+  end
 
 end</diff>
      <filename>railties/test/gem_dependency_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,9 +7,11 @@ class GeneratorLookupTest &lt; Test::Unit::TestCase
     # We need to add our testing plugin directory to the plugin paths so
     # the locator knows where to look for our plugins
     @configuration.plugin_paths += @fixture_dirs.map{|fd| plugin_fixture_path(fd)}
-    @initializer = Rails::Initializer.new(@configuration)
-    @initializer.add_plugin_load_paths
-    @initializer.load_plugins
+    @initializer = Rails::Initializer.default
+    @initializer.config = @configuration
+    @initializer.run(:add_plugin_load_paths)
+    @initializer.run(:load_plugins)
+    @initializer.run(:set_root_path)
     load 'rails_generator.rb'
     require 'rails_generator/scripts'
   end</diff>
      <filename>railties/test/generator_lookup_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -38,14 +38,15 @@ class Initializer_eager_loading_Test &lt; Test::Unit::TestCase
     @config.cache_classes = true
     @config.load_paths = [File.expand_path(File.dirname(__FILE__) + &quot;/fixtures/eager&quot;)]
     @config.eager_load_paths = [File.expand_path(File.dirname(__FILE__) + &quot;/fixtures/eager&quot;)]
-    @initializer = Rails::Initializer.new(@config)
-    @initializer.set_load_path
-    @initializer.set_autoload_paths
+    @initializer = Rails::Initializer.default
+    @initializer.config = @config
+    @initializer.run(:set_load_path)
+    @initializer.run(:set_autoload_paths)
   end
 
   def test_eager_loading_loads_parent_classes_before_children
     assert_nothing_raised do
-      @initializer.load_application_classes
+      @initializer.run(:load_application_classes)
     end
   end
 end
@@ -62,7 +63,7 @@ class Initializer_after_initialize_with_blocks_environment_Test &lt; Test::Unit::Te
     assert_nil $test_after_initialize_block1
     assert_nil $test_after_initialize_block2
 
-    Rails::Initializer.any_instance.expects(:gems_dependencies_loaded).returns(true)
+    config.expects(:gems_dependencies_loaded).returns(true)
     Rails::Initializer.run(:after_initialize, config)
   end
 
@@ -92,7 +93,7 @@ class Initializer_after_initialize_with_no_block_environment_Test &lt; Test::Unit::
     end
     assert_nil $test_after_initialize_block1
 
-    Rails::Initializer.any_instance.expects(:gems_dependencies_loaded).returns(true)
+    config.expects(:gems_dependencies_loaded).returns(true)
     Rails::Initializer.run(:after_initialize, config)
   end
 
@@ -114,101 +115,99 @@ class ConfigurationFrameworkPathsTests &lt; Test::Unit::TestCase
   def setup
     @config = Rails::Configuration.new
     @config.frameworks.clear
+    @initializer = Rails::Initializer.default
+    @initializer.config = @config
 
     File.stubs(:directory?).returns(true)
-    @config.stubs(:framework_root_path).returns('')
+    Rails::Initializer.run(:set_root_path, @config)
   end
 
   def test_minimal
-    expected = %w(
-      /railties
-      /railties/lib
-      /activesupport/lib
-    )
-    assert_equal expected, @config.framework_paths
+    expected = %w(railties railties/lib activesupport/lib)
+    assert_equal expected.map {|e| &quot;#{@config.framework_root_path}/#{e}&quot;}, @config.framework_paths
   end
 
   def test_actioncontroller_or_actionview_add_actionpack
     @config.frameworks &lt;&lt; :action_controller
-    assert_framework_path '/actionpack/lib'
+    assert_framework_path &quot;actionpack/lib&quot;
 
     @config.frameworks = [:action_view]
-    assert_framework_path '/actionpack/lib'
+    assert_framework_path 'actionpack/lib'
   end
 
   def test_paths_for_ar_ares_and_mailer
     [:active_record, :action_mailer, :active_resource, :action_web_service].each do |framework|
       @config.frameworks = [framework]
-      assert_framework_path &quot;/#{framework.to_s.gsub('_', '')}/lib&quot;
+      assert_framework_path &quot;#{framework.to_s.gsub('_', '')}/lib&quot;
     end
   end
 
   def test_unknown_framework_raises_error
     @config.frameworks &lt;&lt; :action_foo
-    initializer = Rails::Initializer.new @config
-    initializer.expects(:require).raises(LoadError)
+
+    Class.any_instance.expects(:require).raises(LoadError)
 
     assert_raise RuntimeError do
-      initializer.send :require_frameworks
+      @initializer.run(:require_frameworks)
     end
   end
 
   def test_action_mailer_load_paths_set_only_if_action_mailer_in_use
     @config.frameworks = [:action_controller]
-    initializer = Rails::Initializer.new @config
-    initializer.send :require_frameworks
+    @initializer.config = @config
+    @initializer.run :require_frameworks
 
     assert_nothing_raised NameError do
-      initializer.send :load_view_paths
+      @initializer.run :load_view_paths
     end
   end
 
   def test_action_controller_load_paths_set_only_if_action_controller_in_use
     @config.frameworks = []
-    initializer = Rails::Initializer.new @config
-    initializer.send :require_frameworks
+    @initializer.run :require_frameworks
 
     assert_nothing_raised NameError do
-      initializer.send :load_view_paths
+      @initializer.run :load_view_paths
     end
   end
 
   protected
     def assert_framework_path(path)
-      assert @config.framework_paths.include?(path),
+      assert @config.framework_paths.include?(&quot;#{@config.framework_root_path}/#{path}&quot;),
         &quot;&lt;#{path.inspect}&gt; not found among &lt;#{@config.framework_paths.inspect}&gt;&quot;
     end
 end
 
-require File.dirname(__FILE__) + '/plugin_test_helper'
+require 'plugin_test_helper'
 
 class InitializerPluginLoadingTests &lt; Test::Unit::TestCase
   def setup
     @configuration     = Rails::Configuration.new
     @configuration.frameworks -= [:action_mailer]
     @configuration.plugin_paths &lt;&lt; plugin_fixture_root_path
-    @initializer       = Rails::Initializer.new(@configuration)
+    @initializer       = Rails::Initializer.default
+    @initializer.config = @configuration
     @valid_plugin_path = plugin_fixture_path('default/stubby')
     @empty_plugin_path = plugin_fixture_path('default/empty')
   end
 
   def test_no_plugins_are_loaded_if_the_configuration_has_an_empty_plugin_list
     only_load_the_following_plugins! []
-    @initializer.load_plugins
-    assert_equal [], @initializer.loaded_plugins
+    @initializer.run :load_plugins
+    assert_equal [], @configuration.loaded_plugins
   end
 
   def test_only_the_specified_plugins_are_located_in_the_order_listed
     plugin_names = [:plugin_with_no_lib_dir, :acts_as_chunky_bacon]
     only_load_the_following_plugins! plugin_names
     load_plugins!
-    assert_plugins plugin_names, @initializer.loaded_plugins
+    assert_plugins plugin_names, @configuration.loaded_plugins
   end
 
   def test_all_plugins_are_loaded_when_registered_plugin_list_is_untouched
     failure_tip = &quot;It's likely someone has added a new plugin fixture without updating this list&quot;
     load_plugins!
-    assert_plugins [:a, :acts_as_chunky_bacon, :engine, :gemlike, :plugin_with_no_lib_dir, :stubby], @initializer.loaded_plugins, failure_tip
+    assert_plugins [:a, :acts_as_chunky_bacon, :engine, :gemlike, :plugin_with_no_lib_dir, :stubby], @configuration.loaded_plugins, failure_tip
   end
 
   def test_all_plugins_loaded_when_all_is_used
@@ -216,7 +215,7 @@ class InitializerPluginLoadingTests &lt; Test::Unit::TestCase
     only_load_the_following_plugins! plugin_names
     load_plugins!
     failure_tip = &quot;It's likely someone has added a new plugin fixture without updating this list&quot;
-    assert_plugins [:stubby, :acts_as_chunky_bacon, :a, :engine, :gemlike, :plugin_with_no_lib_dir], @initializer.loaded_plugins, failure_tip
+    assert_plugins [:stubby, :acts_as_chunky_bacon, :a, :engine, :gemlike, :plugin_with_no_lib_dir], @configuration.loaded_plugins, failure_tip
   end
 
   def test_all_plugins_loaded_after_all
@@ -224,7 +223,7 @@ class InitializerPluginLoadingTests &lt; Test::Unit::TestCase
     only_load_the_following_plugins! plugin_names
     load_plugins!
     failure_tip = &quot;It's likely someone has added a new plugin fixture without updating this list&quot;
-    assert_plugins [:stubby, :a, :engine, :gemlike, :plugin_with_no_lib_dir, :acts_as_chunky_bacon], @initializer.loaded_plugins, failure_tip
+    assert_plugins [:stubby, :a, :engine, :gemlike, :plugin_with_no_lib_dir, :acts_as_chunky_bacon], @configuration.loaded_plugins, failure_tip
   end
 
   def test_plugin_names_may_be_strings
@@ -232,7 +231,7 @@ class InitializerPluginLoadingTests &lt; Test::Unit::TestCase
     only_load_the_following_plugins! plugin_names
     load_plugins!
     failure_tip = &quot;It's likely someone has added a new plugin fixture without updating this list&quot;
-    assert_plugins plugin_names, @initializer.loaded_plugins, failure_tip
+    assert_plugins plugin_names, @configuration.loaded_plugins, failure_tip
   end
 
   def test_registering_a_plugin_name_that_does_not_exist_raises_a_load_error
@@ -251,7 +250,7 @@ class InitializerPluginLoadingTests &lt; Test::Unit::TestCase
       flunk &quot;Expected a LoadError but did not get one&quot;
     rescue LoadError =&gt; e
       failure_tip = &quot;It's likely someone renamed or deleted plugin fixtures without updating this test&quot;
-      assert_plugins valid_plugin_names, @initializer.loaded_plugins, failure_tip
+      assert_plugins valid_plugin_names, @configuration.loaded_plugins, failure_tip
       invalid_plugin_names.each do |plugin|
         assert_match(/#{plugin.to_s}/, e.message, &quot;LoadError message should mention plugin '#{plugin}'&quot;)
       end
@@ -265,7 +264,7 @@ class InitializerPluginLoadingTests &lt; Test::Unit::TestCase
   def test_should_ensure_all_loaded_plugins_load_paths_are_added_to_the_load_path
     only_load_the_following_plugins! [:stubby, :acts_as_chunky_bacon]
 
-    @initializer.add_plugin_load_paths
+    @initializer.run(:add_plugin_load_paths)
 
     assert $LOAD_PATH.include?(File.join(plugin_fixture_path('default/stubby'), 'lib'))
     assert $LOAD_PATH.include?(File.join(plugin_fixture_path('default/acts/acts_as_chunky_bacon'), 'lib'))
@@ -274,8 +273,8 @@ class InitializerPluginLoadingTests &lt; Test::Unit::TestCase
   private
 
     def load_plugins!
-      @initializer.add_plugin_load_paths
-      @initializer.load_plugins
+      @initializer.run(:add_plugin_load_paths)
+      @initializer.run(:load_plugins)
     end
 end
 
@@ -312,9 +311,10 @@ class InitializerSetupI18nTests &lt; Test::Unit::TestCase
     assert_equal [
      File.expand_path(File.dirname(__FILE__) + &quot;/../../activesupport/lib/active_support/locale/en.yml&quot;),
      File.expand_path(File.dirname(__FILE__) + &quot;/../../actionpack/lib/action_view/locale/en.yml&quot;),
+     File.expand_path(File.dirname(__FILE__) + &quot;/../../activemodel/lib/active_model/locale/en.yml&quot;),
      File.expand_path(File.dirname(__FILE__) + &quot;/../../activerecord/lib/active_record/locale/en.yml&quot;),
      &quot;my/test/locale.yml&quot;,
-     &quot;my/other/locale.yml&quot; ], I18n.load_path.collect { |path| path =~ /^\./ ? File.expand_path(path) : path }
+     &quot;my/other/locale.yml&quot; ], I18n.load_path.collect { |path| path =~ /\.\./ ? File.expand_path(path) : path }
   end
 
   def test_setting_another_default_locale</diff>
      <filename>railties/test/initializer_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,8 @@ class TestPluginLoader &lt; Test::Unit::TestCase
 
     @configuration     = Rails::Configuration.new
     @configuration.plugin_paths &lt;&lt; plugin_fixture_root_path
-    @initializer       = Rails::Initializer.new(@configuration)
+    @initializer       = Rails::Initializer.default
+    @initializer.config = @configuration
     @valid_plugin_path = plugin_fixture_path('default/stubby')
     @empty_plugin_path = plugin_fixture_path('default/empty')
 </diff>
      <filename>railties/test/plugin_loader_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -27,7 +27,8 @@ class PluginFileSystemLocatorTest &lt; Test::Unit::TestCase
     # We need to add our testing plugin directory to the plugin paths so
     # the locator knows where to look for our plugins
     @configuration.plugin_paths &lt;&lt; plugin_fixture_root_path
-    @initializer       = Rails::Initializer.new(@configuration)
+    @initializer       = Rails::Initializer.default
+    @initializer.config = @configuration
     @locator           = Rails::Plugin::FileSystemLocator.new(@initializer)
     @valid_plugin_path = plugin_fixture_path('default/stubby')
     @empty_plugin_path = plugin_fixture_path('default/empty')</diff>
      <filename>railties/test/plugin_locator_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,8 @@ require 'plugin_test_helper'
 
 class PluginTest &lt; Test::Unit::TestCase
   def setup
-    @initializer         = Rails::Initializer.new(Rails::Configuration.new)
+    @initializer         = Rails::Initializer.default
+    @initializer.config  = Rails::Configuration.new
     @valid_plugin_path   = plugin_fixture_path('default/stubby')
     @empty_plugin_path   = plugin_fixture_path('default/empty')
     @gemlike_plugin_path = plugin_fixture_path('default/gemlike')</diff>
      <filename>railties/test/plugin_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ $:.unshift File.dirname(__FILE__) + &quot;/../../activesupport/lib&quot;
 require 'test/unit'
 require 'active_support'
 require 'initializer'
-require File.join(File.dirname(__FILE__), 'abstract_unit')
+require 'abstract_unit'
 
 # We need to set RAILS_ROOT if it isn't already set
 RAILS_ROOT = '.' unless defined?(RAILS_ROOT)</diff>
      <filename>railties/test/plugin_test_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -50,6 +50,9 @@ class RailsGeneratorTest &lt; Test::Unit::TestCase
 
   def setup
     ActiveRecord::Base.pluralize_table_names = true
+    @initializer = Rails::Initializer.default
+    @initializer.config = Rails.configuration
+    @initializer.run(:set_root_path)
   end
 
   def test_sources</diff>
      <filename>railties/test/rails_generator_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,6 +9,12 @@ ActionController::Routing::Routes.draw do |map|
   map.connect ':controller/:action/:id'
 end
 
+module ActionController
+  class Base
+    include ActionController::Testing
+  end
+end
+
 class InfoControllerTest &lt; ActionController::TestCase
   tests Rails::InfoController
 </diff>
      <filename>railties/test/rails_info_controller_test.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>actionpack/lib/action_controller/base/chained/benchmarking.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/base/chained/filters.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/base/chained/flash.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/base/layout.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/base/redirect.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/base/render.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/base/rescue.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/base/responder.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/new_base.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/new_base/base.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/new_base/compatibility.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/new_base/conditional_get.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/new_base/helpers.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/new_base/hide_actions.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/new_base/http.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/new_base/layouts.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/new_base/rack_convenience.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/new_base/redirector.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/new_base/render_options.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/new_base/renderer.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/new_base/rescuable.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/new_base/session.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/new_base/testing.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/new_base/url_for.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/testing/performance.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_controller/testing/process2.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/lib/action_view/template/path.rb</filename>
    </removed>
    <removed>
      <filename>actionpack/test/new_base/abstract_unit.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/core_ext/module/model_naming.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/json/encoders/date.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/json/encoders/date_time.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/json/encoders/enumerable.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/json/encoders/false_class.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/json/encoders/hash.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/json/encoders/nil_class.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/json/encoders/numeric.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/json/encoders/object.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/json/encoders/regexp.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/json/encoders/string.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/json/encoders/symbol.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/json/encoders/time.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/json/encoders/true_class.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/data_timezone.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/data_timezone_info.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Algiers.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Cairo.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Casablanca.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Harare.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Johannesburg.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Monrovia.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Africa/Nairobi.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Argentina/Buenos_Aires.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Argentina/San_Juan.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Bogota.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Caracas.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Chicago.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Chihuahua.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Denver.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Godthab.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Guatemala.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Halifax.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Indiana/Indianapolis.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Juneau.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/La_Paz.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Lima.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Los_Angeles.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Mazatlan.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Mexico_City.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Monterrey.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/New_York.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Phoenix.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Regina.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Santiago.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Sao_Paulo.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/St_Johns.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/America/Tijuana.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Almaty.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Baghdad.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Baku.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Bangkok.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Chongqing.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Colombo.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Dhaka.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Hong_Kong.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Irkutsk.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Jakarta.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Jerusalem.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Kabul.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Kamchatka.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Karachi.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Katmandu.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Kolkata.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Krasnoyarsk.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Kuala_Lumpur.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Kuwait.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Magadan.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Muscat.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Novosibirsk.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Rangoon.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Riyadh.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Seoul.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Shanghai.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Singapore.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Taipei.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Tashkent.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Tbilisi.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Tehran.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Tokyo.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Ulaanbaatar.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Urumqi.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Vladivostok.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Yakutsk.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Yekaterinburg.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Asia/Yerevan.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Atlantic/Azores.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Atlantic/Cape_Verde.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Atlantic/South_Georgia.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Adelaide.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Brisbane.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Darwin.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Hobart.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Melbourne.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Perth.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Australia/Sydney.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Etc/UTC.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Amsterdam.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Athens.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Belgrade.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Berlin.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Bratislava.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Brussels.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Bucharest.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Budapest.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Copenhagen.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Dublin.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Helsinki.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Istanbul.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Kiev.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Lisbon.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Ljubljana.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/London.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Madrid.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Minsk.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Moscow.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Paris.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Prague.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Riga.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Rome.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Sarajevo.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Skopje.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Sofia.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Stockholm.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Tallinn.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Vienna.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Vilnius.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Warsaw.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Europe/Zagreb.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Auckland.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Fiji.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Guam.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Honolulu.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Majuro.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Midway.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Noumea.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Pago_Pago.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Port_Moresby.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/definitions/Pacific/Tongatapu.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/info_timezone.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/linked_timezone.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/linked_timezone_info.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/offset_rationals.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/ruby_core_support.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/time_or_datetime.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone_definition.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone_info.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone_offset_info.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone_period.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/lib/active_support/vendor/tzinfo-0.3.12/tzinfo/timezone_transition_info.rb</filename>
    </removed>
    <removed>
      <filename>activesupport/test/core_ext/module/model_naming_test.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>bf5ac9965f12840d469ef2a4a16e8205dbbe5253</id>
    </parent>
    <parent>
      <id>a4bdc00fec623f72592e663e6d7830eea0bc6ea4</id>
    </parent>
  </parents>
  <author>
    <name>Pratik Naik</name>
    <email>pratiknaik@gmail.com</email>
  </author>
  <url>http://github.com/lifo/docrails/commit/2fe263bb328c20539f2970057f31e567ec4ab7c8</url>
  <id>2fe263bb328c20539f2970057f31e567ec4ab7c8</id>
  <committed-date>2009-07-03T05:01:39-07:00</committed-date>
  <authored-date>2009-07-03T05:01:39-07:00</authored-date>
  <message>Merge commit 'mainstream/master'

Conflicts:
	actionpack/lib/action_controller.rb
	actionpack/lib/action_controller/base/base.rb
	actionpack/lib/action_view/template/path.rb
	activesupport/lib/active_support/json/encoders/hash.rb</message>
  <tree>63e85164fb09aca6beb78e1a5c52424fa49ed098</tree>
  <committer>
    <name>Pratik Naik</name>
    <email>pratiknaik@gmail.com</email>
  </committer>
</commit>
