<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>docs/merb-core-call-stack-diagram.mmap</filename>
    </added>
    <added>
      <filename>docs/merb-core-call-stack-diagram.pdf</filename>
    </added>
    <added>
      <filename>docs/merb-core-call-stack-diagram.png</filename>
    </added>
    <added>
      <filename>lib/merb-core/rack/apps/path_prefix.rb</filename>
    </added>
    <added>
      <filename>lib/merb-core/rack/apps/static.rb</filename>
    </added>
    <added>
      <filename>lib/merb-core/rack/middleware.rb</filename>
    </added>
    <added>
      <filename>lib/merb-core/tasks/audit.rake</filename>
    </added>
    <added>
      <filename>lib/merb-core/tasks/merb.rb</filename>
    </added>
    <added>
      <filename>lib/merb-core/tasks/merb_rake_helper.rb</filename>
    </added>
    <added>
      <filename>lib/merb-core/test/test_ext/string.rb</filename>
    </added>
    <added>
      <filename>simple_benches/to_proc.rb</filename>
    </added>
    <added>
      <filename>spec/private/dispatch/session_mixin_spec.rb</filename>
    </added>
    <added>
      <filename>spec/private/router/behavior_spec.rb</filename>
    </added>
    <added>
      <filename>spec/private/router/route_spec.rb</filename>
    </added>
    <added>
      <filename>spec/private/router/router_spec.rb</filename>
    </added>
    <added>
      <filename>spec/private/vendor/facets/plural_spec.rb</filename>
    </added>
    <added>
      <filename>spec/private/vendor/facets/singular_spec.rb</filename>
    </added>
    <added>
      <filename>spec/public/abstract_controller/controllers/cousins.rb</filename>
    </added>
    <added>
      <filename>spec/public/abstract_controller/controllers/views/partial/with_absolute_partial/_partial.erb</filename>
    </added>
    <added>
      <filename>spec/public/abstract_controller/controllers/views/partial/with_absolute_partial/index.erb</filename>
    </added>
    <added>
      <filename>spec/public/controller/controllers/views/layout/custom_arg.json.erb</filename>
    </added>
    <added>
      <filename>spec/public/controller/controllers/views/merb/test/fixtures/controllers/display_with_template/no_layout.html.erb</filename>
    </added>
    <added>
      <filename>spec/public/core_ext/fixtures/core_ext_dependency.rb</filename>
    </added>
    <added>
      <filename>spec/public/core_ext/kernel_spec.rb</filename>
    </added>
    <added>
      <filename>spec/public/core_ext/spec_helper.rb</filename>
    </added>
    <added>
      <filename>spec/public/router/fixation_spec.rb</filename>
    </added>
    <added>
      <filename>spec/public/router/nested_matches_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,78 @@
+== 0.9.3 &quot;We Sold Our Soul for Rock 'n' Roll&quot; 2008-05-03
+* Added render(template_path) feature to view specs.
+* add mutex around compiled statement generation in the router so reloading doesn't step
+* BootLoader::LoadClasses now logs the actual exceptions
+* Added String#unescape_regexp for usage in Router::Route#generate
+* Added Time#to_json to Core Extensions so JSON formatted output for Time is ISO 8601 compatible
+* redo stream_file to (hopefully) work
+* _dispatch returns @body
+* Refactored Merb::AbstractController.layout class method
+* Fixed lurking infinite loop with not so common formats and ExceptionController
+* HTTP Basic authentication based on Rack
+* added dispatch helper for http basic authentication
+* added support and specs for http basic authorization
+* modified specs to test a route restriction based on the request method
+* Added ability to specify :format in url() for named routes
+* Added thrown_content? predicate method for use in templates.
+* pass arguments to filters
+* Fix cookie sessions bug where you could not properly delete a cookie
+* Standardises the call to set_cookie to use the set_cookie method in cookies.rb by default
+* added HasContent matcher
+* Added \- to String.unescape_regexp
+* Changed the display method to handle options properly, so that passing :layout =&gt; :false works.
+* Added error message for when a content_type is requested but not provided
+* added delete action to docs
+* deferred?(env) now works with thin and ebb.
+* If deferred_actions are empty? we want a regex that will never match.
+* Fix example in Merb::Test::RequestHelper#request documentation.
+* Unify &amp;block documentation across Merb::Test::RequestHelper
+* Add spec command run options to run_specs. Add tasks for profiled spec run.
+* Report total spec suite run time.
+* Use RSPEC_OPTS environment variable to override default spec run options.
+* Better formatting of spec suite run benchmark with good old sprintf.
+* Fix a nasty String#camel_case bug revealed but new shiny spec for String extensions.
+* Remove helper that duplicated String#camel_case functionality, update the rest of spec suite.
+* Split 'misc' examples group in Kernel extensions spec: each method should have a separate group
+* Split Kernel#use_orm guts into a bunch of smaller methods. Document those.
+* Kernel#already_registred_orm? is a sucky name. Make it Kernel#registred_orm?. Yay.
+* Split Kernel#use_test into smaller methos. Document them. Add specs for them beforehand.
+* Use a constant for sleep time in reloading specs
+* Use @ in publicity markers in RDoc.
+* Remove InvalidPathConversion exception: it is used nowhere in the core.
+* A bit clearer --init-file option description.
+* Be clear about what is the default init file Merb uses in RDoc.
+* hopefully the last fix for session fixation, woot woot
+* Provide hook for param filtering
+* Give useful information when no template is found for a partial
+* Adds a question method to determine environment.  eg Merb.env?(:production)
+* Make #display method pass all 'unknown' options to serialization method.
+* Add Object#in? for checking array inclusion
+* Update Kernel#__profile__ documentation.
+* Adding support for pidfile setting with cluster nodes setting.
+* Updating pidfile cluster fix to handle any extension.
+* Fix for kill so that cli options are read and handled before kill is actually called.
+* Refactored Exception status handling/inheritance (it actually works now!)
+* Replaced remaining ::STATUS constant references to .status method calls
+* Append the content_type to the given :template option for render()
+* Fix bug in --very-flat (allow direct inheritance from Merb::Controller)
+* Show merb usage if first argument is not a switch
+* Adding missing info about ebb adapter.
+* completed spec to Merb::Logger#new
+* Added Provide matcher class, so you can do &quot;controller.should provide( :xml )&quot; in your specs.
+* Added support for multiple keys to designate a resource. For use with Datamapper composite keys
+* Ensure that Merb::Logger doesn't try to close terminal streams.
+* Remove redundant unescape for cookie string
+* Added handling of INT signal for Merb server in foreground mode
+* params array serialization
+* Fixing pidfiles glob on cluster and pidfile argument
+* test request helpers support namespaced routes
+* Testing Merb::Test::RequestHelper#request method to properly handle namespaced routes
+* Provide opts for alternate rackup config path.
+* Add new -R/--rackup option to the full(-ish) list of options.
+* Make change_priveledge actually work
+* Allow http status to be a symbol - refactored String snake_case method
+* removing __app_file_trace__  since it doesn't work.
+
 == 0.9.2 &quot;appropriate response to reality&quot; 2008-03-24
 * removed Merb.logger calls due to the fact the bootloader did not ran by now and it is not initialized.
 * use __send__ rather than send</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -15,7 +15,7 @@ Goals of this release:
   
 To familiarize yourself with how a merb-core application might look,
 use merb-gen (from merb-more) to generate a few apps:
-$ merb-gen myapp                   # a &quot;normal&quot; merb app
-$ merb-gen myapp --flat            # a flattened app
-$ merb-gen myapp --very-flat       # a single-file app
+$ merb-gen app myapp                   # a &quot;normal&quot; merb app
+$ merb-gen app myapp --flat            # a flattened app
+$ merb-gen app myapp --very-flat       # a single-file app
 </diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -19,16 +19,13 @@ NAME = &quot;merb-core&quot;
 
 require &quot;lib/merb-core/version&quot;
 require &quot;lib/merb-core/test/run_specs&quot;
+require 'lib/merb-core/tasks/merb_rake_helper'
 
 ##############################################################################
 # Packaging &amp; Installation
 ##############################################################################
 CLEAN.include [&quot;**/.*.sw?&quot;, &quot;pkg&quot;, &quot;lib/*.bundle&quot;, &quot;*.gem&quot;, &quot;doc/rdoc&quot;, &quot;.config&quot;, &quot;coverage&quot;, &quot;cache&quot;]
 
-windows = (PLATFORM =~ /win32|cygwin/) rescue nil
-
-SUDO = windows ? &quot;&quot; : &quot;sudo&quot;
-
 desc &quot;Packages up Merb.&quot;
 task :default =&gt; :package
 
@@ -59,7 +56,6 @@ spec = Gem::Specification.new do |s|
   s.add_dependency &quot;json_pure&quot;
   s.add_dependency &quot;rspec&quot;
   s.add_dependency &quot;rack&quot;
-  s.add_dependency &quot;hpricot&quot;
   s.add_dependency &quot;mime-types&quot;
   # Requirements
   s.requirements &lt;&lt; &quot;install the json gem to get faster json parsing&quot;
@@ -72,17 +68,17 @@ end
 
 desc &quot;Run :package and install the resulting .gem&quot;
 task :install =&gt; :package do
-  sh %{#{SUDO} gem install --local pkg/#{NAME}-#{Merb::VERSION}.gem --no-rdoc --no-ri}
+  sh %{#{sudo} gem install #{install_home} --local pkg/#{NAME}-#{Merb::VERSION}.gem --no-rdoc --no-ri}
 end
 
 desc &quot;Run :package and install the resulting .gem with jruby&quot;
 task :jinstall =&gt; :package do
-  sh %{#{SUDO} jruby -S gem install pkg/#{NAME}-#{Merb::VERSION}.gem --no-rdoc --no-ri}
+  sh %{#{sudo} jruby -S gem install #{install_home} pkg/#{NAME}-#{Merb::VERSION}.gem --no-rdoc --no-ri}
 end
 
 desc &quot;Run :clean and uninstall the .gem&quot;
 task :uninstall =&gt; :clean do
-  sh %{#{SUDO} gem uninstall #{NAME}}
+  sh %{#{sudo} gem uninstall #{NAME}}
 end
 
 namespace :github do
@@ -90,14 +86,14 @@ namespace :github do
   task :update_gemspec do
     skip_fields = %w(new_platform original_platform)
     integer_fields = %w(specification_version)
-    
+
     result = &quot;Gem::Specification.new do |s|\n&quot;
-    spec.instance_variables.each do |ivar| 
+    spec.instance_variables.each do |ivar|
       value = spec.instance_variable_get(ivar)
       name  = ivar.split(&quot;@&quot;).last
       next if skip_fields.include?(name) || value.nil? || value == &quot;&quot; || (value.respond_to?(:empty?) &amp;&amp; value.empty?)
       if name == &quot;dependencies&quot;
-        value.each do |d| 
+        value.each do |d|
           dep, *ver = d.to_s.split(&quot; &quot;)
           result &lt;&lt;  &quot;  s.add_dependency #{dep.inspect}, #{ver.join(&quot; &quot;).inspect.gsub(/[()]/, &quot;&quot;)}\n&quot;
         end
@@ -143,7 +139,7 @@ namespace :doc do
   desc &quot;rdoc to rubyforge&quot;
   task :rubyforge do
     # sh %{rake doc}
-    sh %{#{SUDO} chmod -R 755 doc} unless windows
+    sh %{#{sudo} chmod -R 755 doc} unless windows?
     sh %{/usr/bin/scp -r -p doc/rdoc/* ezmobius@rubyforge.org:/var/www/gforge-projects/merb}
   end
 </diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -55,3 +55,4 @@ deflist: MimeTypes.
 \:xml: to_xml, application/xml or text/xml or application/x-xml, adds &quot;Encoding: UTF-8&quot; response header
 \:js: to_json, text/javascript ot application/javascript or application/x-javascript
 \:json: to_json, application/json or text/x-json
+</diff>
      <filename>docs/bootloading.dox</filename>
    </modified>
    <modified>
      <diff>@@ -9,10 +9,61 @@ $LOAD_PATH.unshift File.dirname(__FILE__) unless
   $LOAD_PATH.include?(File.dirname(__FILE__)) ||
   $LOAD_PATH.include?(File.expand_path(File.dirname(__FILE__)))
 
+require 'merb-core/vendor/facets'
+
 module Merb
   module GlobalHelpers; end
   class &lt;&lt; self
 
+    # Merge environment settings
+    # Can allow you to have a &quot;localdev&quot; that runs like your &quot;development&quot;
+    #   OR
+    # A &quot;staging&quot; environment that runs like your &quot;production&quot;
+    #
+    # ==== Examples
+    # From any environment config file (ie, development.rb, custom.rb, localdev.rb, etc)
+    #   staging.rb:
+    #     Merb.merge_env &quot;production&quot;         #We want to use all the settings production uses
+    #     Merb::Config.use { |c|
+    #       c[:log_level]         = &quot;debug&quot;   #except we want debug log level
+    #       c[:exception_details] = true      #and we want to see exception details
+    #     }
+    #
+    # ==== Parameters
+    # env&lt;~String&gt;:: Environment to run like
+    # use_db&lt;~Boolean&gt;:: Should Merb use the merged environments DB connection
+    #     Defaults to +false+
+    def merge_env(env,use_db=false)
+      if Merb.environment_info.nil?
+        Merb.environment_info = {
+          :real_env =&gt; Merb.environment,
+          :merged_envs =&gt; [],
+          :db_env =&gt; Merb.environment
+        }
+      end
+      
+      #Only load if it hasn't been loaded
+      unless Merb.environment_info[:merged_envs].member? env
+        Merb.environment_info[:merged_envs] &lt;&lt; env
+        
+        env_file = Merb.dir_for(:config) / &quot;environments&quot; / (&quot;#{env}.rb&quot;)
+        if File.exists?(env_file)
+          load(env_file)
+        else
+          Merb.logger.warn! &quot;Environment file does not exist! #{env_file}&quot;
+        end
+        
+      end
+      
+      # Mark specific environment to load when ORM loads,
+      # if multiple environments are loaded, the last one
+      # with use_db as TRUE will be loaded
+      if use_db
+        Merb.environment_info[:db_env] = env
+      end
+    end
+
+
     # Startup Merb by setting up the Config and starting the server.
     # This is where Merb application environment and root path are set.
     #
@@ -59,11 +110,11 @@ module Merb
       start_environment(Merb::Config.to_hash.merge(argv))
     end
 
-    attr_accessor :environment, :load_paths, :adapter
+    attr_accessor :environment, :load_paths, :adapter, :environment_info
 
     alias :env :environment
 
-    Merb.load_paths = Hash.new { [Merb.root] } unless Merb.load_paths.is_a?(Hash)
+    Merb.load_paths = Dictionary.new { [Merb.root] } unless Merb.load_paths.is_a?(Dictionary)
 
     # This is the core mechanism for setting up your application layout.
     # There are three application layouts in Merb:
@@ -103,10 +154,10 @@ module Merb
     # uses to simplify transition of legacy application, you can
     # set it up like this:
     #
-    # Merb.push_path(:models,      Merb.root / &quot;app&quot; / &quot;models&quot;,      &quot;**/*.rb&quot;)
-    # Merb.push_path(:mailers,     Merb.root / &quot;app&quot; / &quot;models&quot;,      &quot;**/*.rb&quot;)
-    # Merb.push_path(:controllers, Merb.root / &quot;app&quot; / &quot;controllers&quot;, &quot;**/*.rb&quot;)
-    # Merb.push_path(:views,       Merb.root / &quot;app&quot; / &quot;views&quot;,       &quot;**/*.rb&quot;)
+    # Merb.push_path(:model,      Merb.root / &quot;app&quot; / &quot;models&quot;,      &quot;**/*.rb&quot;)
+    # Merb.push_path(:mailer,     Merb.root / &quot;app&quot; / &quot;models&quot;,      &quot;**/*.rb&quot;)
+    # Merb.push_path(:controller, Merb.root / &quot;app&quot; / &quot;controllers&quot;, &quot;**/*.rb&quot;)
+    # Merb.push_path(:view,       Merb.root / &quot;app&quot; / &quot;views&quot;,       &quot;**/*.rb&quot;)
     #
     # ==== Parameters
     # type&lt;Symbol&gt;:: The type of path being registered (i.e. :view)
@@ -132,8 +183,8 @@ module Merb
     # application components.
     #
     # Merb.root = &quot;path/to/legacy/app/root&quot;
-    # Merb.remove_paths(:mailers)
-    # Merb.push_path(:mailers,     Merb.root / &quot;app&quot; / &quot;models&quot;,      &quot;**/*.rb&quot;)
+    # Merb.remove_paths(:mailer)
+    # Merb.push_path(:mailer,     Merb.root / &quot;app&quot; / &quot;models&quot;,      &quot;**/*.rb&quot;)
     #
     # Will make Merb use app/models for mailers just like Ruby on Rails does.
     def remove_paths(*args)
@@ -245,8 +296,35 @@ module Merb
     end
 
     # Set up default variables under Merb
-    attr_accessor :generator_scope, :klass_hashes
-    Merb.generator_scope = [:merb_default, :merb, :rspec]
+    attr_accessor :generator_scope, :klass_hashes, :orm_generator_scope, :test_framework_generator_scope
+
+    # Returns registered ORM generators as symbols,
+    # for instance, :datamapper.
+    #
+    # ==== Returns
+    # &lt;Array(Symbol&gt;:: registered ORM generators.
+    def orm_generator_scope
+      @orm_generator_scope ||= :merb_default
+    end
+
+    # Returns registered test framework generators.
+    #
+    # ==== Returns
+    # &lt;Array(Symbol&gt;:: registred test framework generators.
+    def test_framework_generator_scope
+      @test_framework_generator_scope ||= :rspec
+    end
+
+    # Returns all registered generators plus Merb generator.
+    #
+    # ==== Returns
+    # &lt;Array(Symbol&gt;::
+    #   all registered generators, inc. needed by Merb itself.
+    def generator_scope
+      [:merb, orm_generator_scope, test_framework_generator_scope]
+    end
+
+
     Merb.klass_hashes = []
 
     attr_reader :registered_session_types
@@ -322,6 +400,9 @@ module Merb
     # :session_id_key&lt;String&gt;::   session identifier,
     #                             default is _session_id
     #
+    # :session_store&lt;String&gt;::    session store to use (one of cookies,
+    #                             memcache or memory)
+    #
     # :log_delimiter&lt;String&gt;::    what Merb logger uses as delimiter
     #                             between message sections, default is &quot; ~ &quot;
     #
@@ -359,7 +440,7 @@ module Merb
       load_config(options)
       Merb::BootLoader::BuildFramework.run
       Merb::BootLoader::Dependencies.run
-      Merb::BootLoader::BeforeAppRuns.run
+      Merb::BootLoader::BeforeAppLoads.run
     end
 
     # Reload application and framework classes.
@@ -475,7 +556,6 @@ require 'merb-core/gem_ext/erubis'
 require 'merb-core/logger'
 require 'merb-core/version'
 require 'merb-core/controller/mime'
-require 'merb-core/vendor/facets'
 
 # Set the environment if it hasn't already been set.
 Merb.environment ||= ENV['MERB_ENV'] || Merb::Config[:environment] || (Merb.testing? ? 'test' : 'development')</diff>
      <filename>lib/merb-core.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,10 +5,8 @@ module Merb
     # def self.subclasses
     #---
     # @semipublic
-    cattr_accessor :subclasses, :after_load_callbacks, :before_load_callbacks
-    self.subclasses = []
-    self.after_load_callbacks = []
-    self.before_load_callbacks = []
+    cattr_accessor :subclasses, :after_load_callbacks, :before_load_callbacks, :finished
+    self.subclasses, self.after_load_callbacks, self.before_load_callbacks, self.finished = [], [], [], []
 
     class &lt;&lt; self
 
@@ -65,9 +63,21 @@ module Merb
           bootloader = subclasses.shift
           Merb.logger.debug!(&quot;Loading: #{bootloader}&quot;) if ENV['DEBUG']
           Object.full_const_get(bootloader).run
+          self.finished &lt;&lt; bootloader
         end
         self.subclasses = subklasses
       end
+      
+      # Determines whether or not a specific bootloader has finished yet.
+      #
+      # ==== Parameters
+      # bootloader&lt;String, Class&gt;:: The name of the bootloader to check.
+      #
+      # ==== Returns
+      # Boolean:: Whether or not the bootloader has finished.
+      def finished?(bootloader)
+        self.finished.include?(bootloader.to_s)
+      end
 
       # Set up the default framework
       #
@@ -128,9 +138,20 @@ class Merb::BootLoader::Logger &lt; Merb::BootLoader
   # Sets Merb.logger to a new logger created based on the config settings.
   def self.run
     Merb.logger = Merb::Logger.new(Merb.log_file, Merb::Config[:log_level], Merb::Config[:log_delimiter], Merb::Config[:log_auto_flush])
+    print_warnings
+  end
+  
+  def self.print_warnings
+    if Gem::Version.new(Gem::RubyGemsVersion) &lt; Gem::Version.new(&quot;1.1&quot;)
+      Merb.logger.warn! &quot;Please upgrade your Rubygems to the latest version&quot;      
+    end
   end
 end
 
+# Stores pid file.
+#
+# Only run if daemonization or clustering options specified on start.
+# Port is taken from Merb::Config and must be already set at this point.
 class Merb::BootLoader::DropPidFile &lt;  Merb::BootLoader
   class &lt;&lt; self
 
@@ -141,6 +162,14 @@ class Merb::BootLoader::DropPidFile &lt;  Merb::BootLoader
   end
 end
 
+# Setup some useful defaults
+class Merb::BootLoader::Defaults &lt; Merb::BootLoader
+  def self.run
+    Merb::Request.browser_method_workarounds &lt;&lt; &quot;_method&quot;
+  end
+end
+
+
 # Build the framework paths.
 #
 # By default, the following paths will be used:
@@ -272,7 +301,7 @@ class Merb::BootLoader::Dependencies &lt; Merb::BootLoader
 
 end
 
-class Merb::BootLoader::BeforeAppRuns &lt; Merb::BootLoader
+class Merb::BootLoader::BeforeAppLoads &lt; Merb::BootLoader
 
   # Call any before_app_loads hooks that were registered via before_app_loads
   # in any plugins.
@@ -295,21 +324,42 @@ class Merb::BootLoader::LoadClasses &lt; Merb::BootLoader
 
   class &lt;&lt; self
 
-    # Load all classes inside the load paths.
+    # Load all classes from Merb's native load paths.
     def run
-      orphaned_classes = []
       # Add models, controllers, and lib to the load path
       $LOAD_PATH.unshift Merb.dir_for(:model)
       $LOAD_PATH.unshift Merb.dir_for(:controller)
       $LOAD_PATH.unshift Merb.dir_for(:lib)
 
+      # Load application file if it exists - for flat applications
       load_file Merb.dir_for(:application) if File.file?(Merb.dir_for(:application))
+      
+      # Load classes and their requirements
+      Merb.load_paths.each do |component, path|
+        next unless path.last &amp;&amp; component != :application
+        load_classes(path.first / path.last)
+      end
 
-      # Require all the files in the registered load paths
-      Merb.load_paths.each do |name, path|
-        next unless path.last &amp;&amp; name != :application
-        Dir[path.first / path.last].each do |file|
-
+      Merb::Controller.send :include, Merb::GlobalHelpers
+    end
+    
+    # ==== Parameters
+    # file&lt;String&gt;:: The file to load.
+    def load_file(file)
+      klasses = ObjectSpace.classes.dup
+      load file
+      LOADED_CLASSES[file] = ObjectSpace.classes - klasses
+      MTIMES[file] = File.mtime(file)
+    end
+    
+    # Load classes from given paths - using path/glob pattern.
+    #
+    # *paths&lt;Array&gt;::
+    #   Array of paths to load classes from - may contain glob pattern
+    def load_classes(*paths)
+      orphaned_classes = []
+      paths.flatten.each do |path|
+        Dir[path].each do |file|
           begin
             load_file file
           rescue NameError =&gt; ne
@@ -317,19 +367,62 @@ class Merb::BootLoader::LoadClasses &lt; Merb::BootLoader
           end
         end
       end
-      Merb::Controller.send :include, Merb::GlobalHelpers
-
       load_classes_with_requirements(orphaned_classes)
     end
 
     # ==== Parameters
-    # file&lt;String&gt;:: The file to load.
-    def load_file(file)
-      klasses = ObjectSpace.classes.dup
-      load file
-      LOADED_CLASSES[file] = ObjectSpace.classes - klasses
-      MTIMES[file] = File.mtime(file)
+    # file&lt;String&gt;:: The file to reload.
+    def reload(file)
+      remove_file(file) { |f| load_file(f) }
+    end
+    
+    # Reload the router to regenerate all routes.
+    def reload_router!
+      if File.file?(router_file = Merb.dir_for(:router) / Merb.glob_for(:router))
+        Merb::Router.reset!
+        reload router_file
+      end
+    end
+    
+    # ==== Parameters
+    # file&lt;String&gt;:: The file to remove classes for.
+    # &amp;block:: A block to call with the file that has been removed.
+    def remove_file(file, &amp;block)
+      Merb.klass_hashes.each {|x| x.protect_keys!}
+      if klasses = LOADED_CLASSES.delete(file)
+        klasses.each { |klass| remove_constant(klass) unless klass.to_s =~ /Router/ }
+      end
+      yield file if block_given?
+      Merb.klass_hashes.each {|x| x.unprotect_keys!}
+    end
+
+    # ==== Parameters
+    # const&lt;Class&gt;:: The class to remove.
+    def remove_constant(const)
+      # This is to support superclasses (like AbstractController) that track
+      # their subclasses in a class variable. Classes that wish to use this
+      # functionality are required to alias it to _subclasses_list. Plugins
+      # for ORMs and other libraries should keep this in mind.
+      superklass = const
+      until (superklass = superklass.superclass).nil?
+        if superklass.respond_to?(:_subclasses_list)
+          superklass.send(:_subclasses_list).delete(klass)
+          superklass.send(:_subclasses_list).delete(klass.to_s)
+        end
+      end
+
+      parts = const.to_s.split(&quot;::&quot;)
+      base = parts.size == 1 ? Object : Object.full_const_get(parts[0..-2].join(&quot;::&quot;))
+      object = parts[-1].to_s
+      begin
+        base.send(:remove_const, object)
+        Merb.logger.debug(&quot;Removed constant #{object} from #{base}&quot;)
+      rescue NameError
+        Merb.logger.debug(&quot;Failed to remove constant #{object} from #{base}&quot;)
+      end
     end
+    
+    private
 
     # &quot;Better loading&quot; of classes.  If a class fails to load due to a NameError
     # it will be added to the failed_classs stack.
@@ -373,43 +466,6 @@ class Merb::BootLoader::LoadClasses &lt; Merb::BootLoader
       end
     end
 
-    # ==== Parameters
-    # file&lt;String&gt;:: The file to reload.
-    def reload(file)
-      Merb.klass_hashes.each {|x| x.protect_keys!}
-      if klasses = LOADED_CLASSES.delete(file)
-        klasses.each { |klass| remove_constant(klass) unless klass.to_s =~ /Router/ }
-      end
-      load_file file
-      Merb.klass_hashes.each {|x| x.unprotect_keys!}
-    end
-
-    # ==== Parameters
-    # const&lt;Class&gt;:: The class to remove.
-    def remove_constant(const)
-      # This is to support superclasses (like AbstractController) that track
-      # their subclasses in a class variable. Classes that wish to use this
-      # functionality are required to alias it to _subclasses_list. Plugins
-      # for ORMs and other libraries should keep this in mind.
-      superklass = const
-      until (superklass = superklass.superclass).nil?
-        if superklass.respond_to?(:_subclasses_list)
-          superklass.send(:_subclasses_list).delete(klass)
-          superklass.send(:_subclasses_list).delete(klass.to_s)
-        end
-      end
-
-      parts = const.to_s.split(&quot;::&quot;)
-      base = parts.size == 1 ? Object : Object.full_const_get(parts[0..-2].join(&quot;::&quot;))
-      object = parts[-1].to_s
-      begin
-        base.send(:remove_const, object)
-        Merb.logger.debug(&quot;Removed constant #{object} from #{base}&quot;)
-      rescue NameError
-        Merb.logger.debug(&quot;Failed to remove constant #{object} from #{base}&quot;)
-      end
-    end
-
   end
 
 end
@@ -427,15 +483,18 @@ class Merb::BootLoader::Templates &lt; Merb::BootLoader
     # ==== Returns
     # Array[String]:: Template files found.
     def template_paths
-      extension_glob = &quot;{#{Merb::Template::EXTENSIONS.keys.join(',')}}&quot;
+      extension_glob = &quot;{#{Merb::Template.template_extensions.join(',')}}&quot;
 
       # This gets all templates set in the controllers template roots
       # We separate the two maps because most of controllers will have
       # the same _template_root, so it's silly to be globbing the same
       # path over and over.
-      template_paths = Merb::AbstractController._abstract_subclasses.map do |klass|
-        Object.full_const_get(klass)._template_root
-      end.uniq.compact.map {|path| Dir[&quot;#{path}/**/*.#{extension_glob}&quot;] }
+      controller_view_paths = []
+      Merb::AbstractController._abstract_subclasses.each do |klass|
+        next if (const = Object.full_const_get(klass))._template_root.blank?
+        controller_view_paths += const._template_roots.map { |pair| pair.first }
+      end
+      template_paths = controller_view_paths.uniq.compact.map { |path| Dir[&quot;#{path}/**/*.#{extension_glob}&quot;] }
 
       # This gets the templates that might be created outside controllers
       # template roots.  eg app/views/shared/*
@@ -453,7 +512,7 @@ end
 # :yaml:: to_yaml, application/x-yaml or text/yaml
 # :text:: to_text, text/plain
 # :html:: to_html, text/html or application/xhtml+xml or application/html
-# :xml:: to_xml, application/xml or text/xml or application/x-xml, adds &quot;Encoding: UTF-8&quot; response header
+# :xml:: to_xml, application/xml or text/xml or application/x-xml
 # :js:: to_json, text/javascript ot application/javascript or application/x-javascript
 # :json:: to_json, application/json or text/x-json
 class Merb::BootLoader::MimeTypes &lt; Merb::BootLoader
@@ -461,12 +520,12 @@ class Merb::BootLoader::MimeTypes &lt; Merb::BootLoader
   # Registers the default MIME types.
   def self.run
     Merb.add_mime_type(:all,  nil,      %w[*/*])
-    Merb.add_mime_type(:yaml, :to_yaml, %w[application/x-yaml text/yaml])
-    Merb.add_mime_type(:text, :to_text, %w[text/plain])
-    Merb.add_mime_type(:html, :to_html, %w[text/html application/xhtml+xml application/html])
-    Merb.add_mime_type(:xml,  :to_xml,  %w[application/xml text/xml application/x-xml], :Encoding =&gt; &quot;UTF-8&quot;)
-    Merb.add_mime_type(:js,   :to_json, %w[text/javascript application/javascript application/x-javascript])
-    Merb.add_mime_type(:json, :to_json, %w[application/json text/x-json])
+    Merb.add_mime_type(:yaml, :to_yaml, %w[application/x-yaml text/yaml], :charset =&gt; &quot;utf-8&quot;)
+    Merb.add_mime_type(:text, :to_text, %w[text/plain], :charset =&gt; &quot;utf-8&quot;)
+    Merb.add_mime_type(:html, :to_html, %w[text/html application/xhtml+xml application/html], :charset =&gt; &quot;utf-8&quot;)
+    Merb.add_mime_type(:xml,  :to_xml,  %w[application/xml text/xml application/x-xml], :charset =&gt; &quot;utf-8&quot;)
+    Merb.add_mime_type(:js,   :to_json, %w[text/javascript application/javascript application/x-javascript], :charset =&gt; &quot;utf-8&quot;)
+    Merb.add_mime_type(:json, :to_json, %w[application/json text/x-json], :charset =&gt; &quot;utf-8&quot;)
   end
 end
 
@@ -502,10 +561,8 @@ class Merb::BootLoader::MixinSessionContainer &lt; Merb::BootLoader
       if [&quot;&quot;, &quot;false&quot;, &quot;none&quot;].include?(session_store)
         Merb.logger.warn &quot;Not Using Sessions&quot;
       elsif reg = Merb.registered_session_types[session_store]
-        if session_store == &quot;cookie&quot;
-          Merb::BootLoader::MixinSessionContainer.check_for_secret_key
-          Merb::BootLoader::MixinSessionContainer.check_for_session_id_key
-        end
+        Merb::BootLoader::MixinSessionContainer.check_for_secret_key if session_store == &quot;cookie&quot;
+        Merb::BootLoader::MixinSessionContainer.check_for_session_id_key
         require reg[:file]
         include ::Merb::SessionMixin
         Merb.logger.warn reg[:description]
@@ -556,6 +613,7 @@ class Merb::BootLoader::RackUpApplication &lt; Merb::BootLoader
   # the context of a Rack::Builder.new { } block. Allows for mounting
   # additional apps or middleware.
   def self.run
+    require 'rack'
     if File.exists?(Merb.dir_for(:config) / &quot;rack.rb&quot;)
       Merb::Config[:rackup] ||= Merb.dir_for(:config) / &quot;rack.rb&quot;
     end
@@ -564,25 +622,40 @@ class Merb::BootLoader::RackUpApplication &lt; Merb::BootLoader
       rackup_code = File.read(Merb::Config[:rackup])
       Merb::Config[:app] = eval(&quot;::Rack::Builder.new {( #{rackup_code}\n )}.to_app&quot;, TOPLEVEL_BINDING, Merb::Config[:rackup])
     else
-      Merb::Config[:app] = ::Merb::Rack::Application.new
+      Merb::Config[:app] = ::Rack::Builder.new {
+         if prefix = ::Merb::Config[:path_prefix]
+           use Merb::Rack::PathPrefix, prefix
+         end
+         use Merb::Rack::Static, Merb.dir_for(:public)
+         run Merb::Rack::Application.new
+       }.to_app
     end
   end
 end
 
 class Merb::BootLoader::ReloadClasses &lt; Merb::BootLoader
 
+  class TimedExecutor
+    def self.every(seconds, &amp;block)
+      Thread.abort_on_exception = true
+      Thread.new do
+        loop do
+          sleep( seconds )
+          block.call
+        end
+        Thread.exit
+      end
+    end
+  end
+
   # Setup the class reloader if it's been specified in config.
   def self.run
     return unless Merb::Config[:reload_classes]
 
-    Thread.abort_on_exception = true
-    Thread.new do
-      loop do
-        sleep( Merb::Config[:reload_time] || 0.5 )
-        reload
-      end
-      Thread.exit
+    TimedExecutor.every(Merb::Config[:reload_time] || 0.5) do
+      reload
     end
+    
   end
 
   # Reloads all files.</diff>
      <filename>lib/merb-core/bootloader.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,8 @@ module Merb
           :log_delimiter          =&gt; &quot; ~ &quot;,
           :log_auto_flush         =&gt; false,
           :disabled_components    =&gt; [],
-          :deferred_actions       =&gt; []
+          :deferred_actions       =&gt; [],
+          :verbose                =&gt; false
         }
       end
 
@@ -226,6 +227,10 @@ module Merb
             end
           end
 
+          opts.on(&quot;-V&quot;, &quot;--verbose&quot;, &quot;Print extra information&quot;) do
+            options[:verbose] = true
+          end
+
           opts.on(&quot;-?&quot;, &quot;-H&quot;, &quot;--help&quot;, &quot;Show this help message&quot;) do
             puts opts
             exit
@@ -237,7 +242,7 @@ module Merb
         Merb::Config.setup(options)
       end
 
-      attr_accessor :configuration #:nodoc:
+      attr_accessor :configuration
 
       # Set configuration parameters from a code block, where each method
       # evaluates to a config parameter.
@@ -261,7 +266,7 @@ module Merb
       # ==== Parameters
       # method&lt;~to_s&gt;:: Method name as hash key value.
       # *args:: Value to set the configuration parameter to.
-      def method_missing(method, *args) #:nodoc:
+      def method_missing(method, *args)
         if method.to_s[-1,1] == '='
           @configuration[method.to_s.tr('=','').to_sym] = *args
         else
@@ -271,14 +276,14 @@ module Merb
 
     end # class &lt;&lt; self
 
-    class ConfigBlock #:nodoc:
+    class ConfigBlock
 
-      def initialize(klass, &amp;block) #:nodoc:
+      def initialize(klass, &amp;block)
         @klass = klass
         instance_eval(&amp;block)
       end
 
-      def method_missing(method, *args) #:nodoc:
+      def method_missing(method, *args)
         @klass[method] = *args
       end
 </diff>
      <filename>lib/merb-core/config.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,15 @@
-# Note that the over-use of &quot;_&quot; in Controller methods is to avoid collisions
-# with helpers, which will be pulled directly into controllers from now on.
+# ==== Why do we use Underscores?
+# In Merb, views are actually methods on controllers. This provides
+# not-insignificant speed benefits, as well as preventing us from
+# needing to copy over instance variables, which we think is proof
+# that everything belongs in one class to begin with.
+#
+# Unfortunately, this means that view helpers need to be included
+# into the &lt;strong&gt;Controller&lt;/strong&gt; class. To avoid causing confusion
+# when your helpers potentially conflict with our instance methods,
+# we use an _ to disambiguate. As long as you don't begin your helper
+# methods with _, you only need to worry about conflicts with Merb
+# methods that are part of the public API.
 #
 # ==== Filters
 # #before is a class method that allows you to specify before filters in
@@ -71,7 +81,10 @@ class Merb::AbstractController
   include Merb::RenderMixin
   include Merb::InlineTemplates
   
-  class_inheritable_accessor :_before_filters, :_after_filters, :_layout, :_template_root
+  class_inheritable_accessor :_layout, :_template_root
+  class_inheritable_array :_before_filters, :_after_filters
+  
+  FILTER_OPTIONS = [:only, :exclude, :if, :unless, :with]
 
   # ==== Returns
   # String:: The controller name in path form, e.g. &quot;admin/items&quot;.
@@ -119,6 +132,18 @@ class Merb::AbstractController
     controller ? &quot;#{controller}/#{context}&quot; : context
   end
 
+  # The location to look for a template - stub method for particular behaviour.
+  #
+  # ==== Parameters
+  # template&lt;String&gt;:: The absolute path to a template - without template extension.
+  # type&lt;~to_s&gt;::
+  #    The mime-type of the template that will be rendered. Defaults to nil.
+  #
+  # @public
+  def _absolute_template_location(template, type)
+    template
+  end
+
   # ==== Returns
   # roots&lt;Array[Array]&gt;::
   #   Template roots as pairs of template root path and template location
@@ -152,10 +177,11 @@ class Merb::AbstractController
     # klass&lt;Merb::AbstractController&gt;::
     #   The controller that is being inherited from Merb::AbstractController
     def inherited(klass)
-      _abstract_subclasses &lt;&lt; klass.to_s  
-      Object.make_module &quot;Merb::#{klass}Helper&quot; unless klass.to_s =~ /^Merb::/
+      _abstract_subclasses &lt;&lt; klass.to_s
+      helper_module_name = klass.to_s =~ /^(#|Merb::)/ ? &quot;#{klass}Helper&quot; : &quot;Merb::#{klass}Helper&quot;
+      Object.make_module helper_module_name
       klass.class_eval &lt;&lt;-HERE
-        include Object.full_const_get(&quot;Merb::#{klass}Helper&quot;) rescue nil
+        include Object.full_const_get(&quot;#{helper_module_name}&quot;) rescue nil
       HERE
       super
     end
@@ -435,8 +461,8 @@ class Merb::AbstractController
   #
   # ==== Raises
   # ArgumentError::
-  #   Both :only and :exclude, or :if and :unless given, or filter is not a
-  #   Symbol, String or Proc.
+  #   Both :only and :exclude, or :if and :unless given, if filter is not a
+  #   Symbol, String or Proc, or if an unknown option is passed.
   def self.add_filter(filters, filter, opts={})
     raise(ArgumentError,
       &quot;You can specify either :only or :exclude but 
@@ -445,6 +471,10 @@ class Merb::AbstractController
      raise(ArgumentError,
        &quot;You can specify either :if or :unless but 
         not both at the same time for the same filter.&quot;) if opts.key?(:if) &amp;&amp; opts.key?(:unless)
+        
+    opts.each_key do |key| raise(ArgumentError,
+      &quot;You can only specify known filter options, #{key} is invalid.&quot;) unless FILTER_OPTIONS.include?(key)
+    end
 
     opts = normalize_filters!(opts)
 </diff>
      <filename>lib/merb-core/controller/abstract_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -90,7 +90,7 @@ module Merb
   #   &lt;p&gt;You tried to access &lt;%= @tried_to_access %&gt; but that URL is 
   #   restricted to administrators.&lt;/p&gt;
   #
-  module ControllerExceptions #:nodoc: all
+  module ControllerExceptions
     
     # Mapping of status code names to their numeric value.
     STATUS_CODES = {}
@@ -294,7 +294,7 @@ module Merb
   # Required to show exceptions in the log file
   #
   # e&lt;Exception&gt;:: The exception that a message is being generated for
-  def self.exception(e) #:nodoc:
+  def self.exception(e)
     &quot;#{ e.message } - (#{ e.class })\n&quot; &lt;&lt;  
     &quot;#{(e.backtrace or []).join(&quot;\n&quot;)}&quot; 
   end</diff>
      <filename>lib/merb-core/controller/exceptions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 class Merb::Controller &lt; Merb::AbstractController
 
   class_inheritable_accessor :_hidden_actions, :_shown_actions
-  cattr_accessor :_subclasses, :_session_id_key, :_session_secret_key, :_session_expiry
+  cattr_accessor :_subclasses, :_session_id_key, :_session_secret_key, :_session_expiry, :_session_cookie_domain
   self._subclasses = Set.new
 
   def self.subclasses_list() _subclasses end
@@ -9,6 +9,7 @@ class Merb::Controller &lt; Merb::AbstractController
   self._session_secret_key = nil
   self._session_id_key = Merb::Config[:session_id_key] || '_session_id'
   self._session_expiry = Merb::Config[:session_expiry] || Merb::Const::WEEK * 2
+  self._session_cookie_domain = Merb::Config[:session_cookie_domain]
 
   include Merb::ResponderMixin
   include Merb::ControllerMixin
@@ -23,8 +24,8 @@ class Merb::Controller &lt; Merb::AbstractController
     #   The Merb::Controller inheriting from the base class.
     def inherited(klass)
       _subclasses &lt;&lt; klass.to_s
-      self._template_root = Merb.dir_for(:view) unless self._template_root
       super
+      klass._template_root = Merb.dir_for(:view) unless self._template_root
     end
 
     # Hide each of the given methods from being callable as actions.
@@ -101,16 +102,7 @@ class Merb::Controller &lt; Merb::AbstractController
     # ==== Returns
     # SimpleSet[String]:: A set of actions that should be callable.
     def callable_actions
-      unless @callable_actions
-        callables = []
-        klass = self
-        begin
-          callables &lt;&lt; (klass.public_instance_methods(false) + klass._shown_actions) - klass._hidden_actions
-          klass = klass.superclass
-        end until klass == Merb::AbstractController || klass == Object
-        @callable_actions = Merb::SimpleSet.new(callables.flatten)
-      end
-      @callable_actions
+      @callable_actions ||= Merb::SimpleSet.new(_callable_methods)
     end
 
     # This is a stub method so plugins can implement param filtering if they want.
@@ -126,6 +118,22 @@ class Merb::Controller &lt; Merb::AbstractController
       params
     end
 
+    private
+    
+    # All methods that are callable as actions.
+    #
+    # ==== Returns
+    # Array:: A list of method names that are also actions
+    def _callable_methods
+      callables = []
+      klass = self
+      begin
+        callables &lt;&lt; (klass.public_instance_methods(false) + klass._shown_actions) - klass._hidden_actions
+        klass = klass.superclass
+      end until klass == Merb::AbstractController || klass == Object
+      callables.flatten.reject{|action| action =~ /^_.*/}
+    end
+
   end # class &lt;&lt; self
 
   # The location to look for a template for a particular controller, context,
@@ -149,6 +157,23 @@ class Merb::Controller &lt; Merb::AbstractController
   def _template_location(context, type = nil, controller = controller_name)
     controller ? &quot;#{controller}/#{context}.#{type}&quot; : &quot;#{context}.#{type}&quot;
   end
+  
+  # The location to look for a template and mime-type. This is overridden 
+  # from AbstractController, which defines a version of this that does not 
+  # involve mime-types.
+  #
+  # ==== Parameters
+  # template&lt;String&gt;:: 
+  #    The absolute path to a template - without mime and template extension.
+  #    The mime-type extension is optional - it will be appended from the 
+  #    current content type if it hasn't been added already.
+  # type&lt;~to_s&gt;::
+  #    The mime-type of the template that will be rendered. Defaults to nil.
+  #
+  # @public
+  def _absolute_template_location(template, type)
+    template.match(/\.#{type.to_s.escape_regexp}$/) ? template : &quot;#{template}.#{type}&quot;
+  end
 
   # Build a new controller.
   #
@@ -227,7 +252,10 @@ class Merb::Controller &lt; Merb::AbstractController
   # ==== Returns
   # Hash:: The session that was extracted from the request object.
   def session() request.session end
-
+  
+  # Hide any methods that may have been exposed as actions before.
+  hide_action(*_callable_methods)
+  
   private
 
   # Create a default cookie jar, and pre-set a fixation cookie</diff>
      <filename>lib/merb-core/controller/merb_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -28,17 +28,23 @@ module Merb
     #   The associated method to call on objects to convert them to the
     #   appropriate mime-type. For instance, :json would use :to_json as its
     #   transform_method.
-    # values&lt;Array[String]&gt;::
+    # mimes&lt;Array[String]&gt;::
     #   A list of possible values sent in the Accept header, such as text/html,
     #   that should be associated with this content-type.
     # new_response_headers&lt;Hash&gt;::
-    #   The response headers to set for the the mime type.
-    def add_mime_type(key, transform_method, values, new_response_headers = {}) 
-      enforce!(key =&gt; Symbol, values =&gt; Array)
+    #   The response headers to set for the the mime type. For example: 
+    #   'Content-Type' =&gt; 'application/json; charset=utf-8'; As a shortcut for
+    #   the common charset option, use :charset =&gt; 'utf-8', which will be
+    #   correctly appended to the mimetype itself.
+    # &amp;block:: a block which recieves the current controller when the format
+    #   is set (in the controller's #content_type method)
+    def add_mime_type(key, transform_method, mimes, new_response_headers = {}, &amp;block) 
+      enforce!(key =&gt; Symbol, mimes =&gt; Array)
       ResponderMixin::TYPES.update(key =&gt; 
-        {:request_headers   =&gt; values, 
+        {:accepts           =&gt; mimes, 
          :transform_method  =&gt; transform_method,
-         :response_headers  =&gt; new_response_headers })
+         :response_headers  =&gt; new_response_headers,
+         :response_block    =&gt; block })
 
       Merb::RenderMixin.class_eval &lt;&lt;-EOS, __FILE__, __LINE__
         def render_#{key}(thing = nil, opts = {})
@@ -81,7 +87,7 @@ module Merb
     # ==== Returns
     # Hash:: The mime type information.
     def mime_by_request_header(header)
-      available_mime_types.find {|key,info| info[request_headers].include?(header)}.first
+      available_mime_types.find {|key,info| info[:accepts].include?(header)}.first
     end
     
   end</diff>
      <filename>lib/merb-core/controller/mime.rb</filename>
    </modified>
    <modified>
      <diff>@@ -51,7 +51,7 @@ module Merb::AuthenticationMixin
     BasicAuthentication.new(self, realm, &amp;authenticator)
   end
   
-  class BasicAuthentication #:nodoc:
+  class BasicAuthentication
     # So we can have access to the status codes
     include Merb::ControllerExceptions
 </diff>
      <filename>lib/merb-core/controller/mixins/authentication.rb</filename>
    </modified>
    <modified>
      <diff>@@ -92,6 +92,8 @@ module Merb
     # ==== Parameters
     # url&lt;String&gt;::
     #   URL to redirect to. It can be either a relative or fully-qualified URL.
+    # permanent&lt;Boolean&gt;::
+    #   When true, return status 301 Moved Permanently
     #
     # ==== Returns
     # String:: Explanation of redirect.
@@ -99,9 +101,10 @@ module Merb
     # ==== Examples
     #   redirect(&quot;/posts/34&quot;)
     #   redirect(&quot;http://www.merbivore.com/&quot;)
-    def redirect(url)
-      Merb.logger.info(&quot;Redirecting to: #{url}&quot;)
-      self.status = 302
+    #   redirect(&quot;http://www.merbivore.com/&quot;, true)
+    def redirect(url, permanent = false)
+      self.status = permanent ? 301 : 302
+      Merb.logger.info(&quot;Redirecting to: #{url} (#{self.status})&quot;)
       headers['Location'] = url
       &quot;&lt;html&gt;&lt;body&gt;You are being &lt;a href=\&quot;#{url}\&quot;&gt;redirected&lt;/a&gt;.&lt;/body&gt;&lt;/html&gt;&quot;
     end</diff>
      <filename>lib/merb-core/controller/mixins/controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 module Merb::RenderMixin
   # So we can do raise TemplateNotFound
   include Merb::ControllerExceptions
-  
+
   # ==== Parameters
   # base&lt;Module&gt;:: Module that is including RenderMixin (probably a controller)
   def self.included(base)
@@ -10,9 +10,9 @@ module Merb::RenderMixin
       class_inheritable_accessor :_default_render_options
     end
   end
-  
+
   module ClassMethods
-    
+
     # Return the default render options.
     #
     # ==== Returns
@@ -20,7 +20,7 @@ module Merb::RenderMixin
     def default_render_options
       self._default_render_options ||= {}
     end
-    
+
     # Set default render options at the class level.
     #
     # ==== Parameters
@@ -28,53 +28,57 @@ module Merb::RenderMixin
     def render_options(opts)
       self._default_render_options = opts
     end
-    
+
     # Set the default layout to use or nil/false to disable layout rendering.
-    # This is a shortcut for render_options :layout =&gt; false. 
+    # This is a shortcut for render_options :layout =&gt; false.
     #
     # ==== Parameters
-    # layout&lt;~to_s&gt;:: The layout that should be used for this class
-    # 
+    # layout&lt;~to_s&gt;:: The layout that should be used for this class.
+    #
+    # ==== Notes
+    # You can override by passing :layout =&gt; true to render method.
+    #
     # ==== Returns
     # Hash:: The default render options.
     def layout(layout)
       self.default_render_options.update(:layout =&gt; (layout ? layout : false))
     end
-    
+
     # Enable the default layout logic - reset the layout option.
     def default_layout
       self.default_render_options.delete(:layout)
     end
-    
+
   end
-  
+
   # Render the specified item, with the specified options.
   #
   # ==== Parameters
-  # thing&lt;String, Symbol, nil&gt;:: 
+  # thing&lt;String, Symbol, nil&gt;::
   #   The thing to render. This will default to the current action
   # opts&lt;Hash&gt;:: An options hash (see below)
   #
   # ==== Options (opts)
   # :format&lt;Symbol&gt;:: A registered mime-type format
-  # :template&lt;String&gt;:: 
+  # :template&lt;String&gt;::
   #   The path to the template relative to the template root
-  # :status&lt;~to_i&gt;:: 
+  # :status&lt;~to_i&gt;::
   #   The status to send to the client. Typically, this would be an integer
   #   (200), or a Merb status code (Accepted)
-  # :layout&lt;~to_s&gt;::
+  # :layout&lt;~to_s, FalseClass&gt;::
   #   A layout to use instead of the default. This should be relative to the
   #   layout root. By default, the layout will be either the controller_name or
   #   application. If you want to use an alternative content-type than the one
   #   that the base template was rendered as, you will need to do :layout =&gt;
-  #   &quot;foo.#{content_type}&quot; (i.e. &quot;foo.json&quot;)
+  #   &quot;foo.#{content_type}&quot; (i.e. &quot;foo.json&quot;). If you want to render without
+  #   layout, use :layout =&gt; false. This overrides layout set by +layout+ method.
   #
   # ==== Returns
   # String:: The rendered template, including layout, if appropriate.
   #
   # ==== Raises
   # TemplateNotFound:: There is no template for the specified location.
-  # 
+  #
   # ==== Alternatives
   # If you pass a Hash as the first parameter, it will be moved to opts and
   # &quot;thing&quot; will be the current action
@@ -83,59 +87,65 @@ module Merb::RenderMixin
   def render(thing = nil, opts = {})
     # render :format =&gt; :xml means render nil, :format =&gt; :xml
     opts, thing = thing, nil if thing.is_a?(Hash)
-    
+
     # Merge with class level default render options
     opts = self.class.default_render_options.merge(opts)
-    
+
     # If you don't specify a thing to render, assume they want to render the current action
     thing ||= action_name.to_sym
 
     # Content negotiation
-    opts[:format] ? (self.content_type = opts[:format]) : content_type 
-    
+    opts[:format] ? (self.content_type = opts[:format]) : content_type
+
     # Handle options (:status)
-    _handle_options!(opts)    
-    
+    _handle_options!(opts)
+
     # Do we have a template to try to render?
     if thing.is_a?(Symbol) || opts[:template]
 
-      template_method, template_location = _template_for(thing, content_type, controller_name, opts)
-  
+      template_method, template_location = 
+        _template_for(thing, content_type, controller_name, opts[:template])
+      
       # Raise an error if there's no template
-      raise TemplateNotFound, &quot;No template found at #{template_location}.*&quot;  \
-        unless template_method &amp;&amp; self.respond_to?(template_method)
+      unless template_method &amp;&amp; self.respond_to?(template_method)
+        template_files = Merb::Template.template_extensions.map { |ext| &quot;#{template_location}.#{ext}&quot; }
+        raise TemplateNotFound, &quot;Oops! No template found. Merb was looking for #{template_files.join(', ')}&quot; + 
+          &quot;for content type '#{content_type}'. You might have mispelled the template or file name. &quot; + 
+          &quot;Registered template extensions: #{Merb::Template.template_extensions.join(', ')}. &quot; +
+          &quot;If you use Haml or some other template plugin, make sure you required Merb plugin dependency &quot; + 
+          &quot;in your init file.&quot;
+      end
 
       # Call the method in question and throw the content for later consumption by the layout
       throw_content(:for_layout, self.send(template_method))
-      
+
     # Do we have a string to render?
     elsif thing.is_a?(String)
-      
+
       # Throw it for later consumption by the layout
       throw_content(:for_layout, thing)
     end
-    
+
     # If we find a layout, use it. Otherwise, just render the content thrown for layout.
-    layout = opts[:layout] != false &amp;&amp; _get_layout(opts[:layout])
-    layout ? send(layout) : catch_content(:for_layout)
+    (layout = _get_layout(opts[:layout])) ? send(layout) : catch_content(:for_layout)
   end
-    
+
   # Renders an object using to registered transform method based on the
   # negotiated content-type, if a template does not exist. For instance, if the
   # content-type is :json, Merb will first look for current_action.json.*.
   # Failing that, it will run object.to_json.
   #
   # ==== Parameter
-  # object&lt;Object&gt;:: 
+  # object&lt;Object&gt;::
   #   An object that responds_to? the transform method registered for the
   #   negotiated mime-type.
   # thing&lt;String, Symbol&gt;::
   #   The thing to attempt to render via #render before calling the transform
   #   method on the object. Defaults to nil.
-  # opts&lt;Hash&gt;:: 
+  # opts&lt;Hash&gt;::
   #   An options hash that will be used for rendering
   #   (passed on to #render or serialization methods like #to_json or #to_xml)
-  # 
+  #
   # ==== Returns
   # String::
   #   The rendered template or if no template is found, the transformed object.
@@ -144,10 +154,10 @@ module Merb::RenderMixin
   # NotAcceptable::
   #   If there is no transform method for the specified mime-type or the object
   #   does not respond to the transform method.
-  # 
+  #
   # ==== Alternatives
   # A string in the second parameter will be interpreted as a template:
-  #   display @object, &quot;path/to/foo&quot; 
+  #   display @object, &quot;path/to/foo&quot;
   #   #=&gt; display @object, nil, :template =&gt; &quot;path/to/foo&quot;
   #
   # A hash in the second parameters will be interpreted as opts:
@@ -157,18 +167,18 @@ module Merb::RenderMixin
   # If you need to pass extra parameters to serialization method, for instance,
   # to exclude some of attributes or serialize associations, just pass options
   # for it.
-  # For instance, 
+  # For instance,
+  #
+  # display @locations, :except =&gt; [:locatable_type, :locatable_id], :include =&gt; [:locatable]
   #
-  # display	@locations, :except =&gt; [:locatable_type, :locatable_id], :include =&gt; [:locatable]
+  # serializes object with polymorphic association, not raw locatable_* attributes.
   #
-  # serializes object with polymorphic association,	not raw	locatable_* attributes.
   #
-  #  
   # ==== Options
   #
   # :template                a template to use for rendering
   # :layout                  a layout to use for rendering
-  
+  #
   # all other options        options that will be pass to serialization method
   #                          like #to_json or #to_xml
   #
@@ -177,62 +187,47 @@ module Merb::RenderMixin
   # explicitly passed in the opts.
   #
   def display(object, thing = nil, opts = {})
-    # display @object, &quot;path/to/foo&quot; means display @object, nil, :template =&gt; &quot;path/to/foo&quot;
-    # display @object, :template =&gt; &quot;path/to/foo&quot; means display @object, nil, :template =&gt; &quot;path/to/foo&quot;
     template_opt = opts.delete(:template)
-    
+
     case thing
+    # display @object, &quot;path/to/foo&quot; means display @object, nil, :template =&gt; &quot;path/to/foo&quot;
     when String
       template_opt, thing = thing, nil
+    # display @object, :template =&gt; &quot;path/to/foo&quot; means display @object, nil, :template =&gt; &quot;path/to/foo&quot;
     when Hash
       opts, thing = thing, nil
     end
-    
+
     # Try to render without the object
     render(thing || action_name.to_sym, opts.merge(:template =&gt; template_opt))
-  
+
   # If the render fails (i.e. a template was not found)
-  rescue TemplateNotFound
+  rescue TemplateNotFound =&gt; e
     # Merge with class level default render options
+    # @todo can we find a way to refactor this out so we don't have to do it everywhere?
     opts = self.class.default_render_options.merge(opts)
-    
+
     # Figure out what to transform and raise NotAcceptable unless there's a transform method assigned
     transform = Merb.mime_transform_method(content_type)
-    raise NotAcceptable unless transform &amp;&amp; object.respond_to?(transform)
+    if !transform
+      raise NotAcceptable, &quot;#{e.message} and there was no transform method registered for #{content_type.inspect}&quot;
+    elsif !object.respond_to?(transform)
+      raise NotAcceptable, &quot;#{e.message} and your object does not respond to ##{transform}&quot;
+    end
 
-    # Only use a layout if one was specified
     layout_opt = opts.delete(:layout)
-    
-    if layout_opt
-      # Look for the layout under the default layout directly. If it's not found, reraise
-      # the TemplateNotFound error
-      template = _template_location(layout_opt, layout.index(&quot;.&quot;) ? content_type : nil, &quot;layout&quot;)      
-      layout = _template_for(_template_root / template) ||
-        (raise TemplateNotFound, &quot;No layout found at #{_template_root / template}.*&quot;)      
-              
-      # If the layout was found, call it
-      send(layout)
-    
-    # Otherwise, just render the transformed object
-    else
-      unless opts.empty?
-        # there are options for serialization method
-        throw_content(:for_layout, object.send(transform, opts))
-      else
-        throw_content(:for_layout, object.send(transform))
-      end  
-      catch_content(:for_layout)
-    end
+    throw_content(:for_layout, opts.empty? ? object.send(transform) : object.send(transform, opts))
+    layout_opt ? send(_get_layout(layout_opt)) : catch_content(:for_layout)
   end
 
   # Render a partial template.
   #
   # ==== Parameters
   # template&lt;~to_s&gt;::
-  #   The path to the template, relative to the current controller or the 
-  #   template root. If the template contains a &quot;/&quot;, Merb will search for it
-  #   relative to the template root; otherwise, Merb will search for it
-  #   relative to the current controller.
+  #   The path to the template, relative to the current controller or the
+  #   template root; absolute path will work too. If the template contains a &quot;/&quot;, 
+  #   Merb will search for it relative to the template root; otherwise, 
+  #   Merb will search for it relative to the current controller.
   # opts&lt;Hash&gt;:: A hash of options (see below)
   #
   # ==== Options (opts)
@@ -254,46 +249,50 @@ module Merb::RenderMixin
     # partial :foo becomes &quot;#{controller_name}/_foo&quot;
     # partial &quot;foo/bar&quot; becomes &quot;foo/_bar&quot;
     template = template.to_s
-    kontroller = (m = template.match(/.*(?=\/)/)) ? m[0] : controller_name
-    template = &quot;_#{File.basename(template)}&quot;
-    
-    template_method, template_location = _template_for(template, opts.delete(:format) || content_type, kontroller)
+    if template =~ %r{^/}
+      template_path = File.dirname(template) / &quot;_#{File.basename(template)}&quot;
+    else
+      kontroller = (m = template.match(/.*(?=\/)/)) ? m[0] : controller_name
+      template = &quot;_#{File.basename(template)}&quot;
+    end
+    template_method, template_location = 
+      _template_for(template, opts.delete(:format) || content_type, kontroller, template_path)
 
     (@_old_partial_locals ||= []).push @_merb_partial_locals
-
-    if opts.key?(:with)
-      with = opts.delete(:with)
-      as = opts.delete(:as) || template_location.match(%r[.*/_([^\.]*)])[1]
-      @_merb_partial_locals = opts
-      sent_template = [with].flatten.map do |temp|
-        @_merb_partial_locals[as.to_sym] = temp
-        send(template_method)
-      end.join
-    else
-      @_merb_partial_locals = opts
+    
+    # This handles no :with as well
+    with = [opts.delete(:with)].flatten
+    as = opts.delete(:as) || template_location.match(%r[.*/_([^\.]*)])[1]
+    
+    @_merb_partial_locals = opts
+    
+    sent_template = with.map do |temp|
+      @_merb_partial_locals[as.to_sym] = temp
       if template_method &amp;&amp; self.respond_to?(template_method)
-        sent_template = send(template_method)
+        send(template_method)
       else
         raise TemplateNotFound, &quot;Could not find template at #{template_location}.*&quot;
       end
-    end
+    end.join
+    
     @_merb_partial_locals = @_old_partial_locals.pop
     sent_template
-  end      
-  
+  end
+
   # Take the options hash and handle it as appropriate.
-  # 
+  #
   # ==== Parameters
   # opts&lt;Hash&gt;:: The options hash that was passed into render.
-  # 
+  #
   # ==== Options
   # :status&lt;~to_i&gt;::
   #   The status of the response will be set to opts[:status].to_i
-  # 
+  #
   # ==== Returns
   # Hash:: The options hash that was passed in.
   def _handle_options!(opts)
     self.status = opts[:status].to_i if opts[:status]
+    headers[&quot;Location&quot;] = opts.delete(:location) if opts[:location]
     opts
   end
 
@@ -305,22 +304,26 @@ module Merb::RenderMixin
   #
   # ==== Parameters
   # layout&lt;~to_s&gt;:: A layout, relative to the layout root. Defaults to nil.
-  # 
+  #
   # ==== Returns
   # String:: The method name that corresponds to the found layout.
-  # 
+  #
   # ==== Raises
   # TemplateNotFound::
   #   If a layout was specified (either via layout in the class or by passing
   #   one in to this method), and not found. No error will be raised if no
   #   layout was specified, and the default layouts were not found.
   def _get_layout(layout = nil)
+    return false if layout == false
+    
     layout = layout.instance_of?(Symbol) &amp;&amp; self.respond_to?(layout, true) ? send(layout) : layout
     layout = layout.to_s if layout
-    
+
     # If a layout was provided, throw an error if it's not found
-    if layout
-      template_method, template_location = _template_for(layout, layout.index(&quot;.&quot;) ? nil : content_type, &quot;layout&quot;)
+    if layout      
+      template_method, template_location = 
+        _template_for(layout, layout.index(&quot;.&quot;) ? nil : content_type, &quot;layout&quot;)
+        
       raise TemplateNotFound, &quot;No layout found at #{template_location}&quot; unless template_method
       template_method
 
@@ -331,13 +334,13 @@ module Merb::RenderMixin
       template
     end
   end
-  
-  # Iterate over the template roots in reverse order, and return the template 
+
+  # Iterate over the template roots in reverse order, and return the template
   # and template location of the first match.
   #
   # ==== Parameters
-  # context&lt;Object&gt;:: The controller action or template basename.
-  # content_type&lt;~to_s&gt;:: The content type. Defaults to nil.
+  # context&lt;Object&gt;:: The controller action or template (basename or absolute path).
+  # content_type&lt;~to_s&gt;:: The content type (like html or json).
   # controller&lt;~to_s&gt;:: The name of the controller. Defaults to nil.
   #
   # ==== Options (opts)
@@ -348,25 +351,48 @@ module Merb::RenderMixin
   # ==== Returns
   # Array[Symbol, String]::
   #   A pair consisting of the template method and location.
-  def _template_for(context, content_type, controller=nil, opts={})
-    template_method = nil
-    template_location = nil
-    
-    self.class._template_roots.reverse_each do |root, template_location| 
-      if opts[:template] # use the given template as the location context
-        template_location = root / self.send(template_location, opts[:template], content_type, nil)
-        template_method = Merb::Template.template_for(template_location)
-        break if template_method &amp;&amp; self.respond_to?(template_method)
+  def _template_for(context, content_type, controller=nil, template=nil)
+    template_method, template_location = nil, nil
+
+    # absolute path to a template (:template =&gt; &quot;/foo/bar&quot;)
+    if template.is_a?(String) &amp;&amp; template =~ %r{^/}
+      template_location = self._absolute_template_location(template, content_type)
+      return [_template_method_for(template_location), template_location]
+    end
+
+    self.class._template_roots.reverse_each do |root, template_meth|
+      # :template =&gt; &quot;foo/bar.html&quot; where root / &quot;foo/bar.html.*&quot; exists
+      if template &amp;&amp; template.is_a?(String) &amp;&amp; template.index(&quot;/&quot;)
+        template_location = root / template
+        
+      # :template =&gt; :tmpl where root / &quot;tmpl.html.*&quot; exists
+      elsif template
+        template_location = root / self.send(template_meth, template, content_type, nil)
+        
+      # :layout =&gt; &quot;foo&quot; where root / &quot;layouts&quot; / &quot;#{controller}.html.*&quot; exists        
+      else
+        template_location = root / self.send(template_meth, context, content_type, controller)
       end
       
-      template_location = root / (opts[:template] || self.send(template_location, context, content_type, controller))
-      template_method = Merb::Template.template_for(template_location)
-      break if template_method &amp;&amp; self.respond_to?(template_method)
+      break if template_method = _template_method_for(template_location)
     end
 
     [template_method, template_location]
   end
-    
+  
+  # Return the template method for a location, and check to make sure the current controller
+  # actually responds to the method.
+  #
+  # ==== Parameters
+  # template_location&lt;String&gt;:: The phyical path of the template
+  #
+  # ==== Returns
+  # String:: The method, if it exists. Otherwise return nil.
+  def _template_method_for(template_location)
+    meth = Merb::Template.template_for(template_location)
+    meth &amp;&amp; self.respond_to?(meth) ? meth : nil
+  end
+
   # Called in templates to get at content thrown in another template. The
   # results of rendering a template are automatically thrown into :for_layout,
   # so catch_content or catch_content(:for_layout) can be used inside layouts
@@ -379,7 +405,7 @@ module Merb::RenderMixin
   def catch_content(obj = :for_layout)
     @_caught_content[obj]
   end
-  
+
   # Called in templates to test for the existence of previously thrown content.
   #
   # ==== Parameters
@@ -389,7 +415,7 @@ module Merb::RenderMixin
   def thrown_content?(obj = :for_layout)
     @_caught_content.key?(obj)
   end
-  
+
   # Called in templates to store up content for later use. Takes a string
   # and/or a block. First, the string is evaluated, and then the block is
   # captured using the capture() helper provided by the template languages. The
@@ -414,5 +440,5 @@ module Merb::RenderMixin
     end
     @_caught_content[obj] = string.to_s &lt;&lt; (block_given? ? capture(&amp;block) : &quot;&quot;)
   end
-  
+
 end</diff>
      <filename>lib/merb-core/controller/mixins/render.rb</filename>
    </modified>
    <modified>
      <diff>@@ -103,7 +103,7 @@ module Merb
     
     # ==== Parameters
     # base&lt;Module&gt;:: The module that ResponderMixin was mixed into
-    def self.included(base) # :nodoc:
+    def self.included(base)
       base.extend(ClassMethods)
       base.class_eval do
         class_inheritable_accessor :class_provided_formats
@@ -285,7 +285,7 @@ module Merb
     # 3. If it's */*, use the first provided format
     # 4. Look for one that is provided, in order of request
     # 5. Raise 406 if none found
-    def _perform_content_negotiation # :nodoc:
+    def _perform_content_negotiation
       raise Merb::ControllerExceptions::NotAcceptable if _provided_formats.empty?
       if (fmt = params[:format]) &amp;&amp; !fmt.empty?
         accepts = [fmt.to_sym]
@@ -350,8 +350,26 @@ module Merb
     def content_type=(type)
       unless Merb.available_mime_types.has_key?(type)
         raise Merb::ControllerExceptions::NotAcceptable.new(&quot;Unknown content_type for response: #{type}&quot;) 
-      end        
-      headers['Content-Type'] = Merb.available_mime_types[type][:request_headers].first
+      end
+      # set the Content-Type header - defaults to first accepted mime
+      if Merb.available_mime_types[type][:response_headers]['Content-Type']
+        headers['Content-Type'] = Merb.available_mime_types[type][:response_headers]['Content-Type']
+      else
+        headers['Content-Type'] = Merb.available_mime_types[type][:accepts].first
+        # explicitly append the character set to the Content-Type header
+        if Merb.available_mime_types[type][:response_headers][:charset]
+          headers['Content-Type'] += &quot;; charset=#{Merb.available_mime_types[type][:response_headers][:charset]}&quot; 
+        end
+      end
+      # merge any format specific response headers
+      Merb.available_mime_types[type][:response_headers].each do |key, value|
+        next if key == :charset || headers.key?(key)
+        headers[key] = value
+      end
+      # if given, use a block to finetune any runtime headers
+      if Merb.available_mime_types[type][:response_block].respond_to?(:call)
+        Merb.available_mime_types[type][:response_block].call(self)
+      end
       @_content_type = type
     end
     
@@ -440,7 +458,7 @@ module Merb
     #   All Accept header values, such as &quot;text/html&quot;, that match this type.
     def synonyms
       @syns ||= Merb.available_mime_types.values.map do |e| 
-        e[:request_headers] if e[:request_headers].include?(@media_range)
+        e[:accepts] if e[:accepts].include?(@media_range)
       end.compact.flatten
     end
 
@@ -456,7 +474,7 @@ module Merb
     # Symbol: The type as a symbol, e.g. :html.
     def to_sym
       Merb.available_mime_types.select{|k,v| 
-        v[:request_headers] == synonyms || v[:request_headers][0] == synonyms[0]}.flatten.first
+        v[:accepts] == synonyms || v[:accepts][0] == synonyms[0]}.flatten.first
     end
 
     # ==== Returns</diff>
      <filename>lib/merb-core/controller/mixins/responder.rb</filename>
    </modified>
    <modified>
      <diff>@@ -44,11 +44,11 @@ module Merb::Template
       
       ret = 
       if Merb::Config[:reload_templates]
-        file = Dir[&quot;#{path}.{#{Merb::Template::EXTENSIONS.keys.join(',')}}&quot;].first
+        file = Dir[&quot;#{path}.{#{template_extensions.join(',')}}&quot;].first
         METHOD_LIST[path] = file ? inline_template(file) : nil
       else
         METHOD_LIST[path] ||= begin
-          file = Dir[&quot;#{path}.{#{Merb::Template::EXTENSIONS.keys.join(',')}}&quot;].first          
+          file = Dir[&quot;#{path}.{#{template_extensions.join(',')}}&quot;].first          
           file ? inline_template(file) : nil
         end
       end
@@ -56,6 +56,16 @@ module Merb::Template
       ret
     end
     
+    # Get all known template extensions
+    #
+    # ==== Returns
+    #   Array:: Extension strings.
+    #---
+    # @semipublic
+    def template_extensions
+      EXTENSIONS.keys
+    end
+    
     # Takes a template at a particular path and inlines it into a module and
     # adds it to the METHOD_LIST table to speed lookup later.
     # </diff>
      <filename>lib/merb-core/controller/template.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,25 @@
+# Copyright (c) 2004-2008 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.
+
+
 # Allows attributes to be shared within an inheritance hierarchy, but where
 # each descendant gets a copy of their parents' attributes, instead of just a
 # pointer to the same. This means that the child can add elements to, for
@@ -7,8 +29,13 @@
 class Class
   # Defines class-level and instance-level attribute reader.
   #
-  # ==== Parameters
-  # *syms&lt;Array&gt;:: Array of attributes to define reader for.
+  # @param *syms&lt;Array&gt; Array of attributes to define reader for.
+  # @return &lt;Array[#to_s]&gt; List of attributes that were made into cattr_readers
+  #
+  # @api public
+  #
+  # @todo Is this inconsistent in that it does not allow you to prevent
+  #   an instance_reader via :instance_reader =&gt; false
   def cattr_reader(*syms)
     syms.flatten.each do |sym|
       next if sym.is_a?(Hash)
@@ -30,15 +57,15 @@ class Class
 
   # Defines class-level (and optionally instance-level) attribute writer.
   #
-  # ==== Parameters
-  # *syms&lt;Array&gt;:: Array of attributes to define writer for.
+  # @param &lt;Array[*#to_s, Hash{:instance_writer =&gt; Boolean}]&gt; Array of attributes to define writer for.
+  # @option syms :instance_writer&lt;Boolean&gt; if true, instance-level attribute writer is defined.
+  # @return &lt;Array[#to_s]&gt; List of attributes that were made into cattr_writers
   #
-  # ==== Options
-  # :instance_writer&lt;Boolean&gt;:: if true, instance-level attribute writer is defined.
+  # @api public
   def cattr_writer(*syms)
     options = syms.last.is_a?(Hash) ? syms.pop : {}
     syms.flatten.each do |sym|
-      class_eval(&lt;&lt;-EOS, __FILE__, __LINE__)
+      class_eval(&lt;&lt;-RUBY, __FILE__, __LINE__)
         unless defined? @@#{sym}
           @@#{sym} = nil
         end
@@ -46,24 +73,25 @@ class Class
         def self.#{sym}=(obj)
           @@#{sym} = obj
         end
-
-        #{&quot;
-
-        def #{sym}=(obj)
-          @@#{sym} = obj
-        end
-        &quot; unless options[:instance_writer] == false }
-      EOS
+      RUBY
+      
+      unless options[:instance_writer] == false
+        class_eval(&lt;&lt;-RUBY, __FILE__, __LINE__)
+          def #{sym}=(obj)
+            @@#{sym} = obj
+          end
+        RUBY
+      end
     end
   end
 
   # Defines class-level (and optionally instance-level) attribute accessor.
   #
-  # ==== Parameters
-  # *syms&lt;Array&gt;:: Array of attributes to define accessor for.
+  # @param *syms&lt;Array[*#to_s, Hash{:instance_writer =&gt; Boolean}]&gt; Array of attributes to define accessor for.
+  # @option syms :instance_writer&lt;Boolean&gt; if true, instance-level attribute writer is defined.
+  # @return &lt;Array[#to_s]&gt; List of attributes that were made into accessors
   #
-  # ==== Options
-  # :instance_writer&lt;Boolean&gt;:: if true, instance-level attribute writer is defined.
+  # @api public
   def cattr_accessor(*syms)
     cattr_reader(*syms)
     cattr_writer(*syms)
@@ -72,8 +100,16 @@ class Class
   # Defines class-level inheritable attribute reader. Attributes are available to subclasses,
   # each subclass has a copy of parent's attribute.
   #
-  # ==== Parameters
-  # *syms&lt;Array&gt;:: Array of attributes to define inheritable reader for.
+  # @param *syms&lt;Array[#to_s]&gt; Array of attributes to define inheritable reader for.
+  # @return &lt;Array[#to_s]&gt; Array of attributes converted into inheritable_readers.
+  #
+  # @api public
+  #
+  # @todo Do we want to block instance_reader via :instance_reader =&gt; false
+  # @todo It would be preferable that we do something with a Hash passed in
+  #   (error out or do the same as other methods above) instead of silently
+  #   moving on). In particular, this makes the return value of this function
+  #   less useful.
   def class_inheritable_reader(*syms)
     syms.each do |sym|
       next if sym.is_a?(Hash)
@@ -93,27 +129,30 @@ class Class
   # Defines class-level inheritable attribute writer. Attributes are available to subclasses,
   # each subclass has a copy of parent's attribute.
   #
-  # ==== Parameters
-  # *syms&lt;Array&gt;:: Array of attributes to define inheritable writer for.
+  # @param *syms&lt;Array[*#to_s, Hash{:instance_writer =&gt; Boolean}]&gt; Array of attributes to
+  #   define inheritable writer for.
+  # @option syms :instance_writer&lt;Boolean&gt; if true, instance-level inheritable attribute writer is defined.
+  # @return &lt;Array[#to_s]&gt; An Array of the attributes that were made into inheritable writers.
+  #
+  # @api public
   #
-  # ==== Options
-  # :instance_writer&lt;Boolean&gt;:: if true, instance-level inheritable attribute writer is defined.
+  # @todo We need a style for class_eval &lt;&lt;-HEREDOC. I'd like to make it 
+  #   class_eval(&lt;&lt;-RUBY, __FILE__, __LINE__), but we should codify it somewhere.
   def class_inheritable_writer(*syms)
     options = syms.last.is_a?(Hash) ? syms.pop : {}
     syms.each do |sym|
-      class_eval &lt;&lt;-EOS, __FILE__, __LINE__
-
+      class_eval(&lt;&lt;-RUBY, __FILE__, __LINE__)
         def self.#{sym}=(obj)
           write_inheritable_attribute(:#{sym}, obj)
         end
-
-        #{&quot;
-
-        def #{sym}=(obj)
-          self.class.#{sym} = obj
-        end
-        &quot; unless options[:instance_writer] == false }
-      EOS
+      RUBY
+      unless options[:instance_writer] == false
+        class_eval &lt;&lt;-RUBY, __FILE__, __LINE__
+          def #{sym}=(obj)
+            self.class.#{sym} = obj
+          end
+        RUBY
+      end
     end
   end
 
@@ -121,27 +160,29 @@ class Class
   # each subclass has a copy of parent's array. Difference between other inheritable
   # attributes is that array is recreated every time it is written.
   #
-  # ==== Parameters
-  # *syms&lt;Array&gt;:: Array of array attribute names to define inheritable writer for.
-  #
-  # ==== Options
-  # :instance_writer&lt;Boolean&gt;:: if true, instance-level inheritable array attribute writer is defined.
+  # @param *syms&lt;Array[*#to_s, Hash{:instance_writer =&gt; Boolean}]&gt; Array of array attribute 
+  #   names to define inheritable writer for.
+  # @option syms :instance_writer&lt;Boolean&gt; if true, instance-level inheritable array 
+  #   attribute writer is defined.
+  # @return &lt;Array[#to_s]&gt; An array of the attributes that were made into inheritable
+  #   array writers.
+  # 
+  # @api public
   def class_inheritable_array_writer(*syms)
     options = syms.last.is_a?(Hash) ? syms.pop : {}
     syms.each do |sym|
-      class_eval &lt;&lt;-EOS, __FILE__, __LINE__
-
+      class_eval(&lt;&lt;-RUBY, __FILE__, __LINE__)
         def self.#{sym}=(obj)
           write_inheritable_array(:#{sym}, obj)
         end
-
-        #{&quot;
-
-        def #{sym}=(obj)
-          self.class.#{sym} = obj
-        end
-        &quot; unless options[:instance_writer] == false }
-      EOS
+      RUBY
+      unless options[:instance_writer] == false
+        class_eval(&lt;&lt;-RUBY, __FILE__, __LINE__)
+          def #{sym}=(obj)
+            self.class.#{sym} = obj
+          end
+        RUBY
+      end
     end
   end
 
@@ -149,38 +190,40 @@ class Class
   # each subclass has a copy of parent's hash. Difference between other inheritable
   # attributes is that hash is recreated every time it is written.
   #
-  # ==== Parameters
-  # *syms&lt;Array&gt;:: Array of hash attribute names to define inheritable writer for.
+  # @param *syms&lt;Array[*#to_s, Hash{:instance_writer =&gt; Boolean}]&gt;:: Array of hash 
+  #   attribute names to define inheritable writer for.
+  # @option syms :instance_writer&lt;Boolean&gt;:: if true, instance-level inheritable hash
+  #   attribute writer is defined.
+  # @return &lt;Array[#to_s]&gt; An Array of attributes turned into hash_writers.
   #
-  # ==== Options
-  # :instance_writer&lt;Boolean&gt;:: if true, instance-level inheritable hash attribute writer is defined.
+  # @api public
   def class_inheritable_hash_writer(*syms)
     options = syms.last.is_a?(Hash) ? syms.pop : {}
     syms.each do |sym|
-      class_eval &lt;&lt;-EOS, __FILE__, __LINE__
-
+      class_eval(&lt;&lt;-RUBY, __FILE__, __LINE__)
         def self.#{sym}=(obj)
           write_inheritable_hash(:#{sym}, obj)
         end
-
-        #{&quot;
-
-        def #{sym}=(obj)
-          self.class.#{sym} = obj
-        end
-        &quot; unless options[:instance_writer] == false }
-      EOS
+      RUBY
+      unless options[:instance_writer] == false
+        class_eval(&lt;&lt;-RUBY, __FILE__, __LINE__)
+          def #{sym}=(obj)
+            self.class.#{sym} = obj
+          end
+        RUBY
+      end
     end
   end
 
   # Defines class-level inheritable attribute accessor. Attributes are available to subclasses,
   # each subclass has a copy of parent's attribute.
   #
-  # ==== Parameters
-  # *syms&lt;Array&gt;:: Array of attributes to define inheritable accessor for.
+  # @param *syms&lt;Array[*#to_s, Hash{:instance_writer =&gt; Boolean}]&gt; Array of attributes to 
+  #   define inheritable accessor for.
+  # @option syms :instance_writer&lt;Boolean&gt; if true, instance-level inheritable attribute writer is defined.
+  # @return &lt;Array[#to_s]&gt; An Array of attributes turned into inheritable accessors.
   #
-  # ==== Options
-  # :instance_writer&lt;Boolean&gt;:: if true, instance-level inheritable attribute writer is defined.
+  # @api public
   def class_inheritable_accessor(*syms)
     class_inheritable_reader(*syms)
     class_inheritable_writer(*syms)
@@ -190,11 +233,13 @@ class Class
   # each subclass has a copy of parent's array. Difference between other inheritable
   # attributes is that array is recreated every time it is written.
   #
-  # ==== Parameters
-  # *syms&lt;Array&gt;:: Array of array attribute names to define inheritable accessor for.
-  #
-  # ==== Options
-  # :instance_writer&lt;Boolean&gt;:: if true, instance-level inheritable array attribute writer is defined.
+  # @param *syms&lt;Array[*#to_s, Hash{:instance_writer =&gt; Boolean}]&gt; Array of array attribute 
+  #   names to define inheritable accessor for.
+  # @option syms :instance_writer&lt;Boolean&gt; if true, instance-level inheritable array
+  #   attribute writer is defined.
+  # @return &lt;Array[#to_s]&gt; An Array of attributes turned into inheritable arrays.
+  # 
+  # @api public
   def class_inheritable_array(*syms)
     class_inheritable_reader(*syms)
     class_inheritable_array_writer(*syms)
@@ -204,31 +249,34 @@ class Class
   # each subclass has a copy of parent's hash. Difference between other inheritable
   # attributes is that hash is recreated every time it is written.
   #
-  # ==== Parameters
-  # *syms&lt;Array&gt;:: Array of hash attribute names to define inheritable accessor for.
-  #
-  # ==== Options
-  # :instance_writer&lt;Boolean&gt;:: if true, instance-level inheritable hash attribute writer is defined.
+  # @param *syms&lt;Array[*#to_s, Hash{:instance_writer =&gt; Boolean}]&gt; Array of hash attribute 
+  #   names to define inheritable accessor for.
+  # @option syms :instance_writer&lt;Boolean&gt; if true, instance-level inheritable hash 
+  #   attribute writer is defined.
+  # @return &lt;Array[#to_s]&gt; An Array of attributes turned into inheritable hashes.
   def class_inheritable_hash(*syms)
     class_inheritable_reader(*syms)
     class_inheritable_hash_writer(*syms)
   end
 
-  # ==== Returns
-  # &lt;Hash&gt;:: inheritable attributes hash or it's default value, new frozen Hash.
+  # @return &lt;Hash&gt; inheritable attributes hash or it's default value, new frozen Hash.
+  # 
+  # @api private
   def inheritable_attributes
     @inheritable_attributes ||= EMPTY_INHERITABLE_ATTRIBUTES
   end
 
   # Sets the attribute which copy is available to subclasses.
   #
-  # ==== Parameters
-  # key&lt;~to_s, String, Symbol&gt;:: inheritable attribute name
-  # value&lt;Anything but Array or Hash&gt;:: value of inheritable attribute
+  # @param key&lt;#to_s&gt; inheritable attribute name
+  # @param value&lt;not(Array, Hash)&gt; value of inheritable attribute
+  # @return &lt;not(Array, Hash)&gt; the value that was set
+  #
+  # @api private
   #
-  # ==== Notes
-  # If inheritable attributes storage has it's default value,
-  # a new frozen hash, it is set to new Hash that is not frozen.
+  # @note
+  #   If inheritable attributes storage has it's default value,
+  #   a new frozen hash, it is set to new Hash that is not frozen.
   def write_inheritable_attribute(key, value)
     if inheritable_attributes.equal?(EMPTY_INHERITABLE_ATTRIBUTES)
       @inheritable_attributes = {}
@@ -238,12 +286,14 @@ class Class
 
   # Sets the array attribute which copy is available to subclasses.
   #
-  # ==== Parameters
-  # key&lt;~to_s, String, Symbol&gt;:: inheritable attribute name
-  # value&lt;Array&gt;:: value of inheritable attribute
+  # @param key&lt;#to_s&gt; inheritable attribute name
+  # @param elements&lt;Array&gt; value of inheritable attribute
+  # @return &lt;Array&gt; the Array that was set
+  #
+  # @api private
   #
-  # ==== Notes
-  # Inheritable array is re-created on each write.
+  # @note
+  #   Inheritable array is re-created on each write.
   def write_inheritable_array(key, elements)
     write_inheritable_attribute(key, []) if read_inheritable_attribute(key).nil?
     write_inheritable_attribute(key, read_inheritable_attribute(key) + elements)
@@ -251,12 +301,15 @@ class Class
 
   # Sets the hash attribute which copy is available to subclasses.
   #
-  # ==== Parameters
-  # key&lt;~to_s, String, Symbol&gt;:: inheritable attribute name
-  # value&lt;Hash&gt;:: value of inheritable attribute
+  # @param key&lt;#to_s&gt; inheritable attribute name
+  # @param value&lt;Hash&gt; value of inheritable attribute
+  # @return &lt;Hash&gt; the new hash that resulted from merging the new values
+  #   with the inherited values.
   #
-  # ==== Notes
-  # Inheritable hash is re-created on each write.
+  # @api private
+  #
+  # @note
+  #   Inheritable hash is re-created on each write.
   def write_inheritable_hash(key, hash)
     write_inheritable_attribute(key, {}) if read_inheritable_attribute(key).nil?
     write_inheritable_attribute(key, read_inheritable_attribute(key).merge(hash))
@@ -264,14 +317,24 @@ class Class
 
   # Reads value of inheritable attributes.
   #
-  # ==== Returns
-  # Inheritable attribute value. Subclasses store copies of values.
+  # @param key&lt;#to_s&gt; the key of the attribute to read
+  # @return &lt;Object&gt; 
+  #   Inheritable attribute value. Subclasses store copies of values.
+  #
+  # @api private
   def read_inheritable_attribute(key)
     inheritable_attributes[key]
   end
 
-  # Resets inheritable attributes to either EMPTY_INHERITABLE_ATTRIBUTES
-  # if it is defined or it's default value, new frozen Hash.
+  # Resets inheritable attributes.
+  #
+  # @return &lt;Object&gt; the empty inheritable attributes. By default, this
+  #   is a frozen, empty Hash. You can override this for a class by defining
+  #   EMPTY_INHERITABLE_ATTRIBUTES
+  #
+  # @api private
+  #
+  # @todo do we need this?
   def reset_inheritable_attributes
     @inheritable_attributes = EMPTY_INHERITABLE_ATTRIBUTES
   end
@@ -280,6 +343,7 @@ class Class
     # Prevent this constant from being created multiple times
     EMPTY_INHERITABLE_ATTRIBUTES = {}.freeze unless const_defined?(:EMPTY_INHERITABLE_ATTRIBUTES)
 
+    # @todo document this
     def inherited_with_inheritable_attributes(child)
       inherited_without_inheritable_attributes(child) if respond_to?(:inherited_without_inheritable_attributes)
 
@@ -287,7 +351,7 @@ class Class
         new_inheritable_attributes = EMPTY_INHERITABLE_ATTRIBUTES
       else
         new_inheritable_attributes = inheritable_attributes.inject({}) do |memo, (key, value)|
-          memo.update(key =&gt; (value.dup rescue value))
+          memo.update(key =&gt; ((value.is_a?(Module) ? value : value.dup) rescue value))
         end
       end
 </diff>
      <filename>lib/merb-core/core_ext/class.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,28 +4,24 @@ class Hash
   class &lt;&lt; self
     # Converts valid XML into a Ruby Hash structure.
     #
-    # ==== Paramters
-    # xml&lt;String&gt;:: A string representation of valid XML.
+    # @param xml&lt;String&gt; A string representation of valid XML.
     #
-    # ==== Notes
-    # * Mixed content is treated as text and any tags in it are left unparsed
-    # * Any attributes other than type on a node containing a text node will be
+    # @note Mixed content is treated as text and any tags in it are left unparsed
+    # @note Any attributes other than type on a node containing a text node will be
     #   discarded
     #
-    # ===== Typecasting
-    # Typecasting is performed on elements that have a +type+ attribute:
-    # integer::
-    # boolean:: Anything other than &quot;true&quot; evaluates to false.
-    # datetime::
-    #   Returns a Time object. See Time documentation for valid Time strings.
-    # date::
-    #   Returns a Date object. See Date documentation for valid Date strings.
+    # @details [Typecasting]
+    #   Typecasting is performed on elements that have a +type+ attribute:
+    #   integer::
+    #   boolean:: Anything other than &quot;true&quot; evaluates to false.
+    #   datetime::
+    #     Returns a Time object. See Time documentation for valid Time strings.
+    #   date::
+    #     Returns a Date object. See Date documentation for valid Date strings.
     #
     # Keys are automatically converted to +snake_case+
     #
-    # ==== Examples
-    #
-    # ===== Standard
+    # @example [Simple]
     #   &lt;user gender='m'&gt;
     #     &lt;age type='integer'&gt;35&lt;/age&gt;
     #     &lt;name&gt;Home Simpson&lt;/name&gt;
@@ -34,7 +30,7 @@ class Hash
     #     &lt;is-cool type='boolean'&gt;true&lt;/is-cool&gt;
     #   &lt;/user&gt;
     #
-    # evaluates to
+    #   evaluates to
     #
     #   { &quot;user&quot; =&gt; {
     #       &quot;gender&quot;    =&gt; &quot;m&quot;,
@@ -46,50 +42,48 @@ class Hash
     #     }
     #   }
     #
-    # ===== Mixed Content
+    # @example [Mixed Content]
     #   &lt;story&gt;
     #     A Quick &lt;em&gt;brown&lt;/em&gt; Fox
     #   &lt;/story&gt;
     #
-    # evaluates to
+    #   evaluates to
     #
     #   { &quot;story&quot; =&gt; &quot;A Quick &lt;em&gt;brown&lt;/em&gt; Fox&quot; }
     #
-    # ====== Attributes other than type on a node containing text
+    # @details [Attributes other than type on a node containing text]
     #   &lt;story is-good='false'&gt;
     #     A Quick &lt;em&gt;brown&lt;/em&gt; Fox
     #   &lt;/story&gt;
     #
-    # evaluates to
+    #   evaluates to
     #
     #   { &quot;story&quot; =&gt; &quot;A Quick &lt;em&gt;brown&lt;/em&gt; Fox&quot; }
     #
     #   &lt;bicep unit='inches' type='integer'&gt;60&lt;/bicep&gt;
     #
-    # evaluates with a typecast to an integer. But unit attribute is ignored.
+    #   evaluates with a typecast to an integer. But unit attribute is ignored.
     #
-    #    { &quot;bicep&quot; =&gt; 60 }
+    #   { &quot;bicep&quot; =&gt; 60 }
     def from_xml( xml )
       ToHashParser.from_xml(xml)
     end
   end
-
-  # ==== Returns
-  # Mash:: This hash as a Mash for string or symbol key access.
-  #
+  
   # This class has semantics of ActiveSupport's HashWithIndifferentAccess
   # and we only have it so that people can write
   # params[:key] instead of params['key'].
+  #
+  # @return &lt;Mash&gt; This hash as a Mash for string or symbol key access.
   def to_mash
     hash = Mash.new(self)
     hash.default = default
     hash
   end
 
-  # ==== Returns
-  # String:: This hash as a query string
+  # @return &lt;String&gt; This hash as a query string
   #
-  # ==== Examples
+  # @example
   #   { :name =&gt; &quot;Bob&quot;,
   #     :address =&gt; {
   #       :street =&gt; '111 Ruby Ave.',
@@ -124,36 +118,35 @@ class Hash
     params
   end
 
-  # ==== Parameters
-  # *allowed:: The hash keys to include.
+  # @param *allowed&lt;Array[(String, Symbol)]&gt; The hash keys to include.
   #
-  # ==== Returns
-  # Hash:: A new hash with only the selected keys.
+  # @return &lt;Hash&gt; A new hash with only the selected keys.
   #
-  # ==== Examples
+  # @example
   #   { :one =&gt; 1, :two =&gt; 2, :three =&gt; 3 }.only(:one)
   #     #=&gt; { :one =&gt; 1 }
   def only(*allowed)
-    reject { |k,v| !allowed.include?(k) }
+    hash = {}
+    allowed.each {|k| hash[k] = self[k] }
+    hash
   end
 
-  # ==== Parameters
-  # *rejected:: The hash keys to exclude.
+  # @param *rejected&lt;Array[(String, Symbol)] The hash keys to exclude.
   #
-  # ==== Returns
-  # Hash:: A new hash without the selected keys.
+  # @return &lt;Hash&gt; A new hash without the selected keys.
   #
-  # ==== Examples
+  # @example
   #   { :one =&gt; 1, :two =&gt; 2, :three =&gt; 3 }.except(:one)
   #     #=&gt; { :two =&gt; 2, :three =&gt; 3 }
   def except(*rejected)
-    reject { |k,v| rejected.include?(k) }
+    hash = self.dup
+    rejected.each {|k| hash.delete(k) }
+    hash
   end
 
-  # ==== Returns
-  # String:: The hash as attributes for an XML tag.
+  # @return &lt;String&gt; The hash as attributes for an XML tag.
   #
-  # ==== Examples
+  # @example
   #   { :one =&gt; 1, &quot;two&quot;=&gt;&quot;TWO&quot; }.to_xml_attributes
   #     #=&gt; 'one=&quot;1&quot; two=&quot;TWO&quot;'
   def to_xml_attributes
@@ -164,17 +157,15 @@ class Hash
 
   alias_method :to_html_attributes, :to_xml_attributes
 
-  # ==== Parameters
-  # html_class&lt;~to_s&gt;::
+  # @param html_class&lt;#to_s&gt;
   #   The HTML class to add to the :class key. The html_class will be
   #   concatenated to any existing classes.
   #
-  # ==== Examples
-  #   hash[:class] #=&gt; nil
-  #   hash.add_html_class!(:selected)
-  #   hash[:class] #=&gt; &quot;selected&quot;
-  #   hash.add_html_class!(&quot;class1 class2&quot;)
-  #   hash[:class] #=&gt; &quot;selected class1 class2&quot;
+  # @example hash[:class] #=&gt; nil
+  # @example hash.add_html_class!(:selected)
+  # @example hash[:class] #=&gt; &quot;selected&quot;
+  # @example hash.add_html_class!(&quot;class1 class2&quot;)
+  # @example hash[:class] #=&gt; &quot;selected class1 class2&quot;
   def add_html_class!(html_class)
     if self[:class]
       self[:class] = &quot;#{self[:class]} #{html_class}&quot;
@@ -186,7 +177,9 @@ class Hash
   # Converts all keys into string values. This is used during reloading to
   # prevent problems when classes are no longer declared.
   #
-  # === Examples
+  # @return &lt;Array&gt; An array of they hash's keys
+  #
+  # @example 
   #   hash = { One =&gt; 1, Two =&gt; 2 }.proctect_keys!
   #   hash # =&gt; { &quot;One&quot; =&gt; 1, &quot;Two&quot; =&gt; 2 }
   def protect_keys!
@@ -196,7 +189,7 @@ class Hash
   # Attempts to convert all string keys into Class keys. We run this after
   # reloading to convert protected hashes back into usable hashes.
   #
-  # === Examples
+  # @example
   #   # Provided that classes One and Two are declared in this scope:
   #   hash = { &quot;One&quot; =&gt; 1, &quot;Two&quot; =&gt; 2 }.unproctect_keys!
   #   hash # =&gt; { One =&gt; 1, Two =&gt; 2 }
@@ -209,10 +202,9 @@ class Hash
   # Destructively and non-recursively convert each key to an uppercase string,
   # deleting nil values along the way.
   #
-  # ==== Returns
-  # Hash:: The newly environmentized hash.
+  # @return &lt;Hash&gt; The newly environmentized hash.
   #
-  # ==== Examples
+  # @example
   #   { :name =&gt; &quot;Bob&quot;, :contact =&gt; { :email =&gt; &quot;bob@bob.com&quot; } }.environmentize_keys!
   #     #=&gt; { &quot;NAME&quot; =&gt; &quot;Bob&quot;, &quot;CONTACT&quot; =&gt; { :email =&gt; &quot;bob@bob.com&quot; } }
   def environmentize_keys!
@@ -234,7 +226,7 @@ require 'rexml/light/node'
 # It's mainly just adding vowels, as I ht cd wth n vwls :)
 # This represents the hard part of the work, all I did was change the
 # underlying parser.
-class REXMLUtilityNode # :nodoc:
+class REXMLUtilityNode
   attr_accessor :name, :attributes, :children, :type
   cattr_accessor :typecasts, :available_typecasts
 
@@ -324,27 +316,25 @@ class REXMLUtilityNode # :nodoc:
   # +node+ has #type == &quot;integer&quot;,
   # {{[node.typecast_value(&quot;12&quot;) #=&gt; 12]}}
   #
-  # ==== Parameters
-  # value&lt;String&gt;:: The value that is being typecast.
+  # @param value&lt;String&gt; The value that is being typecast.
   #
-  # ==== :type options
-  # &quot;integer&quot;::
-  #   converts +value+ to an integer with #to_i
-  # &quot;boolean&quot;::
-  #   checks whether +value+, after removing spaces, is the literal
-  #   &quot;true&quot;
-  # &quot;datetime&quot;::
-  #   Parses +value+ using Time.parse, and returns a UTC Time
-  # &quot;date&quot;::
-  #   Parses +value+ using Date.parse
+  # @details [:type options]
+  #   &quot;integer&quot;::
+  #     converts +value+ to an integer with #to_i
+  #   &quot;boolean&quot;::
+  #     checks whether +value+, after removing spaces, is the literal
+  #     &quot;true&quot;
+  #   &quot;datetime&quot;::
+  #     Parses +value+ using Time.parse, and returns a UTC Time
+  #   &quot;date&quot;::
+  #     Parses +value+ using Date.parse
   #
-  # ==== Returns
-  # Integer, true, false, Time, Date, Object::
+  # @return &lt;Integer, TrueClass, FalseClass, Time, Date, Object&gt;
   #   The result of typecasting +value+.
   #
-  # ==== Notes
-  # If +self+ does not have a &quot;type&quot; key, or if it's not one of the
-  # options specified above, the raw +value+ will be returned.
+  # @note
+  #   If +self+ does not have a &quot;type&quot; key, or if it's not one of the
+  #   options specified above, the raw +value+ will be returned.
   def typecast_value(value)
     return value unless @type
     proc = self.class.typecasts[@type]
@@ -353,13 +343,9 @@ class REXMLUtilityNode # :nodoc:
 
   # Convert basic XML entities into their literal values.
   #
-  # ==== Parameters
-  # value&lt;~gsub&gt;::
-  #   An XML fragment.
+  # @param value&lt;#gsub&gt; An XML fragment.
   #
-  # ==== Returns
-  # ~gsub::
-  #   The XML fragment after converting entities.
+  # @return &lt;#gsub&gt; The XML fragment after converting entities.
   def translate_xml_entities(value)
     value.gsub(/&amp;lt;/,   &quot;&lt;&quot;).
           gsub(/&amp;gt;/,   &quot;&gt;&quot;).
@@ -383,21 +369,19 @@ class REXMLUtilityNode # :nodoc:
 
   # Converts the node into a readable HTML node.
   #
-  # ==== Returns
-  # String:: The HTML node in text form.
+  # @return &lt;String&gt; The HTML node in text form.
   def to_html
     attributes.merge!(:type =&gt; @type ) if @type
     &quot;&lt;#{name}#{attributes.to_xml_attributes}&gt;#{@nil_element ? '' : inner_html}&lt;/#{name}&gt;&quot;
   end
 
-  # ==== Alias
-  # #to_html
+  # @alias #to_html #to_s
   def to_s
     to_html
   end
 end
 
-class ToHashParser # :nodoc:
+class ToHashParser
 
   def self.from_xml(xml)
     stack = []</diff>
      <filename>lib/merb-core/core_ext/hash.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,29 +1,41 @@
 module Kernel
-  # Loads the given string as a gem. Execution is deferred to
-  # the Merb::BootLoader::Dependencies.run during bootup.
+  # Loads the given string as a gem. Execution is deferred until
+  # after the logger has been instantiated and the framework directory
+  # structure is defined.
   #
+  # If that has already happened, the gem will be activated
+  # immediately.
+  # 
   # ==== Parameters
-  # name&lt;String&gt;:: The name of the gem to load.
-  # *ver&lt;Gem::Requirement, Gem::Version, Array, ~to_str&gt;::
+  # @param name&lt;String&gt; The name of the gem to load.
+  # @param *ver&lt;Gem::Requirement, Gem::Version, Array, #to_str&gt;
   #   Version requirements to be passed to Gem.activate.
+  #
+  # ==== Returns
+  # Array[String, Array[Gem::Requirement, Gem::Version, Array, #to_str]]::
+  #   The name and version information that was passed in.
   def dependency(name, *ver)
-    Merb::BootLoader::Dependencies.dependencies &lt;&lt; [name, ver]
+    if Merb::BootLoader.finished?(Merb::BootLoader::Dependencies)
+      load_dependency(name, *ver)
+    else
+      Merb::BootLoader::Dependencies.dependencies &lt;&lt; [name, ver]
+    end
+    [name, ver]
   end
 
   # Loads the given string as a gem.
   #
-  # ==== Parameters
-  # name&lt;String&gt;:: The name of the gem to load.
-  # *ver&lt;Gem::Requirement, Gem::Version, Array, ~to_str&gt;::
-  #   Version requirements to be passed to Gem.activate.
-  #
-  # ==== Notes
-  # If the gem cannot be found, the method will attempt to require the string
-  # as a library.
-  #
   # This new version tries to load the file via ROOT/gems first before moving
   # off to the system gems (so if you have a lower version of a gem in
   # ROOT/gems, it'll still get loaded).
+  #
+  # @param name&lt;String&gt; The name of the gem to load.
+  # @param *ver&lt;Gem::Requirement, Gem::Version, Array, #to_str&gt;
+  #   Version requirements to be passed to Gem.activate.
+  #
+  # @note
+  #   If the gem cannot be found, the method will attempt to require the string
+  #   as a library.
   def load_dependency(name, *ver)
     try_framework = Merb.frozen?
     begin
@@ -52,8 +64,7 @@ module Kernel
   # Loads both gem and library dependencies that are passed in as arguments.
   # Execution is deferred to the Merb::BootLoader::Dependencies.run during bootup.
   #
-  # ==== Parameters
-  # *args&lt;String, Hash, Array&gt;:: The dependencies to load.
+  # @param *args&lt;String, Hash, Array&gt; The dependencies to load.
   def dependencies(*args)
     args.each do |arg|
       case arg
@@ -66,20 +77,18 @@ module Kernel
 
   # Loads both gem and library dependencies that are passed in as arguments.
   #
-  # ==== Parameters
-  # *args&lt;String, Hash, Array&gt;:: The dependencies to load.
-  #
-  # ==== Notes
-  # Each argument can be:
-  # String:: Single dependency.
-  # Hash::
-  #   Multiple dependencies where the keys are names and the values versions.
-  # Array:: Multiple string dependencies.
-  #
-  # ==== Examples
-  # dependencies &quot;RedCloth&quot;                 # Loads the the RedCloth gem
-  # dependencies &quot;RedCloth&quot;, &quot;merb_helpers&quot; # Loads RedCloth and merb_helpers
-  # dependencies &quot;RedCloth&quot; =&gt; &quot;3.0&quot;        # Loads RedCloth 3.0
+  # @param *args&lt;String, Hash, Array&gt; The dependencies to load.
+  #
+  # @note
+  #   Each argument can be:
+  #   String:: Single dependency.
+  #   Hash::
+  #     Multiple dependencies where the keys are names and the values versions.
+  #   Array:: Multiple string dependencies.
+  #
+  # @example dependencies &quot;RedCloth&quot;                 # Loads the the RedCloth gem
+  # @example dependencies &quot;RedCloth&quot;, &quot;merb_helpers&quot; # Loads RedCloth and merb_helpers
+  # @example dependencies &quot;RedCloth&quot; =&gt; &quot;3.0&quot;        # Loads RedCloth 3.0
   def load_dependencies(*args)
     args.each do |arg|
       case arg
@@ -92,9 +101,8 @@ module Kernel
 
   # Does a basic require, and prints a message if an error occurs.
   #
-  # ==== Parameters
-  # library&lt;~to_s&gt;:: The library to attempt to include.
-  # message&lt;String&gt;:: The error to add to the log upon failure. Defaults to nil.
+  # @param library&lt;to_s&gt; The library to attempt to include.
+  # @param message&lt;String&gt; The error to add to the log upon failure. Defaults to nil.
   def rescue_require(library, message = nil)
     require library
   rescue LoadError, RuntimeError
@@ -105,20 +113,19 @@ module Kernel
   # Mapper) you wish to use. Currently Merb has plugins to support
   # ActiveRecord, DataMapper, and Sequel.
   #
-  # ==== Parameters
-  # orm&lt;~to_s&gt;:: The ORM to use.
+  # @param orm&lt;#to_s&gt; The ORM to use.
   #
-  # ==== Examples
-  #   # This line goes in dependencies.yml
+  # @example
   #   use_orm :datamapper
   #
   #   # This will use the DataMapper generator for your ORM
-  #   $ ruby script/generate model MyModel
+  #   $ merb-gen model ActivityEvent
+  #
+  # @note
+  #   If for some reason this is called more than once, latter
+  #   call takes over other.
   def use_orm(orm)
-    raise &quot;Don't call use_orm more than once&quot; if registred_orm?(orm)
-
     begin
-      Merb.generator_scope.delete(:merb_default)
       register_orm(orm)
       orm_plugin = &quot;merb_#{orm}&quot;
       Kernel.dependency(orm_plugin)
@@ -128,46 +135,28 @@ module Kernel
     end
   end
 
-  # Use to check whether given ORM already registred at generator scope
-  #
-  # ==== Parameters
-  # orm&lt;~to_sym&gt;::
-  #   ORM alias, like :activerecord, :datamapper or :sequel.
-  #
-  # ==== Returns
-  # Boolean::
-  #   true if ORM is already registred, false otherwise
-  #
-  #--
-  # @semi-public
-  def registred_orm?(orm)
-    !Merb.generator_scope.include?(:merb_default) &amp;&amp; !Merb.generator_scope.include?(orm.to_sym)
-  end
 
   # Registers ORM at generator scope.
   #
-  # ==== Parameters
-  # orm&lt;~to_sym&gt;::
+  # @param orm&lt;#to_sym&gt;
   #   ORM alias, like :activerecord, :datamapper or :sequel.
-  #--
-  # @private
+  #
+  # @api private
   def register_orm(orm)
-    Merb.generator_scope.unshift(orm.to_sym) unless Merb.generator_scope.include?(orm.to_sym)
+    Merb.orm_generator_scope = orm
   end
 
   # Used in Merb.root/config/init.rb to tell Merb which testing framework to
   # use. Currently Merb has plugins to support RSpec and Test::Unit.
   #
-  # ==== Parameters
-  # test_framework&lt;Symbol&gt;::
+  # @param test_framework&lt;Symbol&gt;
   #   The test framework to use. Currently only supports :rspec and :test_unit.
   #
-  # ==== Examples
-  #   # This line goes in dependencies.yml
+  # @example
   #   use_test :rspec
   #
   #   # This will now use the RSpec generator for tests
-  #   $ ruby script/generate controller MyController
+  #   $ merb-gen model ActivityEvent
   def use_test(test_framework, *test_dependencies)
     raise &quot;use_test only supports :rspec and :test_unit currently&quot; unless supported_test_framework?(test_framework)
     register_test_framework(test_framework)
@@ -177,63 +166,55 @@ module Kernel
 
   # Check whether Merb supports test framework. Currently Merb has plugins to support RSpec and Test::Unit.
   #
-  # ==== Parameters
-  # test_framework&lt;Symbol&gt;::
+  # @param test_framework&lt;Symbol&gt;
   #   The test framework to check. Currently only supports :rspec and :test_unit.
-  #--
-  # @semi-public
+  #
+  # @api plugin
   def supported_test_framework?(test_framework)
     [:rspec, :test_unit].include?(test_framework.to_sym)
   end
 
   # Register test framework at generator scope. Currently Merb has plugins to support RSpec and Test::Unit.
   #
-  # ==== Parameters
-  # test_framework&lt;Symbol&gt;::
-  #   The test framework to check. Currently only supports :rspec and :test_unit but the check is performed before registration if you use API.
-  #--
-  # @private
+  # @param test_framework&lt;Symbol&gt;
+  #   The test framework to check. Currently only supports :rspec and :test_unit but the 
+  #   check is performed before registration if you use API.
+  #
+  # @api private
   def register_test_framework(test_framework)
-    Merb.generator_scope.delete(:rspec)
-    Merb.generator_scope.delete(:test_unit)
-
-    Merb.generator_scope.push(test_framework.to_sym)
+    Merb.test_framework_generator_scope = test_framework
   end
 
-  # ==== Parameters
-  # i&lt;Fixnum&gt;:: The caller number. Defaults to 1.
+  # @param i&lt;Fixnum&gt; The caller number. Defaults to 1.
   #
-  # ==== Returns
-  # Array[Array]:: The file, line and method of the caller.
+  # @return &lt;Array[Array]&gt; The file, line and method of the caller.
   #
-  # ==== Examples
+  # @example
   #   __caller_info__(1)
   #     # =&gt; ['/usr/lib/ruby/1.8/irb/workspace.rb', '52', 'irb_binding']
   def __caller_info__(i = 1)
     file, line, meth = caller[i].scan(/(.*?):(\d+):in `(.*?)'/).first
   end
 
-  # ==== Parameters
-  # file&lt;String&gt;:: The file to read.
-  # line&lt;Fixnum&gt;:: The line number to look for.
-  # size&lt;Fixnum&gt;::
+  # @param file&lt;String&gt; The file to read.
+  # @param line&lt;Fixnum&gt; The line number to look for.
+  # @param size&lt;Fixnum&gt;
   #   Number of lines to include above and below the the line to look for.
   #   Defaults to 4.
   #
-  # ==== Returns
-  # Array[Array]::
+  # @return &lt;Array[Array]&gt;
   #   Triplets containing the line number, the line and whether this was the
   #   searched line.
   #
-  # ==== Examples
-  #  __caller_lines__('/usr/lib/ruby/1.8/debug.rb', 122, 2) # =&gt;
-  #   [
-  #     [ 120, &quot;  def check_suspend&quot;,                               false ],
-  #     [ 121, &quot;    return if Thread.critical&quot;,                     false ],
-  #     [ 122, &quot;    while (Thread.critical = true; @suspend_next)&quot;, true  ],
-  #     [ 123, &quot;      DEBUGGER__.waiting.push Thread.current&quot;,      false ],
-  #     [ 124, &quot;      @suspend_next = false&quot;,                       false ]
-  #   ]
+  # @example
+  #   __caller_lines__('/usr/lib/ruby/1.8/debug.rb', 122, 2) # =&gt;
+  #     [
+  #       [ 120, &quot;  def check_suspend&quot;,                               false ],
+  #       [ 121, &quot;    return if Thread.critical&quot;,                     false ],
+  #       [ 122, &quot;    while (Thread.critical = true; @suspend_next)&quot;, true  ],
+  #       [ 123, &quot;      DEBUGGER__.waiting.push Thread.current&quot;,      false ],
+  #       [ 124, &quot;      @suspend_next = false&quot;,                       false ]
+  #     ]
   def __caller_lines__(file, line, size = 4)
     return [['Template Error!', &quot;problem while rendering&quot;, false]] if file =~ /\(erubis\)/
     lines = File.readlines(file)
@@ -260,29 +241,28 @@ module Kernel
   # Takes a block, profiles the results of running the block
   # specified number of times and generates HTML report.
   #
-  # ==== Parameters
-  # name&lt;~to_s&gt;::
+  # @param name&lt;#to_s&gt;
   #   The file name. The result will be written out to
   #   Merb.root/&quot;log/#{name}.html&quot;.
-  # min&lt;Fixnum&gt;::
+  # @param min&lt;Fixnum&gt;
   #   Minimum percentage of the total time a method must take for it to be
   #   included in the result. Defaults to 1.
   #
-  # ==== Returns
-  # String:: The result of the profiling.
+  # @return &lt;String&gt;
+  #   The result of the profiling.
   #
-  # ==== Notes
-  # Requires ruby-prof (&lt;tt&gt;sudo gem install ruby-prof&lt;/tt&gt;)
+  # @note
+  #   Requires ruby-prof (&lt;tt&gt;sudo gem install ruby-prof&lt;/tt&gt;)
   #
-  # ==== Examples
+  # @example
   #   __profile__(&quot;MyProfile&quot;, 5, 30) do
   #     rand(10)**rand(10)
   #     puts &quot;Profile run&quot;
   #   end
   #
-  # Assuming that the total time taken for #puts calls was less than 5% of the
-  # total time to run, #puts won't appear in the profile report.
-  # The code block will be run 30 times in the example above.
+  #   Assuming that the total time taken for #puts calls was less than 5% of the
+  #   total time to run, #puts won't appear in the profile report.
+  #   The code block will be run 30 times in the example above.
   def __profile__(name, min=1, iter=100)
     require 'ruby-prof' unless defined?(RubyProf)
     return_result = ''
@@ -301,10 +281,9 @@ module Kernel
   # Extracts an options hash if it is the last item in the args array. Used
   # internally in methods that take *args.
   #
-  # ==== Parameters
-  # args&lt;Array&gt;:: The arguments to extract the hash from.
+  # @param args&lt;Array&gt; The arguments to extract the hash from.
   #
-  # ==== Examples
+  # @example
   #   def render(*args,&amp;blk)
   #     opts = extract_options_from_args!(args) || {}
   #     # [...]
@@ -315,13 +294,12 @@ module Kernel
 
   # Checks that the given objects quack like the given conditions.
   #
-  # ==== Parameters
-  # opts&lt;Hash&gt;::
+  # @param opts&lt;Hash&gt;
   #   Conditions to enforce. Each key will receive a quacks_like? call with the
   #   value (see Object#quacks_like? for details).
   #
-  # ==== Raises
-  # ArgumentError:: An object failed to quack like a condition.
+  # @raise &lt;ArgumentError&gt;
+  #   An object failed to quack like a condition.
   def enforce!(opts = {})
     opts.each do |k,v|
       raise ArgumentError, &quot;#{k.inspect} doesn't quack like #{v.inspect}&quot; unless k.quacks_like?(v)</diff>
      <filename>lib/merb-core/core_ext/kernel.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,13 +2,12 @@
 # params[:key] instead of params['key'].
 class Mash &lt; Hash
 
-  # ==== Parameters
-  # constructor&lt;Object&gt;::
+  # @param constructor&lt;Object&gt;
   #   The default value for the mash. Defaults to an empty hash.
   #
-  # ==== Alternatives
-  # If constructor is a Hash, a new mash will be created based on the keys of
-  # the hash and no default value will be set.
+  # @details [Alternatives]
+  #   If constructor is a Hash, a new mash will be created based on the keys of
+  #   the hash and no default value will be set.
   def initialize(constructor = {})
     if constructor.is_a?(Hash) 
       super() 
@@ -18,12 +17,11 @@ class Mash &lt; Hash
     end 
   end
 
-  # ==== Parameters
-  # key&lt;Object&gt;:: The default value for the mash. Defaults to nil.
+  # @param key&lt;Object&gt; The default value for the mash. Defaults to nil.
   #
-  # ==== Alternatives
-  # If key is a Symbol and it is a key in the mash, then the default value will
-  # be set to the value matching the key.
+  # @details [Alternatives]
+  #   If key is a Symbol and it is a key in the mash, then the default value will
+  #   be set to the value matching the key.
   def default(key = nil) 
     if key.is_a?(Symbol) &amp;&amp; include?(key = key.to_s) 
       self[key] 
@@ -35,21 +33,21 @@ class Mash &lt; Hash
   alias_method :regular_writer, :[]= unless method_defined?(:regular_writer) 
   alias_method :regular_update, :update unless method_defined?(:regular_update)
 
-  # ==== Parameters
-  # key&lt;Object&gt;:: The key to set. This will be run through convert_key.
-  # value&lt;Object&gt;::
-  #   The value to set the key to.  This will be run through convert_value.
+  # @param key&lt;Object&gt; The key to set.
+  # @param value&lt;Object&gt;
+  #   The value to set the key to.
+  #
+  # @see Mash#convert_key
+  # @see Mash#convert_value
   def []=(key, value) 
     regular_writer(convert_key(key), convert_value(value)) 
   end
 
-  # ==== Parameters
-  # other_hash&lt;Hash&gt;::
-  # A hash to update values in the mash with. The keys and the values will be
-  # converted to Mash format.
+  # @param other_hash&lt;Hash&gt;
+  #   A hash to update values in the mash with. The keys and the values will be
+  #   converted to Mash format.
   #
-  # ==== Returns
-  # Mash:: The updated mash.
+  # @return &lt;Mash&gt; The updated mash.
   def update(other_hash) 
     other_hash.each_pair { |key, value| regular_writer(convert_key(key), convert_value(value)) } 
     self 
@@ -57,90 +55,81 @@ class Mash &lt; Hash
  
   alias_method :merge!, :update
 
-  # ==== Parameters
-  # key&lt;Object&gt;:: The key to check for. This will be run through convert_key.
+  # @param key&lt;Object&gt; The key to check for. This will be run through convert_key.
   #
-  # ==== Returns
-  # Boolean:: True if the key exists in the mash.
+  # @return &lt;TrueClass, FalseClass&gt; True if the key exists in the mash.
   def key?(key) 
     super(convert_key(key)) 
   end 
 
   # def include? def has_key? def member?
-  alias_method :include?, :key? 
-  alias_method :has_key?, :key? 
+  alias_method :include?, :key?
+  alias_method :has_key?, :key?
   alias_method :member?, :key?
 
-  # ==== Parameters
-  # key&lt;Object&gt;:: The key to fetch. This will be run through convert_key.
-  # extras:: Default value.
+  # @param key&lt;Object&gt; The key to fetch. This will be run through convert_key.
+  # @param *extras&lt;Array&gt; Default value.
   #
-  # ==== Returns
-  # Object:: The value at key or the default value.
+  # @return &lt;Object&gt; The value at key or the default value.
   def fetch(key, *extras) 
     super(convert_key(key), *extras) 
   end
 
-  # ==== Parameters
-  # indices&lt;Array&gt;::
+  # @param *indices&lt;Array&gt;
   #   The keys to retrieve values for. These will be run through +convert_key+.
+  #
+  # @return &lt;Array&gt; The values at each of the provided keys
   def values_at(*indices) 
     indices.collect {|key| self[convert_key(key)]} 
   end
 
-  # ==== Returns
-  # Mash:: A duplicate of this mash.
+  # @return &lt;Mash&gt; A duplicate of this mash.
   def dup 
     Mash.new(self) 
   end
 
-  # ==== Parameters
-  # hash&lt;Hash&gt;:: The hash to merge with the mash.
+  # @param hash&lt;Hash&gt; The hash to merge with the mash.
   #
-  # ==== Returns
-  # Mash:: A new mash with the hash values merged in.
+  # @return &lt;Mash&gt; A new mash with the hash values merged in.
   def merge(hash) 
     self.dup.update(hash) 
   end
 
-  # ==== Parameters
-  # key&lt;Object&gt;::
-  #   The key to delete from the mash. This will be run through convert_key.
+  # @param key&lt;Object&gt;
+  #   The key to delete from the mash.\
   def delete(key) 
     super(convert_key(key)) 
   end
 
   # Used to provide the same interface as Hash.
   #
-  # ==== Returns
-  # Mash:: This mash unchanged.
+  # @return &lt;Mash&gt; This mash unchanged.
   def stringify_keys!; self end
  
-  # ==== Returns
-  # Hash:: The mash as a Hash with string keys.
+  # @return &lt;Hash&gt; The mash as a Hash with string keys.
   def to_hash 
     Hash.new(default).merge(self) 
   end 
  
   protected
-  # ==== Parameters
-  # key&lt;Object&gt;:: The key to convert.
+  # @param key&lt;Object&gt; The key to convert.
   #
-  # ==== Returns
-  # Object::
+  # @param &lt;Object&gt;
   #   The converted key. If the key was a symbol, it will be converted to a
   #   string.
+  #
+  # @api private
   def convert_key(key) 
     key.kind_of?(Symbol) ? key.to_s : key 
   end
 
-  # ==== Parameters
-  # value&lt;Object&gt;:: The value to convert.
+  # @param value&lt;Object&gt; The value to convert.
   #
-  # ==== Returns
-  # Object::
+  # @return &lt;Object&gt;
   #   The converted value. A Hash or an Array of hashes, will be converted to
   #   their Mash equivalents.
+  #
+  # @api private
   def convert_value(value) 
     case value 
     when Hash </diff>
      <filename>lib/merb-core/core_ext/mash.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,9 @@
 class Object
   # Extracts the singleton class, so that metaprogramming can be done on it.
   #
-  # ==== Returns
-  # Class:: The meta class.
+  # @return &lt;Class&gt; The meta class.
   #
-  # ==== Examples
+  # @example [Setup]
   #   class MyString &lt; String; end
   #
   #   MyString.instance_eval do
@@ -27,47 +26,51 @@ class Object
   #     end
   #   end
   #
+  # @example
   #   MyString.new(&quot;Hello&quot;).foo #=&gt; &quot;Hello&quot;
+  # @example
   #   MyString.new(&quot;Hello&quot;).bar
   #     #=&gt; NoMethodError: undefined method `bar' for &quot;Hello&quot;:MyString
+  # @example
   #   MyString.foo
   #     #=&gt; NoMethodError: undefined method `foo' for MyString:Class
+  # @example  
   #   MyString.bar
   #     #=&gt; MyString
+  # @example  
   #   String.bar
   #     #=&gt; NoMethodError: undefined method `bar' for String:Class
-  #
+  # @example
   #   MyString.add_meta_var(:x)
   #   MyString.x #=&gt; HELLO
   #
-  # As you can see, using #meta_class allows you to execute code (and here,
-  # define a method) on the metaclass itself. It also allows you to define
-  # class methods that can be run on subclasses, and then be able to execute
-  # code on the metaclass of the subclass (here MyString).
+  # @details [Description of Examples]
+  #   As you can see, using #meta_class allows you to execute code (and here,
+  #   define a method) on the metaclass itself. It also allows you to define
+  #   class methods that can be run on subclasses, and then be able to execute
+  #   code on the metaclass of the subclass (here MyString).
   #
-  # In this case, we were able to define a class method (add_meta_var) on
-  # String that was executable by the MyString subclass. It was then able to
-  # define a method on the subclass by adding it to the MyString metaclass.
+  #   In this case, we were able to define a class method (add_meta_var) on
+  #   String that was executable by the MyString subclass. It was then able to
+  #   define a method on the subclass by adding it to the MyString metaclass.
   #
-  # For more information, you can check out _why's excellent article at:
-  # http://whytheluckystiff.net/articles/seeingMetaclassesClearly.html
+  #   For more information, you can check out _why's excellent article at:
+  #   http://whytheluckystiff.net/articles/seeingMetaclassesClearly.html
   def meta_class() class &lt;&lt; self; self end end
 
-  # ==== Returns
-  # Boolean::
+  # @return &lt;TrueClass, FalseClass&gt;
   #   True if the empty? is true or if the object responds to strip (e.g. a
   #   String) and strip.empty? is true, or if !self is true.
   #
-  # ==== Examples
-  #    [].blank?         #=&gt;  true
-  #    [1].blank?        #=&gt;  false
-  #    [nil].blank?      #=&gt;  false
-  #    nil.blank?        #=&gt;  true
-  #    true.blank?       #=&gt;  false
-  #    false.blank?      #=&gt;  true
-  #    &quot;&quot;.blank?         #=&gt;  true
-  #    &quot;     &quot;.blank?    #=&gt;  true
-  #    &quot; hey ho &quot;.blank? #=&gt;  false
+  # @example [].blank?         #=&gt;  true
+  # @example [1].blank?        #=&gt;  false
+  # @example [nil].blank?      #=&gt;  false
+  # @example nil.blank?        #=&gt;  true
+  # @example true.blank?       #=&gt;  false
+  # @example false.blank?      #=&gt;  true
+  # @example &quot;&quot;.blank?         #=&gt;  true
+  # @example &quot;     &quot;.blank?    #=&gt;  true
+  # @example &quot; hey ho &quot;.blank? #=&gt;  false
   def blank?
     if respond_to?(:empty?) &amp;&amp; respond_to?(:strip)
       empty? or strip.empty?
@@ -78,26 +81,40 @@ class Object
     end
   end
 
-  # ==== Parameters
-  # name&lt;String&gt;:: The name of the constant to get, e.g. &quot;Merb::Router&quot;.
+  # @param name&lt;String&gt; The name of the constant to get, e.g. &quot;Merb::Router&quot;.
   #
-  # ==== Returns
-  # Object:: The constant corresponding to the name.
+  # @return &lt;Object&gt; The constant corresponding to the name.
   def full_const_get(name)
     list = name.split(&quot;::&quot;)
-    obj = Object
-    list.each {|x| obj = obj.const_get(x) }
+    list.shift if list.first.blank?
+    obj = self
+    list.each do |x| 
+      # This is required because const_get tries to look for constants in the 
+      # ancestor chain, but we only want constants that are HERE
+      obj = obj.const_defined?(x) ? obj.const_get(x) : obj.const_missing(x)
+    end
     obj
   end
+  
+  # @param name&lt;String&gt; The name of the constant to get, e.g. &quot;Merb::Router&quot;.
+  # @param value&lt;Object&gt; The value to assign to the constant.
+  #
+  # @return &lt;Object&gt; The constant corresponding to the name.
+  def full_const_set(name, value)    
+    list = name.split(&quot;::&quot;)
+    toplevel = list.first.blank?
+    list.shift if toplevel
+    last = list.pop
+    obj = list.empty? ? Object : Object.full_const_get(list.join(&quot;::&quot;))
+    obj.const_set(last, value) if obj &amp;&amp; !obj.const_defined?(last)
+  end
 
   # Defines module from a string name (e.g. Foo::Bar::Baz)
-  # If method already exists, no exception raised.
+  # If module already exists, no exception raised.
   #
-  # ==== Parameters
-  # name&lt;String&gt;:: The name of the full module name to make
+  # @param name&lt;String&gt; The name of the full module name to make
   #
-  # ==== Returns
-  # nil
+  # @return &lt;NilClass&gt;
   def make_module(str)
     mod = str.split(&quot;::&quot;)
     start = mod.map {|x| &quot;module #{x}&quot;}.join(&quot;; &quot;)
@@ -108,19 +125,18 @@ class Object
     HERE
   end
 
-  # ==== Parameters
-  # duck&lt;Symbol, Class, Array&gt;:: The thing to compare the object to.
-  #
-  # ==== Notes
-  # The behavior of the method depends on the type of duck as follows:
-  # Symbol:: Check whether the object respond_to?(duck).
-  # Class:: Check whether the object is_a?(duck).
-  # Array::
-  #   Check whether the object quacks_like? at least one of the options in the
-  #   array.
-  #
-  # ==== Returns
-  # Boolean:: True if the object quacks like duck.
+  # @param duck&lt;Symbol, Class, Array&gt; The thing to compare the object to.
+  #
+  # @note
+  #   The behavior of the method depends on the type of duck as follows:
+  #   Symbol:: Check whether the object respond_to?(duck).
+  #   Class:: Check whether the object is_a?(duck).
+  #   Array::
+  #     Check whether the object quacks_like? at least one of the options in the
+  #     array.
+  #
+  # @return &lt;TrueClass, FalseClass&gt;
+  #   True if the object quacks like duck.
   def quacks_like?(duck)
     case duck
     when Symbol
@@ -134,12 +150,14 @@ class Object
     end
   end
   
-  # ==== Parameters
-  # arrayish&lt;Array&gt;:: Container to check, to see if it includes the object.
-  # more&lt;Objects&gt;:: additional args, will be flattened into arrayish
+  # @param arrayish&lt;#include?&gt; Container to check, to see if it includes the object.
+  # @param *more&lt;Array&gt;:: additional args, will be flattened into arrayish
+  #
+  # @return &lt;TrueClass, FalseClass&gt;
+  #   True if the object is included in arrayish (+ more)
   #
-  # ==== Returns
-  # Boolean: True if the object is included in arrayish (+ more)
+  # @example 1.in?([1,2,3]) #=&gt; true
+  # @example 1.in?(1,2,3) #=&gt; true
   def in?(arrayish,*more)
     arrayish = more.unshift(arrayish) unless more.empty?
     arrayish.include?(self)</diff>
      <filename>lib/merb-core/core_ext/object.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,8 +2,7 @@ module ObjectSpace
   
   class &lt;&lt; self
 
-    # ==== Returns
-    # Array[Class]:: All the classes in the object space.
+    # @return &lt;Array[Class]&gt; All the classes in the object space.
     def classes
       klasses = []
       ObjectSpace.each_object(Class) {|o| klasses &lt;&lt; o}</diff>
      <filename>lib/merb-core/core_ext/object_space.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,14 +3,25 @@ require 'rubygems'
 module Gem
   class SourceIndex
     
-    # Overwrite this so that a gem of the same name and version won't push one
-    # from the gems directory out entirely.
-    #
-    # ==== Parameters
-    # gem_spec&lt;Gem::Specification&gt;:: The specification of the gem to add.
-    def add_spec(gem_spec)
-      @gems[gem_spec.full_name] = gem_spec unless @gems[gem_spec.full_name].is_a?(Gem::Specification) &amp;&amp; @gems[gem_spec.full_name].installation_path == File.join(defined?(Merb) &amp;&amp; Merb.respond_to?(:root) ? Merb.root : Dir.pwd,&quot;gems&quot;)
+    # This is resolved in 1.1
+    if Version.new(RubyGemsVersion) &lt; Version.new(&quot;1.1&quot;)
+      
+      # Overwrite this so that a gem of the same name and version won't push one
+      # from the gems directory out entirely.
+      #
+      # @param gem_spec&lt;Gem::Specification&gt; The specification of the gem to add.
+      def add_spec(gem_spec)
+        unless gem_spec.instance_variable_get(&quot;@loaded_from&quot;) &amp;&amp;
+          @gems[gem_spec.full_name].is_a?(Gem::Specification) &amp;&amp; 
+          @gems[gem_spec.full_name].installation_path == 
+            File.join(defined?(Merb) &amp;&amp; Merb.respond_to?(:root) ? Merb.root : Dir.pwd,&quot;gems&quot;)
+            
+          @gems[gem_spec.full_name] = gem_spec
+        end
+      end
+      
     end
+    
   end
 
   class Specification
@@ -19,8 +30,7 @@ module Gem
     # from any other location. If there are two gems of different versions in
     # the gems directory, the later one will load as usual.
     #
-    # ==== Returns
-    # Array[Array]:: The object used for sorting gem specs.
+    # @return &lt;Array[Array]&gt; The object used for sorting gem specs.
     def sort_obj
       [@name, installation_path == File.join(defined?(Merb) &amp;&amp; Merb.respond_to?(:root) ? Merb.root : Dir.pwd,&quot;gems&quot;) ? 1 : -1, @version.to_ints, @new_platform == Gem::Platform::RUBY ? -1 : 1]
     end</diff>
      <filename>lib/merb-core/core_ext/rubygems.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,35 +6,28 @@ module Merb
   # a set of callable actions of controller.
   class SimpleSet &lt; Hash
 
-    # ==== Parameters
-    # arr&lt;Array&gt;:: Initial set values.
+    # @param arr&lt;Array&gt; Initial set values.
     #
-    # ==== Returns
-    # Array:: The array the Set was initialized with
+    # @return &lt;Array&gt; The array the Set was initialized with
     def initialize(arr = [])
       arr.each {|x| self[x] = true}
     end
 
-    # ==== Parameters
-    # value&lt;Object&gt;:: Value to add to set.
+    # @param value&lt;Object&gt; Value to add to set.
     #
-    # ==== Returns
-    # true
+    # @return &lt;TrueClass&gt;
     def &lt;&lt;(value)
       self[value] = true
     end
 
-    # ==== Parameters
-    # arr&lt;Array&gt;:: Values to merge with set.
+    # @param arr&lt;Array&gt; Values to merge with set.
     #
-    # ==== Returns
-    # SimpleSet:: The set after the Array was merged in.
+    # @return &lt;SimpleSet&gt; The set after the Array was merged in.
     def merge(arr)
       super(arr.inject({}) {|s,x| s[x] = true; s })
     end
 
-    # ==== Returns
-    # String:: A human readable version of the set.
+    # @return &lt;String&gt; A human readable version of the set.
     def inspect
       &quot;#&lt;SimpleSet: {#{keys.map {|x| x.inspect}.join(&quot;, &quot;)}}&gt;&quot;
     end</diff>
      <filename>lib/merb-core/core_ext/set.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,31 +1,33 @@
 require &quot;pathname&quot;
 
 class String
-
-  # ==== Returns
-  # String:: The string with all regexp special characters escaped.
+  
+  ##
+  # @return &lt;String&gt; The string with all regexp special characters escaped.
   #
-  # ==== Examples
+  # @example
   #   &quot;*?{}.&quot;.escape_regexp #=&gt; &quot;\\*\\?\\{\\}\\.&quot;
   def escape_regexp
     Regexp.escape self
   end
-
-  # ==== Returns
-  # String:: The string with all regexp special characters unescaped.
+  
+  ##
+  # @return String The string with all regexp special characters unescaped.
   #
-  # ==== Examples
+  # @example
   #   &quot;\\*\\?\\{\\}\\.&quot;.unescape_regexp #=&gt; &quot;*?{}.&quot;
   def unescape_regexp
     self.gsub(/\\([\.\?\|\(\)\[\]\{\}\^\$\*\+\-])/, '\1')
   end
-
-  # ==== Returns
-  # String:: The string converted to snake case.
+  
+  ##
+  # @return &lt;String&gt; The string converted to snake case.
   #
-  # ==== Examples
+  # @example
   #   &quot;FooBar&quot;.snake_case #=&gt; &quot;foo_bar&quot;
+  # @example
   #   &quot;HeadlineCNNNews&quot;.snake_case #=&gt; &quot;headline_cnn_news&quot;
+  # @example
   #   &quot;CNN&quot;.snake_case #=&gt; &quot;cnn&quot;
   def snake_case
     return self.downcase if self =~ /^[A-Z]+$/
@@ -33,57 +35,56 @@ class String
       return $+.downcase
   end
 
-  # ==== Returns
-  # String:: The string converted to camel case.
+  ##
+  # @return &lt;String&gt; The string converted to camel case.
   #
-  # ==== Examples
+  # @example
   #   &quot;foo_bar&quot;.camel_case #=&gt; &quot;FooBar&quot;
   def camel_case
     return self if self !~ /_/ &amp;&amp; self =~ /[A-Z]+.*/
     split('_').map{|e| e.capitalize}.join
   end
 
-  # ==== Returns
-  # String:: The path string converted to a constant name.
+  ##
+  # @return &lt;String&gt; The path string converted to a constant name.
   #
-  # ==== Examples
+  # @example
   #   &quot;merb/core_ext/string&quot;.to_const_string #=&gt; &quot;Merb::CoreExt::String&quot;
   def to_const_string
     gsub(/\/(.?)/) { &quot;::#{$1.upcase}&quot; }.gsub(/(?:^|_)(.)/) { $1.upcase }
   end
 
-  # ==== Returns
-  # String::
+  ##
+  # @return &lt;String&gt;
   #   The path that is associated with the constantized string, assuming a
   #   conventional structure.
   #
-  # ==== Examples
+  # @example
   #   &quot;FooBar::Baz&quot;.to_const_path # =&gt; &quot;foo_bar/baz&quot;
   def to_const_path
     snake_case.gsub(/::/, &quot;/&quot;)
   end
 
-  # ==== Parameters
-  # o&lt;String&gt;:: The path component to join with the string.
+  ##
+  # @param o&lt;String&gt; The path component to join with the string.
   #
-  # ==== Returns
-  # String:: The original path concatenated with o.
+  # @return &lt;String&gt; The original path concatenated with o.
   #
-  # ==== Examples
+  # @example
   #   &quot;merb&quot;/&quot;core_ext&quot; #=&gt; &quot;merb/core_ext&quot;
   def /(o)
     File.join(self, o.to_s)
   end
 
-  # ==== Parameters ====
-  # other&lt;String&gt;:: Base path to calculate against
+  ##
+  # @param other&lt;String&gt; Base path to calculate against
   #
-  # ==== Returns ====
-  # String:: Relative path from between the two
+  # @return &lt;String&gt; Relative path from between the two
   #
-  # ==== Example ====
-  # &quot;/opt/local/lib&quot;.relative_path_from(&quot;/opt/local/lib/ruby/site_ruby&quot;) # =&gt; &quot;../..&quot;
+  # @example
+  #   &quot;/opt/local/lib&quot;.relative_path_from(&quot;/opt/local/lib/ruby/site_ruby&quot;) # =&gt; &quot;../..&quot;
   def relative_path_from(other)
     Pathname.new(self).relative_path_from(Pathname.new(other)).to_s
   end
+  
 end</diff>
      <filename>lib/merb-core/core_ext/string.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,9 @@
 class Time
   
-  # ==== Returns
-  # String::
+  # @return &lt;String&gt;
   #   ISO 8601 compatible rendering of the Time object's properties.
   # 
-  # ==== Examples
+  # @example
   #   Time.now.to_json # =&gt; &quot;\&quot;2008-03-28T17:54:20-05:00\&quot;&quot;
   def to_json
     self.xmlschema.to_json</diff>
      <filename>lib/merb-core/core_ext/time.rb</filename>
    </modified>
    <modified>
      <diff>@@ -27,6 +27,7 @@ class Merb::Dispatcher
     def handle(rack_env)
       start   = Time.now
       request = Merb::Request.new(rack_env)
+      Merb.logger.info &quot;Start: #{start.to_s}&quot;
       
       route_index, route_params = Merb::Router.match(request)
       
@@ -71,7 +72,8 @@ class Merb::Dispatcher
       end      
 
       controller = dispatch_action(klass, action, request)
-      controller._benchmarks[:dispatch_time] = Time.now - start  
+      controller._benchmarks[:dispatch_time] = Time.now - start
+      controller.route = route
       Merb.logger.info controller._benchmarks.inspect
       Merb.logger.flush
 </diff>
      <filename>lib/merb-core/dispatch/dispatcher.rb</filename>
    </modified>
    <modified>
      <diff>@@ -195,10 +195,16 @@
 			    &lt;tr&gt;&lt;th width=&quot;25%&quot;&gt;Key&lt;/th&gt;&lt;th width=&quot;75%&quot;&gt;Value&lt;/th&gt;&lt;/tr&gt;
 		    &lt;/thead&gt;
 		    &lt;tbody&gt;			  			  
-    			&lt;% params[:original_session].each_with_index do |param_value, i| %&gt;
-            &lt;tr class=&quot;&lt;%= i % 2 == 0 ? &quot;even&quot; : &quot;odd&quot; %&gt;&quot;&gt;&lt;td&gt;&lt;%= param_value.first %&gt;&lt;/td&gt;&lt;td&gt;&lt;%= param_value.last.inspect %&gt;&lt;/td&gt;&lt;/tr&gt;
-    			&lt;% end %&gt;
-    			&lt;%= &quot;&lt;tr class='odd'&gt;&lt;td colspan='2'&gt;None&lt;/td&gt;&lt;/tr&gt;&quot; if params[:original_session].empty? %&gt;
+					&lt;% if params[:original_session].respond_to?( :data )%&gt;
+						&lt;% params[:original_session].data.each_with_index do |param_value, i| %&gt;
+				    &lt;tr class=&quot;&lt;%= i % 2 == 0 ? &quot;even&quot; : &quot;odd&quot; %&gt;&quot;&gt;&lt;td&gt;&lt;%= param_value.first %&gt;&lt;/td&gt;&lt;td&gt;&lt;%= param_value.last.inspect %&gt;&lt;/td&gt;&lt;/tr&gt;
+						&lt;% end %&gt;
+					&lt;% else %&gt;
+	    			&lt;% params[:original_session].each_with_index do |param_value, i| %&gt;
+	            &lt;tr class=&quot;&lt;%= i % 2 == 0 ? &quot;even&quot; : &quot;odd&quot; %&gt;&quot;&gt;&lt;td&gt;&lt;%= param_value.first %&gt;&lt;/td&gt;&lt;td&gt;&lt;%= param_value.last.inspect %&gt;&lt;/td&gt;&lt;/tr&gt;
+	    			&lt;% end %&gt;
+	    			&lt;%= &quot;&lt;tr class='odd'&gt;&lt;td colspan='2'&gt;None&lt;/td&gt;&lt;/tr&gt;&quot; if params[:original_session].empty? %&gt;
+					&lt;% end %&gt;
     		&lt;/tbody&gt;
 		  &lt;/table&gt;
 			</diff>
      <filename>lib/merb-core/dispatch/exceptions.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,15 +1,26 @@
+require 'tempfile'
+
 module Merb
   
   class Request
     # def env def session def route_params
     attr_accessor :env, :session, :route_params
     
-    # by setting these to false, auto-parsing is disabled; this way you can do your own parsing instead
-    cattr_accessor :parse_multipart_params, :parse_json_params, :parse_xml_params
+    # by setting these to false, auto-parsing is disabled; this way you can
+    # do your own parsing instead
+    cattr_accessor :parse_multipart_params, :parse_json_params,
+      :parse_xml_params
     self.parse_multipart_params = true
     self.parse_json_params = true
     self.parse_xml_params = true
     
+    # Most web browsers can't send PUT or DELETE requests
+    # Any Strings stored in this array will be used as paramaters
+    # to find the real method.  Common examples are _method and
+    # fb_sig_request_method 
+    cattr_accessor :browser_method_workarounds
+    self.browser_method_workarounds = []
+    
     # Initial the request object.
     #
     # ==== Parameters
@@ -27,8 +38,9 @@ module Merb
     # Symbol:: The name of the request method, e.g. :get.
     #
     # ==== Notes
-    # If the method is post, then the +_method+ param will be checked for
-    # masquerading method.
+    # If the method is post, then the params specified in
+    # browser_method_workarounds will be checked for the masquerading method.
+    # The first matching workaround wins.
     def method
       @method ||= begin
         request_method = @env['REQUEST_METHOD'].downcase.to_sym
@@ -37,9 +49,16 @@ module Merb
           request_method
         when :post
           if self.class.parse_multipart_params
-            m = body_and_query_params.merge(multipart_params)['_method']
+            p = body_and_query_params.merge(multipart_params)
           else  
-            m = body_and_query_params['_method']
+            p = body_and_query_params
+          end
+          m = nil
+          self.class.browser_method_workarounds.each do |workaround|
+            if p.include?(workaround.to_s)
+              m = p[workaround.to_s]
+              break
+            end
           end
           m.downcase! if m
           METHODS.include?(m) ? m.to_sym : :post
@@ -98,9 +117,9 @@ module Merb
     def multipart_params
       @multipart_params ||= 
         begin
-          # if the content-type is multipart and there's stuff in the body,
+          # if the content-type is multipart
           # parse the multipart. Otherwise return {}
-          if (Merb::Const::MULTIPART_REGEXP =~ content_type &amp;&amp; @body.size &gt; 0)
+          if (Merb::Const::MULTIPART_REGEXP =~ content_type)
             self.class.parse_multipart(@body, $1, content_length)
           else
             {}
@@ -113,10 +132,17 @@ module Merb
 
     # ==== Returns
     # Hash:: Parameters from body if this is a JSON request.
+    #
+    # ==== Notes
+    # If the JSON object parses as a Hash, it will be merged with the
+    # parameters hash.  If it parses to anything else (such as an Array, or
+    # if it inflates to an Object) it will be accessible via the inflated_object
+    # parameter.
     def json_params
       @json_params ||= begin
         if Merb::Const::JSON_MIME_TYPE_REGEXP.match(content_type)
-          JSON.parse(raw_post)
+          jobj = JSON.parse(raw_post)
+          jobj.kind_of?(Hash) ? jobj : { :inflated_object =&gt; jobj }
         end
       end
     end
@@ -211,9 +237,15 @@ module Merb
     end
     
     # ==== Returns
+    # String:: The full URI, including protocol and host
+    def full_uri
+      protocol + host + uri
+    end
+    
+    # ==== Returns
     # String:: The request URI.
     def uri
-      @env['REQUEST_URI'] || @env['REQUEST_PATH']
+      @env['REQUEST_PATH'] || @env['REQUEST_URI']
     end
 
     # ==== Returns
@@ -366,7 +398,7 @@ module Merb
     class &lt;&lt; self
       
       # ==== Parameters
-      # value&lt;Array, Hash, ~to_s&gt;:: The value for the query string.
+      # value&lt;Array, Hash, Dictionary ~to_s&gt;:: The value for the query string.
       # prefix&lt;~to_s&gt;:: The prefix to add to the query string keys.
       #
       # ==== Returns
@@ -390,7 +422,7 @@ module Merb
           value.map { |v|
             params_to_query_string(v, &quot;#{prefix}[]&quot;)
           } * &quot;&amp;&quot;
-        when Hash
+        when Hash, Dictionary
           value.map { |k, v|
             params_to_query_string(v, prefix ? &quot;#{prefix}[#{Merb::Request.escape(k)}]&quot; : Merb::Request.escape(k))
           } * &quot;&amp;&quot;
@@ -424,18 +456,21 @@ module Merb
       # ==== Parameters
       # qs&lt;String&gt;:: The query string.
       # d&lt;String&gt;:: The query string divider. Defaults to &quot;&amp;&quot;.
+      # preserve_order&lt;Boolean&gt;:: Preserve order of args. Defaults to false.
       #
       # ==== Returns
-      # Mash:: The parsed query string.
+      # Mash:: The parsed query string (Dictionary if preserve_order is set).
       #
       # ==== Examples
       #   query_parse(&quot;bar=nik&amp;post[body]=heya&quot;)
       #     # =&gt; { :bar =&gt; &quot;nik&quot;, :post =&gt; { :body =&gt; &quot;heya&quot; } }
-      def query_parse(qs, d = '&amp;;')
-        (qs||'').split(/[#{d}] */n).inject({}) { |h,p| 
+      def query_parse(qs, d = '&amp;;', preserve_order = false)
+        qh = preserve_order ? Dictionary.new : {}
+        (qs||'').split(/[#{d}] */n).inject(qh) { |h,p| 
           key, value = unescape(p).split('=',2)
           normalize_params(h, key, value)
-        }.to_mash
+        }
+        preserve_order ? qh : qh.to_mash
       end
     
       NAME_REGEX = /Content-Disposition:.* name=&quot;?([^\&quot;;]*)&quot;?/ni.freeze
@@ -464,6 +499,7 @@ module Merb
         bufsize = 16384
         content_length -= boundary_size
         status = input.read(boundary_size)
+        return {} if status == nil || status.empty?
         raise ControllerExceptions::MultiPartParseError, &quot;bad content body:\n'#{status}' should == '#{boundary + EOL}'&quot;  unless status == boundary + EOL
         rx = /(?:#{EOL})?#{Regexp.quote(boundary,'n')}(#{EOL}|--)/
         loop {</diff>
      <filename>lib/merb-core/dispatch/request.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,18 +3,39 @@ require 'merb-core/dispatch/router/behavior'
 require 'merb-core/dispatch/router/route'
 require 'merb-core/controller/mixins/responder'
 module Merb
+  # Router stores route definitions and finds first
+  # that matches incoming request URL.
+  #
+  # Then information from route is used by dispatcher to
+  # call action on the controller.
+  #
+  # ==== Routes compilation.
+  #
+  # Most interesting method of Router (and heart of
+  # route matching machinery) is match method generated
+  # on fly from routes definitions. It is called routes
+  # compilation. Generated match method body contains
+  # one if/elsif statement that picks first matching route
+  # definition and sets values to named parameters of the route.
+  #
+  # Compilation is synchronized by mutex.
   class Router
     SEGMENT_REGEXP = /(:([a-z_][a-z0-9_]*|:))/
     SEGMENT_REGEXP_WITH_BRACKETS = /(:[a-z_]+)(\[(\d+)\])?/
     JUST_BRACKETS = /\[(\d+)\]/
     PARENTHETICAL_SEGMENT_STRING = &quot;([^\/.,;?]+)&quot;.freeze
-    
+
     @@named_routes = {}
     @@routes = []
     @@compiler_mutex = Mutex.new
     cattr_accessor :routes, :named_routes
-    
+
     class &lt;&lt; self
+      
+      # Clear all routes.
+      def reset!
+        self.routes, self.named_routes = [], {}
+      end
 
       # Appends the generated routes to the current routes.
       #
@@ -50,6 +71,18 @@ module Merb
         compile
       end
 
+      # Capture any new routes that have been added within the block.
+      #
+      # This utility method lets you track routes that have been added;
+      # it doesn't affect how/which routes are added.
+      #
+      # &amp;block:: A context in which routes are generated.
+      def capture(&amp;block)
+        routes_before, named_route_keys_before = self.routes.dup, self.named_routes.keys
+        yield
+        [self.routes - routes_before, self.named_routes.except(*named_route_keys_before)]
+      end
+
       # ==== Returns
       # String:: A routing lambda statement generated from the routes.
       def compiled_statement
@@ -68,14 +101,14 @@ module Merb
       # compiled_statement.
       def compile
         puts &quot;compiled route: #{compiled_statement}&quot; if $DEBUG
-        eval(compiled_statement, binding, __FILE__, __LINE__)
+        eval(compiled_statement, binding, &quot;Generated Code for Router#match(#{__FILE__}:#{__LINE__})&quot;, 1)
       end
 
       # Generates a URL based on passed options.
       #
       # ==== Parameters
       # name&lt;~to_sym, Hash&gt;:: The name of the route to generate.
-      # params&lt;Hash&gt;:: The params to use in the route generation.
+      # params&lt;Hash, Fixnum, Object&gt;:: The params to use in the route generation.
       # fallback&lt;Hash&gt;:: Parameters for generating a fallback URL.
       #
       # ==== Returns
@@ -85,7 +118,9 @@ module Merb
       # If name is a hash, it will be merged with params and passed on to
       # generate_for_default_route along with fallback.
       def generate(name, params = {}, fallback = {})
+        params.reject! { |k,v| v.nil? } if params.is_a? Hash
         if name.is_a? Hash
+          name.reject! { |k,v| v.nil? }
           return generate_for_default_route(name.merge(params), fallback)
         end
         name = name.to_sym
@@ -139,6 +174,6 @@ module Merb
         url
       end
     end # self
-    
+
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/merb-core/dispatch/router.rb</filename>
    </modified>
    <modified>
      <diff>@@ -108,8 +108,19 @@ module Merb
       #   within the regular expression syntax.
       #   +path+ is optional.
       # conditions&lt;Hash&gt;::
-      #   This optional hash helps refine the settings for the route.
-      #   When combined with a block it can help keep your routes DRY
+      #   Addational conditions that the request must meet in order to match.
+      #   the keys must be methods that the Merb::Request instance will respond
+      #   to.  The value is the string or regexp that matched the returned value.
+      #   Conditions are inherited by child routes.
+      #
+      #   The Following have special meaning:
+      #   * :method -- Limit this match based on the request method. (GET,
+      #     POST, PUT, DELETE)
+      #   * :path -- Used internally to maintain URL form information
+      #   * :controller and :action -- These can be used here instead of '#to', and
+      #     will be inherited in the block.
+      #   * :params -- Sets other key/value pairs that are placed in the params
+      #     hash. The value must be a hash.
       # &amp;block::
       #   Passes a new instance of a Behavior object into the optional block so
       #   that sub-matching and routes nesting may occur.
@@ -124,20 +135,28 @@ module Merb
       # ==== Examples
       #
       #   # registers /foo/bar to controller =&gt; &quot;foo&quot;, :action =&gt; &quot;bar&quot;
-      #   # and /foo/baz to controller =&gt; &quot;foo&quot;, :action =&gt; &quot;caz&quot;
-      #   r.match &quot;/foo&quot;, :controller =&gt; &quot;foo&quot; do |f|
+      #   # and /foo/baz to controller =&gt; &quot;foo&quot;, :action =&gt; &quot;baz&quot;
+      #   r.match &quot;/foo&quot;, :controller=&gt;&quot;foo&quot; do |f|
       #     f.match(&quot;/bar&quot;).to(:action =&gt; &quot;bar&quot;)
       #     f.match(&quot;/baz&quot;).to(:action =&gt; &quot;caz&quot;)
       #   end
       #
-      #   r.match &quot;/foo&quot;, :controller =&gt; &quot;foo&quot; do |f|
-      #     f.match(&quot;/bar&quot;, :action =&gt; &quot;bar&quot;)
-      #     f.match(&quot;/baz&quot;, :action =&gt; &quot;caz&quot;)
-      #   end # =&gt; doesn't register any routes at all
+      #   #match only of the browser string contains MSIE or Gecko
+      #   r.match ('/foo', :user_agent =&gt; /(MSIE|Gecko)/ )
+      #        .to({:controller=&gt;'foo', :action=&gt;'popular')
+      #
+      #   # Route GET and POST requests to different actions (see also #resources)
+      #   r.match('/foo', :method=&gt;:get).to(:action=&gt;'show')
+      #   r.mathc('/foo', :method=&gt;:post).to(:action=&gt;'create')
       #
       #   # match also takes regular expressions
+      #
       #   r.match(%r[/account/([a-z]{4,6})]).to(:controller =&gt; &quot;account&quot;,
       #      :action =&gt; &quot;show&quot;, :id =&gt; &quot;[1]&quot;)
+      #
+      #   r.match(/\/?(en|es|fr|be|nl)?/).to(:language =&gt; &quot;[1]&quot;) do |l|
+      #     l.match(&quot;/guides/:action/:id&quot;).to(:controller =&gt; &quot;tour_guides&quot;)
+      #   end
       #---
       # @public
       def match(path = '', conditions = {}, &amp;block)
@@ -161,8 +180,10 @@ module Merb
       # ==== Returns
       # Behavior:: The new behavior.
       def match_without_path(conditions = {})
-        new_behavior = self.class.new(conditions, {}, self)
-        conditions.delete :path if ['', '^$'].include?(conditions[:path])
+        params = conditions.delete(:params) || {} #parents params will be merged  in Route#new
+        params[:controller] = conditions.delete(:controller) if conditions[:controller]
+        params[:action] = conditions.delete(:action) if conditions[:action]
+        new_behavior = self.class.new(conditions, params, self)
         yield new_behavior if block_given?
         new_behavior
       end
@@ -178,6 +199,22 @@ module Merb
         Route.new compiled_conditions, compiled_params, self, &amp;conditional_block
       end
 
+      # Combines common case of match being used with
+      # to({}).
+      #
+      # ==== Returns
+      # &lt;Route&gt;:: route that uses params from named path segments.
+      #
+      # ==== Examples
+      # r.match!(&quot;/api/:token/:controller/:action/:id&quot;)
+      #
+      # is the same thing as
+      #
+      # r.match!(&quot;/api/:token/:controller/:action/:id&quot;).to({})
+      def match!(path = '', conditions = {}, &amp;block)
+        self.match(path, conditions, &amp;block).to({})
+      end
+
       # Creates a Route from one or more Behavior objects, unless a +block+ is
       # passed in.
       #
@@ -286,11 +323,11 @@ module Merb
       #     admin.resources :accounts
       #     admin.resource :email
       #   end
-      # 
+      #
       #   # /super_admin/accounts
       #   r.namespace(:admin, :path=&gt;&quot;super_admin&quot;) do |admin|
       #     admin.resources :accounts
-      #   end 
+      #   end
       #---
       # @public
       def namespace(name_or_path, options={}, &amp;block)
@@ -470,11 +507,11 @@ module Merb
         if name_prefix.nil? &amp;&amp; !namespace.nil?
           name_prefix = namespace_to_name_prefix namespace
         end
-        
+
         unless @@parent_resource.empty?
           parent_resource = namespace_to_name_prefix @@parent_resource.join('_')
         end
-        
+
         routes = next_level.to_resource options
 
         route_name = &quot;#{name_prefix}#{name}&quot;
@@ -586,6 +623,23 @@ module Merb
         @conditions_have_regexp
       end
 
+      def redirect(url, permanent = true)
+        @redirects       = true
+        @redirect_url    = url
+        @redirect_status = permanent ? 301 : 302
+
+        # satisfy route compilation
+        self.to({})
+      end
+
+      def redirects?
+        @redirects
+      end
+      
+      def ancestors
+        @ancestors ||= find_ancestors
+      end
+
     protected
 
       # ==== Parameters
@@ -693,12 +747,12 @@ module Merb
       #
       # ==== Returns
       # Array:: All the ancestor behaviors of this behavior.
-      def ancestors(list = [])
+      def find_ancestors(list = [])
         if parent.nil?
           list
         else
           list.push parent
-          parent.ancestors list
+          parent.find_ancestors list
           list
         end
       end
@@ -749,7 +803,7 @@ module Merb
         compiled = {}
         params.each_pair do |key, value|
           unless value.is_a? String
-            raise ArgumentError, &quot;param value must be string (#{value.inspect})&quot;
+            raise ArgumentError, &quot;param value for #{key.to_s} must be string (#{value.inspect})&quot;
           end
           result = []
           value = value.dup</diff>
      <filename>lib/merb-core/dispatch/router/behavior.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,98 @@
 require 'merb-core/controller/mixins/responder'
 module Merb
-  
-  class Router
 
+  class Router
+    # Route instances incapsulate information about particular route
+    # definition. Route definition ties
+    # number of conditions (URL match, HTTP request method) with
+    # resulting hash of route parameters:
+    # controller, action, format and named parameters
+    # from the URL.
+    #
+    # The following routes definition:
+    #
+    # Merb::Router.prepare do |r|
+    #   r.match(&quot;api/:action/:token.:format&quot;).to(:controller =&gt; &quot;dev&quot;).fixatable
+    # end
+    #
+    # maps URL matching pattern to controller named &quot;dev&quot;
+    # and specifies fixation for that route. Path and request method are
+    # route conditions, controller name, action name, format and
+    # value of segment we decided to call :token are route parameters.
+    #
+    # ==== How route definitions are used.
+    #
+    # When routes are compiled, each route produces
+    # a string with eval-able if/elsif condition statement.
+    # This statement together with others constructs body
+    # of Merb::Router.match method.
+    # Condition statements are Ruby code in form of string.
+    #
+    # ==== Segments.
+    #
+    # Route definitions use conventional syntax for named parameters.
+    # This splits route path into segments. Static (not changing) segments
+    # represented internally as strings, named parameters are stored
+    # as symbols and called symbol segments. Symbol segments
+    # map to groups in regular expression in resulting condition statement.
+    #
+    # ==== Route conditions.
+    #
+    # Because route conditions include path matching,
+    # regular expression is created from string that uses
+    # :segment format to fetch groups and assign them to
+    # named parameters. This regular expression is used
+    # to produce compiled statement mentioned above.
+    #
+    # Route conditions may also include
+    # user agent. Symbol segments
+    #
+    # Here is example of Route conditions:
+    # {
+    #   :path =&gt; /^\/continents\/?(\.([^\/.,;?]+))?$/,
+    #   :method =&gt; /^get$/
+    # }
+    #
+    #
+    # ==== Route parameters.
+    #
+    # Route parameters is a Hash with controller name,
+    # action name and parameters key/value pairs.
+    # It is then merged with request.params hash.
+    #
+    # Example of route parameters:
+    #
+    # {
+    #   :action =&gt; &quot;\&quot;index\&quot;&quot;,
+    #   :format =&gt; &quot;path2&quot;,
+    #   :controller =&gt; &quot;\&quot;continents\&quot;&quot;
+    # }
+    #
+    # Router takes first matching route and uses it's parameters
+    # to dispatch request to certain controller and action.
+    #
+    # ==== Behavior
+    #
+    # Each route has utility collaborator called behavior
+    # that incapsulates additional information about route
+    # (like namespace or if route is deferred) and also
+    # provides utility methods.
+    #
+    # ==== Route registration.
+    #
+    # When route is added to set of routes, it is called route
+    # registration. Registred route knows it's index in routes set.
+    #
+    # ==== Fixation
+    # Fixatable routes allow setting of session key from GET params
+    # found in incoming request. This is very useful to allow certain
+    # URLs to be used by rich media applications and other kinds
+    # of clients that have no other way of passing session identifier.
+    #
+    # ==== Conditional block.
+    # Conditional block is anonymous function that is evaluated
+    # when deferred routes are processed. Unless route is deferred,
+    # it has no condition block.
     class Route
       attr_reader :conditions, :conditional_block
       attr_reader :params, :behavior, :segments, :index, :symbol
@@ -13,7 +103,7 @@ module Merb
       # behavior&lt;Merb::Router::Behavior&gt;::
       #   The associated behavior. Defaults to nil.
       # &amp;conditional_block::
-      #		A block with the conditions to be met for the route to take effect.
+      #   A block with the conditions to be met for the route to take effect.
       def initialize(conditions, params, behavior = nil, &amp;conditional_block)
         @conditions, @params, @behavior = conditions, params, behavior
         @conditional_block = conditional_block
@@ -25,17 +115,20 @@ module Merb
 
       # ==== Returns
       # Boolean:: True if fixation is allowed.
-      def allow_fixation? 
+      def allow_fixation?
         @fixation
-      end 
-         
+      end
+
       # ==== Parameters
       # enabled&lt;Boolean&gt;:: True enables fixation on the route.
-      def fixatable(enable=true) 
-        @fixation = enable 
+      def fixatable(enable=true)
+        @fixation = enable
         self
       end
 
+      # Concatenates all route segments and returns result.
+      # Symbol segments have colon preserved.
+      #
       # ==== Returns
       # String:: The route as a string, e.g. &quot;admin/:controller/:id&quot;.
       def to_s
@@ -43,20 +136,21 @@ module Merb
           str &lt;&lt; (seg.is_a?(Symbol) ? &quot;:#{seg}&quot; : seg)
         end
       end
-      
+
       # Registers the route in the Router.routes array.
+      # After registration route has index.
       def register
         @index = Router.routes.size
         Router.routes &lt;&lt; self
         self
       end
-      
+
       # ==== Returns
       # Array:: All the symbols in the segments array.
       def symbol_segments
         segments.select{ |s| s.is_a?(Symbol) }
       end
-      
+
       # Turn a path into string and symbol segments so it can be reconstructed,
       # as in the case of a named route.
       #
@@ -77,8 +171,8 @@ module Merb
         segments &lt;&lt; strip[path] unless path.empty?
         segments
       end
-      
-      # Names this route in Router.
+
+      # Names this route in Router. Name must be a Symbol.
       #
       # ==== Parameters
       # symbol&lt;Symbol&gt;:: The name of the route.
@@ -95,9 +189,12 @@ module Merb
       #   True if this route is a regexp, i.e. its behavior or one of the
       #   behavior's ancestors is a regexp.
       def regexp?
-        behavior.regexp? || behavior.send(:ancestors).any? { |a| a.regexp? }
+        @regexp ||= behavior.regexp? || behavior.ancestors.any? { |a| a.regexp? }
       end
-      
+
+      # Generates URL using route segments and given parameters.
+      # If parameter value responds to :to_param, it is called.
+      #
       # ==== Parameters
       # params&lt;Hash&gt;:: Optional parameters for the route.
       # fallback&lt;Hash&gt;:: Optional parameters for the fallback route.
@@ -116,7 +213,7 @@ module Merb
                 params[segment] || fallback[segment]
                 query_params.delete segment
               else
-                if segment == :id &amp;&amp; params.respond_to?(:to_param) 
+                if segment == :id &amp;&amp; params.respond_to?(:to_param)
                   params.to_param
                 elsif segment == :id &amp;&amp; params.is_a?(Fixnum)
                   params
@@ -143,6 +240,9 @@ module Merb
         url
       end
 
+      # Generates and returns if statement used to
+      # construct final condition statement of the route.
+      #
       # ==== Params
       # params_as_string&lt;String&gt;::
       #   The params hash as a string, e.g. &quot;:foo =&gt; 'bar'&quot;.
@@ -158,7 +258,7 @@ module Merb
           &quot; (#{value.inspect} =~ #{regexp_string}) #{&quot; &amp;&amp; (&quot; + captures + &quot;)&quot; unless captures.empty?}&quot;
         end
         @conditions.each_pair do |key, value|
-          
+
           # Note: =~ is slightly faster than .match
           cond &lt;&lt; case key
           when :path then condition_string[key, value, &quot;cached_path&quot;]
@@ -174,7 +274,8 @@ module Merb
         cond
       end
 
-      # Compiles the route to a form used by Merb::Router.
+      # Compiles the route to a form used by Merb::Router. This form sometimes
+      # referred as condition statement of the route.
       #
       # ==== Parameters
       # first&lt;Boolean&gt;::
@@ -214,4 +315,4 @@ module Merb
       end
     end # Route
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/merb-core/dispatch/router/route.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,9 @@
 module Merb
   
   module SessionMixin
-
+    @_finalize_session_exception_callbacks = []
+    @_persist_exception_callbacks = []
+    
     # ==== Returns
     # String:: A random 32 character string for use as a unique session ID.
     def rand_uuid
@@ -22,7 +24,23 @@ module Merb
       @_new_cookie = true
     end
     
-    module_function :rand_uuid, :needs_new_cookie!
+    def finalize_session_exception_callbacks(&amp;block)
+      if block_given?
+        @_finalize_session_exception_callbacks &lt;&lt; block
+      else
+        @_finalize_session_exception_callbacks
+      end
+    end
+    
+    def persist_exception_callbacks(&amp;block)
+      if block_given?
+        @_persist_exception_callbacks &lt;&lt; block
+      else
+        @_persist_exception_callbacks
+      end
+    end
+    
+    module_function :rand_uuid, :needs_new_cookie!, :finalize_session_exception_callbacks, :persist_exception_callbacks
   end
 
 end
\ No newline at end of file</diff>
      <filename>lib/merb-core/dispatch/session.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ require 'openssl'       # to generate the HMAC message digest
 # Most of this code is taken from bitsweat's implementation in rails
 module Merb
 
-  module SessionMixin #:nodoc:
+  module SessionMixin
 
     # Adds a before and after dispatch hook for setting up the cookie session
     # store.
@@ -20,7 +20,9 @@ module Merb
     def finalize_session
       new_session = request.session.read_cookie
       if @original_session != new_session
-        cookies.set_cookie(_session_id_key, new_session, :expires =&gt; (Time.now + _session_expiry))
+        options = {:expires =&gt; (Time.now + _session_expiry)}
+        options[:domain] = _session_cookie_domain if _session_cookie_domain
+        cookies.set_cookie(_session_id_key, new_session, options)
       end
     end
 </diff>
      <filename>lib/merb-core/dispatch/session/cookie.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 module Merb
 
-  module SessionMixin #:nodoc:
+  module SessionMixin
 
     # Adds a before and after dispatch hook for setting up the memcached
     # session store.
@@ -16,15 +16,18 @@ module Merb
 
     # Finalizes the session by storing the session ID in a cookie, if the
     # session has changed.
-    def finalize_session 
+    def finalize_session
       if @_fingerprint != Marshal.dump(request.session.data).hash
         begin
           CACHE.set(&quot;session:#{request.session.session_id}&quot;, request.session.data)
         rescue =&gt; err
           Merb.logger.debug(&quot;MemCache Error: #{err.message}&quot;)
+          Merb::SessionMixin::finalize_session_exception_callbacks.each {|x| x.call(err) }
         end
       end
-      set_cookie(_session_id_key, request.session.session_id, Time.now + _session_expiry) if (@_new_cookie || request.session.needs_new_cookie)
+      options = {:expires =&gt; (Time.now + _session_expiry)}
+      options[:domain] = _session_cookie_domain if _session_cookie_domain
+      set_cookie(_session_id_key, request.session.session_id, options) if (@_new_cookie || request.session.needs_new_cookie)
     end
 
     # ==== Returns
@@ -82,12 +85,17 @@ module Merb
       # Array::
       #   A pair consisting of a MemCacheSession and the session's ID. If no
       #   sessions matched session_id, a new MemCacheSession will be generated.
+      #
+      # ==== Notes
+      # If there are persiste exceptions callbacks to execute, they all get executed
+      # when Memcache library raises an exception.
       def persist(session_id)
         unless session_id.blank?
           begin
             session = CACHE.get(&quot;session:#{session_id}&quot;)
           rescue =&gt; err
             Merb.logger.debug(&quot;MemCache Error: #{err.message}&quot;)
+            Merb::SessionMixin::persist_exception_callbacks.each {|x| x.call(err) }
           end
           if session.nil?
             # Not in memcached, but assume that cookie exists
@@ -108,27 +116,27 @@ module Merb
       end
 
       # Don't try to reload in dev mode.
-      def reloadable? #:nodoc:
+      def reloadable?
         false
       end
 
     end
 
     # Regenerate the session ID.
-    def regenerate 
-      @session_id = Merb::SessionMixin::rand_uuid 
-      self.needs_new_cookie=true 
-    end 
-      
+    def regenerate
+      @session_id = Merb::SessionMixin::rand_uuid
+      self.needs_new_cookie=true
+    end
+
     # Recreates the cookie with the default expiration time. Useful during log
     # in for pushing back the expiration date.
-    def refresh_expiration 
-      self.needs_new_cookie=true 
-    end 
-     
+    def refresh_expiration
+      self.needs_new_cookie=true
+    end
+
     # Deletes the session by emptying stored data.
-    def delete  
-      @data = {} 
+    def delete
+      @data = {}
     end
 
     # ==== Returns
@@ -136,11 +144,11 @@ module Merb
     def loaded?
       !! @data
     end
-    
+
     # ==== Parameters
     # k&lt;~to_s&gt;:: The key of the session parameter to set.
     # v&lt;~to_s&gt;:: The value of the session parameter to set.
-    def []=(k, v) 
+    def []=(k, v)
       @data[k] = v
     end
 
@@ -149,18 +157,18 @@ module Merb
     #
     # ==== Returns
     # String:: The value of the session parameter.
-    def [](k) 
-      @data[k] 
+    def [](k)
+      @data[k]
     end
 
     # Yields the session data to an each block.
     #
     # ==== Parameter
     # &amp;b:: The block to pass to each.
-    def each(&amp;b) 
-      @data.each(&amp;b) 
+    def each(&amp;b)
+      @data.each(&amp;b)
     end
-    
+
     private
 
     # Attempts to redirect any messages to the data object.
@@ -170,4 +178,4 @@ module Merb
 
   end
 
-end
\ No newline at end of file
+end</diff>
      <filename>lib/merb-core/dispatch/session/memcached.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 module Merb
 
-  module SessionMixin #:nodoc:
+  module SessionMixin
 
     # Adds a before and after dispatch hook for setting up the memory session
     # store.
@@ -16,7 +16,9 @@ module Merb
     # Finalizes the session by storing the session ID in a cookie, if the
     # session has changed.
     def finalize_session
-      set_cookie(_session_id_key, request.session.session_id, Time.now + _session_expiry) if (@_new_cookie || request.session.needs_new_cookie)
+      options = {:expires =&gt; (Time.now + _session_expiry)}
+      options[:domain] = _session_cookie_domain if _session_cookie_domain
+      set_cookie(_session_id_key, request.session.session_id, options) if (@_new_cookie || request.session.needs_new_cookie)
     end
 
     # ==== Returns</diff>
      <filename>lib/merb-core/dispatch/session/memory.rb</filename>
    </modified>
    <modified>
      <diff>@@ -33,7 +33,7 @@ require &quot;time&quot; # httpdate
 #   Merb::Logger.new(log{String, IO},level{Symbol, String})
 module Merb
 
-  class &lt;&lt; self #:nodoc:
+  class &lt;&lt; self
     attr_accessor :logger
   end
 </diff>
      <filename>lib/merb-core/logger.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,9 +7,12 @@ module Merb
     autoload :EventedMongrel, &quot;merb-core/rack/adapter/evented_mongrel&quot;    
     autoload :FastCGI,        &quot;merb-core/rack/adapter/fcgi&quot;
     autoload :Irb,            &quot;merb-core/rack/adapter/irb&quot;
+    autoload :Middleware,     &quot;merb-core/rack/middleware&quot;
     autoload :Mongrel,        &quot;merb-core/rack/adapter/mongrel&quot;
     autoload :Runner,         &quot;merb-core/rack/adapter/runner&quot;    
     autoload :Thin,           &quot;merb-core/rack/adapter/thin&quot;
     autoload :WEBrick,        &quot;merb-core/rack/adapter/webrick&quot;
+    autoload :PathPrefix,     &quot;merb-core/rack/apps/path_prefix&quot;
+    autoload :Static,         &quot;merb-core/rack/apps/static&quot;
   end # Rack
 end # Merb
\ No newline at end of file</diff>
      <filename>lib/merb-core/rack.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,33 +9,43 @@ module Merb
       # String:: The generated URL.
       #
       # ==== Alternatives
-      # If name is a hash, it will be merged with params.      
+      # If name is a hash, it will be merged with params.
       def url(name, params={})
         Merb::Router.generate(name, params)
       end
-      
+
       # Reloads classes using Merb::BootLoader::ReloadClasses.
       def reload!
         Merb::BootLoader::ReloadClasses.reload
       end
-      
+
       # Prints all routes for the application.
       def show_routes
         seen = []
         unless Merb::Router.named_routes.empty?
-          puts &quot;Named Routes&quot;
+          puts &quot;==== Named routes&quot;
           Merb::Router.named_routes.each do |name,route|
-            puts &quot;  #{name}: #{route}&quot;
+            # something weird happens when you combine sprintf and irb
+            puts &quot;Helper     : #{name}&quot;
+            meth = $1.upcase if route.conditions[:method].to_s =~ /(get|post|put|delete)/
+            puts &quot;HTTP method: #{meth || 'GET'}&quot;
+            puts &quot;Route      : #{route}&quot;
+            puts &quot;Params     : #{route.params.inspect}&quot;
+            puts
             seen &lt;&lt; route
           end
         end
-        puts &quot;Anonymous Routes&quot;
+        puts &quot;==== Anonymous routes&quot;
         (Merb::Router.routes - seen).each do |route|
-          puts &quot;  #{route}&quot;
+          meth = $1.upcase if route.conditions[:method].to_s =~ /(get|post|put|delete)/
+          puts &quot;HTTP method: #{meth || 'GET'}&quot;
+          puts &quot;Route      : #{route}&quot;
+          puts &quot;Params     : #{route.params.inspect}&quot;
+          puts
         end
         nil
       end
-      
+
       # Starts a sandboxed session (delegates to any Merb::Orms::* modules).
       #
       # An ORM should implement Merb::Orms::MyOrm#open_sandbox! to support this.
@@ -45,7 +55,7 @@ module Merb
         puts &quot;Any modifications you make will be rolled back on exit&quot;
         orm_modules.each { |orm| orm.open_sandbox! if orm.respond_to?(:open_sandbox!) }
       end
-      
+
       # Ends a sandboxed session (delegates to any Merb::Orms::* modules).
       #
       # An ORM should implement Merb::Orms::MyOrm#close_sandbox! to support this.
@@ -54,14 +64,14 @@ module Merb
         orm_modules.each { |orm| orm.close_sandbox! if orm.respond_to?(:close_sandbox!) }
         puts &quot;Modifications have been rolled back&quot;
       end
-      
+
       # Explictly show logger output during IRB session
       def trace_log!
         Merb.logger.auto_flush = true
       end
-      
+
       private
-      
+
       # ==== Returns
       # Array:: All Merb::Orms::* modules.
       def orm_modules
@@ -71,7 +81,7 @@ module Merb
           []
         end
       end
-      
+
     end
 
     class Irb
@@ -85,11 +95,11 @@ module Merb
       def self.start(opts={})
         m = Merb::Rack::Console.new
         m.extend Merb::Test::RequestHelper
-        Object.send(:define_method, :merb) { m }  
-        ARGV.clear # Avoid passing args to IRB 
+        Object.send(:define_method, :merb) { m }
+        ARGV.clear # Avoid passing args to IRB
         m.open_sandbox! if sandboxed?
-        require 'irb' 
-        require 'irb/completion' 
+        require 'irb'
+        require 'irb/completion'
         if File.exists? &quot;.irbrc&quot;
           ENV['IRBRC'] = &quot;.irbrc&quot;
         end
@@ -97,12 +107,12 @@ module Merb
         at_exit do merb.close_sandbox! if sandboxed? end
         exit
       end
-      
+
       private
-      
+
       def self.sandboxed?
         Merb::Config[:sandbox]
-      end      
+      end
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/merb-core/rack/adapter/irb.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,93 +1,18 @@
-module Merb
-  
+module Merb  
   module Rack
-
     class Application
-      # ==== Parameters
-      # options&lt;Hash&gt;::
-      #   Options for creating a new application. Currently ignored.
-      def initialize(options={})
-        @static_server = ::Rack::File.new Merb.dir_for(:public)
-        if prefix = ::Merb::Config[:path_prefix]
-          @path_prefix = /^#{Regexp.escape(prefix)}/
-        end
-      end
       
-      # ==== Parameters
-      # env&lt;Hash&gt;:: Environment variables to pass on to the application.
-      #
-      # ==== Returns
-      # true or false::
-      def deferred?(env)
-        strip_path_prefix(env) if @path_prefix  # Strip out the path_prefix if one was set 
-        path = env['PATH_INFO'] ? env['PATH_INFO'].chomp('/') : &quot;&quot;
-        if path =~ Merb.deferred_actions
-          Merb.logger.info! &quot;Deferring Request: #{path}&quot;
-          true
-        else
-          false
-        end    
-      end
-      
-      # ==== Parameters
-      # env&lt;Hash&gt;:: Environment variables to pass on to the application.
-      #
-      # ==== Returns
-      # Array[Array]::
-      #   A 3 element tuple consisting of response status, headers and body.
       def call(env) 
-        strip_path_prefix(env) if @path_prefix  # Strip out the path_prefix if one was set 
-        path = env['PATH_INFO'] ? env['PATH_INFO'].chomp('/') : &quot;&quot;
-        cached_path = (path.empty? ? 'index' : path) + '.html'
-        Merb.logger.info &quot;Request: #{path}&quot;
-        if file_exist?(path) &amp;&amp; env['REQUEST_METHOD'] =~ /GET|HEAD/ # Serve the file if it's there and the request method is GET or HEAD
-          serve_static(env)
-        elsif file_exist?(cached_path) &amp;&amp; env['REQUEST_METHOD'] =~ /GET|HEAD/ # Serve the page cache if it's there and the request method is GET or HEAD
-          env['PATH_INFO'] = cached_path
-          serve_static(env)
-        else                              # No static file, let Merb handle it
-          if path =~ /favicon\.ico/
-            return [404, {&quot;Content-Type&quot;=&gt;&quot;text/html&quot;}, &quot;404 Not Found.&quot;]
-          end  
-          begin
-            controller = ::Merb::Dispatcher.handle(env)
-          rescue Object =&gt; e
-            return [500, {&quot;Content-Type&quot;=&gt;&quot;text/html&quot;}, e.message + &quot;&lt;br/&gt;&quot; + e.backtrace.join(&quot;&lt;br/&gt;&quot;)]
-          end
-          Merb.logger.info &quot;\n\n&quot;
-          Merb.logger.flush
-          [controller.status, controller.headers, controller.body]
-        end
-      end
-
-      # ==== Parameters
-      # path&lt;String&gt;:: The path to the file relative to the server root.
-      #
-      # ==== Returns
-      # Boolean:: True if file exists under the server root and is readable.
-      def file_exist?(path)
-        full_path = ::File.join(@static_server.root, ::Merb::Request.unescape(path))
-        ::File.file?(full_path) &amp;&amp; ::File.readable?(full_path)
-      end
-
-      # ==== Parameters
-      # env&lt;Hash&gt;:: Environment variables to pass on to the server.
-      def serve_static(env)
-        env[&quot;PATH_INFO&quot;] = ::Merb::Request.unescape(env[&quot;PATH_INFO&quot;])        
-        @static_server.call(env)
-      end
-      
-      # ==== Parameters
-      # env&lt;Hash&gt;:: Environment variables to pass on to the server.
-      def strip_path_prefix(env)
-        ['PATH_INFO', 'REQUEST_URI'].each do |path_key|
-          if env[path_key] =~ @path_prefix
-            env[path_key].sub!(@path_prefix, '')
-            env[path_key] = '/' if env[path_key].empty?
-          end
+        begin
+          controller = ::Merb::Dispatcher.handle(env)
+        rescue Object =&gt; e
+          return [500, {&quot;Content-Type&quot;=&gt;&quot;text/html&quot;}, e.message + &quot;&lt;br/&gt;&quot; + e.backtrace.join(&quot;&lt;br/&gt;&quot;)]
         end
+        Merb.logger.info &quot;\n\n&quot;
+        Merb.logger.flush
+        [controller.status, controller.headers, controller.body]
       end
       
     end
   end  
-end    
\ No newline at end of file
+end</diff>
      <filename>lib/merb-core/rack/application.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,25 +22,34 @@ module Merb
         @cluster = cluster
         if @cluster
           @port.to_i.upto(@port.to_i + @cluster.to_i-1) do |port|
+            pidfile = pid_file(port)
+            pid = IO.read(pidfile).chomp.to_i if File.exist?(pidfile)
+
             unless alive?(port)
               remove_pid_file(port)
-              puts &quot;Starting merb server on port: #{port}&quot;
+              puts &quot;Starting merb server on port #{port}, pid file: #{pidfile} and process id is #{pid}&quot; if Merb::Config[:verbose]
               daemonize(port)
             else
-              raise &quot;Merb is already running on port: #{port}&quot;
+              raise &quot;Merb is already running: port is #{port}, pid file: #{pidfile}, process id is #{pid}&quot;
             end
           end
         elsif Merb::Config[:daemonize]
+          pidfile = pid_file(port)
+          pid = IO.read(pidfile).chomp.to_i if File.exist?(pidfile)
+
           unless alive?(@port)
             remove_pid_file(@port)
+            puts &quot;Daemonizing...&quot; if Merb::Config[:verbose]
             daemonize(@port)
           else
-            raise &quot;Merb is already running on port: #{port}&quot;
+            raise &quot;Merb is already running: port is #{port}, pid file: #{pidfile}, process id is #{pid}&quot;
           end
         else
           trap('TERM') { exit }
           trap('INT') { puts &quot;\nExiting&quot;; exit }
+          puts &quot;Running bootloaders...&quot; if Merb::Config[:verbose]
           BootLoader.run
+          puts &quot;Starting Rack adapter...&quot; if Merb::Config[:verbose]
           Merb.adapter.start(Merb::Config.to_hash)
         end
       end
@@ -52,8 +61,11 @@ module Merb
       # Boolean::
       #   True if Merb is running on the specified port.
       def alive?(port)
+        puts &quot;About to check if port #{port} is alive...&quot; if Merb::Config[:verbose]
         pidfile = pid_file(port)
+        puts &quot;Pidfile is #{pidfile}...&quot; if Merb::Config[:verbose]
         pid = IO.read(pidfile).chomp.to_i
+        puts &quot;Process id is #{pid}&quot; if Merb::Config[:verbose]
         Process.kill(0, pid)
         true
       rescue
@@ -72,8 +84,8 @@ module Merb
         begin
           pidfiles = port == &quot;all&quot; ?
             pid_files : [ pid_file(port) ]
-            
-          pidfiles.each do |f|          
+
+          pidfiles.each do |f|
             pid = IO.read(f).chomp.to_i
             begin
               Process.kill(sig, pid)
@@ -98,6 +110,7 @@ module Merb
       # ==== Parameters
       # port&lt;~to_s&gt;:: The port of the Merb process to daemonize.
       def daemonize(port)
+        puts &quot;About to fork...&quot; if Merb::Config[:verbose]
         fork do
           Process.setsid
           exit if fork
@@ -117,13 +130,15 @@ module Merb
       def change_privilege
         if Merb::Config[:user]
           if Merb::Config[:group]
+            puts &quot;About to change privilege to group #{Merb::Config[:group]} and user #{Merb::Config[:user]}&quot; if Merb::Config[:verbose]
             _change_privilege(Merb::Config[:user], Merb::Config[:group])
           else
+            puts &quot;About to change privilege to user #{Merb::Config[:user]}&quot; if Merb::Config[:verbose]
             _change_privilege(Merb::Config[:user])
           end
         end
       end
-      
+
       # Removes a PID file used by the server from the filesystem.
       # This uses :pid_file options from configuration when provided
       # or merb.&lt;port&gt;.pid in log directory by default.
@@ -137,6 +152,7 @@ module Merb
       # instead of the port based PID file.
       def remove_pid_file(port)
         pidfile = pid_file(port)
+        puts &quot;Removing pid file #{pidfile} (port is #{port})...&quot;
         FileUtils.rm(pidfile) if File.exist?(pidfile)
       end
 
@@ -153,10 +169,12 @@ module Merb
       # instead of the port based PID file.
       def store_pid(port)
         pidfile = pid_file(port)
+        puts &quot;Storing pid file to #{pidfile}...&quot;
         FileUtils.mkdir_p(File.dirname(pidfile)) unless File.directory?(File.dirname(pidfile))
+        puts &quot;Created directory, writing process id...&quot; if Merb::Config[:verbose]
         File.open(pidfile, 'w'){ |f| f.write(&quot;#{Process.pid}&quot;) }
       end
-          
+
       # Gets the pid file for the specified port.
       #
       # ==== Parameters
@@ -202,8 +220,8 @@ module Merb
         else
           Dir[Merb.log_path / &quot;merb.*.pid&quot;]
         end
-       end      
-      
+       end
+
       # Change privileges of the process to the specified user and group.
       #
       # ==== Parameters</diff>
      <filename>lib/merb-core/server.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,7 @@ require &quot;hpricot&quot;
 
 require 'merb-core/test/test_ext/hpricot'
 require 'merb-core/test/test_ext/object'
+require 'merb-core/test/test_ext/string'
 
 module Merb; module Test; end; end
 </diff>
      <filename>lib/merb-core/test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -97,8 +97,8 @@ module Merb::Test::MultipartRequestHelper
   # &amp;blk:: The block is executed in the context of the controller.
   #  
   # ==== Example
-  #   dispatch_multipart_to(MyController, :create, :my_file =&gt; @a_file ) do
-  #     self.stub!(:current_user).and_return(@user)
+  #   dispatch_multipart_to(MyController, :create, :my_file =&gt; @a_file ) do |controller|
+  #     controller.stub!(:current_user).and_return(@user)
   #   end
   #
   # ==== Notes
@@ -172,4 +172,4 @@ module Merb::Test::MultipartRequestHelper
                               :content_length =&gt; body.length), :post_body =&gt; body)
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/merb-core/test/helpers/multipart_request_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -87,8 +87,8 @@ module Merb
       #   the action being dispatched.
       #
       # ==== Example
-      #   dispatch_to(MyController, :create, :name =&gt; 'Homer' ) do
-      #     self.stub!(:current_user).and_return(@user)
+      #   dispatch_to(MyController, :create, :name =&gt; 'Homer' ) do |controller|
+      #     controller.stub!(:current_user).and_return(@user)
       #   end
       #
       # ==== Notes
@@ -99,9 +99,9 @@ module Merb
       def dispatch_to(controller_klass, action, params = {}, env = {}, &amp;blk)
         action = action.to_s
         request_body = { :post_body =&gt; env[:post_body], :req =&gt; env[:req] }
-        request = fake_request(env.merge(
-          :query_string =&gt; Merb::Request.params_to_query_string(params)), request_body)
-
+        params = Merb::Request.params_to_query_string(params)
+        env[:query_string] = env[&quot;QUERY_STRING&quot;] ? &quot;#{env[&quot;QUERY_STRING&quot;]}&amp;#{params}&quot; : params
+        request = fake_request(env, request_body)
         dispatch_request(request, controller_klass, action, &amp;blk)
       end
 
@@ -126,8 +126,8 @@ module Merb
       #   the action being dispatched.
       #
       # ==== Example
-      #   dispatch_with_basic_authentication_to(MyController, :create, 'Fred', 'secret', :name =&gt; 'Homer' ) do
-      #     self.stub!(:current_user).and_return(@user)
+      #   dispatch_with_basic_authentication_to(MyController, :create, 'Fred', 'secret', :name =&gt; 'Homer' ) do |controller|
+      #     controller.stub!(:current_user).and_return(@user)
       #   end
       #
       # ==== Notes
@@ -228,8 +228,8 @@ module Merb
       #   the action being dispatched.
       #
       # ==== Example
-      #   request(path, { :name =&gt; 'Homer' }, { :request_method =&gt; &quot;PUT&quot; }) do
-      #     self.stub!(:current_user).and_return(@user)
+      #   request(path, { :name =&gt; 'Homer' }, { :request_method =&gt; &quot;PUT&quot; }) do |controller|
+      #     controller.stub!(:current_user).and_return(@user)
       #   end
       #
       # ==== Notes
@@ -239,7 +239,8 @@ module Merb
       # @semi-public
       def request(path, params = {}, env= {}, &amp;block)
         env[:request_method] ||= &quot;GET&quot;
-        env[:request_uri] = path
+        env[:request_uri], env[:query_string] = path.split('?')
+        
         multipart = env.delete(:test_with_multipart)
 
         request = fake_request(env)</diff>
      <filename>lib/merb-core/test/helpers/request_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -48,7 +48,7 @@ module Merb::Test::Rspec::RouteMatchers
     # If parameters is an object, then a new expected hash will be constructed
     # with the key :id set to parameters.to_param.
     def with(parameters)
-      @paramter_matcher = ParameterMatcher.new(parameters)
+      @parameter_matcher = ParameterMatcher.new(parameters)
 
       self
     end
@@ -56,17 +56,26 @@ module Merb::Test::Rspec::RouteMatchers
     # ==== Returns
     # String:: The failure message.
     def failure_message
-      &quot;expected the request to route to #{@expected_controller.camel_case}##{@expected_action}, but was #{@target_controller.camel_case}##{@target_action}&quot;
+      &quot;expected the request to route to #{@expected_controller.camel_case}##{@expected_action}#{expected_parameters_message}, but was #{@target_controller.camel_case}##{@target_action}#{actual_parameters_message}&quot;
     end
 
     # ==== Returns
     # String:: The failure message to be displayed in negative matches.
     def negative_failure_message
-      &quot;expected the request not to route to #{@expected_controller.camel_case}##{@expected_action}, but it did&quot;
+      &quot;expected the request not to route to #{@expected_controller.camel_case}##{@expected_action}#{expected_parameters_message}, but it did&quot;
+    end
+
+    def expected_parameters_message
+      &quot; with #{@parameter_matcher.expected.inspect}&quot; if @parameter_matcher
+    end
+
+    def actual_parameters_message
+      &quot; with #{(@parameter_matcher.actual || {}).inspect}&quot; if @parameter_matcher
     end
   end
 
   class ParameterMatcher
+    attr_accessor :expected, :actual
 
     # ==== Parameters
     # hash_or_object&lt;Hash, ~to_param&gt;:: The parameters to match.</diff>
      <filename>lib/merb-core/test/matchers/route_matchers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -251,13 +251,13 @@ module Merb::Test::Rspec::ViewMatchers
     # ==== Returns
     # String:: The failure message.
     def failure_message
-      &quot;expected the following element's content to #{content_message}:\n#{@element.inner_content}&quot;
+      &quot;expected the following element's content to #{content_message}:\n#{@element.inner_text}&quot;
     end
 
     # ==== Returns
     # String:: The failure message to be displayed in negative matches.
     def negative_failure_message
-      &quot;expected the following element's content to not #{content_message}:\n#{@element.inner_content}&quot;
+      &quot;expected the following element's content to not #{content_message}:\n#{@element.inner_text}&quot;
     end
     
     def content_message
@@ -332,4 +332,4 @@ module Merb::Test::Rspec::ViewMatchers
   def contain(content)
     HasContent.new(content)
   end
-end
\ No newline at end of file
+end</diff>
      <filename>lib/merb-core/test/matchers/view_matchers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,4 @@
+require 'rubygems'
 require 'open3'
 require 'benchmark'
 </diff>
      <filename>lib/merb-core/test/run_specs.rb</filename>
    </modified>
    <modified>
      <diff>@@ -56,5 +56,6 @@ namespace :spec do
     t.spec_files = Dir['spec/**/*_spec.rb'].sort
     t.libs = ['lib', 'server/lib' ]
     t.rcov = true
+    t.rcov_opts = [&quot;--exclude 'config,spec,#{Gem::path.join(',')}'&quot;]    
   end
 end
\ No newline at end of file</diff>
      <filename>lib/merb-core/test/tasks/spectasks.rb</filename>
    </modified>
    <modified>
      <diff>@@ -166,6 +166,7 @@ module English
           return result.dup
         end
         result = word.dup
+        return result if singular_of.value? result
         singularization_rules.each do |(match, replacement)|
           break if result.gsub!(match, replacement)
         end
@@ -216,6 +217,10 @@ module English
     word 'sheep'
     word 'moose'
     word 'hovercraft'
+    word 'grass'
+    word 'news'
+    word 'rain'
+    word 'milk'
 
     # Two arguments defines a singular and plural exception.
 
@@ -237,7 +242,7 @@ module English
     word 'torpedo'   , 'torpedoes'
     word 'quiz'      , 'quizes'
     word 'matrix'    , 'matrices'
-    word 'vertex'    , 'vetices'
+    word 'vertex'    , 'vertices'
     word 'index'     , 'indices'
     word 'ox'        , 'oxen'
     word 'mouse'     , 'mice'
@@ -245,10 +250,16 @@ module English
     word 'thesis'    , 'theses'
     word 'thief'     , 'thieves'
     word 'analysis'  , 'analyses'
+    word 'erratum'   , 'errata'
+    word 'phenomenon', 'phenomena'
+    word 'octopus'   , 'octopi'
+    word 'thesaurus' , 'thesauri'
+    word 'movie'     , 'movies'
+    word 'cactus'    , 'cacti'
 
     # One-way singularization exception (convert plural to singular).
 
-    singular_word 'cactus', 'cacti'
+    # singular_word 'cactus', 'cacti'
 
     # General rules.
 </diff>
      <filename>lib/merb-core/vendor/facets/inflect.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 module Merb
-  VERSION = '0.9.3' unless defined?(Merb::VERSION)
+  VERSION = '0.9.4' unless defined?(Merb::VERSION)
 
   # Merb::RELEASE meanings:
   # 'dev'   : unreleased</diff>
      <filename>lib/merb-core/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,93 +1,70 @@
 Gem::Specification.new do |s|
-  s.authors = [&quot;Ezra Zygmuntowicz&quot;]
-  s.bindir = &quot;bin&quot;
-  s.required_rubygems_version = &quot;&gt;= 0&quot;
-  s.requirements = [&quot;install the json gem to get faster json parsing&quot;]
   s.has_rdoc = &quot;true&quot;
   s.specification_version = &quot;2&quot;
-  s.name = &quot;merb-core&quot;
   s.loaded = &quot;false&quot;
+  s.bindir = &quot;bin&quot;
   s.email = &quot;ez@engineyard.com&quot;
   s.required_ruby_version = &quot;&gt;= 1.8.4&quot;
-  s.extra_rdoc_files = [&quot;README&quot;, &quot;LICENSE&quot;, &quot;TODO&quot;]
-  s.require_paths = [&quot;lib&quot;]
   s.rubygems_version = &quot;1.1.0&quot;
   s.homepage = &quot;http://merbivore.com&quot;
-  s.executables = [&quot;merb&quot;]
   s.platform = &quot;ruby&quot;
   s.summary = &quot;Merb. Pocket rocket web framework.&quot;
+  s.extra_rdoc_files = [&quot;README&quot;, &quot;LICENSE&quot;, &quot;TODO&quot;]
+  s.description = &quot;Merb. Pocket rocket web framework.&quot;
+  s.add_dependency &quot;erubis&quot;, &quot;&gt;= 0&quot;
+  s.add_dependency &quot;rake&quot;, &quot;&gt;= 0&quot;
+  s.add_dependency &quot;json_pure&quot;, &quot;&gt;= 0&quot;
+  s.add_dependency &quot;rspec&quot;, &quot;&gt;= 0&quot;
+  s.add_dependency &quot;rack&quot;, &quot;&gt;= 0&quot;
+  s.add_dependency &quot;hpricot&quot;, &quot;&gt;= 0&quot;
+  s.add_dependency &quot;mime-types&quot;, &quot;&gt;= 0&quot;
+  s.executables = [&quot;merb&quot;]
+  s.date = &quot;Thu May 08 00:00:00 +0300 2008&quot;
+  s.version = &quot;0.9.3&quot;
   s.files = [&quot;LICENSE&quot;,
  &quot;README&quot;,
  &quot;Rakefile&quot;,
  &quot;TODO&quot;,
+ &quot;docs/merb-core-call-stack-diagram.mmap&quot;,
+ &quot;docs/setting-up-merb-application-structure.markdown&quot;,
+ &quot;docs/new_render_api&quot;,
+ &quot;docs/merb-core-call-stack-diagram.png&quot;,
  &quot;docs/bootloading.dox&quot;,
+ &quot;docs/merb-core-call-stack-diagram.pdf&quot;,
  &quot;docs/documentation_standards&quot;,
- &quot;docs/new_render_api&quot;,
  &quot;bin/merb&quot;,
  &quot;bin/merb-specs&quot;,
- &quot;spec/private&quot;,
- &quot;spec/private/config&quot;,
- &quot;spec/private/config/adapter_spec.rb&quot;,
- &quot;spec/private/config/config_spec.rb&quot;,
- &quot;spec/private/config/environment_spec.rb&quot;,
- &quot;spec/private/config/spec_helper.rb&quot;,
- &quot;spec/private/core_ext&quot;,
- &quot;spec/private/core_ext/class_spec.rb&quot;,
- &quot;spec/private/core_ext/hash_spec.rb&quot;,
- &quot;spec/private/core_ext/kernel_spec.rb&quot;,
- &quot;spec/private/core_ext/object_spec.rb&quot;,
- &quot;spec/private/core_ext/set_spec.rb&quot;,
- &quot;spec/private/core_ext/string_spec.rb&quot;,
- &quot;spec/private/core_ext/time_spec.rb&quot;,
- &quot;spec/private/dispatch&quot;,
- &quot;spec/private/dispatch/cookies_spec.rb&quot;,
- &quot;spec/private/dispatch/dispatch_spec.rb&quot;,
- &quot;spec/private/dispatch/fixture&quot;,
- &quot;spec/private/dispatch/fixture/app&quot;,
- &quot;spec/private/dispatch/fixture/app/controllers&quot;,
- &quot;spec/private/dispatch/fixture/app/controllers/application.rb&quot;,
- &quot;spec/private/dispatch/fixture/app/controllers/exceptions.rb&quot;,
- &quot;spec/private/dispatch/fixture/app/controllers/foo.rb&quot;,
- &quot;spec/private/dispatch/fixture/app/helpers&quot;,
- &quot;spec/private/dispatch/fixture/app/helpers/global_helpers.rb&quot;,
- &quot;spec/private/dispatch/fixture/app/views&quot;,
- &quot;spec/private/dispatch/fixture/app/views/exeptions&quot;,
- &quot;spec/private/dispatch/fixture/app/views/exeptions/client_error.html.erb&quot;,
- &quot;spec/private/dispatch/fixture/app/views/exeptions/internal_server_error.html.erb&quot;,
- &quot;spec/private/dispatch/fixture/app/views/exeptions/not_acceptable.html.erb&quot;,
- &quot;spec/private/dispatch/fixture/app/views/exeptions/not_found.html.erb&quot;,
- &quot;spec/private/dispatch/fixture/app/views/foo&quot;,
- &quot;spec/private/dispatch/fixture/app/views/foo/bar.html.erb&quot;,
- &quot;spec/private/dispatch/fixture/app/views/layout&quot;,
- &quot;spec/private/dispatch/fixture/app/views/layout/application.html.erb&quot;,
- &quot;spec/private/dispatch/fixture/config&quot;,
- &quot;spec/private/dispatch/fixture/config/environments&quot;,
- &quot;spec/private/dispatch/fixture/config/environments/development.rb&quot;,
- &quot;spec/private/dispatch/fixture/config/environments/production.rb&quot;,
- &quot;spec/private/dispatch/fixture/config/environments/test.rb&quot;,
- &quot;spec/private/dispatch/fixture/config/init.rb&quot;,
- &quot;spec/private/dispatch/fixture/config/rack.rb&quot;,
- &quot;spec/private/dispatch/fixture/config/router.rb&quot;,
- &quot;spec/private/dispatch/fixture/log&quot;,
- &quot;spec/private/dispatch/fixture/log/merb.4000.pid&quot;,
- &quot;spec/private/dispatch/fixture/log/merb_test.log&quot;,
- &quot;spec/private/dispatch/fixture/merb.4000.pid&quot;,
- &quot;spec/private/dispatch/fixture/public&quot;,
- &quot;spec/private/dispatch/fixture/public/images&quot;,
- &quot;spec/private/dispatch/fixture/public/images/merb.jpg&quot;,
- &quot;spec/private/dispatch/fixture/public/merb.fcgi&quot;,
- &quot;spec/private/dispatch/fixture/public/stylesheets&quot;,
- &quot;spec/private/dispatch/fixture/public/stylesheets/master.css&quot;,
- &quot;spec/private/dispatch/route_params_spec.rb&quot;,
- &quot;spec/private/dispatch/spec_helper.rb&quot;,
- &quot;spec/private/plugins&quot;,
- &quot;spec/private/plugins/plugin_spec.rb&quot;,
- &quot;spec/private/rack&quot;,
- &quot;spec/private/rack/application_spec.rb&quot;,
  &quot;spec/public&quot;,
+ &quot;spec/public/template&quot;,
+ &quot;spec/public/template/templates&quot;,
+ &quot;spec/public/template/templates/template.html.myt&quot;,
+ &quot;spec/public/template/templates/error.html.erb&quot;,
+ &quot;spec/public/template/templates/template.html.erb&quot;,
+ &quot;spec/public/template/template_spec.rb&quot;,
+ &quot;spec/public/reloading&quot;,
+ &quot;spec/public/reloading/reload_spec.rb&quot;,
+ &quot;spec/public/reloading/directory&quot;,
+ &quot;spec/public/reloading/directory/app&quot;,
+ &quot;spec/public/reloading/directory/app/controllers&quot;,
+ &quot;spec/public/reloading/directory/app/controllers/reload.rb&quot;,
+ &quot;spec/public/reloading/directory/app/controllers/application.rb&quot;,
+ &quot;spec/public/reloading/directory/config&quot;,
+ &quot;spec/public/reloading/directory/config/init.rb&quot;,
+ &quot;spec/public/reloading/directory/log&quot;,
+ &quot;spec/public/reloading/directory/log/merb_test.log&quot;,
  &quot;spec/public/abstract_controller&quot;,
+ &quot;spec/public/abstract_controller/filter_spec.rb&quot;,
+ &quot;spec/public/abstract_controller/render_spec.rb&quot;,
+ &quot;spec/public/abstract_controller/display_spec.rb&quot;,
  &quot;spec/public/abstract_controller/controllers&quot;,
+ &quot;spec/public/abstract_controller/controllers/render.rb&quot;,
+ &quot;spec/public/abstract_controller/controllers/display.rb&quot;,
  &quot;spec/public/abstract_controller/controllers/alt_views&quot;,
+ &quot;spec/public/abstract_controller/controllers/alt_views/partial&quot;,
+ &quot;spec/public/abstract_controller/controllers/alt_views/partial/basic_partial_with_multiple_roots&quot;,
+ &quot;spec/public/abstract_controller/controllers/alt_views/partial/basic_partial_with_multiple_roots/_partial.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/alt_views/render_template_multiple_roots_and_custom_location&quot;,
+ &quot;spec/public/abstract_controller/controllers/alt_views/render_template_multiple_roots_and_custom_location/index.erb&quot;,
  &quot;spec/public/abstract_controller/controllers/alt_views/layout&quot;,
  &quot;spec/public/abstract_controller/controllers/alt_views/layout/application.erb&quot;,
  &quot;spec/public/abstract_controller/controllers/alt_views/layout/merb&quot;,
@@ -96,119 +73,136 @@ Gem::Specification.new do |s|
  &quot;spec/public/abstract_controller/controllers/alt_views/layout/merb/test/fixtures/abstract&quot;,
  &quot;spec/public/abstract_controller/controllers/alt_views/layout/merb/test/fixtures/abstract/render_string_controller_layout.erb&quot;,
  &quot;spec/public/abstract_controller/controllers/alt_views/layout/merb/test/fixtures/abstract/render_template_controller_layout.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/alt_views/render_template_multiple_roots_inherited&quot;,
+ &quot;spec/public/abstract_controller/controllers/alt_views/render_template_multiple_roots_inherited/index.erb&quot;,
  &quot;spec/public/abstract_controller/controllers/alt_views/merb&quot;,
  &quot;spec/public/abstract_controller/controllers/alt_views/merb/test&quot;,
  &quot;spec/public/abstract_controller/controllers/alt_views/merb/test/fixtures&quot;,
  &quot;spec/public/abstract_controller/controllers/alt_views/merb/test/fixtures/abstract&quot;,
  &quot;spec/public/abstract_controller/controllers/alt_views/merb/test/fixtures/abstract/display_object_with_multiple_roots&quot;,
- &quot;spec/public/abstract_controller/controllers/alt_views/merb/test/fixtures/abstract/display_object_with_multiple_roots/index.erb&quot;,
  &quot;spec/public/abstract_controller/controllers/alt_views/merb/test/fixtures/abstract/display_object_with_multiple_roots/show.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/alt_views/merb/test/fixtures/abstract/display_object_with_multiple_roots/index.erb&quot;,
  &quot;spec/public/abstract_controller/controllers/alt_views/merb/test/fixtures/abstract/render_template_multiple_roots&quot;,
  &quot;spec/public/abstract_controller/controllers/alt_views/merb/test/fixtures/abstract/render_template_multiple_roots/index.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/alt_views/partial&quot;,
- &quot;spec/public/abstract_controller/controllers/alt_views/partial/basic_partial_with_multiple_roots&quot;,
- &quot;spec/public/abstract_controller/controllers/alt_views/partial/basic_partial_with_multiple_roots/_partial.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/alt_views/render_template_multiple_roots_and_custom_location&quot;,
- &quot;spec/public/abstract_controller/controllers/alt_views/render_template_multiple_roots_and_custom_location/index.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/alt_views/render_template_multiple_roots_inherited&quot;,
- &quot;spec/public/abstract_controller/controllers/alt_views/render_template_multiple_roots_inherited/index.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/display.rb&quot;,
- &quot;spec/public/abstract_controller/controllers/filters.rb&quot;,
- &quot;spec/public/abstract_controller/controllers/helpers.rb&quot;,
  &quot;spec/public/abstract_controller/controllers/partial.rb&quot;,
- &quot;spec/public/abstract_controller/controllers/render.rb&quot;,
  &quot;spec/public/abstract_controller/controllers/views&quot;,
- &quot;spec/public/abstract_controller/controllers/views/helpers&quot;,
- &quot;spec/public/abstract_controller/controllers/views/helpers/capture&quot;,
- &quot;spec/public/abstract_controller/controllers/views/helpers/capture/index.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/helpers/concat&quot;,
- &quot;spec/public/abstract_controller/controllers/views/helpers/concat/index.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/test_display&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/test_display/foo.html.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/with_partial&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/with_partial/_with_partial.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/with_partial/index.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_locals&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_locals/_variables.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_locals/index.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_with_and_locals&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_with_and_locals/_both.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_with_and_locals/index.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/with_nil_partial&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/with_nil_partial/_with_partial.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/with_nil_partial/index.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/partial_in_another_directory&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/partial_in_another_directory/index.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_collections_and_as&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_collections_and_as/_collection.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_collections_and_as/index.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/with_as_partial&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/with_as_partial/_with_partial.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/with_as_partial/index.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_collections&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_collections/_collection.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_collections/index.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/nested_partial&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/nested_partial/_first.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/nested_partial/_second.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/nested_partial/index.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/basic_partial&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/basic_partial/_partial.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/basic_partial/index.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/basic_partial_with_multiple_roots&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/basic_partial_with_multiple_roots/index.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_both&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_both/_collection.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_both/index.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/another_directory&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/partial/another_directory/_partial.erb&quot;,
  &quot;spec/public/abstract_controller/controllers/views/layout&quot;,
  &quot;spec/public/abstract_controller/controllers/views/layout/alt.erb&quot;,
  &quot;spec/public/abstract_controller/controllers/views/layout/custom.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/wonderful&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/wonderful/index.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/helpers&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/helpers/concat&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/helpers/concat/index.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/helpers/capture&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/helpers/capture/index.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/test_render&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/test_render/foo.html.erb&quot;,
  &quot;spec/public/abstract_controller/controllers/views/merb&quot;,
  &quot;spec/public/abstract_controller/controllers/views/merb/test&quot;,
  &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures&quot;,
  &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract&quot;,
  &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/display_object&quot;,
  &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/display_object/index.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/display_object_with_action&quot;,
- &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/display_object_with_action/new.erb&quot;,
  &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/render_template&quot;,
  &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/render_template/index.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/render_template_app_layout&quot;,
- &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/render_template_app_layout/index.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/render_template_custom_layout&quot;,
- &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/render_template_custom_layout/index.erb&quot;,
  &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/render_template_multiple_roots&quot;,
- &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/render_template_multiple_roots/index.erb&quot;,
  &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/render_template_multiple_roots/show.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/another_directory&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/another_directory/_partial.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/basic_partial&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/basic_partial/_partial.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/basic_partial/index.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/basic_partial_with_multiple_roots&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/basic_partial_with_multiple_roots/index.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/content_type_controller&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/content_type_controller/_content_type_test.html.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/content_type_controller/_content_type_test.xml.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/content_type_controller/index.html.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/nested_partial&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/nested_partial/_first.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/nested_partial/_second.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/nested_partial/index.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/partial_in_another_directory&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/partial_in_another_directory/index.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_both&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_both/_collection.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_both/index.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_collections&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_collections/_collection.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_collections/index.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_collections_and_as&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_collections_and_as/_collection.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_collections_and_as/index.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_locals&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_locals/_variables.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_locals/index.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_with_and_locals&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_with_and_locals/_both.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/partial_with_with_and_locals/index.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/with_as_partial&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/with_as_partial/_with_partial.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/with_as_partial/index.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/with_nil_partial&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/with_nil_partial/_with_partial.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/with_nil_partial/index.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/with_partial&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/with_partial/_with_partial.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/partial/with_partial/index.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/test_display&quot;,
- &quot;spec/public/abstract_controller/controllers/views/test_display/foo.html.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/test_render&quot;,
- &quot;spec/public/abstract_controller/controllers/views/test_render/foo.html.erb&quot;,
- &quot;spec/public/abstract_controller/controllers/views/wonderful&quot;,
- &quot;spec/public/abstract_controller/controllers/views/wonderful/index.erb&quot;,
- &quot;spec/public/abstract_controller/display_spec.rb&quot;,
- &quot;spec/public/abstract_controller/filter_spec.rb&quot;,
- &quot;spec/public/abstract_controller/helper_spec.rb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/render_template_multiple_roots/index.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/render_template_custom_layout&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/render_template_custom_layout/index.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/render_template_app_layout&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/render_template_app_layout/index.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/display_object_with_action&quot;,
+ &quot;spec/public/abstract_controller/controllers/views/merb/test/fixtures/abstract/display_object_with_action/new.erb&quot;,
+ &quot;spec/public/abstract_controller/controllers/helpers.rb&quot;,
+ &quot;spec/public/abstract_controller/controllers/filters.rb&quot;,
  &quot;spec/public/abstract_controller/partial_spec.rb&quot;,
- &quot;spec/public/abstract_controller/render_spec.rb&quot;,
  &quot;spec/public/abstract_controller/spec_helper.rb&quot;,
+ &quot;spec/public/abstract_controller/helper_spec.rb&quot;,
+ &quot;spec/public/DEFINITIONS&quot;,
+ &quot;spec/public/test&quot;,
+ &quot;spec/public/test/controller_matchers_spec.rb&quot;,
+ &quot;spec/public/test/route_matchers_spec.rb&quot;,
+ &quot;spec/public/test/request_helper_spec.rb&quot;,
+ &quot;spec/public/test/multipart_request_helper_spec.rb&quot;,
+ &quot;spec/public/test/view_matchers_spec.rb&quot;,
+ &quot;spec/public/test/controllers&quot;,
+ &quot;spec/public/test/controllers/controller_assertion_mock.rb&quot;,
+ &quot;spec/public/test/controllers/spec_helper_controller.rb&quot;,
+ &quot;spec/public/test/controllers/dispatch_controller.rb&quot;,
+ &quot;spec/public/test/route_helper_spec.rb&quot;,
+ &quot;spec/public/test/view_helper_spec.rb&quot;,
+ &quot;spec/public/test/multipart_upload_text_file.txt&quot;,
+ &quot;spec/public/request&quot;,
+ &quot;spec/public/request/multipart_spec.rb&quot;,
+ &quot;spec/public/request/request_spec.rb&quot;,
+ &quot;spec/public/core&quot;,
+ &quot;spec/public/core/merb_core_spec.rb&quot;,
+ &quot;spec/public/router&quot;,
+ &quot;spec/public/router/special_spec.rb&quot;,
+ &quot;spec/public/router/default_spec.rb&quot;,
+ &quot;spec/public/router/namespace_spec.rb&quot;,
+ &quot;spec/public/router/deferred_spec.rb&quot;,
+ &quot;spec/public/router/spec_helper.rb&quot;,
+ &quot;spec/public/router/nested_resources_spec.rb&quot;,
+ &quot;spec/public/router/resources_spec.rb&quot;,
+ &quot;spec/public/router/resource_spec.rb&quot;,
+ &quot;spec/public/router/string_spec.rb&quot;,
+ &quot;spec/public/logger&quot;,
+ &quot;spec/public/logger/logger_spec.rb&quot;,
+ &quot;spec/public/logger/spec_helper.rb&quot;,
  &quot;spec/public/boot_loader&quot;,
  &quot;spec/public/boot_loader/boot_loader_spec.rb&quot;,
  &quot;spec/public/boot_loader/spec_helper.rb&quot;,
  &quot;spec/public/controller&quot;,
  &quot;spec/public/controller/authentication_spec.rb&quot;,
- &quot;spec/public/controller/base_spec.rb&quot;,
+ &quot;spec/public/controller/display_spec.rb&quot;,
  &quot;spec/public/controller/controllers&quot;,
- &quot;spec/public/controller/controllers/authentication.rb&quot;,
- &quot;spec/public/controller/controllers/base.rb&quot;,
  &quot;spec/public/controller/controllers/display.rb&quot;,
- &quot;spec/public/controller/controllers/responder.rb&quot;,
  &quot;spec/public/controller/controllers/url.rb&quot;,
+ &quot;spec/public/controller/controllers/responder.rb&quot;,
+ &quot;spec/public/controller/controllers/authentication.rb&quot;,
  &quot;spec/public/controller/controllers/views&quot;,
  &quot;spec/public/controller/controllers/views/layout&quot;,
  &quot;spec/public/controller/controllers/views/layout/custom.html.erb&quot;,
@@ -217,196 +211,199 @@ Gem::Specification.new do |s|
  &quot;spec/public/controller/controllers/views/merb/test&quot;,
  &quot;spec/public/controller/controllers/views/merb/test/fixtures&quot;,
  &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers&quot;,
- &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/class_provides&quot;,
- &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/class_provides/index.html.erb&quot;,
- &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/class_provides/index.xml.erb&quot;,
- &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/display_with_template&quot;,
- &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/display_with_template/index.html.erb&quot;,
- &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/display_with_template_argument&quot;,
- &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/display_with_template_argument/index.html.erb&quot;,
- &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/html_default&quot;,
- &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/html_default/index.html.erb&quot;,
+ &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/multi_provides&quot;,
+ &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/multi_provides/index.html.erb&quot;,
+ &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/multi_provides/index.js.erb&quot;,
  &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/layout&quot;,
  &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/layout/custom.html.erb&quot;,
+ &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/html_default&quot;,
+ &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/html_default/index.html.erb&quot;,
+ &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/display_with_template_argument&quot;,
+ &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/display_with_template_argument/index.html.erb&quot;,
  &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/local_provides&quot;,
- &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/local_provides/index.html.erb&quot;,
  &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/local_provides/index.xml.erb&quot;,
- &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/multi_provides&quot;,
- &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/multi_provides/index.html.erb&quot;,
- &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/multi_provides/index.js.erb&quot;,
- &quot;spec/public/controller/display_spec.rb&quot;,
- &quot;spec/public/controller/responder_spec.rb&quot;,
+ &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/local_provides/index.html.erb&quot;,
+ &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/display_with_template&quot;,
+ &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/display_with_template/index.html.erb&quot;,
+ &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/class_provides&quot;,
+ &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/class_provides/index.xml.erb&quot;,
+ &quot;spec/public/controller/controllers/views/merb/test/fixtures/controllers/class_provides/index.html.erb&quot;,
+ &quot;spec/public/controller/controllers/base.rb&quot;,
  &quot;spec/public/controller/spec_helper.rb&quot;,
+ &quot;spec/public/controller/base_spec.rb&quot;,
  &quot;spec/public/controller/url_spec.rb&quot;,
- &quot;spec/public/core&quot;,
- &quot;spec/public/core/merb_core_spec.rb&quot;,
- &quot;spec/public/DEFINITIONS&quot;,
+ &quot;spec/public/controller/responder_spec.rb&quot;,
  &quot;spec/public/directory_structure&quot;,
  &quot;spec/public/directory_structure/directory&quot;,
  &quot;spec/public/directory_structure/directory/app&quot;,
  &quot;spec/public/directory_structure/directory/app/controllers&quot;,
- &quot;spec/public/directory_structure/directory/app/controllers/application.rb&quot;,
  &quot;spec/public/directory_structure/directory/app/controllers/base.rb&quot;,
+ &quot;spec/public/directory_structure/directory/app/controllers/application.rb&quot;,
  &quot;spec/public/directory_structure/directory/app/controllers/custom.rb&quot;,
  &quot;spec/public/directory_structure/directory/app/views&quot;,
- &quot;spec/public/directory_structure/directory/app/views/base&quot;,
- &quot;spec/public/directory_structure/directory/app/views/base/template.html.erb&quot;,
  &quot;spec/public/directory_structure/directory/app/views/wonderful&quot;,
  &quot;spec/public/directory_structure/directory/app/views/wonderful/template.erb&quot;,
+ &quot;spec/public/directory_structure/directory/app/views/base&quot;,
+ &quot;spec/public/directory_structure/directory/app/views/base/template.html.erb&quot;,
  &quot;spec/public/directory_structure/directory/config&quot;,
  &quot;spec/public/directory_structure/directory/config/router.rb&quot;,
  &quot;spec/public/directory_structure/directory/log&quot;,
- &quot;spec/public/directory_structure/directory/log/merb.4000.pid&quot;,
  &quot;spec/public/directory_structure/directory/log/merb_test.log&quot;,
- &quot;spec/public/directory_structure/directory/merb.4000.pid&quot;,
  &quot;spec/public/directory_structure/directory_spec.rb&quot;,
- &quot;spec/public/logger&quot;,
- &quot;spec/public/logger/logger_spec.rb&quot;,
- &quot;spec/public/logger/spec_helper.rb&quot;,
- &quot;spec/public/reloading&quot;,
- &quot;spec/public/reloading/directory&quot;,
- &quot;spec/public/reloading/directory/app&quot;,
- &quot;spec/public/reloading/directory/app/controllers&quot;,
- &quot;spec/public/reloading/directory/app/controllers/application.rb&quot;,
- &quot;spec/public/reloading/directory/app/controllers/reload.rb&quot;,
- &quot;spec/public/reloading/directory/config&quot;,
- &quot;spec/public/reloading/directory/config/init.rb&quot;,
- &quot;spec/public/reloading/directory/log&quot;,
- &quot;spec/public/reloading/directory/log/merb.4000.pid&quot;,
- &quot;spec/public/reloading/directory/log/merb_test.log&quot;,
- &quot;spec/public/reloading/directory/merb.4000.pid&quot;,
- &quot;spec/public/reloading/reload_spec.rb&quot;,
- &quot;spec/public/request&quot;,
- &quot;spec/public/request/multipart_spec.rb&quot;,
- &quot;spec/public/request/request_spec.rb&quot;,
- &quot;spec/public/router&quot;,
- &quot;spec/public/router/default_spec.rb&quot;,
- &quot;spec/public/router/deferred_spec.rb&quot;,
- &quot;spec/public/router/namespace_spec.rb&quot;,
- &quot;spec/public/router/nested_resources_spec.rb&quot;,
- &quot;spec/public/router/resource_spec.rb&quot;,
- &quot;spec/public/router/resources_spec.rb&quot;,
- &quot;spec/public/router/spec_helper.rb&quot;,
- &quot;spec/public/router/special_spec.rb&quot;,
- &quot;spec/public/router/string_spec.rb&quot;,
- &quot;spec/public/template&quot;,
- &quot;spec/public/template/template_spec.rb&quot;,
- &quot;spec/public/template/templates&quot;,
- &quot;spec/public/template/templates/error.html.erb&quot;,
- &quot;spec/public/template/templates/template.html.erb&quot;,
- &quot;spec/public/template/templates/template.html.myt&quot;,
- &quot;spec/public/test&quot;,
- &quot;spec/public/test/controller_matchers_spec.rb&quot;,
- &quot;spec/public/test/controllers&quot;,
- &quot;spec/public/test/controllers/controller_assertion_mock.rb&quot;,
- &quot;spec/public/test/controllers/dispatch_controller.rb&quot;,
- &quot;spec/public/test/controllers/spec_helper_controller.rb&quot;,
- &quot;spec/public/test/multipart_request_helper_spec.rb&quot;,
- &quot;spec/public/test/multipart_upload_text_file.txt&quot;,
- &quot;spec/public/test/request_helper_spec.rb&quot;,
- &quot;spec/public/test/route_helper_spec.rb&quot;,
- &quot;spec/public/test/route_matchers_spec.rb&quot;,
- &quot;spec/public/test/view_helper_spec.rb&quot;,
- &quot;spec/public/test/view_matchers_spec.rb&quot;,
+ &quot;spec/private&quot;,
+ &quot;spec/private/rack&quot;,
+ &quot;spec/private/rack/application_spec.rb&quot;,
+ &quot;spec/private/config&quot;,
+ &quot;spec/private/config/config_spec.rb&quot;,
+ &quot;spec/private/config/spec_helper.rb&quot;,
+ &quot;spec/private/config/environment_spec.rb&quot;,
+ &quot;spec/private/config/adapter_spec.rb&quot;,
+ &quot;spec/private/dispatch&quot;,
+ &quot;spec/private/dispatch/dispatch_spec.rb&quot;,
+ &quot;spec/private/dispatch/spec_helper.rb&quot;,
+ &quot;spec/private/dispatch/cookies_spec.rb&quot;,
+ &quot;spec/private/dispatch/fixture&quot;,
+ &quot;spec/private/dispatch/fixture/public&quot;,
+ &quot;spec/private/dispatch/fixture/public/stylesheets&quot;,
+ &quot;spec/private/dispatch/fixture/public/stylesheets/master.css&quot;,
+ &quot;spec/private/dispatch/fixture/public/images&quot;,
+ &quot;spec/private/dispatch/fixture/public/images/merb.jpg&quot;,
+ &quot;spec/private/dispatch/fixture/public/merb.fcgi&quot;,
+ &quot;spec/private/dispatch/fixture/app&quot;,
+ &quot;spec/private/dispatch/fixture/app/controllers&quot;,
+ &quot;spec/private/dispatch/fixture/app/controllers/exceptions.rb&quot;,
+ &quot;spec/private/dispatch/fixture/app/controllers/foo.rb&quot;,
+ &quot;spec/private/dispatch/fixture/app/controllers/application.rb&quot;,
+ &quot;spec/private/dispatch/fixture/app/views&quot;,
+ &quot;spec/private/dispatch/fixture/app/views/foo&quot;,
+ &quot;spec/private/dispatch/fixture/app/views/foo/bar.html.erb&quot;,
+ &quot;spec/private/dispatch/fixture/app/views/layout&quot;,
+ &quot;spec/private/dispatch/fixture/app/views/layout/application.html.erb&quot;,
+ &quot;spec/private/dispatch/fixture/app/views/exeptions&quot;,
+ &quot;spec/private/dispatch/fixture/app/views/exeptions/internal_server_error.html.erb&quot;,
+ &quot;spec/private/dispatch/fixture/app/views/exeptions/not_found.html.erb&quot;,
+ &quot;spec/private/dispatch/fixture/app/views/exeptions/client_error.html.erb&quot;,
+ &quot;spec/private/dispatch/fixture/app/views/exeptions/not_acceptable.html.erb&quot;,
+ &quot;spec/private/dispatch/fixture/app/helpers&quot;,
+ &quot;spec/private/dispatch/fixture/app/helpers/global_helpers.rb&quot;,
+ &quot;spec/private/dispatch/fixture/config&quot;,
+ &quot;spec/private/dispatch/fixture/config/router.rb&quot;,
+ &quot;spec/private/dispatch/fixture/config/black_hole.rb&quot;,
+ &quot;spec/private/dispatch/fixture/config/rack.rb&quot;,
+ &quot;spec/private/dispatch/fixture/config/init.rb&quot;,
+ &quot;spec/private/dispatch/fixture/config/environments&quot;,
+ &quot;spec/private/dispatch/fixture/config/environments/production.rb&quot;,
+ &quot;spec/private/dispatch/fixture/config/environments/development.rb&quot;,
+ &quot;spec/private/dispatch/fixture/config/environments/test.rb&quot;,
+ &quot;spec/private/dispatch/fixture/log&quot;,
+ &quot;spec/private/dispatch/fixture/log/merb_test.log&quot;,
+ &quot;spec/private/dispatch/route_params_spec.rb&quot;,
+ &quot;spec/private/dispatch/bootloader_spec.rb&quot;,
+ &quot;spec/private/plugins&quot;,
+ &quot;spec/private/plugins/plugin_spec.rb&quot;,
+ &quot;spec/private/core_ext&quot;,
+ &quot;spec/private/core_ext/set_spec.rb&quot;,
+ &quot;spec/private/core_ext/kernel_spec.rb&quot;,
+ &quot;spec/private/core_ext/time_spec.rb&quot;,
+ &quot;spec/private/core_ext/hash_spec.rb&quot;,
+ &quot;spec/private/core_ext/string_spec.rb&quot;,
+ &quot;spec/private/core_ext/class_spec.rb&quot;,
+ &quot;spec/private/core_ext/object_spec.rb&quot;,
  &quot;spec/spec_helper.rb&quot;,
+ &quot;lib/merb-core.rb&quot;,
+ &quot;lib/coretasks.rb&quot;,
  &quot;lib/merb-core&quot;,
- &quot;lib/merb-core/autoload.rb&quot;,
  &quot;lib/merb-core/bootloader.rb&quot;,
- &quot;lib/merb-core/config.rb&quot;,
- &quot;lib/merb-core/constants.rb&quot;,
- &quot;lib/merb-core/controller&quot;,
- &quot;lib/merb-core/controller/abstract_controller.rb&quot;,
- &quot;lib/merb-core/controller/exceptions.rb&quot;,
- &quot;lib/merb-core/controller/merb_controller.rb&quot;,
- &quot;lib/merb-core/controller/mime.rb&quot;,
- &quot;lib/merb-core/controller/mixins&quot;,
- &quot;lib/merb-core/controller/mixins/authentication.rb&quot;,
- &quot;lib/merb-core/controller/mixins/controller.rb&quot;,
- &quot;lib/merb-core/controller/mixins/render.rb&quot;,
- &quot;lib/merb-core/controller/mixins/responder.rb&quot;,
- &quot;lib/merb-core/controller/template.rb&quot;,
- &quot;lib/merb-core/core_ext&quot;,
- &quot;lib/merb-core/core_ext/class.rb&quot;,
- &quot;lib/merb-core/core_ext/hash.rb&quot;,
- &quot;lib/merb-core/core_ext/kernel.rb&quot;,
- &quot;lib/merb-core/core_ext/mash.rb&quot;,
- &quot;lib/merb-core/core_ext/object.rb&quot;,
- &quot;lib/merb-core/core_ext/object_space.rb&quot;,
- &quot;lib/merb-core/core_ext/rubygems.rb&quot;,
- &quot;lib/merb-core/core_ext/set.rb&quot;,
- &quot;lib/merb-core/core_ext/string.rb&quot;,
- &quot;lib/merb-core/core_ext/time.rb&quot;,
- &quot;lib/merb-core/core_ext.rb&quot;,
- &quot;lib/merb-core/dispatch&quot;,
- &quot;lib/merb-core/dispatch/cookies.rb&quot;,
- &quot;lib/merb-core/dispatch/dispatcher.rb&quot;,
- &quot;lib/merb-core/dispatch/exceptions.html.erb&quot;,
- &quot;lib/merb-core/dispatch/request.rb&quot;,
- &quot;lib/merb-core/dispatch/router&quot;,
- &quot;lib/merb-core/dispatch/router/behavior.rb&quot;,
- &quot;lib/merb-core/dispatch/router/cached_proc.rb&quot;,
- &quot;lib/merb-core/dispatch/router/route.rb&quot;,
- &quot;lib/merb-core/dispatch/router.rb&quot;,
- &quot;lib/merb-core/dispatch/session&quot;,
- &quot;lib/merb-core/dispatch/session/cookie.rb&quot;,
- &quot;lib/merb-core/dispatch/session/memcached.rb&quot;,
- &quot;lib/merb-core/dispatch/session/memory.rb&quot;,
- &quot;lib/merb-core/dispatch/session.rb&quot;,
- &quot;lib/merb-core/gem_ext&quot;,
- &quot;lib/merb-core/gem_ext/erubis.rb&quot;,
- &quot;lib/merb-core/logger.rb&quot;,
- &quot;lib/merb-core/plugins.rb&quot;,
  &quot;lib/merb-core/rack&quot;,
+ &quot;lib/merb-core/rack/handler&quot;,
+ &quot;lib/merb-core/rack/handler/mongrel.rb&quot;,
  &quot;lib/merb-core/rack/adapter&quot;,
- &quot;lib/merb-core/rack/adapter/ebb.rb&quot;,
  &quot;lib/merb-core/rack/adapter/evented_mongrel.rb&quot;,
+ &quot;lib/merb-core/rack/adapter/thin.rb&quot;,
  &quot;lib/merb-core/rack/adapter/fcgi.rb&quot;,
- &quot;lib/merb-core/rack/adapter/irb.rb&quot;,
  &quot;lib/merb-core/rack/adapter/mongrel.rb&quot;,
- &quot;lib/merb-core/rack/adapter/runner.rb&quot;,
- &quot;lib/merb-core/rack/adapter/thin.rb&quot;,
  &quot;lib/merb-core/rack/adapter/webrick.rb&quot;,
- &quot;lib/merb-core/rack/adapter.rb&quot;,
+ &quot;lib/merb-core/rack/adapter/runner.rb&quot;,
+ &quot;lib/merb-core/rack/adapter/irb.rb&quot;,
+ &quot;lib/merb-core/rack/adapter/ebb.rb&quot;,
  &quot;lib/merb-core/rack/application.rb&quot;,
- &quot;lib/merb-core/rack/handler&quot;,
- &quot;lib/merb-core/rack/handler/mongrel.rb&quot;,
+ &quot;lib/merb-core/rack/adapter.rb&quot;,
+ &quot;lib/merb-core/gem_ext&quot;,
+ &quot;lib/merb-core/gem_ext/erubis.rb&quot;,
+ &quot;lib/merb-core/config.rb&quot;,
  &quot;lib/merb-core/rack.rb&quot;,
- &quot;lib/merb-core/server.rb&quot;,
  &quot;lib/merb-core/test&quot;,
+ &quot;lib/merb-core/test/matchers.rb&quot;,
+ &quot;lib/merb-core/test/run_specs.rb&quot;,
+ &quot;lib/merb-core/test/matchers&quot;,
+ &quot;lib/merb-core/test/matchers/controller_matchers.rb&quot;,
+ &quot;lib/merb-core/test/matchers/route_matchers.rb&quot;,
+ &quot;lib/merb-core/test/matchers/view_matchers.rb&quot;,
+ &quot;lib/merb-core/test/test_ext&quot;,
+ &quot;lib/merb-core/test/test_ext/object.rb&quot;,
+ &quot;lib/merb-core/test/test_ext/hpricot.rb&quot;,
  &quot;lib/merb-core/test/helpers&quot;,
  &quot;lib/merb-core/test/helpers/controller_helper.rb&quot;,
- &quot;lib/merb-core/test/helpers/multipart_request_helper.rb&quot;,
- &quot;lib/merb-core/test/helpers/request_helper.rb&quot;,
  &quot;lib/merb-core/test/helpers/route_helper.rb&quot;,
  &quot;lib/merb-core/test/helpers/view_helper.rb&quot;,
+ &quot;lib/merb-core/test/helpers/request_helper.rb&quot;,
+ &quot;lib/merb-core/test/helpers/multipart_request_helper.rb&quot;,
  &quot;lib/merb-core/test/helpers.rb&quot;,
- &quot;lib/merb-core/test/matchers&quot;,
- &quot;lib/merb-core/test/matchers/controller_matchers.rb&quot;,
- &quot;lib/merb-core/test/matchers/route_matchers.rb&quot;,
- &quot;lib/merb-core/test/matchers/view_matchers.rb&quot;,
- &quot;lib/merb-core/test/matchers.rb&quot;,
- &quot;lib/merb-core/test/run_specs.rb&quot;,
  &quot;lib/merb-core/test/tasks&quot;,
  &quot;lib/merb-core/test/tasks/spectasks.rb&quot;,
- &quot;lib/merb-core/test/test_ext&quot;,
- &quot;lib/merb-core/test/test_ext/hpricot.rb&quot;,
- &quot;lib/merb-core/test/test_ext/object.rb&quot;,
+ &quot;lib/merb-core/dispatch&quot;,
+ &quot;lib/merb-core/dispatch/request.rb&quot;,
+ &quot;lib/merb-core/dispatch/router.rb&quot;,
+ &quot;lib/merb-core/dispatch/session.rb&quot;,
+ &quot;lib/merb-core/dispatch/router&quot;,
+ &quot;lib/merb-core/dispatch/router/route.rb&quot;,
+ &quot;lib/merb-core/dispatch/router/behavior.rb&quot;,
+ &quot;lib/merb-core/dispatch/router/cached_proc.rb&quot;,
+ &quot;lib/merb-core/dispatch/cookies.rb&quot;,
+ &quot;lib/merb-core/dispatch/dispatcher.rb&quot;,
+ &quot;lib/merb-core/dispatch/exceptions.html.erb&quot;,
+ &quot;lib/merb-core/dispatch/session&quot;,
+ &quot;lib/merb-core/dispatch/session/memory.rb&quot;,
+ &quot;lib/merb-core/dispatch/session/memcached.rb&quot;,
+ &quot;lib/merb-core/dispatch/session/cookie.rb&quot;,
+ &quot;lib/merb-core/core_ext.rb&quot;,
+ &quot;lib/merb-core/plugins.rb&quot;,
  &quot;lib/merb-core/test.rb&quot;,
+ &quot;lib/merb-core/server.rb&quot;,
+ &quot;lib/merb-core/constants.rb&quot;,
+ &quot;lib/merb-core/logger.rb&quot;,
+ &quot;lib/merb-core/autoload.rb&quot;,
+ &quot;lib/merb-core/controller&quot;,
+ &quot;lib/merb-core/controller/template.rb&quot;,
+ &quot;lib/merb-core/controller/exceptions.rb&quot;,
+ &quot;lib/merb-core/controller/mime.rb&quot;,
+ &quot;lib/merb-core/controller/merb_controller.rb&quot;,
+ &quot;lib/merb-core/controller/abstract_controller.rb&quot;,
+ &quot;lib/merb-core/controller/mixins&quot;,
+ &quot;lib/merb-core/controller/mixins/render.rb&quot;,
+ &quot;lib/merb-core/controller/mixins/responder.rb&quot;,
+ &quot;lib/merb-core/controller/mixins/controller.rb&quot;,
+ &quot;lib/merb-core/controller/mixins/authentication.rb&quot;,
  &quot;lib/merb-core/vendor&quot;,
  &quot;lib/merb-core/vendor/facets&quot;,
- &quot;lib/merb-core/vendor/facets/dictionary.rb&quot;,
  &quot;lib/merb-core/vendor/facets/inflect.rb&quot;,
+ &quot;lib/merb-core/vendor/facets/dictionary.rb&quot;,
  &quot;lib/merb-core/vendor/facets.rb&quot;,
- &quot;lib/merb-core/version.rb&quot;,
- &quot;lib/merb-core.rb&quot;]
-  s.description = &quot;Merb. Pocket rocket web framework.&quot;
-  s.add_dependency &quot;erubis&quot;, &quot;&gt;= 0&quot;
-  s.add_dependency &quot;rake&quot;, &quot;&gt;= 0&quot;
-  s.add_dependency &quot;json_pure&quot;, &quot;&gt;= 0&quot;
-  s.add_dependency &quot;rspec&quot;, &quot;&gt;= 0&quot;
-  s.add_dependency &quot;rack&quot;, &quot;&gt;= 0&quot;
-  s.add_dependency &quot;hpricot&quot;, &quot;&gt;= 0&quot;
-  s.add_dependency &quot;mime-types&quot;, &quot;&gt;= 0&quot;
-  s.version = &quot;0.9.2&quot;
-  s.date = &quot;Fri Apr 25 00:00:00 +1000 2008&quot;
+ &quot;lib/merb-core/core_ext&quot;,
+ &quot;lib/merb-core/core_ext/string.rb&quot;,
+ &quot;lib/merb-core/core_ext/rubygems.rb&quot;,
+ &quot;lib/merb-core/core_ext/class.rb&quot;,
+ &quot;lib/merb-core/core_ext/kernel.rb&quot;,
+ &quot;lib/merb-core/core_ext/hash.rb&quot;,
+ &quot;lib/merb-core/core_ext/mash.rb&quot;,
+ &quot;lib/merb-core/core_ext/set.rb&quot;,
+ &quot;lib/merb-core/core_ext/object.rb&quot;,
+ &quot;lib/merb-core/core_ext/object_space.rb&quot;,
+ &quot;lib/merb-core/core_ext/time.rb&quot;,
+ &quot;lib/merb-core/version.rb&quot;]
+  s.authors = [&quot;Ezra Zygmuntowicz&quot;]
+  s.require_paths = [&quot;lib&quot;]
+  s.name = &quot;merb-core&quot;
+  s.requirements = [&quot;install the json gem to get faster json parsing&quot;]
+  s.required_rubygems_version = &quot;&gt;= 0&quot;
 end
\ No newline at end of file</diff>
      <filename>merb-core.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -444,16 +444,16 @@ hsh = {:x =&gt; :y, :z =&gt; :a, :b =&gt; :c, :d =&gt; :e, :f =&gt; :g, :h =&gt; :i, :j =&gt; :k, :l
 arr = hsh.to_a
 dic = Dictionary[*arr.flatten]
 
-# Benchmark.bmbm do |x|
-#   x.report(&quot;Hash&quot;) do
-#     TIMES.times { hsh[:b] }
-#   end
-#   
-#   x.report(&quot;Array&quot;) do
-#     TIMES.times { arr.assoc(:b) }
-#   end
-#   
-#   x.report(&quot;Dicrionary&quot;) do
-#     TIMES.times{ dic[:b] }
-#   end
-# end
\ No newline at end of file
+Benchmark.bmbm do |x|
+  x.report(&quot;Hash&quot;) do
+    TIMES.times { hsh[:b] }
+  end
+  
+  x.report(&quot;Array&quot;) do
+    TIMES.times { arr.assoc(:b) }
+  end
+  
+  x.report(&quot;Dictionary&quot;) do
+    TIMES.times{ dic[:b] }
+  end
+end
\ No newline at end of file</diff>
      <filename>simple_benches/hash_assoc.rb</filename>
    </modified>
    <modified>
      <diff>@@ -567,7 +567,7 @@ Inflector.inflections do |inflect|
   inflect.uncountable(%w(equipment information rice money species series fish sheep))
 end
 
-module Inflections #:nodoc:
+module Inflections
 
   def pluralize
     Inflector.pluralize(self)</diff>
      <filename>simple_benches/inflector.rb</filename>
    </modified>
    <modified>
      <diff>@@ -49,7 +49,7 @@ describe Merb::Config do
     Merb::Config[:group].should == &quot;tester&quot;
   end
 
-  it &quot;should support -f to set the filename to run Merb as&quot; do
+  it &quot;should support -d to daemonize Merb&quot; do
     Merb::Config.parse_args([&quot;-d&quot;])
     Merb::Config[:daemonize].should == true
   end
@@ -71,7 +71,7 @@ describe Merb::Config do
 
   it &quot;should have server return PIDfile setting as is with no cluster nodes&quot; do
     Merb::Config.parse_args([&quot;-P&quot;, &quot;pidfile&quot;, &quot;-p&quot;, &quot;6000&quot;])
-    Merb::Server.pid_file(6000).should == &quot;pidfile&quot;    
+    Merb::Server.pid_file(6000).should == &quot;pidfile&quot;
     Merb::Server.pid_files.should == [&quot;pidfile&quot;]
   end
 
@@ -79,7 +79,7 @@ describe Merb::Config do
     Merb::Config.parse_args([&quot;-P&quot;, &quot;/tmp/merb.pidfile&quot;, &quot;-c&quot;, &quot;2&quot;, &quot;-p&quot;, &quot;6000&quot;])
     Merb::Server.pid_file(6000).should == &quot;/tmp/merb.6000.pidfile&quot;
     Merb::Server.pid_file(6001).should == &quot;/tmp/merb.6001.pidfile&quot;
-    
+
     Dir.should_receive(:[]).with(&quot;/tmp/merb.*.pidfile&quot;)
     Merb::Server.pid_files
   end
@@ -87,7 +87,7 @@ describe Merb::Config do
   it &quot;should support default PIDfile setting&quot; do
     Merb::Config.parse_args([&quot;-p&quot;, &quot;6000&quot;])
     Merb::Server.pid_file(6000).should == Merb.log_path / &quot;merb.6000.pid&quot;
-    
+
     Dir.should_receive(:[]).with(Merb.log_path / &quot;merb.*.pid&quot;)
     Merb::Server.pid_files
   end
@@ -164,4 +164,19 @@ describe Merb::Config do
     $TESTING = true; Merb::Config[:testing] = false # reset
   end
 
+  it &quot;supports -V to turn on verbose mode&quot; do
+    Merb::Config[:verbose] = false
+    Merb::Config.parse_args([&quot;-V&quot;])
+    Merb::Config[:verbose].should be(true)
+  end
+
+  it &quot;supports --verbose to turn on verbose mode&quot; do
+    Merb::Config[:verbose] = false
+    Merb::Config.parse_args([&quot;--verbose&quot;])
+    Merb::Config[:verbose].should be(true)
+  end
+
+  it &quot;has verbose mode turned off by default&quot; do
+    Merb::Config[:verbose].should be(false)
+  end
 end</diff>
      <filename>spec/private/config/config_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -48,18 +48,6 @@ describe &quot;Kernel#debugger&quot; do
 end
 
 
-describe &quot;Kernel#dependency&quot; do
-  it &quot;adds dependency to the list&quot; do
-    lambda { dependency(&quot;dm_merb&quot;, &quot;&gt;= 0.9&quot;) }.should change(Merb::BootLoader::Dependencies.dependencies, :size)
-  end
-
-  it &quot;deferres load to boot loader run&quot; do
-    Object.should_not_receive(:full_const_get)
-    dependency(&quot;dm_merb&quot;, &quot;&gt;= 0.9&quot;)
-  end
-end
-
-
 describe &quot;Kernel#load_dependency&quot; do
   before :each do
 </diff>
      <filename>spec/private/core_ext/kernel_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -57,35 +57,77 @@ describe Object, &quot;#full_const_get&quot; do
   end
 
   it &quot;returns constant corresponding to the name&quot; do
-    self.full_const_get(&quot;April&quot;).should == April
+    Object.full_const_get(&quot;April&quot;).should == April
   end
 
   it &quot;handles nested classes&quot; do
-    self.full_const_get(&quot;April::In::Paris&quot;).should == April::In::Paris
+    Object.full_const_get(&quot;April::In::Paris&quot;).should == April::In::Paris
   end
 
   it &quot;handles nested modules&quot; do
-    self.full_const_get(&quot;Succubus::In::Rapture&quot;).should == Succubus::In::Rapture
+    Object.full_const_get(&quot;Succubus::In::Rapture&quot;).should == Succubus::In::Rapture
+  end
+  
+  it &quot;handles top level constant naming&quot; do
+    Object.full_const_get(&quot;::Succubus::In::Rapture&quot;).should == Succubus::In::Rapture
   end
 
   it &quot;handles in-scoped constants in modules&quot; do
-    self.full_const_get(&quot;Succubus::In::Rapture::PERFORMER&quot;).should == &quot;Dimmu Borgir&quot;
+    Object.full_const_get(&quot;Succubus::In::Rapture::PERFORMER&quot;).should == &quot;Dimmu Borgir&quot;
   end
 
   it &quot;handles in-scoped constants in classes&quot; do
-    self.full_const_get(&quot;April::In::Paris::PERFORMER&quot;).should == &quot;Ella Fitzgerald&quot;
+    Object.full_const_get(&quot;April::In::Paris::PERFORMER&quot;).should == &quot;Ella Fitzgerald&quot;
   end
 
   it &quot;acts as a global function&quot; do
-    lambda { April::In::Paris.full_const_get(&quot;PERFORMER&quot;) }.should raise_error(NameError)
+    lambda { self.full_const_get(&quot;April::In::Paris::PERFORMER&quot;) }.should raise_error(NameError)
   end
 
   it &quot;raises an exception if constant is undefined&quot; do
-    lambda { self.full_const_get(&quot;We::May::Never::Meet::Again&quot;) }.should raise_error(NameError)
+    lambda { Object.full_const_get(&quot;We::May::Never::Meet::Again&quot;) }.should raise_error(NameError)
   end
 end
 
+describe Object, &quot;#full_const_set&quot; do
+  class April
+    class In
+      class Paris
+      end
+    end
+  end
+  
+  module Succubus
+    module In
+      module Rapture
+      end
+    end
+  end
+
+  it &quot;should assign top level constants&quot; do
+    Object.full_const_set('May', 5).should == 5
+    Object.full_const_get('May').should == 5
+  end
+  
+  it &quot;handles top level constant naming&quot; do
+    Object.full_const_set('::June', 6).should == 6
+    Object.full_const_get('::June').should == 6
+  end
+  
+  it &quot;handles in-scoped constants in classes&quot; do
+    Object.full_const_set(&quot;April::In::Paris::COUNTRY&quot;, &quot;USA&quot;).should == &quot;USA&quot;
+    Object.full_const_get(&quot;April::In::Paris::COUNTRY&quot;).should == &quot;USA&quot;
+  end
+
+  it &quot;handles in-scoped constants in modules&quot; do
+    Object.full_const_set(&quot;Succubus::In::Rapture::COUNTRY&quot;, &quot;Norway&quot;).should == &quot;Norway&quot;
+    Object.full_const_get(&quot;Succubus::In::Rapture::COUNTRY&quot;).should == &quot;Norway&quot;
+  end
 
+  it &quot;raises an exception if constant is undefined&quot; do
+    lambda { Object.full_const_set(&quot;We::May::Never::Meet&quot;, &quot;Again&quot;) }.should raise_error(NameError)
+  end
+end
 
 describe Object, &quot;#make_module&quot; do
   it &quot;defines module from a string name&quot; do</diff>
      <filename>spec/private/core_ext/object_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,7 @@ describe Merb::BootLoader::RackUpApplication do
     options = {:merb_root =&gt; File.dirname(__FILE__) / 'fixture'}
     Merb::Config.setup(options)
     app = Merb::BootLoader::RackUpApplication.run
-    app.class.should == Merb::Rack::Application
+    app.class.should == Merb::Rack::Static
   end
 
   it &quot;should use rackup config that we specified&quot; do</diff>
      <filename>spec/private/dispatch/bootloader_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,5 +22,14 @@ describe Merb::Dispatcher do
     env['REQUEST_URI'] = '/foo/raise_conflict'
     Merb::Dispatcher.handle(env).action_name.should == 'client_error'
   end
+  
+  it &quot;should log the start time of the transaction&quot; do
+    t = Time.now
+    env = Rack::MockRequest.env_for(&quot;/notreal&quot;)
+    Time.stub!(:now).and_return(t)
+    Merb.logger.should_receive(:info).with(&quot;Start: #{t}&quot;)
+    
+    Merb::Dispatcher.handle(env)
+  end
     
 end
\ No newline at end of file</diff>
      <filename>spec/private/dispatch/dispatch_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1,11 @@
+# use PathPrefix Middleware if :path_prefix is set in Merb::Config
+if prefix = ::Merb::Config[:path_prefix]
+  use Merb::Rack::PathPrefix, prefix
+end
+
+# comment this out if you are running merb behind a load balancer
+# that serves static files
+use Merb::Rack::Static, Merb.dir_for(:public)
+
+# this is our main merb application
 run Merb::Rack::Application.new
\ No newline at end of file</diff>
      <filename>spec/private/dispatch/fixture/config/rack.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,125 +2,135 @@ require File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;..&quot;, &quot;spec_helper&quot;)
 
 Merb.environment = 'test'
 
-describe &quot;Plugins&quot;, &quot;default GENERATOR_SCOPE&quot; do
-  it &quot;should have :merb_default first&quot; do
-    Merb.generator_scope.first.should == :merb_default
+def reset_merb_generator_scope
+  Merb.orm_generator_scope = :merb_default
+  Merb.test_framework_generator_scope = :rspec
+  Kernel.stub!(:dependency)
+end
+
+describe &quot;Plugins&quot;, &quot;default generator scope&quot; do
+  it &quot;has :merb_default&quot; do
+    Merb.generator_scope.should include(:merb_default)
   end
 
-  it &quot;should have :merb&quot; do
+  it &quot;MUST include :merb&quot; do
     Merb.generator_scope.should include(:merb)
   end
 
-  it &quot;should have :rspec last&quot; do
-    Merb.generator_scope.last.should == :rspec
+  it &quot;has :rspec&quot; do
+    Merb.generator_scope.should include(:rspec)
   end
 end
 
-describe &quot;Plugins&quot;,&quot;use_orm&quot; do
-  before(:each) do
-    Merb.generator_scope.replace [:merb_default, :merb, :rspec]
-    Kernel.stub!(:dependency)
+
+
+describe &quot;Plugins&quot;, &quot;ORM generator scope&quot; do
+  before :each do
+    reset_merb_generator_scope
   end
 
-  it &quot;should raise an error if use_orm is called twice&quot; do
-    use_orm(:activerecord)
-    lambda { use_orm(:datamapper) }.should raise_error(&quot;Don't call use_orm more than once&quot;)
+  it &quot;has merb_default stub by default&quot; do
+    Merb.orm_generator_scope.should == :merb_default
   end
+end
 
-  it &quot;should not have :merb_default in GENERATOR_SCOPE with use_orm(:activerecord)&quot; do
-    use_orm(:activerecord)
+
+
+describe &quot;Plugins&quot;,&quot;use_orm&quot; do
+  before(:each) do
+    reset_merb_generator_scope
+  end
+
+  it &quot;removes defaults from generator scope&quot; do
+    use_orm(:datamapper)
     Merb.generator_scope.should_not include(:merb_default)
   end
 
-  it &quot;should have :activerecord in GENERATOR_SCOPE with use_orm(:activerecord)&quot; do
+  it &quot;adds orm symbol to generator scope&quot; do
     use_orm(:activerecord)
     Merb.generator_scope.should include(:activerecord)
   end
 
-  it &quot;should have :activerecord first in GENERATOR_SCOPE with use_orm(:activerecord)&quot; do
+  it &quot;replaces previously used if use_orm is called more than once&quot; do
+    use_orm(:sequel)
     use_orm(:activerecord)
-    Merb.generator_scope.first.should == :activerecord
+    use_orm(:datamapper)
+
+    Merb.generator_scope.should_not include(:sequel)
+    Merb.generator_scope.should_not include(:activerecord)
+    Merb.generator_scope.should include(:datamapper)
   end
 
-  it &quot;should call dependency :merb_activerecord with use_orm(:activerecord)&quot; do
+  it &quot;calls dependency :merb_&lt;orm&gt;&quot; do
     Kernel.should_receive(:dependency).with(&quot;merb_activerecord&quot;).once.
       and_return(true)
     use_orm(:activerecord)
   end
+
+  it &quot;does not affect presence of :merb in generator scope&quot; do
+    use_orm(:datamapper)
+    Merb.generator_scope.should include(:merb)
+  end
 end
 
 
 
-describe &quot;Plugins&quot;,&quot;use_test&quot; do
-  before(:each) do
-    Merb.generator_scope.replace [:merb_default, :merb, :rspec]
-    Kernel.stub!(:dependency)
+describe &quot;Plugins&quot;, &quot;test framework generator scope&quot; do
+  before :each do
+    reset_merb_generator_scope
   end
 
-  it &quot;should have :rspec in GENERATOR_SCOPE by default&quot; do
-    Merb.generator_scope.should include(:rspec)
+  it &quot;has rspec by default&quot; do
+    Merb.test_framework_generator_scope.should == :rspec
   end
+end
 
-  it &quot;should not have :rspec in GENERATOR_SCOPE with use_test(:test_unit)&quot; do
-    use_test(:test_unit)
-    Merb.generator_scope.should_not include(:rspec)
+
+
+describe &quot;Plugins&quot;,&quot;use_test&quot; do
+  before(:each) do
+    reset_merb_generator_scope
   end
 
-  it &quot;should have :test_unit in GENERATOR_SCOPE with use_test(:test_unit)&quot; do
+  it &quot;removes defaults&quot; do
     use_test(:test_unit)
-    Merb.generator_scope.should include(:test_unit)
+    Merb.generator_scope.should_not include(:rspec)
   end
 
-  it &quot;should have :test_unit last in GENERATOR_SCOPE with use_test(:test_unit)&quot; do
+  it &quot;adds used test framework to generator scope&quot; do
     use_test(:test_unit)
-    Merb.generator_scope.last.should == :test_unit
+    Merb.generator_scope.should include(:test_unit)
   end
 
-  it &quot;should raise an error if called with an unsupported test framework&quot; do
+  it &quot;raises an error when unsupported test framework is used&quot; do
     lambda { use_test(:fiddlefaddle) }.should raise_error
   end
-end
-
-
-describe &quot;Plugins&quot;, &quot;register_orm&quot; do
-  before(:each) do
-    Merb.generator_scope.replace [:merb_default, :merb, :rspec]
-    Kernel.stub!(:dependency)
-  end
 
-  it &quot;registers ORM plugin at generator scope&quot; do
-    register_orm(:sequel)
-
-    Merb.generator_scope.should include(:sequel)
+  it &quot;does not affect presence of :merb in generator scope&quot; do
+    use_test(:test_unit)
+    Merb.generator_scope.should include(:merb)
   end
 end
 
 
 
-describe &quot;Plugins&quot;, &quot;registred_orm?&quot; do
+describe &quot;Plugins&quot;, &quot;register_orm&quot; do
   before(:each) do
-    Merb.generator_scope.replace [:merb_default, :merb, :rspec]
-    Kernel.stub!(:dependency)
-  end
-
-  it &quot;returns false unless ORM is registred&quot; do
-    registred_orm?(:sequel).should be(false)
+    reset_merb_generator_scope
   end
 
-  it &quot;returns true once ORM is registred&quot; do
-    use_orm(:sequel)
+  it &quot;registers ORM plugin at orm generator scope&quot; do
+    register_orm(:sequel)
 
-    registred_orm?(:sequel).should be(false)
+    Merb.orm_generator_scope.should == :sequel
   end
 end
 
 
 
-
 describe &quot;Plugins&quot;, &quot;register_test_framework&quot; do
   before(:each) do
-    Merb.generator_scope.replace [:merb_default, :merb, :rspec]
-    Kernel.stub!(:dependency)
+    reset_merb_generator_scope
   end
 
   it &quot;registers test framework at generator scope&quot; do
@@ -146,7 +156,11 @@ describe &quot;Plugins&quot;, &quot;supported_test_framework?&quot; do
     supported_test_framework?(:rspec).should be(true)
   end
 
-  it &quot;DOES NOT yet support MSpec (of Rubinius fame)&quot; do
+  it &quot;does not (no yet) support MSpec&quot; do
     supported_test_framework?(:mspec).should be(false)
   end
+
+  it &quot;does not (no yet) support Bacon&quot; do
+    supported_test_framework?(:bacon).should be(false)
+  end
 end</diff>
      <filename>spec/private/plugins/plugin_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,7 +20,13 @@ describe Merb::Rack::Application, &quot;with :path_prefix set&quot; do
 
   before do 
     Merb::Config[:path_prefix] = &quot;/quux&quot;
-    @app = Merb::Rack::Application.new
+    @app = ::Rack::Builder.new {
+       if prefix = ::Merb::Config[:path_prefix]
+         use Merb::Rack::PathPrefix, prefix
+       end
+       use Merb::Rack::Static, Merb.dir_for(:public)
+       run Merb::Rack::Application.new
+     }.to_app
     @nullobj = mock('controller', :null_object =&gt; true)
   end
   </diff>
      <filename>spec/private/rack/application_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,7 +11,7 @@ module Merb::Test::Fixtures
         &quot;partial/#{File.basename(controller)}/#{context}&quot;
       end
     end
-
+    
     class BasicPartial &lt; RenderIt
 
       def index
@@ -19,6 +19,14 @@ module Merb::Test::Fixtures
       end
     end
 
+    class WithAbsolutePartial &lt; RenderIt
+      
+      def index
+        @absolute_partial_path = File.expand_path(File.dirname(__FILE__)) / 'views' / 'partial' / 'with_absolute_partial' / 'partial'
+        render 
+      end
+    end
+
     class WithPartial &lt; RenderIt
 
       def index</diff>
      <filename>spec/public/abstract_controller/controllers/partial.rb</filename>
    </modified>
    <modified>
      <diff>@@ -76,11 +76,19 @@ module Merb::Test::Fixtures
       end
     end
     
+    class RenderTemplateAbsolutePath &lt; RenderTemplate
+      
+      def index
+        render :template =&gt; File.expand_path(self._template_root) / 'wonderful' / 'index'
+      end
+      
+    end
+    
     class RenderTemplateMultipleRoots &lt; RenderTemplate
       self._template_roots &lt;&lt; [File.dirname(__FILE__) / &quot;alt_views&quot;, :_template_location]
       
       def show
-        render :layout=&gt;false
+        render :layout =&gt; false
       end
     end
 </diff>
      <filename>spec/public/abstract_controller/controllers/render.rb</filename>
    </modified>
    <modified>
      <diff>@@ -78,6 +78,15 @@ describe Merb::AbstractController, &quot; should support before and after filters&quot; do
     running { dispatch_should_make_body(&quot;TestConditionalFilterWithNoProcOrSymbol&quot;, &quot;&quot;) }.should raise_error(ArgumentError, /a Symbol or a Proc/)
   end
   
+  it &quot;should throw an error if an unknown option is passed to a filter&quot; do
+    running { Merb::Test::Fixtures::Abstract.class_eval do
+        
+      class TestErrorFilter &lt; Merb::Test::Fixtures::Abstract::Testing
+        before :foo, :except =&gt; :index
+      end 
+    end }.should raise_error(ArgumentError, /known filter options/)
+  end
+  
   it &quot;should support passing an argument to a before filter method&quot; do
     dispatch_should_make_body(&quot;TestBeforeFilterWithArgument&quot;, &quot;index action&quot;)
   end
@@ -85,4 +94,13 @@ describe Merb::AbstractController, &quot; should support before and after filters&quot; do
   it &quot;should support passing arguments to a before filter method&quot; do
     dispatch_should_make_body(&quot;TestBeforeFilterWithArguments&quot;, &quot;index action&quot;)
   end
+  
+  it &quot;should inherit before filters&quot; do
+    dispatch_should_make_body(&quot;FilterChild2&quot;, &quot;Before Limited&quot;, :limited)
+  end
+  
+  it &quot;should not get contaminated by cousins&quot; do
+    pending
+    dispatch_should_make_body(&quot;FilterChild2&quot;, &quot;Before Index&quot;)
+  end
 end
\ No newline at end of file</diff>
      <filename>spec/public/abstract_controller/filter_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -50,4 +50,8 @@ describe Merb::AbstractController, &quot; Partials&quot; do
     dispatch_should_make_body(&quot;BasicPartialWithMultipleRoots&quot;, &quot;Base Index: Alt Partial&quot;)
   end
   
+  it &quot;should render a partial using an absolute path&quot; do
+    dispatch_should_make_body(&quot;WithAbsolutePartial&quot;, &quot;Index Absolute Partial&quot;)
+  end
+  
 end
\ No newline at end of file</diff>
      <filename>spec/public/abstract_controller/partial_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -63,6 +63,10 @@ describe Merb::AbstractController, &quot; rendering templates&quot; do
     dispatch_should_make_body(&quot;RenderTemplateCustomLocation&quot;, &quot;Wonderful&quot;)
   end
   
+  it &quot;should support rendering templates from an absolute path location&quot; do
+    dispatch_should_make_body(&quot;RenderTemplateAbsolutePath&quot;, &quot;Wonderful&quot;)
+  end
+
   it &quot;should support rendering templates with multiple roots&quot; do
     dispatch_should_make_body(&quot;RenderTemplateMultipleRoots&quot;, &quot;App: Multiple&quot;)
   end</diff>
      <filename>spec/public/abstract_controller/render_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,7 @@ __DIR__ = File.dirname(__FILE__)
 require File.join(__DIR__, &quot;..&quot;, &quot;..&quot;, &quot;spec_helper&quot;)
 
 require File.join(__DIR__, &quot;controllers&quot;, &quot;filters&quot;)
+require File.join(__DIR__, &quot;controllers&quot;, &quot;cousins&quot;)
 require File.join(__DIR__, &quot;controllers&quot;, &quot;render&quot;)
 require File.join(__DIR__, &quot;controllers&quot;, &quot;partial&quot;)
 require File.join(__DIR__, &quot;controllers&quot;, &quot;display&quot;)</diff>
      <filename>spec/public/abstract_controller/spec_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@
 require File.join(File.dirname(__FILE__), &quot;spec_helper&quot;)
 
 class Merb::BootLoader::AfterTest &lt; Merb::BootLoader
-  after Merb::BootLoader::BeforeAppRuns
+  after Merb::BootLoader::BeforeAppLoads
   
   def self.run
   end
@@ -21,7 +21,7 @@ end
 describe &quot;The BootLoader&quot; do
   
   it &quot;should support adding a BootLoader after another&quot; do
-    idx = Merb::BootLoader.subclasses.index(&quot;Merb::BootLoader::BeforeAppRuns&quot;)
+    idx = Merb::BootLoader.subclasses.index(&quot;Merb::BootLoader::BeforeAppLoads&quot;)
     Merb::BootLoader.subclasses.index(&quot;Merb::BootLoader::AfterTest&quot;).should == idx + 1
   end
 </diff>
      <filename>spec/public/boot_loader/boot_loader_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,6 +9,10 @@ describe Merb::Controller, &quot; callable actions&quot; do
     end
   end
   
+  it &quot;should not have any callable actions by default&quot; do
+    Merb::Controller.callable_actions.should be_empty
+  end
+  
   it &quot;should dispatch to callable actions&quot; do
     controller = dispatch_to(Merb::Test::Fixtures::Controllers::Base, :index)
     controller.body.should == &quot;index&quot;</diff>
      <filename>spec/public/controller/base_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,47 +1,45 @@
 module Merb::Test::Fixtures::Controllers
-  
+
   class Testing &lt; Merb::Controller
     self._template_root = File.dirname(__FILE__) / &quot;views&quot;
   end
 
   class BasicAuthentication &lt; Testing
-
     before :authenticate, :only =&gt; :index
 
     def index
       &quot;authenticated&quot;
     end
-    
+
     protected
-  
+
     def authenticate
       basic_authentication { |u, p| u == &quot;Fred&quot; &amp;&amp; p == &quot;secret&quot; }
     end
-    
   end
-  
+
   class BasicAuthenticationWithRealm &lt; BasicAuthentication
     def authenticate
       basic_authentication(&quot;My Super App&quot;) { |u, p| u == &quot;Fred&quot; &amp;&amp; p == &quot;secret&quot; }
     end
   end
-  
+
   class AuthenticateBasicAuthentication &lt; Testing
     def index
       basic_authentication.authenticate { |u, p| &quot;Fred:secret&quot; }
     end
   end
-  
+
   class RequestBasicAuthentication &lt; BasicAuthentication
     def authenticate
       basic_authentication.request
     end
   end
-  
+
   class RequestBasicAuthenticationWithRealm &lt; BasicAuthentication
     def authenticate
       basic_authentication(&quot;My SuperApp&quot;).request
     end
   end
-  
-end
\ No newline at end of file
+
+end</diff>
      <filename>spec/public/controller/controllers/authentication.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,15 +1,10 @@
-
-
 module Merb::Test::Fixtures
-
   module Controllers
-    
     class Testing &lt; Merb::Controller
       self._template_root = File.dirname(__FILE__) / &quot;views&quot;
     end
 
     module Inclusion
-
       def self.included(base)
         base.show_action(:baz)
       end
@@ -21,12 +16,11 @@ module Merb::Test::Fixtures
       def bat
         &quot;bat&quot;
       end
-      
     end
 
     class Base &lt; Testing
       include Inclusion
-      
+
       def index
         self.status = :ok
         &quot;index&quot;
@@ -39,4 +33,4 @@ module Merb::Test::Fixtures
     end
 
   end
-end
\ No newline at end of file
+end</diff>
      <filename>spec/public/controller/controllers/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,4 @@
-
-
 module Merb::Test::Fixtures::Controllers
-  
   class SomeModel
     def to_xml; &quot;&lt;XML:Model /&gt;&quot; end
     def to_json(options = {})
@@ -9,18 +6,31 @@ module Merb::Test::Fixtures::Controllers
       excludes = options[:except].first rescue &quot;&quot;
       &quot;{ 'include': '#{includes}', 'exclude': '#{excludes}' }&quot;
     end
+    def to_param
+      &quot;1&quot;
+    end
   end
-  
+
+
   class Testing &lt; Merb::Controller
     self._template_root = File.dirname(__FILE__) / &quot;views&quot;
   end
-  
+
+
   class Display &lt; Testing
-    
     def index
       @obj = SomeModel.new
       display @obj
-    end
+    end    
+  end
+
+  class DisplayWithLayout &lt; Testing
+    provides :json
+    
+    def index
+      @obj = SomeModel.new
+      display @obj, :layout =&gt; :custom_arg
+    end    
   end
 
   class DisplayHtmlDefault &lt; Display; end
@@ -29,17 +39,30 @@ module Merb::Test::Fixtures::Controllers
     provides :xml
   end
 
+
   class DisplayLocalProvides &lt; Display
-    
     def index
       @obj = SomeModel.new
       provides :xml
       display @obj
     end
   end
-  
+
+
   class DisplayWithTemplate &lt; Display
     layout :custom
+
+    def no_layout
+      render :layout =&gt; false
+    end
+    
+    def absolute_without_mime
+      render :template =&gt; File.expand_path(self._template_root) / &quot;merb/test/fixtures/controllers/html_default/index&quot;
+    end
+    
+    def absolute_with_mime
+      render :template =&gt; File.expand_path(self._template_root) / &quot;merb/test/fixtures/controllers/html_default/index.html&quot;
+    end
   end
   
   class DisplayWithTemplateArgument &lt; Display
@@ -47,24 +70,33 @@ module Merb::Test::Fixtures::Controllers
       @obj = SomeModel.new
       display @obj, :layout =&gt; :custom_arg
     end
-    
+
     def index_by_arg
       @obj = SomeModel.new
       display @obj, &quot;merb/test/fixtures/controllers/display_with_template_argument/index.html&quot;
     end
   end
-  
+
+  class DisplayWithStringLocation &lt; Display
+    provides :json
+    def index
+      @obj = SomeModel.new
+      display @obj, :location =&gt; &quot;/some_resources/#{@obj.to_param}&quot;
+    end
+  end
+
+
   class DisplayWithSerializationOptions &lt; Display
     provides :json
-    
+
     def index
       @obj = SomeModel.new
       display @obj, :include =&gt; [:beer, :jazz], :except =&gt; [:idiots]
     end
-    
+
     def index_that_passes_empty_hash
       @obj = SomeModel.new
       display @obj, {}
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>spec/public/controller/controllers/display.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,24 +1,24 @@
-
-
 module Merb::Test::Fixtures::Controllers
-
   class Testing &lt; Merb::Controller
     self._template_root = File.dirname(__FILE__) / &quot;views&quot;
   end
 
+
   class Responder &lt; Testing
-    
     def index
       render
     end
   end
 
+
   class HtmlDefault &lt; Responder; end
 
+
   class ClassProvides &lt; Responder
     provides :xml
   end
 
+
   class LocalProvides &lt; Responder
     def index
       provides :xml
@@ -26,37 +26,41 @@ module Merb::Test::Fixtures::Controllers
     end
   end
 
+
   class MultiProvides &lt; Responder
     def index
       provides :html, :js
       render
     end
   end
-  
+
+
   class ClassOnlyProvides &lt; Responder
     only_provides :text, :xml
-    
+
     def index
       &quot;nothing&quot;
     end
   end
-  
+
+
   class OnlyProvides &lt; Responder
     def index
       only_provides :text, :xml
       &quot;nothing&quot;
     end
   end
-    
+
   class ClassDoesntProvides &lt; Responder
     provides :xml
     does_not_provide :html
-    
+
     def index
       &quot;nothing&quot;
     end
   end
-  
+
+
   class DoesntProvide &lt; Responder
     def index
       provides :xml
@@ -64,4 +68,19 @@ module Merb::Test::Fixtures::Controllers
       &quot;nothing&quot;
     end
   end
-end
\ No newline at end of file
+
+
+  class FooFormatProvides &lt; Responder
+    only_provides :foo
+
+    def index
+      render &quot;nothing&quot;
+    end
+
+    def show
+      headers[&quot;Content-Language&quot;] = 'nl'
+      headers[&quot;Biz&quot;] = &quot;buzz&quot;
+      render &quot;nothing&quot;
+    end
+  end
+end</diff>
      <filename>spec/public/controller/controllers/responder.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,23 +7,44 @@ describe Merb::Controller, &quot; displaying objects based on mime type&quot; do
       r.default_routes
     end
   end
-  
+
   it &quot;should default the mime-type to HTML (and raise since there's no to_html)&quot; do
     running { dispatch_to(Merb::Test::Fixtures::Controllers::DisplayHtmlDefault, :index) }.should raise_error(Merb::ControllerExceptions::NotAcceptable)
   end
-  
+
+  it &quot;should set headers['Location'] to string provided by :location&quot; do
+    dispatch_to(Merb::Test::Fixtures::Controllers::DisplayWithStringLocation, :index, {}, :http_accept =&gt; &quot;application/json&quot;).headers['Location'].should =~ /some_resources/
+  end
+
   it &quot;should use a template if specified&quot; do
-    dispatch_to(Merb::Test::Fixtures::Controllers::DisplayWithTemplate, :index).body.should == &quot;Custom: Template&quot;
+    dispatch_to(Merb::Test::Fixtures::Controllers::DisplayWithTemplate, :index).body.should match(/Custom: Template/)
+  end
+
+  it &quot;overrides layout settings with render :layout =&gt; false&quot; do
+    dispatch_to(Merb::Test::Fixtures::Controllers::DisplayWithTemplate, :no_layout).body.should_not match(/Custom: Template/)
   end
   
-  it &quot;should accept a layout argument&quot; do
-    dispatch_to(Merb::Test::Fixtures::Controllers::DisplayWithTemplateArgument, :index).body.should == &quot;Custom Arg: Template&quot;
+  it &quot;should accept an absolute template path argument - with the mimetype extension&quot; do
+    dispatch_to(Merb::Test::Fixtures::Controllers::DisplayWithTemplate, :absolute_with_mime).body.should == &quot;Custom: HTML: Default&quot;
   end
   
+  it &quot;should accept an absolute template path argument - without the mimetype extension&quot; do
+    dispatch_to(Merb::Test::Fixtures::Controllers::DisplayWithTemplate, :absolute_without_mime).body.should == &quot;Custom: HTML: Default&quot;
+  end
+
+  it &quot;should accept a layout argument when calling to_*&quot; do
+    dispatch_to(Merb::Test::Fixtures::Controllers::DisplayWithLayout, :index, {}, 
+      :http_accept =&gt; &quot;application/json&quot;).body.should == &quot;{custom_arg: { 'include': '', 'exclude': '' }}&quot;
+  end
+  
+  it &quot;should accept a layout argument with a template&quot; do
+    dispatch_to(Merb::Test::Fixtures::Controllers::DisplayWithTemplateArgument, :index).body.should == &quot;Custom Arg: Template&quot;
+  end
+
   it &quot;should accept a template path argument&quot; do
     dispatch_to(Merb::Test::Fixtures::Controllers::DisplayWithTemplateArgument, :index_by_arg).body.should == &quot;Template&quot;
   end
-
+  
   it &quot;should use other mime-types if they are provided on the class level&quot; do
     controller = dispatch_to(Merb::Test::Fixtures::Controllers::DisplayClassProvides, :index, {}, :http_accept =&gt; &quot;application/xml&quot;)
     controller.body.should == &quot;&lt;XML:Model /&gt;&quot;
@@ -36,16 +57,16 @@ describe Merb::Controller, &quot; displaying objects based on mime type&quot; do
 
   it &quot;should use mime-types that are provided at the local level&quot; do
     controller = dispatch_to(Merb::Test::Fixtures::Controllers::DisplayLocalProvides, :index, {}, :http_accept =&gt; &quot;application/xml&quot;)
-    controller.body.should == &quot;&lt;XML:Model /&gt;&quot;    
+    controller.body.should == &quot;&lt;XML:Model /&gt;&quot;
   end
-  
+
   it &quot;passes all options to serialization method like :to_json&quot; do
     controller = dispatch_to(Merb::Test::Fixtures::Controllers::DisplayWithSerializationOptions, :index, {}, :http_accept =&gt; &quot;application/json&quot;)
     controller.body.should == &quot;{ 'include': 'beer, jazz', 'exclude': 'idiots' }&quot;
   end
-  
+
   it &quot;passes single argument to serialization method like :to_json&quot; do
     controller = dispatch_to(Merb::Test::Fixtures::Controllers::DisplayWithSerializationOptions, :index_that_passes_empty_hash, {}, :http_accept =&gt; &quot;application/json&quot;)
     controller.body.should == &quot;{ 'include': '', 'exclude': '' }&quot;
   end
-end
\ No newline at end of file
+end</diff>
      <filename>spec/public/controller/display_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -92,4 +92,44 @@ describe Merb::Controller, &quot; responds&quot; do
     controller = dispatch_to(Merb::Test::Fixtures::Controllers::ClassOnlyProvides, :index, {}, :http_accept =&gt; &quot;application/html&quot;)
     lambda { controller.content_type }.should raise_error(Merb::ControllerExceptions::NotAcceptable)
   end
+  
+  it &quot;should return the correct default HTTP headers for a format&quot; do
+    controller = dispatch_to(Merb::Test::Fixtures::Controllers::ClassProvides, :index, :format =&gt; &quot;xml&quot;)
+    controller.headers.keys.sort.should == [&quot;Content-Type&quot;]
+    controller.headers[&quot;Content-Type&quot;].should == &quot;application/xml; charset=utf-8&quot;
+  end
+  
+  it &quot;should append the correct charset which was set when the format was added&quot; do
+    Merb.add_mime_type(:foo, nil, %w[application/foo], :charset =&gt; &quot;iso-8859-1&quot;)
+    controller = dispatch_to(Merb::Test::Fixtures::Controllers::FooFormatProvides, :index, :format =&gt; &quot;foo&quot;)
+    controller.headers[&quot;Content-Type&quot;].should == &quot;application/foo; charset=iso-8859-1&quot;
+  end
+  
+  it &quot;should return the correct HTTP headers which were set when the format was added&quot; do
+    Merb.add_mime_type(:foo, nil, %w[application/foo], &quot;Foo&quot; =&gt; 'bar', &quot;Content-Language&quot; =&gt; &quot;en&quot;, :charset =&gt; &quot;utf-8&quot;)
+    controller = dispatch_to(Merb::Test::Fixtures::Controllers::FooFormatProvides, :index, :format =&gt; &quot;foo&quot;)
+    controller.headers.keys.should_not include(:charset)
+    controller.headers[&quot;Content-Type&quot;].should == &quot;application/foo; charset=utf-8&quot;
+    controller.headers[&quot;Content-Language&quot;].should == &quot;en&quot;
+    controller.headers[&quot;Foo&quot;] = &quot;bar&quot;
+  end
+  
+  it &quot;should return the correct HTTP headers using the block given when the format was added&quot; do
+    Merb.add_mime_type(:foo, nil, %w[application/foo], &quot;Foo&quot; =&gt; &quot;bar&quot;) do |controller|
+      controller.headers[&quot;Action-Name&quot;] = controller.action_name
+    end
+    controller = dispatch_to(Merb::Test::Fixtures::Controllers::FooFormatProvides, :index, :format =&gt; &quot;foo&quot;)
+    controller.headers[&quot;Content-Type&quot;].should == &quot;application/foo&quot;
+    controller.headers[&quot;Action-Name&quot;].should == &quot;index&quot;
+    controller.headers[&quot;Foo&quot;] = &quot;bar&quot;
+  end
+  
+  it &quot;should not overwrite runtime-set headers with default format response headers&quot; do
+    Merb.add_mime_type(:foo, nil, %w[application/foo], &quot;Foo&quot; =&gt; &quot;bar&quot;, &quot;Content-Language&quot; =&gt; &quot;en&quot;)
+    controller = dispatch_to(Merb::Test::Fixtures::Controllers::FooFormatProvides, :show, :format =&gt; &quot;foo&quot;)
+    controller.headers[&quot;Content-Language&quot;].should == &quot;nl&quot;
+    controller.headers[&quot;Biz&quot;] = &quot;buzz&quot;
+    controller.headers[&quot;Foo&quot;] = &quot;bar&quot;
+  end
+  
 end</diff>
      <filename>spec/public/controller/responder_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -30,5 +30,16 @@ describe &quot;Merb.env helpers&quot; do
     end
   end
   
+  it &quot;should allow an environment to merge another environments settings&quot; do
+    %w(development test production staging demo custom).each do |e|
+
+      Merb.environment = e
+      Merb.start_environment
+      Merb.merge_env &quot;some_other_env&quot;
+      Merb.environment_info.nil?.should be_false
+      Merb.environment_info[:merged_envs].first.should == &quot;some_other_env&quot;
+    end
+  end
+  
   
 end
\ No newline at end of file</diff>
      <filename>spec/public/core/merb_core_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,18 +1,41 @@
 require File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;..&quot;, &quot;spec_helper&quot;)
+
+class MockTimedExecutor
+  def self.every(seconds, &amp;block)
+    @@scheduled_action = block
+  end
+  def self.run_task
+    @@scheduled_action.call 
+  end
+end
+
+RealTimedExecutor = Merb::BootLoader::ReloadClasses::TimedExecutor
+Merb::BootLoader::ReloadClasses::TimedExecutor = MockTimedExecutor
+
 Merb.start :environment =&gt; 'test',
            :merb_root =&gt; File.dirname(__FILE__) / &quot;directory&quot;
 
-describe &quot;The reloader&quot; do
-  SLEEP_TIME = 0.5
-
-  def reload!
-    Merb::BootLoader::ReloadClasses.reload
+describe &quot;TimedExecutor&quot; do
+  it &quot;should call a block of code repeatedly in the background&quot; do
+    list_of_things = []
+    
+    RealTimedExecutor.every(0.1) do
+      list_of_things &lt;&lt; &quot;Something&quot;
+    end
+    
+    sleep 0.5
+    
+    list_of_things.should_not be_empty
+    list_of_things.size.should &gt; 1
   end
+  
+end
+
+describe &quot;The reloader&quot; do
 
   before :all do
     @reload_file = File.dirname(__FILE__) / &quot;directory&quot; / &quot;app&quot; / &quot;controllers&quot; / &quot;reload.rb&quot;
-    File.open(@reload_file, &quot;w&quot;) do |f|
-      @text = &lt;&lt;-END
+    @text =  &lt;&lt;-END
 
         class Reloader &lt; Application
         end
@@ -20,10 +43,16 @@ describe &quot;The reloader&quot; do
         class Hello &lt; Application
         end
       END
-      f.puts @text
-    end
+     update_file @text
+     MockTimedExecutor.run_task
+  end
 
-    sleep SLEEP_TIME
+  def update_file(contents)
+    mtime = File.mtime(@reload_file)
+    f = File.open(@reload_file, &quot;w&quot;) do |f|
+      f.puts contents
+    end
+    FileUtils.touch(@reload_file, :mtime =&gt; mtime + 30)
   end
 
   it &quot;should reload files that were changed&quot; do
@@ -31,10 +60,7 @@ describe &quot;The reloader&quot; do
     defined?(Reloader).should_not be_nil
     defined?(Reloader2).should be_nil
 
-    sleep SLEEP_TIME
-
-    File.open(@reload_file, &quot;w&quot;) do |f|
-      f.puts &lt;&lt;-END
+    update_file &lt;&lt;-END
 
         class Reloader &lt; Application
         end
@@ -42,18 +68,17 @@ describe &quot;The reloader&quot; do
         class Reloader2
         end
       END
-    end
-
-    sleep SLEEP_TIME
-
+     
+    MockTimedExecutor.run_task
+    
     defined?(Hello).should be_nil
     defined?(Reloader).should_not be_nil
     defined?(Reloader2).should_not be_nil
   end
 
   it &quot;should remove classes for _abstract_subclasses&quot; do
-    File.open(@reload_file, &quot;w&quot;) do |f|
-      f.puts &lt;&lt;-END
+    
+    update_file &lt;&lt;-END
 
         class Reloader &lt; Application
         end
@@ -61,9 +86,8 @@ describe &quot;The reloader&quot; do
         class Reloader2 &lt; Application
         end
       END
-    end
-
-    sleep SLEEP_TIME
+    
+    MockTimedExecutor.run_task
 
     Merb::AbstractController._abstract_subclasses.should include(&quot;Reloader&quot;)
     Merb::AbstractController._abstract_subclasses.should include(&quot;Reloader2&quot;)
@@ -73,9 +97,7 @@ describe &quot;The reloader&quot; do
   end
 
   after :each do
-    sleep SLEEP_TIME
-    File.open(@reload_file, &quot;w&quot;) do |f|
-      f.puts @text
-    end
+    update_file @text
+    MockTimedExecutor.run_task
   end
 end</diff>
      <filename>spec/public/reloading/reload_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,4 +12,30 @@ describe Merb::Request do
     request.params[:file][:tempfile].class.should == Tempfile
     request.params[:file][:content_type].should == 'text/plain'
   end
+  
+  it &quot;should accept env['rack.input'] as IO object (instead of StringIO)&quot; do
+    file = Struct.new(:read, :filename, :path).
+      new(&quot;This is a text file with some small content in it.&quot;, &quot;sample.txt&quot;, &quot;sample.txt&quot;)
+    m = Merb::Test::MultipartRequestHelper::Post.new :file =&gt; file
+    body, head = m.to_multipart
+    
+    t = Tempfile.new(&quot;io&quot;)
+    t.write(body)
+    t.close
+    
+    fd = IO.sysopen(t.path)
+    io = IO.for_fd(fd,&quot;r&quot;)
+    request = Merb::Test::RequestHelper::FakeRequest.new({:request_method =&gt; &quot;POST&quot;, :content_type =&gt; 'multipart/form-data, boundary=----------0xKhTmLbOuNdArY', :content_length =&gt; body.length},io)
+
+    running {request.params}.should_not raise_error        
+    request.params[:file].should_not be_nil
+    request.params[:file][:tempfile].class.should == Tempfile
+    request.params[:file][:content_type].should == 'text/plain'
+  end    
+    
+  it &quot;should handle GET with a content_type but an empty body (happens in some browsers such as safari after redirect)&quot; do
+      request = fake_request({:request_method =&gt; &quot;GET&quot;, :content_type =&gt; 'multipart/form-data, boundary=----------0xKhTmLbOuNdArY', :content_length =&gt; 0}, :req =&gt; '')      
+      running {request.params}.should_not raise_error        
+  end
+  
 end
\ No newline at end of file</diff>
      <filename>spec/public/request/multipart_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -68,7 +68,14 @@ describe Merb::Request, &quot; query and body params&quot; do
     request.stub!(:route_params).and_return({})
     request.params.should == {&quot;foo&quot; =&gt; &quot;bar&quot;}
   end
-
+  
+  it &quot;should populated the inflated_object parameter if JSON params do not inflate to a hash&quot; do
+    request = fake_request({:content_type =&gt; &quot;application/json&quot;}, :req =&gt; %{[&quot;foo&quot;, &quot;bar&quot;]})
+    request.stub!(:route_params).and_return({})
+    request.params.should have_key(:inflated_object)
+    request.params[:inflated_object].should eql([&quot;foo&quot;, &quot;bar&quot;])
+  end
+  
   it &quot;should support XML params&quot; do
     request = fake_request({:content_type =&gt; &quot;application/xml&quot;}, :req =&gt; %{&lt;foo bar=&quot;baz&quot;&gt;&lt;baz/&gt;&lt;/foo&gt;})
     request.stub!(:route_params).and_return({})
@@ -194,7 +201,7 @@ describe Merb::Request, &quot; misc&quot; do
    :http_keep_alive         =&gt; [&quot;keep_alive&quot;, &quot;300&quot;],
    :http_accept_charset     =&gt; [&quot;accept_charset&quot;, &quot;UTF-8&quot;],
    :http_version            =&gt; [&quot;version&quot;, &quot;1.1&quot;],
-   :gateway_inteface        =&gt; [&quot;gateway&quot;, &quot;CGI/1.2&quot;],
+   :gateway_interface       =&gt; [&quot;gateway&quot;, &quot;CGI/1.2&quot;],
    :http_connection         =&gt; [&quot;connection&quot;, &quot;keep-alive&quot;],
    :path_info               =&gt; [&quot;path_info&quot;, &quot;foo/bar/baz&quot;],
   }.each do |env, vars|</diff>
      <filename>spec/public/request/request_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,36 +1,54 @@
 require File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;..&quot;, &quot;spec_helper&quot;)
 require 'ostruct'
+
+require 'rack/mock'
+require 'stringio'
+Merb.start :environment =&gt; 'test',
+           :merb_root =&gt; File.dirname(__FILE__) / 'fixture'
+
+
 class SimpleRequest &lt; OpenStruct
-  
+
   def method
     @table[:method]
   end
-  
+
   def params
     @table
   end
 end
 
 def prepare_route(from, to)
-  Merb::Router.prepare {|r| r.match(from).to(to)}  
+  Merb::Router.prepare {|r| r.match(from).to(to)}
 end
 
 def route_to(path, args = {}, protocol = &quot;http://&quot;)
   Merb::Router.match(SimpleRequest.new({:protocol =&gt; protocol, :path =&gt; path}.merge(args)))[1]
 end
 
+def match_for(path, args = {}, protocol = &quot;http://&quot;)
+  Merb::Router.match(SimpleRequest.new({:protocol =&gt; protocol, :path =&gt; path}.merge(args)))
+end
+
+def matched_route_for(*args)
+  # get route index
+  idx = match_for(*args)[0]
+
+  Merb::Router.routes[idx]
+end
+
 def generate(*args)
   Merb::Router.generate *args
 end
 
 module Merb
-  
+
   module Test
-    
+
     module RspecMatchers
 
       class HaveRoute
-        
+
         def self.build(expected)
           this = new
           this.instance_variable_set(&quot;@expected&quot;, expected)
@@ -62,11 +80,11 @@ module Merb
       def have_route(expected)
         HaveRoute.build(expected)
       end
-      
+
       def have_nil_route
         have_route({})
       end
-  
+
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>spec/public/router/spec_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,9 @@
 require File.join(File.dirname(__FILE__), &quot;spec_helper&quot;)
 
 describe &quot;Regex-based routes&quot; do
-  
+
   it &quot;should process a simple regex&quot; do
-    prepare_route(%r[^/foos?/(bar|baz)/:id], :controller =&gt; &quot;foo&quot;, :action =&gt; &quot;[1]&quot;, :id =&gt; &quot;:id&quot;)      
+    prepare_route(%r[^/foos?/(bar|baz)/:id], :controller =&gt; &quot;foo&quot;, :action =&gt; &quot;[1]&quot;, :id =&gt; &quot;:id&quot;)
     route_to(&quot;/foo/bar/baz&quot;).should have_route(:controller =&gt; &quot;foo&quot;, :action =&gt; &quot;bar&quot;, :id =&gt; &quot;baz&quot;)
     route_to(&quot;/foos/baz/bam&quot;).should have_route(:controller =&gt; &quot;foo&quot;, :action =&gt; &quot;baz&quot;, :id =&gt; &quot;bam&quot;)
   end
@@ -11,7 +11,7 @@ describe &quot;Regex-based routes&quot; do
   it &quot;should support inbound user agents&quot; do
     Merb::Router.prepare do |r|
       r.match(%r[^/foo/(.+)], :user_agent =&gt; /(MSIE|Gecko)/).
-        to(:controller =&gt; &quot;foo&quot;, :title =&gt; &quot;[1]&quot;, :action =&gt; &quot;show&quot;, :agent =&gt; &quot;:user_agent[1]&quot;)    
+        to(:controller =&gt; &quot;foo&quot;, :title =&gt; &quot;[1]&quot;, :action =&gt; &quot;show&quot;, :agent =&gt; &quot;:user_agent[1]&quot;)
     end
     route_to(&quot;/foo/bar&quot;, :user_agent =&gt; /MSIE/).should have_route(
       :controller =&gt; &quot;foo&quot;, :action =&gt; &quot;show&quot;, :title =&gt; &quot;bar&quot;, :agent =&gt; &quot;MSIE&quot;
@@ -21,7 +21,7 @@ describe &quot;Regex-based routes&quot; do
 end
 
 describe &quot;Routes that are restricted based on incoming params&quot; do
-  
+
   it &quot;should allow you to restrict routes to POST requests&quot; do
     Merb::Router.prepare do |r|
       r.match(&quot;/:controller/create/:id&quot;, :method =&gt; :post).
@@ -30,12 +30,12 @@ describe &quot;Routes that are restricted based on incoming params&quot; do
     route_to(&quot;/foo/create/12&quot;, :method =&gt; &quot;post&quot;).should have_route(
       :controller =&gt; &quot;foo&quot;, :action =&gt; &quot;create&quot;, :id =&gt; &quot;12&quot;
     )
-    
+
     route_to(&quot;/foo/create/12&quot;, :method =&gt; &quot;get&quot;).should_not have_route(
       :controller =&gt; &quot;foo&quot;, :action =&gt; &quot;create&quot;, :id =&gt; &quot;12&quot;
     )
   end
-  
+
   it &quot;should allow you to restrict routes based on protocol&quot; do
     Merb::Router.prepare do |r|
       r.match(:protocol =&gt; &quot;http://&quot;).to(:controller =&gt; &quot;foo&quot;, :action =&gt; &quot;bar&quot;)
@@ -44,5 +44,18 @@ describe &quot;Routes that are restricted based on incoming params&quot; do
     route_to(&quot;/foo/bar&quot;).should have_route(:controller =&gt; &quot;foo&quot;, :action =&gt; &quot;bar&quot;)
     route_to(&quot;/boo/hoo&quot;, :protocol =&gt; &quot;https://&quot;).should have_route(:controller =&gt; &quot;boo&quot;, :action =&gt; &quot;hoo&quot;)
   end
-  
-end
\ No newline at end of file
+
+  it &quot;does not require explicit specifying of params&quot; do
+    Merb::Router.prepare do |r|
+      r.match!(&quot;/fb/:callback_path/:controller/:action&quot;)
+    end
+
+    route_to(&quot;/fb/callybacky/products/search&quot;).should have_route(
+      :controller =&gt; &quot;products&quot;, :action =&gt; &quot;search&quot;, :callback_path =&gt; &quot;callybacky&quot;
+    )
+    route_to(&quot;/fb/ping/products/search&quot;).should have_route(
+      :controller =&gt; &quot;products&quot;, :action =&gt; &quot;search&quot;, :callback_path =&gt; &quot;ping&quot;
+    )
+  end
+
+end</diff>
      <filename>spec/public/router/special_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -52,6 +52,7 @@ describe Merb::Template do
   it &quot;should accept template-type registrations via #register_extensions&quot; do
     Merb::Template.register_extensions(Merb::Test::Fixtures::MyTemplateEngine, %w[myt])
     Merb::Template.engine_for(&quot;foo.myt&quot;).should == Merb::Test::Fixtures::MyTemplateEngine
+    Merb::Template.template_extensions.should include(&quot;myt&quot;)
   end
   
   # @semipublic</diff>
      <filename>spec/public/template/template_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -26,6 +26,15 @@ describe Merb::Test::RequestHelper do
       controller.params[:name].should == &quot;Fred&quot;
     end
 
+    it &quot;should dispatch to the given controller and action with the query string merged into the params&quot; do
+      Merb::Test::ControllerAssertionMock.should_receive(:called).with(:show)
+      controller = dispatch_to(@controller_klass, :show, {:name =&gt; &quot;Fred&quot;}, {'QUERY_STRING' =&gt; &quot;last_name=Jones&amp;age=42&quot;} )
+      
+      controller.params[:name].should == &quot;Fred&quot;
+      controller.params[:last_name].should == &quot;Jones&quot;
+      controller.params[:age].should == &quot;42&quot;   
+    end
+
     it &quot;should not hit the router to match its route&quot; do
       Merb::Router.should_not_receive(:match)
       dispatch_to(@controller_klass, :index)
@@ -85,6 +94,14 @@ describe Merb::Test::RequestHelper do
       controller = get(&quot;/spec_helper_controller&quot;, :name =&gt; &quot;Harry&quot;)
       controller.params[:name].should == &quot;Harry&quot;    
     end
+    
+    it &quot;should perform the index action and have params available from the query string&quot; do
+      Merb::Test::ControllerAssertionMock.should_receive(:called).with(:index)
+      controller = get(&quot;/spec_helper_controller?last_name=Oswald&amp;age=25&quot;, :name =&gt; &quot;Harry&quot;)
+      controller.params[:name].should == &quot;Harry&quot;
+      controller.params[:last_name].should == &quot;Oswald&quot;
+      controller.params[:age].should == &quot;25&quot;
+    end
 
     it &quot;should evaluate in the context of the controller in the block&quot; do
       get(&quot;/spec_helper_controller&quot;) do |controller|</diff>
      <filename>spec/public/test/request_helper_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -28,6 +28,23 @@ describe Merb::Test::RouteHelper do
     it &quot;should work with a parameters hash&quot; do
       url(:with_id, :id =&gt; 123).should == &quot;/123&quot;
     end
+    
+    it &quot;should turn extra hash items into query params&quot; do
+      generated_url = url(:getter, :id =&gt; 123, :color =&gt; 'red', :size =&gt; 'large')
+      lambda {
+        generated_url.match(/\bid=123\b/) &amp;&amp;
+        generated_url.match(/\bsize=large\b/) &amp;&amp;
+        generated_url.match(/\bcolor=red\b/)
+      }.call.should_not be_nil
+    end
+    
+    it &quot;should remove items with nil values from query params&quot; do
+      url(:getter, :color =&gt; nil, :size =&gt; 'large').should == &quot;/?size=large&quot;
+    end
+    
+    it &quot;should remove items with nil values from query params when named route isn't specified&quot; do
+      url(:controller =&gt; 'cont', :action =&gt; 'act', :color =&gt; nil, :size =&gt; 'large').should == &quot;/cont/act?size=large&quot;
+    end
   end
   
   describe &quot;#request_to&quot; do
@@ -51,4 +68,4 @@ describe Merb::Test::RouteHelper do
       request_to(&quot;/123&quot;)[:id].should == &quot;123&quot;
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>spec/public/test/route_helper_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -92,6 +92,22 @@ describe Merb::Test::Rspec::RouteMatchers do
           matcher.matches?(:controller =&gt; &quot;target_controller&quot;, :action =&gt; &quot;target_action&quot;)
           matcher.failure_message.should include(&quot;TargetController#target_action&quot;)
         end
+
+        it &quot;should include the expected parameters&quot; do
+          expected_parameters = {:id =&gt; '123', :page =&gt; '2'}
+          matcher = RouteToMatcher.new(TestController, :any_action)
+          matcher.with(expected_parameters)
+          matcher.matches?(:controller =&gt; &quot;target_controller&quot;, :action =&gt; &quot;target_action&quot;)
+          matcher.failure_message.should include(expected_parameters.inspect)
+        end
+
+        it &quot;should include the actual paramters&quot; do
+          expected_parameters, actual_parameters = {:id =&gt; '123', :page =&gt; '2'}, {:id =&gt; '2', :page =&gt; '321'}
+          matcher = RouteToMatcher.new(TestController, :any_action)
+          matcher.with(expected_parameters)
+          matcher.matches?(actual_parameters.merge(:controller =&gt; &quot;test_controller&quot;, :action =&gt; &quot;any_action&quot;))
+          matcher.failure_message.should include(actual_parameters.inspect)
+        end
       end
 
       describe &quot;#negative_failure_message&quot; do</diff>
      <filename>spec/public/test/route_matchers_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -132,7 +132,7 @@ describe Merb::Test::Rspec::ViewMatchers do
     describe HasContent do
       before(:each) do
         @element = stub(:element)
-        @element.stub!(:inner_content).and_return &lt;&lt;-EOF
+        @element.stub!(:inner_text).and_return &lt;&lt;-EOF
           &lt;div id='main'&gt;
             &lt;div class='inner'&gt;hello, world!&lt;/div&gt;
           &lt;/div&gt;
@@ -175,9 +175,9 @@ describe Merb::Test::Rspec::ViewMatchers do
           hc = HasContent.new(/hello,\sworld!/)
           hc.matches?(@element)
           
-          hc.failure_message.should include(@element.inner_content)
+          hc.failure_message.should include(@element.inner_text)
         end
       end
     end
   end
-end
\ No newline at end of file
+end</diff>
      <filename>spec/public/test/view_matchers_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,11 +3,13 @@ require &quot;rubygems&quot;
 require &quot;spec&quot;
 require File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;lib&quot;, &quot;merb-core&quot;)
 
+Merb.start :environment =&gt; 'test', :adapter =&gt; 'runner'
+
 # -- Global custom matchers --
 
 # A better +be_kind_of+ with more informative error messages.
 #
-# The default +be_kind_of+ just says 
+# The default +be_kind_of+ just says
 #
 #   &quot;expected to return true but got false&quot;
 #
@@ -16,13 +18,9 @@ require File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;lib&quot;, &quot;merb-core&quot;)
 #   &quot;expected File but got Tempfile&quot;
 
 module Merb
-  
   module Test
-    
     module RspecMatchers
-      
       class BeKindOf
-
         def initialize(expected) # + args
           @expected = expected
         end
@@ -43,7 +41,6 @@ module Merb
         def description
           &quot;be_kind_of #{@target}&quot;
         end
-
       end
 
       def be_kind_of(expected) # + args
@@ -52,20 +49,20 @@ module Merb
     end
 
     module Helper
-      
       def running(&amp;blk) blk; end
-      
+
       def executing(&amp;blk) blk; end
-      
+
       def doing(&amp;blk) blk; end
-      
-      def calling(&amp;blk) blk; end      
+
+      def calling(&amp;blk) blk; end
     end
   end
 end
 
+
 Spec::Runner.configure do |config|
   config.include Merb::Test::Helper
   config.include Merb::Test::RspecMatchers
-  config.include Merb::Test::RequestHelper  
-end
\ No newline at end of file
+  config.include Merb::Test::RequestHelper
+end</diff>
      <filename>spec/spec_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 
 
-class CodeStatistics #:nodoc:
+class CodeStatistics 
 
   TEST_TYPES = %w(Units Functionals Unit\ tests Functional\ tests Integration\ tests)
 </diff>
      <filename>tools/code_statistics.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>deps/rack/lib/rack.rbc</filename>
    </removed>
    <removed>
      <filename>deps/rack/lib/rack/builder.rbc</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>3e8a8934b62aaa5453a97b8150b0ab3877580e0c</id>
    </parent>
    <parent>
      <id>cd7bacb9c7eb105ecf84c01fb56bcc8af29b5c15</id>
    </parent>
  </parents>
  <author>
    <name>David James</name>
    <email>djwonk@collectiveinsight.net</email>
  </author>
  <url>http://github.com/wycats/merb-core/commit/75f71027c5f023eebb91023845f06262cb16a880</url>
  <id>75f71027c5f023eebb91023845f06262cb16a880</id>
  <committed-date>2008-06-11T10:52:54-07:00</committed-date>
  <authored-date>2008-06-11T10:52:54-07:00</authored-date>
  <message>Merge branch 'master' of git://github.com/wycats/merb-core

* 'master' of git://github.com/wycats/merb-core: (192 commits)
  siiiiiigh.
  Revert partial counter and yielding.
  Remove some duplication
  For crying out loud.
  Refactor display. WARNING: This commit might not be stable. I need to add a bunch more specs for display before I feel confident.
  Make the TemplateNotFound error read better. Slight refactor of _get_layout.
  Fix _template_for so it's actually readable
  uhhhhhhhh...
  Added Merb::Router.reset! and Merb::Router.capture
  Speedup Route URL generation
  Start work on fixing contaminated cousins bug.
  Changed controller inheritance of _template_root
  Added the ability to use full/absolute template paths for render, display and partial views
  This cannot be tested this way. It needs to be tested as a public spec (testing it privately here was a cop-out and fails when I fixed up the way dependency works).
  Allows passage of query string via env[&quot;QUERY_STRING&quot;] in tests. [#358 state:resolved]
  Handles use of dependency after BootLoading. [#360 state:resolved]
  properly set the session_id_key
  added 2 specs for multipart formdata: (1) for checking request with IO, (2) for testing GET with content_type not erroring on multipart/form-data absence; fixed error with multipart/form-data absence.
  Made Class a lot more sane.
  Fix README for merb-gen app foo
  ...</message>
  <tree>cc4fa07242559e1e20f49ba4422e51a48626916f</tree>
  <committer>
    <name>David James</name>
    <email>djwonk@collectiveinsight.net</email>
  </committer>
</commit>
