<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>CHANGELOG</filename>
    </added>
    <added>
      <filename>merb-builder/LICENSE</filename>
    </added>
    <added>
      <filename>merb-builder/README</filename>
    </added>
    <added>
      <filename>merb-builder/Rakefile</filename>
    </added>
    <added>
      <filename>merb-builder/TODO</filename>
    </added>
    <added>
      <filename>merb-builder/lib/merb-builder.rb</filename>
    </added>
    <added>
      <filename>merb-builder/lib/merb-builder/template.rb</filename>
    </added>
    <added>
      <filename>merb-builder/spec/builder_spec.rb</filename>
    </added>
    <added>
      <filename>merb-builder/spec/controllers/builder.rb</filename>
    </added>
    <added>
      <filename>merb-builder/spec/controllers/views/builder_config/index.xml.builder</filename>
    </added>
    <added>
      <filename>merb-builder/spec/controllers/views/builder_controller/index.xml.builder</filename>
    </added>
    <added>
      <filename>merb-builder/spec/controllers/views/partial_builder/_partial_builder.xml.builder</filename>
    </added>
    <added>
      <filename>merb-builder/spec/controllers/views/partial_builder/index.xml.builder</filename>
    </added>
    <added>
      <filename>merb-builder/spec/controllers/views/partial_ivars/_partial_builder.xml.builder</filename>
    </added>
    <added>
      <filename>merb-builder/spec/controllers/views/partial_ivars/index.xml.builder</filename>
    </added>
    <added>
      <filename>merb-builder/spec/spec_helper.rb</filename>
    </added>
    <added>
      <filename>merb-cache/LICENSE</filename>
    </added>
    <added>
      <filename>merb-cache/README</filename>
    </added>
    <added>
      <filename>merb-cache/Rakefile</filename>
    </added>
    <added>
      <filename>merb-cache/TODO</filename>
    </added>
    <added>
      <filename>merb-cache/lib/merb-cache.rb</filename>
    </added>
    <added>
      <filename>merb-cache/lib/merb-cache/cache-action.rb</filename>
    </added>
    <added>
      <filename>merb-cache/lib/merb-cache/cache-fragment.rb</filename>
    </added>
    <added>
      <filename>merb-cache/lib/merb-cache/cache-page.rb</filename>
    </added>
    <added>
      <filename>merb-cache/lib/merb-cache/cache-store/database-activerecord.rb</filename>
    </added>
    <added>
      <filename>merb-cache/lib/merb-cache/cache-store/database-datamapper.rb</filename>
    </added>
    <added>
      <filename>merb-cache/lib/merb-cache/cache-store/database-sequel.rb</filename>
    </added>
    <added>
      <filename>merb-cache/lib/merb-cache/cache-store/database.rb</filename>
    </added>
    <added>
      <filename>merb-cache/lib/merb-cache/cache-store/dummy.rb</filename>
    </added>
    <added>
      <filename>merb-cache/lib/merb-cache/cache-store/file.rb</filename>
    </added>
    <added>
      <filename>merb-cache/lib/merb-cache/cache-store/memcache.rb</filename>
    </added>
    <added>
      <filename>merb-cache/lib/merb-cache/cache-store/memory.rb</filename>
    </added>
    <added>
      <filename>merb-cache/lib/merb-cache/merb-cache.rb</filename>
    </added>
    <added>
      <filename>merb-cache/lib/merb-cache/merbtasks.rb</filename>
    </added>
    <added>
      <filename>merb-cache/spec/config/database.yml</filename>
    </added>
    <added>
      <filename>merb-cache/spec/controller.rb</filename>
    </added>
    <added>
      <filename>merb-cache/spec/merb-cache-action_spec.rb</filename>
    </added>
    <added>
      <filename>merb-cache/spec/merb-cache-fragment_spec.rb</filename>
    </added>
    <added>
      <filename>merb-cache/spec/merb-cache-page_spec.rb</filename>
    </added>
    <added>
      <filename>merb-cache/spec/merb-cache_spec.rb</filename>
    </added>
    <added>
      <filename>merb-cache/spec/spec_helper.rb</filename>
    </added>
    <added>
      <filename>merb-cache/spec/views/cache_controller/action1.html.erb</filename>
    </added>
    <added>
      <filename>merb-cache/spec/views/cache_controller/action2.html.haml</filename>
    </added>
    <added>
      <filename>merb-gen/app_generators/merb/templates/autotest/discover.rb</filename>
    </added>
    <added>
      <filename>merb-gen/app_generators/merb/templates/autotest/merb.rb</filename>
    </added>
    <added>
      <filename>merb-gen/app_generators/merb/templates/autotest/merb_rspec.rb</filename>
    </added>
    <added>
      <filename>merb-gen/app_generators/merb/templates/config/environments/rake.rb</filename>
    </added>
    <added>
      <filename>merb-gen/app_generators/merb/templates/public/.DS_Store</filename>
    </added>
    <added>
      <filename>merb-gen/app_generators/merb/templates/public/.htaccess</filename>
    </added>
    <added>
      <filename>merb-gen/app_generators/merb/templates/public/images/.DS_Store</filename>
    </added>
    <added>
      <filename>merb-gen/app_generators/merb_flat/templates/config/framework.rb</filename>
    </added>
    <added>
      <filename>merb-gen/merb_default_generators/resource_controller/templates/app/views/%controller_file_name%/delete.html.erb</filename>
    </added>
    <added>
      <filename>merb-gen/rspec_generators/merb_resource_controller_test/templates/spec/views/%controller_full_file_path%/delete.html.erb_spec.rb</filename>
    </added>
    <added>
      <filename>merb-haml/lib/merb-haml/merbtasks.rb</filename>
    </added>
    <added>
      <filename>merb-haml/spec/controllers/views/capture_haml/index.html.haml</filename>
    </added>
    <added>
      <filename>merb-haml/spec/controllers/views/concat_haml/index.html.haml</filename>
    </added>
    <added>
      <filename>merb-parts/spec/fixtures/views/main/part_within_view.html.erb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,17 +1,21 @@
 ## THESE ARE CRUCIAL
 module Merb
   # Set this to the version of merb-core that you are building against/for
-  VERSION = &quot;0.9.0&quot;
+  VERSION = &quot;0.9.2&quot;
 
   # Set this to the version of merb-more you plan to release
-  MORE_VERSION = &quot;0.9.0&quot;
+  MORE_VERSION = &quot;0.9.2&quot;
 end
 
+require &quot;rake/clean&quot;
 require &quot;rake/gempackagetask&quot;
 require 'fileutils'
 include FileUtils
 
-gems = %w[merb-action-args merb-assets merb-gen merb-haml merb-mailer merb-parts merb-test]
+gems = %w[
+  merb-action-args merb-assets merb-gen merb-haml
+  merb-builder merb-mailer merb-parts merb-cache
+]
 
 merb_more_spec = Gem::Specification.new do |s|
   s.name         = &quot;merb-more&quot;
@@ -22,7 +26,7 @@ merb_more_spec = Gem::Specification.new do |s|
   s.homepage     = &quot;http://www.merbivore.com&quot;
   s.summary      = &quot;(merb - merb-core) == merb-more.  The Full Stack. Take what you need; leave what you don't.&quot;
   s.description  = s.summary
-  s.files        = %w( LICENSE README Rakefile TODO )
+  s.files        = %w( LICENSE README Rakefile TODO lib/merb-more.rb )
   s.add_dependency &quot;merb-core&quot;, &quot;&gt;= #{Merb::VERSION}&quot;
   gems.each do |gem|
     s.add_dependency gem, [&quot;&gt;= #{Merb::VERSION}&quot;, &quot;&lt;= 1.0&quot;]
@@ -41,8 +45,11 @@ merb_spec = Gem::Specification.new do |s|
   s.files        = %w( LICENSE README Rakefile TODO )
   s.add_dependency &quot;merb-core&quot;, &quot;= #{Merb::VERSION}&quot;
   s.add_dependency &quot;merb-more&quot;, &quot;= #{Merb::MORE_VERSION}&quot;
+  s.add_dependency &quot;mongrel&quot;, &quot;&gt;= 1.0.1&quot;
 end
 
+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;, &quot;lib/merb-more.rb&quot;]
+
 windows = (PLATFORM =~ /win32|cygwin/) rescue nil
 
 SUDO = windows ? &quot;&quot; : &quot;sudo&quot;
@@ -60,21 +67,21 @@ end
 
 desc &quot;Install it all&quot;
 task :install =&gt; [:install_gems, :package] do
-  sh %{#{SUDO} gem install pkg/merb-more-#{Merb::MORE_VERSION}.gem}
-  sh %{#{SUDO} gem install pkg/merb-#{Merb::MORE_VERSION}.gem}
+  sh %{#{SUDO} gem install --local pkg/merb-more-#{Merb::MORE_VERSION}.gem  --no-update-sources}
+  sh %{#{SUDO} gem install --local pkg/merb-#{Merb::MORE_VERSION}.gem --no-update-sources}
 end
 
 desc &quot;Build the merb-more gems&quot;
 task :build_gems do
   gems.each do |dir|
-    sh %{cd #{dir}; rake package}
+    Dir.chdir(dir){ sh &quot;rake package&quot; }
   end
 end
 
 desc &quot;Install the merb-more sub-gems&quot;
 task :install_gems do
   gems.each do |dir|
-    sh %{cd #{dir}; #{SUDO} rake install}
+    Dir.chdir(dir){ sh &quot;#{SUDO} rake install&quot; }
   end
 end
 
@@ -85,9 +92,22 @@ task :uninstall_gems do
   end
 end
 
+task :package =&gt; [&quot;lib/merb-more.rb&quot;]
+desc &quot;Create merb-more.rb&quot;
+task &quot;lib/merb-more.rb&quot; do
+  mkdir_p &quot;lib&quot;
+  File.open(&quot;lib/merb-more.rb&quot;,&quot;w+&quot;) do |file|
+    file.puts &quot;### AUTOMATICALLY GENERATED.  DO NOT EDIT.&quot;
+    gems.each do |gem|
+      next if gem == &quot;merb-gen&quot;
+      file.puts &quot;require '#{gem}'&quot;
+    end
+  end
+end
+
 desc &quot;Bundle up all the merb-more gems&quot;
 task :bundle =&gt; [:package, :build_gems] do
-  mkdir &quot;bundle&quot;
+  mkdir_p &quot;bundle&quot;
   cp &quot;pkg/merb-#{Merb::MORE_VERSION}.gem&quot;, &quot;bundle&quot;
   cp &quot;pkg/merb-more-#{Merb::MORE_VERSION}.gem&quot;, &quot;bundle&quot;
   gems.each do |gem|</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ require 'rake/gempackagetask'
 
 PLUGIN = &quot;merb-action-args&quot;
 NAME = &quot;merb-action-args&quot;
-VERSION = &quot;0.9.0&quot;
+VERSION = &quot;0.9.2&quot;
 AUTHOR = &quot;Yehuda Katz&quot;
 EMAIL = &quot;ykatz@engineyard.com&quot;
 HOMEPAGE = &quot;http://merb-plugins.rubyforge.org/merb-haml/&quot;
@@ -20,7 +20,7 @@ spec = Gem::Specification.new do |s|
   s.author = AUTHOR
   s.email = EMAIL
   s.homepage = HOMEPAGE
-  s.add_dependency('merb-core', '&gt;= 0.9.0')
+  s.add_dependency('merb-core', '&gt;= 0.9.2')
   s.require_path = 'lib'
   s.autorequire = PLUGIN
   s.files = %w(LICENSE README Rakefile TODO) + Dir.glob(&quot;{lib,specs}/**/*&quot;)
@@ -31,7 +31,7 @@ Rake::GemPackageTask.new(spec) do |pkg|
 end
 
 task :install =&gt; [:package] do
-  sh %{sudo gem install pkg/#{NAME}-#{VERSION}}
+  sh %{sudo gem install pkg/#{NAME}-#{VERSION} --no-update-sources}
 end
 
 namespace :jruby do
@@ -41,4 +41,4 @@ namespace :jruby do
     sh %{#{SUDO} jruby -S gem install pkg/#{NAME}-#{Merb::VERSION}.gem --no-rdoc --no-ri}
   end
   
-end
\ No newline at end of file
+end</diff>
      <filename>merb-action-args/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,12 @@ class Merb::AbstractController
   class &lt;&lt; self
     attr_accessor :action_argument_list    
     alias_method :old_inherited, :inherited
-    
+
+    # Stores the argument lists for all methods for this class.
+    #
+    # ==== Parameters
+    # klass&lt;Class&gt;::
+    #   The controller that is being inherited from Merb::AbstractController.
     def inherited(klass)
       klass.action_argument_list = Hash.new do |h,k| 
         h[k] = ParseTreeArray.translate(klass, k.to_sym).get_args
@@ -11,13 +16,21 @@ class Merb::AbstractController
       old_inherited(klass)
     end
   end
-  
+
+  # Calls an action and maps the params hash to the action parameters.
+  #
+  # ==== Parameters
+  # action&lt;Symbol&gt;:: The action to call
+  #
+  # ==== Raises
+  # BadRequest:: The params hash doesn't have a required parameter.
   def _call_action(action)
     args = self.class.action_argument_list[action].map do |arg, default|
       arg = arg
-      raise BadRequest unless params.key?(arg.to_sym) || default
-      params.key?(arg.to_sym) ? params[arg.to_sym] : default
+      p = params.key?(arg.to_sym)
+      raise BadRequest unless p || default
+      p ? params[arg.to_sym] : default
     end
-    send(action, *args)
+    __send__(action, *args)
   end
 end
\ No newline at end of file</diff>
      <filename>merb-action-args/lib/merb-action-args/abstract_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,11 +22,19 @@ class ParseTreeArray &lt; Array #:nodoc:
   end
   
   def get_args
-    arg_node = deep_array_node(:args)
-    return nil unless arg_node
-    args = arg_node.arg_nodes
-    default_node = arg_node.deep_array_node(:block)
-    return args unless default_node
+    if arg_node = deep_array_node(:args)
+      # method defined with def keyword
+      args = arg_node.arg_nodes
+      default_node = arg_node.deep_array_node(:block)
+      return args unless default_node
+    else
+      # assuming method defined with Module#define_method
+      return []
+    end
+    
+    # if it was defined with def, and we found the default_node,
+    # that should bring us back to regularly scheduled programming..
+    
     lasgns = default_node[1..-1]
     lasgns.each do |asgn|
       args.assoc(asgn[1]) &lt;&lt; eval(RubyToRuby.new.process(asgn[2]))
@@ -38,14 +46,16 @@ end
 
 # Used in mapping controller arguments to the params hash.
 # NOTE: You must have the 'ruby2ruby' gem installed for this to work.
-# Example:
-#   (In PostsController)
+#
+# ==== Examples
+#   # In PostsController
 #   def show(id)  #=&gt; id is the same as params[:id]
-
 module GetArgs
   
-  # Returns an array of method arguments and their default values
-  # Example:
+  # ==== Returns
+  # Array:: Method arguments and their default values.
+  #
+  # ==== Examples
   #   class Example
   #     def hello(one,two=&quot;two&quot;,three)
   #     end
@@ -54,7 +64,8 @@ module GetArgs
   #     end
   #   end
   #
-  #   Example.instance_method(:hello).get_args    #=&gt; [[:one], [:two, &quot;two&quot;], [:three, &quot;three&quot;]]
+  #   Example.instance_method(:hello).get_args
+  #     #=&gt; [[:one], [:two, &quot;two&quot;], [:three, &quot;three&quot;]]
   #   Example.instance_method(:goodbye).get_args  #=&gt; nil
   def get_args
     klass, meth = self.to_s.split(/ /).to_a[1][0..-2].split(&quot;#&quot;)</diff>
      <filename>merb-action-args/lib/merb-action-args/get_args.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,4 +22,8 @@ describe Merb::AbstractController do
     lambda { dispatch_to(ActionArgs, :index) }.should raise_error(Merb::ControllerExceptions::BadRequest)
   end
   
+  it &quot;should treat define_method actions as equal&quot; do
+    dispatch_to(ActionArgs, :dynamic_define_method).body.should == &quot;mos def&quot;
+  end
+  
 end
\ No newline at end of file</diff>
      <filename>merb-action-args/spec/action_args_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -16,4 +16,8 @@ class ActionArgs &lt; Merb::Controller
     &quot;#{foo} #{bar} #{baz}&quot;
   end
   
+  define_method :dynamic_define_method do
+    &quot;mos def&quot;
+  end
+  
 end
\ No newline at end of file</diff>
      <filename>merb-action-args/spec/controllers/action-args.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,14 @@
 $TESTING=true
 $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
 
+require &quot;rubygems&quot;
 require &quot;merb-core&quot;
 require &quot;merb-action-args&quot;
 require File.dirname(__FILE__) / &quot;controllers&quot; / &quot;action-args&quot;
+require &quot;spec&quot;
 
-Merb.start :environment =&gt; 'test', :adapter =&gt; 'runner'
+Merb.start :environment =&gt; 'test'
 
-require &quot;merb-core/test/fake_request&quot;
-require &quot;merb-core/test/request_helper&quot;
 Spec::Runner.configure do |config|
   config.include Merb::Test::RequestHelper  
 end
\ No newline at end of file</diff>
      <filename>merb-action-args/spec/spec_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ require 'rake/gempackagetask'
 
 PLUGIN = &quot;merb-assets&quot;
 NAME = &quot;merb-assets&quot;
-VERSION = &quot;0.9.0&quot;
+VERSION = &quot;0.9.2&quot;
 AUTHOR = &quot;Ezra Zygmuntowicz&quot;
 EMAIL = &quot;ez@engineyard.com&quot;
 HOMEPAGE = &quot;http://merb-plugins.rubyforge.org/merb-assets/&quot;
@@ -20,7 +20,7 @@ spec = Gem::Specification.new do |s|
   s.author = AUTHOR
   s.email = EMAIL
   s.homepage = HOMEPAGE
-  s.add_dependency('merb-core', '&gt;= 0.9.0')
+  s.add_dependency('merb-core', '&gt;= 0.9.2')
   s.require_path = 'lib'
   s.autorequire = PLUGIN
   s.files = %w(LICENSE README Rakefile TODO) + Dir.glob(&quot;{lib,specs}/**/*&quot;)
@@ -31,7 +31,7 @@ Rake::GemPackageTask.new(spec) do |pkg|
 end
 
 task :install =&gt; [:package] do
-  sh %{sudo gem install pkg/#{NAME}-#{VERSION}}
+  sh %{sudo gem install pkg/#{NAME}-#{VERSION} --no-update-sources --no-update-sources}
 end
 
 namespace :jruby do
@@ -41,4 +41,4 @@ namespace :jruby do
     sh %{#{SUDO} jruby -S gem install pkg/#{NAME}-#{Merb::VERSION}.gem --no-rdoc --no-ri}
   end
   
-end
\ No newline at end of file
+end</diff>
      <filename>merb-assets/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,14 @@
 require 'merb-assets/assets'
 require 'merb-assets/assets_mixin'
 
-Merb::Controller.send(:include, Merb::AssetsMixin)
\ No newline at end of file
+Merb::BootLoader.before_app_loads do
+  Merb::Controller.send(:include, Merb::AssetsMixin)
+end
+
+
+Merb::Plugins.config[:asset_helpers] = {
+    :max_hosts =&gt; 4,
+    :asset_domain =&gt; &quot;assets%s&quot;,
+    :domain =&gt; &quot;my-awesome-domain.com&quot;,
+    :use_ssl =&gt; false
+  } if Merb::Plugins.config[:asset_helpers].nil?
\ No newline at end of file</diff>
      <filename>merb-assets/lib/merb-assets.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,6 @@ module Merb
     # Boolean::
     #   True if the assets should be bundled (e.g., production mode or
     #   :bundle_assets is explicitly enabled).
-    #
     def self.bundle?
       (Merb.environment == 'production') ||
       (!!Merb::Config[:bundle_assets])
@@ -28,7 +27,6 @@ module Merb
       # ==== Parameters
       # asset_type&lt;Symbol&gt;:: Type of the asset (e.g. :javascript).
       # filename&lt;~to_s&gt;:: The path to the file.
-      #
       # local_path&lt;Boolean&gt;::
       #   If true, the returned path will be relative to the Merb.root,
       #   otherwise it will be the public URI path. Defaults to false.
@@ -42,7 +40,6 @@ module Merb
       #
       #   asset_path(:javascript, :dingo, true)
       #   # =&gt; &quot;public/javascripts/dingo.js&quot;
-      #
       def asset_path(asset_type, filename, local_path = false)
         filename = filename.to_s
         if filename !~ /#{'\\' + ASSET_FILE_EXTENSIONS[asset_type]}\Z/
@@ -57,15 +54,55 @@ module Merb
       end
     end
     
+    # Helper for creating unique paths to a file name
+    # Can increase speend for browsers that are limited to a certain number of connections per host 
+    # for downloading static files (css, js, images...)
+    class UniqueAssetPath
+      class &lt;&lt; self
+        @@config = Merb::Plugins.config[:asset_helpers]
+        
+        # Builds the path to the file based on the name
+        # 
+        # ==== Parameters
+        # filename&lt;String&gt;:: Name of file to generate path for
+        #
+        # ==== Returns
+        # String:: The path to the asset.
+        #
+        # ==== Examples
+        #   build(&quot;/javascripts/my_fancy_script.js&quot;)
+        #   # =&gt; &quot;https://assets5.my-awesome-domain.com/javascripts/my_fancy_script.js&quot;
+        #
+        def build(filename)
+          #%{#{(USE_SSL ? 'https' : 'http')}://#{sprintf(@@config[:asset_domain],self.calculate_host_id(file))}.#{@@config[:domain]}/#{filename}}
+          path = @@config[:use_ssl] ? 'https://' : 'http://'
+          path &lt;&lt; sprintf(@@config[:asset_domain],self.calculate_host_id(filename)) &lt;&lt; &quot;.#{@@config[:domain]}&quot;
+          path &lt;&lt; &quot;/&quot; if filename.index('/') != 0
+          path &lt;&lt; filename
+        end
+      
+        protected
+        
+        # Calculates the id for the host
+        def calculate_host_id(filename)
+          ascii_total = 0
+          filename.each_byte {|byte|
+            ascii_total += byte
+          }
+          (ascii_total % @@config[:max_hosts] + 1)
+        end
+      end
+    end
+    
     # An abstract class for bundling text assets into single files.
     class AbstractAssetBundler
       class &lt;&lt; self
         
-        # Add a post-bundle callback.
+        # ==== Parameters
+        # &amp;block:: A block to add as a post-bundle callback.
         #
         # ==== Examples
         #   add_callback { |filename| `yuicompressor #{filename}` }
-        #
         def add_callback(&amp;block)
           callbacks &lt;&lt; block
         end
@@ -74,8 +111,7 @@ module Merb
         # Retrieve existing callbacks.
         #
         # ==== Returns
-        # Array:: An array of existing callbacks.
-        #
+        # Array[Proc]:: An array of existing callbacks.
         def callbacks
           @callbacks ||= []
           return @callbacks
@@ -85,21 +121,19 @@ module Merb
         # this method in your bundler code.
         #
         # ==== Raises
-        # NotImplementedError::
-        #   If this method has not been implemented by the bundler.
+        # NotImplementedError:: This method is implemented by the bundler.
         #
         # ==== Returns
         # Symbol:: The type of the asset
-        #
         def asset_type
           raise NotImplementedError, &quot;should return a symbol for the first argument to be passed to asset_path&quot;
         end
       end
-      
-      # Create a new asset bundler, which will produce a bundled file containing
-      # the contents of +files+. If +name+ is +true+ (as in, is an instance of
-      # +TrueClass+), the filename is written out as &quot;all&quot;, otherwise +name+
-      # is coerced into a string.
+
+      # ==== Parameters
+      # name&lt;~to_s&gt;::
+      #   Name of the bundle. If name is true, it will be converted to :all.
+      # *files&lt;String&gt;:: Names of the files to bundle.
       def initialize(name, *files)
         @bundle_name = name == true ? :all : name
         @bundle_filename = asset_path(self.class.asset_type, @bundle_name, true)
@@ -110,7 +144,6 @@ module Merb
       #
       # ==== Returns
       # Symbol:: Name of the bundle.
-      #
       def bundle!
         # TODO: Move this file check out into an in-memory cache. Also, push it out to the helper level so we don't have to create the helper object.
         unless File.exist?(@bundle_filename)
@@ -128,8 +161,7 @@ module Merb
       #
       # ==== Parameters
       # filename&lt;String&gt;:: Name of the bundle file.
-      # files&lt;Array&gt;:: An array of filenames to be bundled.
-      #
+      # *files&lt;String&gt;:: Filenames to be bundled.
       def bundle_files(filename, *files)
         File.open(filename, &quot;w&quot;) do |f|
           files.each { |file| f.puts(File.read(file)) }
@@ -142,6 +174,9 @@ module Merb
     # 
     #   javascripts/#{name}.js
     class JavascriptAssetBundler &lt; AbstractAssetBundler
+
+      # ==== Returns
+      # Symbol:: The asset type, i.e. :javascript.
       def self.asset_type
         :javascript
       end
@@ -151,6 +186,9 @@ module Merb
     # 
     #   stylesheets/#{name}.css
     class StylesheetAssetBundler &lt; AbstractAssetBundler
+
+      # ==== Returns
+      # Symbol:: The asset type, i.e. :stylesheet.
       def self.asset_type
         :stylesheet
       end</diff>
      <filename>merb-assets/lib/merb-assets/assets.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,37 +4,40 @@ module Merb
   module AssetsMixin
     include Merb::Assets::AssetHelpers
     # :section: Accessing Assets
-    # Merb provides views with convenience methods for links images and other assets.
-    
-    # Creates a link for the URL given in +url+ with the text in +name+; HTML options are given in the +opts+
-    # hash.
-    #
-    # ==== Options
-    # The +opts+ hash is used to set HTML attributes on the tag.
+    # Merb provides views with convenience methods for links images and other
+    # assets.
+
+    # ==== Parameters
+    # name&lt;~to_s&gt;:: The text of the link.
+    # url&lt;~to_s&gt;:: The URL to link to. Defaults to an empty string.
+    # opts&lt;Hash&gt;:: Additional HTML options for the link.
     #    
     # ==== Examples
     #   link_to(&quot;The Merb home page&quot;, &quot;http://www.merbivore.com/&quot;)
-    #   # =&gt; &lt;a href=&quot;http://www.merbivore.com/&quot;&gt;The Merb home page&lt;/a&gt;
+    #     # =&gt; &lt;a href=&quot;http://www.merbivore.com/&quot;&gt;The Merb home page&lt;/a&gt;
     #
     #   link_to(&quot;The Ruby home page&quot;, &quot;http://www.ruby-lang.org&quot;, {'class' =&gt; 'special', 'target' =&gt; 'blank'})
-    #   # =&gt; &lt;a href=&quot;http://www.ruby-lang.org&quot; class=&quot;special&quot; target=&quot;blank&quot;&gt;The Ruby home page&lt;/a&gt;
+    #     # =&gt; &lt;a href=&quot;http://www.ruby-lang.org&quot; class=&quot;special&quot; target=&quot;blank&quot;&gt;The Ruby home page&lt;/a&gt;
     #
     #   link_to p.title, &quot;/blog/show/#{p.id}&quot;
-    #   # =&gt; &lt;a href=&quot;blog/show/13&quot;&gt;The Entry Title&lt;/a&gt;
+    #     # =&gt; &lt;a href=&quot;blog/show/13&quot;&gt;The Entry Title&lt;/a&gt;
     #
     def link_to(name, url='', opts={})
       opts[:href] ||= url
       %{&lt;a #{ opts.to_xml_attributes }&gt;#{name}&lt;/a&gt;}
     end
   
-    # Creates an image tag with the +src+ attribute set to the +img+ argument.  The path
-    # prefix defaults to &lt;tt&gt;/images/&lt;/tt&gt;.  The path prefix can be overriden by setting a +:path+
-    # parameter in the +opts+ hash.  The rest of the +opts+ hash sets HTML attributes.
+    # ==== Parameters
+    # img&lt;~to_s&gt;:: The image path.
+    # opts&lt;Hash&gt;:: Additional options for the image tag (see below).
     #
-    # ==== Options
-    # path:: Sets the path prefix for the image (defaults to +/images/+)
+    # ==== Options (opts)
+    # :path&lt;String&gt;::
+    #   Sets the path prefix for the image. Defaults to &quot;/images/&quot; or whatever
+    #   is specified in Merb::Config. This is ignored if img is an absolute
+    #   path or full URL.
     # 
-    # All other options in +opts+ set HTML attributes on the tag.
+    # All other options set HTML attributes on the tag.
     #
     # ==== Examples
     #   image_tag('foo.gif') 
@@ -48,63 +51,71 @@ module Merb
     #
     #   image_tag('http://test.com/foo.gif')
     #   # =&gt; &lt;img src=&quot;http://test.com/foo.gif&quot;&gt;
+    #
+    #   image_tag('charts', :path =&gt; '/dynamic/')
+    #   or 
+    #   image_tag('/dynamic/charts')
+    #   # =&gt; &lt;img src=&quot;/dynamic/charts&quot;&gt;
     def image_tag(img, opts={})
-      opts[:path] ||= 
-        if img =~ %r{^https?://}
-          ''
-        else
-          if Merb::Config[:path_prefix]
-            Merb::Config[:path_prefix] + '/images/'
+      if img[0].chr == '/'
+        opts[:src] = img
+      else
+        opts[:path] ||= 
+          if img =~ %r{^https?://}
+            ''
           else
-            '/images/'
+            if Merb::Config[:path_prefix]
+              Merb::Config[:path_prefix] + '/images/'
+            else
+              '/images/'
+            end
           end
-        end
-      opts[:src] ||= opts.delete(:path) + img
+        opts[:src] ||= opts.delete(:path) + img
+      end
       %{&lt;img #{ opts.to_xml_attributes } /&gt;}    
     end
 
     # :section: JavaScript related functions
     #
     
-    # Escapes text for use in JavaScript, replacing unsafe strings with their
-    # escaped equivalent.
+    # ==== Parameters
+    # javascript&lt;String&gt;:: Text to escape for use in JavaScript.
     #
     # ==== Examples
     #   escape_js(&quot;'Lorem ipsum!' -- Some guy&quot;)
-    #   # =&gt; &quot;\\'Lorem ipsum!\\' -- Some guy&quot;
+    #     # =&gt; &quot;\\'Lorem ipsum!\\' -- Some guy&quot;
     #
     #   escape_js(&quot;Please keep text\nlines as skinny\nas possible.&quot;)
-    #   # =&gt; &quot;Please keep text\\nlines as skinny\\nas possible.&quot;
+    #     # =&gt; &quot;Please keep text\\nlines as skinny\\nas possible.&quot;
     def escape_js(javascript)
       (javascript || '').gsub('\\','\0\0').gsub(/\r\n|\n|\r/, &quot;\\n&quot;).gsub(/[&quot;']/) { |m| &quot;\\#{m}&quot; }
     end
     
-    # Creates a link tag with the text in +name+ and the &lt;tt&gt;onClick&lt;/tt&gt; handler set to a JavaScript 
-    # string in +function+.
+    # ==== Parameters
+    # name&lt;~to_s&gt;:: The text in the link.
+    # function&lt;~to_s&gt;:: The onClick event in JavaScript.
     #
     # ==== Examples
     #   link_to_function('Click me', &quot;alert('hi!')&quot;)
-    #   # =&gt; &lt;a href=&quot;#&quot; onclick=&quot;alert('hi!'); return false;&quot;&gt;Click me&lt;/a&gt;
+    #     # =&gt; &lt;a href=&quot;#&quot; onclick=&quot;alert('hi!'); return false;&quot;&gt;Click me&lt;/a&gt;
     #
     #   link_to_function('Add to cart', &quot;item_total += 1; alert('Item added!');&quot;)
-    #   # =&gt; &lt;a href=&quot;#&quot; onclick=&quot;item_total += 1; alert('Item added!'); return false;&quot;&gt;Add to cart&lt;/a&gt;
-    #   
+    #     # =&gt; &lt;a href=&quot;#&quot; onclick=&quot;item_total += 1; alert('Item added!'); return false;&quot;&gt;Add to cart&lt;/a&gt;
     def link_to_function(name, function)
       %{&lt;a href=&quot;#&quot; onclick=&quot;#{function}; return false;&quot;&gt;#{name}&lt;/a&gt;}
     end
     
-    # The js method simply calls +to_json+ on an object in +data+; if the object
-    # does not implement a +to_json+ method, then it calls +to_json+ on 
-    # +data.inspect+.
+    # ==== Parameters
+    # data&lt;Object&gt;::
+    #   Object to translate into JSON. If the object does not respond to
+    #   :to_json, then data.inspect.to_json is returned instead.
     #
     # ==== Examples
     #   js({'user' =&gt; 'Lewis', 'page' =&gt; 'home'})
-    #   # =&gt; &quot;{\&quot;user\&quot;:\&quot;Lewis\&quot;,\&quot;page\&quot;:\&quot;home\&quot;}&quot;
-    #
-    #   my_array = [1, 2, {&quot;a&quot;=&gt;3.141}, false, true, nil, 4..10]
-    #   js(my_array)
-    #   # =&gt; &quot;[1,2,{\&quot;a\&quot;:3.141},false,true,null,\&quot;4..10\&quot;]&quot;
+    #    # =&gt; &quot;{\&quot;user\&quot;:\&quot;Lewis\&quot;,\&quot;page\&quot;:\&quot;home\&quot;}&quot;
     #
+    #   js([ 1, 2, {&quot;a&quot;=&gt;3.141}, false, true, nil, 4..10 ])
+    #     # =&gt; &quot;[1,2,{\&quot;a\&quot;:3.141},false,true,null,\&quot;4..10\&quot;]&quot;
     def js(data)
       if data.respond_to? :to_json
         data.to_json
@@ -117,8 +128,9 @@ module Merb
     #
     # You can use require_js(:prototype) or require_css(:shinystyles)
     # from any view or layout, and the scripts will only be included once
-    # in the head of the final page. To get this effect, the head of your layout you will
-    # need to include a call to include_required_js and include_required_css.
+    # in the head of the final page. To get this effect, the head of your
+    # layout you will need to include a call to include_required_js and
+    # include_required_css.
     #
     # ==== Examples
     #   # File: app/views/layouts/application.html.erb
@@ -234,10 +246,12 @@ module Merb
     # 
     #   require_js :bundle =&gt; :posts
     
-    # The require_js method can be used to require any JavaScript
-    # file anywhere in your templates. Regardless of how many times
-    # a single script is included with require_js, Merb will only include
-    # it once in the header.
+    # The require_js method can be used to require any JavaScript file anywhere
+    # in your templates. Regardless of how many times a single script is
+    # included with require_js, Merb will only include it once in the header.
+    #
+    # ==== Parameters
+    # *js&lt;~to_s&gt;:: JavaScript files to include.
     #
     # ==== Examples
     #   &lt;% require_js 'jquery' %&gt;
@@ -254,10 +268,12 @@ module Merb
       @required_js |= js
     end
     
-    # The require_css method can be used to require any CSS
-    # file anywhere in your templates. Regardless of how many times
-    # a single stylesheet is included with require_css, Merb will only include
-    # it once in the header.
+    # The require_css method can be used to require any CSS file anywhere in
+    # your templates. Regardless of how many times a single stylesheet is
+    # included with require_css, Merb will only include it once in the header.
+    #
+    # ==== Parameters
+    # *css&lt;~to_s&gt;:: CSS files to include.
     #
     # ==== Examples
     #   &lt;% require_css('style') %&gt;
@@ -274,15 +290,16 @@ module Merb
       @required_css |= css
     end
     
-    # A method used in the layout of an application to create +&lt;script&gt;+ tags to include JavaScripts required in 
-    # in templates and subtemplates using require_js.
+    # A method used in the layout of an application to create +&lt;script&gt;+ tags
+    # to include JavaScripts required in in templates and subtemplates using
+    # require_js.
     # 
-    # ==== Options
-    # bundle::  The name of the bundle the scripts should be combined into.
-    #           If +nil+ or +false+, the bundle is not created. If +true+, a
-    #           bundle named &lt;tt&gt;all.js&lt;/tt&gt; is created. Otherwise,
-    #           &lt;tt&gt;:bundle&lt;/tt&gt; is treated as an asset name.
+    # ==== Parameters
+    # options&lt;Hash&gt;:: Options to pass to js_include_tag.
     # 
+    # ==== Returns
+    # String:: The JavaScript tag.
+    #
     # ==== Examples
     #   # my_action.herb has a call to require_js 'jquery'
     #   # File: layout/application.html.erb
@@ -301,14 +318,15 @@ module Merb
       js_include_tag(*(@required_js + [options]))
     end
     
-    # A method used in the layout of an application to create +&lt;link&gt;+ tags for CSS stylesheets required in 
-    # in templates and subtemplates using require_css.
+    # A method used in the layout of an application to create +&lt;link&gt;+ tags for
+    # CSS stylesheets required in in templates and subtemplates using
+    # require_css.
     # 
-    # ==== Options
-    # bundle::  The name of the bundle the stylesheets should be combined into.
-    #           If +nil+ or +false+, the bundle is not created. If +true+, a
-    #           bundle named &lt;tt&gt;all.css&lt;/tt&gt; is created. Otherwise,
-    #           &lt;tt&gt;:bundle&lt;/tt&gt; is treated as an asset name.
+    # ==== Parameters
+    # options&lt;Hash&gt;:: Options to pass to css_include_tag.
+    # 
+    # ==== Returns
+    # String:: The CSS tag.
     # 
     # ==== Examples
     #   # my_action.herb has a call to require_css 'style'
@@ -327,16 +345,19 @@ module Merb
       css_include_tag(*(@required_css + [options]))
     end
     
-    # The js_include_tag method will create a JavaScript 
-    # +&lt;include&gt;+ tag for each script named in the arguments, appending
-    # '.js' if it is left out of the call.
-    # 
+    # ==== Parameters
+    # *scripts::
+    #   The scripts to include. If the last element is a Hash, it will be used
+    #   as options (see below). If &quot;.js&quot; is left out from the script names, it
+    #   will be added to them.
+    #
     # ==== Options
-    # bundle::  The name of the bundle the scripts should be combined into.
-    #           If +nil+ or +false+, the bundle is not created. If +true+, a
-    #           bundle named &lt;tt&gt;all.js&lt;/tt&gt; is created. Otherwise,
-    #           &lt;tt&gt;:bundle&lt;/tt&gt; is treated as an asset name.
-    # 
+    # :bundle&lt;~to_s&gt;::
+    #   The name of the bundle the scripts should be combined into.
+    #
+    # ==== Returns
+    # String:: The JavaScript include tag(s).
+    #
     # ==== Examples
     #   js_include_tag 'jquery'
     #   # =&gt; &lt;script src=&quot;/javascripts/jquery.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
@@ -369,41 +390,47 @@ module Merb
           :src =&gt; asset_path(:javascript, script),
           :type =&gt; &quot;text/javascript&quot;
         }
-        tags &lt;&lt; %Q{&lt;script #{attrs.to_xml_attributes}&gt;//&lt;/script&gt;}
+        tags &lt;&lt; %Q{&lt;script #{attrs.to_xml_attributes}&gt;&lt;/script&gt;}
       end
 
       return tags
     end
     
-    # The css_include_tag method will create a CSS stylesheet 
-    # +&lt;link&gt;+ tag for each stylesheet named in the arguments, appending
-    # '.css' if it is left out of the call.
-    # 
+    # ==== Parameters
+    # *stylesheets::
+    #   The stylesheets to include. If the last element is a Hash, it will be
+    #   used as options (see below). If &quot;.css&quot; is left out from the stylesheet
+    #   names, it will be added to them.
+    #
     # ==== Options
-    # bundle::  The name of the bundle the stylesheets should be combined into.
-    #           If +nil+ or +false+, the bundle is not created. If +true+, a
-    #           bundle named &lt;tt&gt;all.css&lt;/tt&gt; is created. Otherwise,
-    #           &lt;tt&gt;:bundle&lt;/tt&gt; is treated as an asset name.
-    # media::   The media attribute for the generated link element. Defaults
-    #           to &lt;tt&gt;:all&lt;/tt&gt;.
+    # :bundle&lt;~to_s&gt;::
+    #   The name of the bundle the stylesheets should be combined into.
+    # :media&lt;~to_s&gt;::
+    #   The media attribute for the generated link element. Defaults to :all.
+    #
+    # ==== Returns
+    # String:: The CSS include tag(s).
     #
     # ==== Examples
     #   css_include_tag 'style'
-    #   # =&gt; &lt;link href=&quot;/stylesheets/style.css&quot; media=&quot;all&quot; rel=&quot;Stylesheet&quot; type=&quot;text/css&quot; /&gt;
+    #   # =&gt; &lt;link href=&quot;/stylesheets/style.css&quot; media=&quot;all&quot; rel=&quot;Stylesheet&quot; type=&quot;text/css&quot; charset=&quot;utf-8&quot; /&gt;
     #
     #   css_include_tag 'style.css', 'layout'
-    #   # =&gt; &lt;link href=&quot;/stylesheets/style.css&quot; media=&quot;all&quot; rel=&quot;Stylesheet&quot; type=&quot;text/css&quot; /&gt;
-    #   #    &lt;link href=&quot;/stylesheets/layout.css&quot; media=&quot;all&quot; rel=&quot;Stylesheet&quot; type=&quot;text/css&quot; /&gt;
+    #   # =&gt; &lt;link href=&quot;/stylesheets/style.css&quot; media=&quot;all&quot; rel=&quot;Stylesheet&quot; type=&quot;text/css&quot; charset=&quot;utf-8&quot; /&gt;
+    #   #    &lt;link href=&quot;/stylesheets/layout.css&quot; media=&quot;all&quot; rel=&quot;Stylesheet&quot; type=&quot;text/css&quot; charset=&quot;utf-8&quot; /&gt;
     #
     #   css_include_tag :menu
-    #   # =&gt; &lt;link href=&quot;/stylesheets/menu.css&quot; media=&quot;all&quot; rel=&quot;Stylesheet&quot; type=&quot;text/css&quot; /&gt;
+    #   # =&gt; &lt;link href=&quot;/stylesheets/menu.css&quot; media=&quot;all&quot; rel=&quot;Stylesheet&quot; type=&quot;text/css&quot; charset=&quot;utf-8&quot; /&gt;
     #
     #   css_include_tag :style, :screen
-    #   # =&gt; &lt;link href=&quot;/stylesheets/style.css&quot; media=&quot;all&quot; rel=&quot;Stylesheet&quot; type=&quot;text/css&quot; /&gt;
-    #   #    &lt;link href=&quot;/stylesheets/screen.css&quot; media=&quot;all&quot; rel=&quot;Stylesheet&quot; type=&quot;text/css&quot; /&gt;
+    #   # =&gt; &lt;link href=&quot;/stylesheets/style.css&quot; media=&quot;all&quot; rel=&quot;Stylesheet&quot; type=&quot;text/css&quot; charset=&quot;utf-8&quot; /&gt;
+    #   #    &lt;link href=&quot;/stylesheets/screen.css&quot; media=&quot;all&quot; rel=&quot;Stylesheet&quot; type=&quot;text/css&quot; charset=&quot;utf-8&quot; /&gt;
     # 
     #  css_include_tag :style, :media =&gt; :print
-    #  # =&gt; &lt;link href=&quot;/stylesheets/style.css&quot; media=&quot;print&quot; rel=&quot;Stylesheet&quot; type=&quot;text/css&quot; /&gt;
+    #  # =&gt; &lt;link href=&quot;/stylesheets/style.css&quot; media=&quot;print&quot; rel=&quot;Stylesheet&quot; type=&quot;text/css&quot; charset=&quot;utf-8&quot; /&gt;
+    #
+    #  css_include_tag :style, :charset =&gt; 'iso-8859-1'
+    #  # =&gt; &lt;link href=&quot;/stylesheets/style.css&quot; media=&quot;print&quot; rel=&quot;Stylesheet&quot; type=&quot;text/css&quot; charset=&quot;iso-8859-1&quot; /&gt;
     def css_include_tag(*stylesheets)
       options = stylesheets.last.is_a?(Hash) ? stylesheets.pop : {}
       return nil if stylesheets.empty?
@@ -421,6 +448,7 @@ module Merb
           :href =&gt; asset_path(:stylesheet, stylesheet),
           :type =&gt; &quot;text/css&quot;,
           :rel =&gt; &quot;Stylesheet&quot;,
+          :charset =&gt; options[:charset] || 'utf-8',
           :media =&gt; options[:media] || :all
         }
         tags &lt;&lt; %Q{&lt;link #{attrs.to_xml_attributes} /&gt;}
@@ -428,5 +456,107 @@ module Merb
 
       return tags
     end
+    
+    # ==== Parameters
+    # *assets::
+    #   The assets to include. These should be the full paths to any static served file
+    #
+    # ==== Returns
+    # Array:: Full unique paths to assets OR
+    # String:: if only a single path is requested
+    # ==== Examples
+    #  uniq_path(&quot;/javascripts/my.js&quot;,&quot;/javascripts/my.css&quot;)
+    #  #=&gt; [&quot;http://assets2.my-awesome-domain.com/javascripts/my.js&quot;, &quot;http://assets2.my-awesome-domain.com/javascripts/my.css&quot;]
+    #
+    #  uniq_path([&quot;/javascripts/my.js&quot;,&quot;/stylesheets/my.css&quot;])
+    #  #=&gt; [&quot;http://assets2.my-awesome-domain.com/javascripts/my.js&quot;, &quot;http://assets1.my-awesome-domain.com/stylesheets/my.css&quot;]
+    #
+    #  uniq_path(%w(/javascripts/my.js /stylesheets/my.css))
+    #  #=&gt; [&quot;http://assets2.my-awesome-domain.com/javascripts/my.js&quot;, &quot;http://assets1.my-awesome-domain.com/stylesheets/my.css&quot;]
+    #
+    #  uniq_path('/stylesheets/somearbitrary.css')
+    #  #=&gt; &quot;http://assets3.my-awesome-domain.com/stylesheets/somearbitrary.css&quot;
+    #
+    #  uniq_path('/images/hostsexypicture.jpg')
+    #  #=&gt;&quot;http://assets1.my-awesome-domain.com/images/hostsexypicture.jpg&quot;
+    def uniq_path(*assets)      
+      paths = []
+      assets.collect.flatten.each do |filename|
+        paths.push(UniqueAssetPath.build(filename))
+      end
+      paths.length &gt; 1 ? paths : paths.first
+    end
+    
+    # ==== Parameters
+    # *assets::
+    #   Creates unique paths for javascript files (prepends &quot;/javascripts&quot; and appends &quot;.js&quot;)
+    #
+    # ==== Returns
+    # Array:: Full unique paths to assets OR
+    # String:: if only a single path is requested
+    # ==== Examples
+    #  uniq_js_path(&quot;my&quot;)
+    #  #=&gt; &quot;http://assets2.my-awesome-domain.com/javascripts/my.js&quot;
+    #
+    #  uniq_js_path([&quot;admin/secrets&quot;,&quot;home/signup&quot;])
+    #  #=&gt; [&quot;http://assets2.my-awesome-domain.com/javascripts/admin/secrets.js&quot;, 
+    #         &quot;http://assets1.my-awesome-domain.com/javascripts/home/signup.js&quot;]
+    def uniq_js_path(*assets)
+      paths = []
+      assets.collect.flatten.each do |filename|
+        paths.push(UniqueAssetPath.build(asset_path(:javascript,filename,true)))
+      end
+      paths.length &gt; 1 ? paths : paths.first
+    end
+    
+    # ==== Parameters
+    # *assets::
+    #   Creates unique paths for stylesheet files (prepends &quot;/stylesheets&quot; and appends &quot;.css&quot;)
+    #
+    # ==== Returns
+    # Array:: Full unique paths to assets OR
+    # String:: if only a single path is requested
+    # ==== Examples
+    #  uniq_css_path(&quot;my&quot;)
+    #  #=&gt; &quot;http://assets2.my-awesome-domain.com/stylesheets/my.css&quot;
+    #
+    #  uniq_css_path([&quot;admin/secrets&quot;,&quot;home/signup&quot;])
+    #  #=&gt; [&quot;http://assets2.my-awesome-domain.com/stylesheets/admin/secrets.css&quot;, 
+    #         &quot;http://assets1.my-awesome-domain.com/stylesheets/home/signup.css&quot;]
+    def uniq_css_path(*assets)
+      paths = []
+      assets.collect.flatten.each do |filename|
+        paths.push(UniqueAssetPath.build(asset_path(:stylesheet,filename,true)))
+      end
+      paths.length &gt; 1 ? paths : paths.first
+    end
+    
+    # ==== Parameters
+    # *assets::
+    #   As js_include_tag but has unique path
+    #
+    # ==== Returns
+    # Array:: Full unique paths to assets OR
+    # String:: if only a single path is requested
+    # ==== Examples
+    #  uniq_js_tag(&quot;my&quot;)
+    #  #=&gt; &lt;script type=&quot;text/javascript&quot; src=&quot;http://assets2.my-awesome-domain.com/javascripts/my.js&quot;&gt;&lt;/script&gt;
+    def uniq_js_tag(*assets)
+      js_include_tag(uniq_js_path(assets))
+    end
+    
+    # ==== Parameters
+    # *assets::
+    #   As uniq_css_tag but has unique path
+    #
+    # ==== Returns
+    # Array:: Full unique paths to assets OR
+    # String:: if only a single path is requested
+    # ==== Examples
+    #  uniq_css_tag(&quot;my&quot;)
+    #  #=&gt; &lt;link href=&quot;http://assets2.my-awesome-domain.com/stylesheets/my.css&quot; type=&quot;text/css&quot; /&gt;
+    def uniq_css_tag(*assets)
+      css_include_tag(uniq_css_path(assets))
+    end
   end
 end</diff>
      <filename>merb-assets/lib/merb-assets/assets_mixin.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ require 'rubygems'
 require 'rake/gempackagetask'
 
 GEM = &quot;merb-gen&quot;
-VERSION = &quot;0.9.0&quot;
+VERSION = &quot;0.9.2&quot;
 AUTHOR = &quot;Yehuda Katz&quot;
 EMAIL = &quot;wycats@gmail.com&quot;
 HOMEPAGE = &quot;http://www.merbivore.com&quot;
@@ -23,8 +23,8 @@ spec = Gem::Specification.new do |s|
   s.executables = %w( merb-gen )
     
   # Uncomment this to add a dependency
-  s.add_dependency &quot;merb-core&quot;, &quot;&gt;= 0.9&quot;
-  s.add_dependency &quot;rubigen&quot;
+  s.add_dependency &quot;merb-core&quot;, &quot;&gt;= 0.9.2&quot;
+  s.add_dependency &quot;rubigen&quot;, &quot;&gt;= 1.2.4&quot;
   
   s.require_path = 'lib'
   s.autorequire = GEM
@@ -38,10 +38,10 @@ end
 
 namespace :jruby do
   task :install do
-    sh %{sudo jruby -S gem install pkg/#{GEM}-#{VERSION}}
+    sh %{sudo jruby -S gem install pkg/#{GEM}-#{VERSION} --no-update-sources}
   end
 end
 
 task :install =&gt; [:package] do
-  sh %{sudo gem install pkg/#{GEM}-#{VERSION}}
-end
\ No newline at end of file
+  sh %{sudo gem install pkg/#{GEM}-#{VERSION} --no-update-sources}
+end</diff>
      <filename>merb-gen/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -15,8 +15,22 @@ class MerbGenerator &lt; Merb::GeneratorBase
     &lt;&lt;-EOS.split(&quot;\n&quot;).map{|x| x.strip}.join(&quot;\n&quot;)
       Creates a Merb application stub.
 
-      USAGE: #{spec.name} -g path&quot;
+      USAGE: #{spec.name} -g path
+      
+      Set environment variable MERB_ORM=[activerecord|datamapper|sequel]
+      to pre-enabled an ORM.
     EOS
   end
 
+  def default_orm?(orm)
+    ENV['MERB_ORM'] == orm.to_s
+  end
+  
+  def default_test_suite?(suite)
+    return ENV['MERB_TEST_SUITE'] == suite.to_s if ENV['MERB_TEST_SUITE']
+    options[suite]
+  end
+
+  def display_framework_selections
+  end
 end</diff>
      <filename>merb-gen/app_generators/merb/merb_generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,52 +9,23 @@ require 'spec/rake/spectask'
 require 'fileutils'
 require 'merb-core'
 require 'rubigen'
-
-$RAKE_ENV = true
-
-Merb.start :environment =&gt; (ENV['MERB_ENV'] || 'development'),
-           :adapter     =&gt; 'runner',
-           :merb_root  =&gt; File.dirname(__FILE__)
-           
 include FileUtils
-# # # Get Merb plugins and dependencies
-Merb::Plugins.rakefiles.each {|r| require r } 
-
-# 
-#desc &quot;Packages up Merb.&quot;
-#task :default =&gt; [:package]
-
-desc &quot;load merb_init.rb&quot;
-task :merb_init do
-  require 'merb-core'
-  require File.dirname(__FILE__)+'/config/init.rb'
-end  
-
-task :uninstall =&gt; [:clean] do
-  sh %{sudo gem uninstall #{NAME}}
-end
-
-desc 'Run all tests, specs and finish with rcov'
-task :aok do
-  sh %{rake rcov}
-  sh %{rake spec}
-end
 
-unless Gem.cache.search(&quot;haml&quot;).empty?
-  namespace :haml do
-    desc &quot;Compiles all sass files into CSS&quot;
-    task :compile_sass do
-      gem 'haml'
-      require 'sass'
-      puts &quot;*** Updating stylesheets&quot;
-      Sass::Plugin.update_stylesheets
-      puts &quot;*** Done&quot;      
-    end
-  end
+# Load the basic runtime dependencies; this will include 
+# any plugins and therefore plugin rake tasks.
+init_env = ENV['MERB_ENV'] || 'rake'
+Merb.load_dependencies(:environment =&gt; init_env)
+     
+# Get Merb plugins and dependencies
+Merb::Plugins.rakefiles.each { |r| require r } 
+
+desc &quot;start runner environment&quot;
+task :merb_env do
+  Merb.start_environment(:environment =&gt; init_env, :adapter =&gt; 'runner')
 end
 
 ##############################################################################
-# SVN
+# ADD YOUR CUSTOM TASKS BELOW
 ##############################################################################
 
 desc &quot;Add new files to subversion&quot;</diff>
      <filename>merb-gen/app_generators/merb/templates/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 &lt;html&gt;
 &lt;head&gt;
-	&lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;
+	&lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
 	&lt;title&gt;&lt;%%= @exception_name %&gt;&lt;/title&gt;
 	&lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;
 		body {</diff>
      <filename>merb-gen/app_generators/merb/templates/app/views/exceptions/internal_server_error.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 &lt;div id=&quot;container&quot;&gt;
   &lt;div id=&quot;header-container&quot;&gt;
-    &lt;img src=&quot;/images/merb.jpg&quot;&gt;
+    &lt;img src=&quot;/images/merb.jpg&quot; /&gt;
     &lt;!-- &lt;h1&gt;Mongrel + Erb&lt;/h1&gt; --&gt;
     &lt;h2&gt;pocket rocket web framework&lt;/h2&gt;
     &lt;hr /&gt;
@@ -15,10 +15,27 @@
     &lt;h3&gt;Why am I seeing this page?&lt;/h3&gt;
     &lt;p&gt;Merb couldn't find an appropriate content_type to return,
       based on what you said was available via provides() and
-      what the client requested.  For more information, visit
-      http://merbivore.com/fixing_406_issues
-    &lt;/p&gt; 
-    
+      what the client requested.&lt;/p&gt;
+
+    &lt;h3&gt;How to add a mime-type&lt;/h3&gt;
+    &lt;pre&gt;&lt;code&gt;
+      Merb.add_mime_type :pdf, :to_pdf, %w[application/pdf], &amp;quot;Content-Encoding&amp;quot; =&amp;gt; &amp;quot;gzip&amp;quot;
+    &lt;/code&gt;&lt;/pre&gt;
+    &lt;h3&gt;What this means is:&lt;/h3&gt;
+    &lt;ul&gt;
+      &lt;li&gt;Add a mime-type for :pdf&lt;/li&gt;
+      &lt;li&gt;Register the method for converting objects to PDF as &lt;code&gt;#to_pdf&lt;/code&gt;.&lt;/li&gt;
+      &lt;li&gt;Register the incoming mime-type &quot;Accept&quot; header as &lt;code&gt;application/pdf&lt;/code&gt;.&lt;/li&gt;
+      &lt;li&gt;Specify a new header for PDF types so it will set &lt;code&gt;Content-Encoding&lt;/code&gt; to gzip.&lt;/li&gt;
+    &lt;/ul&gt;
+
+    &lt;h3&gt;You can then do:&lt;/h3&gt;
+    &lt;pre&gt;&lt;code&gt;
+      class Foo &amp;lt; Application
+        provides :pdf
+      end
+    &lt;/code&gt;&lt;/pre&gt;
+
     &lt;h3&gt;Where can I find help?&lt;/h3&gt;
     &lt;p&gt;If you have any questions or if you can't figure something out, please take a
       look at our &lt;a href=&quot;http://merb.devjavu.com/&quot;&gt; project development page&lt;/a&gt; or,
@@ -26,7 +43,7 @@
 
     &lt;h3&gt;How do I edit this page?&lt;/h3&gt;
     &lt;p&gt;You can change what people see when this happens byy editing &lt;tt&gt;app/views/exceptions/not_found.html.erb&lt;/tt&gt;.&lt;/p&gt; 
-  
+
   &lt;/div&gt;
 
   &lt;div id=&quot;footer-container&quot;&gt;</diff>
      <filename>merb-gen/app_generators/merb/templates/app/views/exceptions/not_acceptable.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 &lt;div id=&quot;container&quot;&gt;
   &lt;div id=&quot;header-container&quot;&gt;
-    &lt;img src=&quot;/images/merb.jpg&quot;&gt;
+    &lt;img src=&quot;/images/merb.jpg&quot; /&gt;
     &lt;!-- &lt;h1&gt;Mongrel + Erb&lt;/h1&gt; --&gt;
     &lt;h2&gt;pocket rocket web framework&lt;/h2&gt;
     &lt;hr /&gt;
@@ -23,7 +23,6 @@
     &lt;h3&gt;How do I edit this page?&lt;/h3&gt;
     &lt;p&gt;You're seeing this page because you need to edit the following files:
       &lt;ul&gt;
-        &lt;li&gt;config/merb.yml &lt;strong&gt;&lt;em&gt;(optional)&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
         &lt;li&gt;config/router.rb &lt;strong&gt;&lt;em&gt;(recommended)&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
         &lt;li&gt;app/views/exceptions/not_found.html.erb &lt;strong&gt;&lt;em&gt;(recommended)&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;
         &lt;li&gt;app/views/layout/application.html.erb &lt;strong&gt;&lt;em&gt;(change this layout)&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;</diff>
      <filename>merb-gen/app_generators/merb/templates/app/views/exceptions/not_found.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@
   &lt;head&gt;
     &lt;title&gt;Fresh Merb App&lt;/title&gt;
     &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
-    &lt;link rel=&quot;stylesheet&quot; href=&quot;/stylesheets/master.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; charset=&quot;utf-8&quot;&gt;
+    &lt;link rel=&quot;stylesheet&quot; href=&quot;/stylesheets/master.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; charset=&quot;utf-8&quot; /&gt;
   &lt;/head&gt;
   &lt;body&gt;
     &lt;%%= catch_content :for_layout %&gt;</diff>
      <filename>merb-gen/app_generators/merb/templates/app/views/layout/application.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,5 @@
 Merb.logger.info(&quot;Loaded TEST Environment...&quot;)
 Merb::Config.use { |c|
+  c[:testing] = true
   c[:exception_details] = true
-  c[:reload_classes] = true
-  c[:reload_time] = 0.5
 }
\ No newline at end of file</diff>
      <filename>merb-gen/app_generators/merb/templates/config/environments/test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,6 +7,11 @@ $LOAD_PATH.unshift(Merb.root / &quot;lib&quot;)
 
 &lt;% require 'sha1' %&gt;
 Merb::Config.use do |c|
+  
+  ### Sets up a custom session id key, if you want to piggyback sessions of other applications
+  ### with the cookie session store. If not specified, defaults to '_session_id'.
+  # c[:session_id_key] = '_session_id'
+  
   c[:session_secret_key]  = '&lt;%= SHA1.new(rand(100000000000).to_s).to_s %&gt;'
   c[:session_store] = 'cookie'
 end  
@@ -16,19 +21,25 @@ end
 ### if you need a database.
 
 ### Uncomment for DataMapper ORM
-# use_orm :datamapper
+&lt;%= &quot;# &quot; unless default_orm?(:datamapper) %&gt;use_orm :datamapper
 
 ### Uncomment for ActiveRecord ORM
-# use_orm :activerecord
+&lt;%= &quot;# &quot; unless default_orm?(:activerecord) %&gt;use_orm :activerecord
 
 ### Uncomment for Sequel ORM
-# use_orm :sequel
+&lt;%= &quot;# &quot; unless default_orm?(:sequel) %&gt;use_orm :sequel
 
 
 ### This defines which test framework the generators will use
 ### rspec is turned on by default
-# use_test :test_unit
-use_test :rspec
+###
+### Note that you need to install the merb_rspec if you want to ue
+### rspec and merb_test_unit if you want to use test_unit. 
+### merb_rspec is installed by default if you did gem install
+### merb.
+###
+&lt;%= &quot;# &quot; unless default_test_suite?(:test) %&gt;use_test :test_unit
+&lt;%= &quot;# &quot; unless default_test_suite?(:spec) %&gt;use_test :rspec
 
 ### Add your other dependencies here
 </diff>
      <filename>merb-gen/app_generators/merb/templates/config/init.rb</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>merb-gen/app_generators/merb/templates/public/images/merb.jpg</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,22 @@
 #!/usr/bin/env ruby
+                                                               
+require 'rubygems'
+require 'merb-core'
 
-argv = ARGV + %w[-a fcgi]
-Merb.start(argv)
\ No newline at end of file
+# this is Merb.root, change this if you have some funky setup.
+merb_root = File.expand_path(File.dirname(__FILE__) / '../')
+        
+# If the fcgi process runs as apache, make sure
+# we have an inlinedir set for Rubyinline action-args to work
+unless ENV[&quot;INLINEDIR&quot;] || ENV[&quot;HOME&quot;]
+  tmpdir = merb_root / &quot;tmp&quot;
+  unless File.directory?(tmpdir)
+    Dir.mkdir(tmpdir)
+  end                
+  ENV[&quot;INLINEDIR&quot;] = tmpdir
+end
+   
+# start merb with the fcgi adapter, add options or change the log dir here
+Merb.start(:adapter =&gt; 'fcgi',
+           :merb_root =&gt; merb_root,
+           :log_file =&gt; merb_root /'log'/'merb.log')
\ No newline at end of file</diff>
      <filename>merb-gen/app_generators/merb/templates/public/merb.fcgi</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,11 @@
-$TESTING=true
 require 'rubygems'
 require 'merb-core'
-require 'merb-core/test/fake_request'
-require 'merb-core/test/request_helper'
+require 'spec' # Satiates Autotest and anyone else not using the Rake tasks
 
-# TODO: Boot Merb, via the Test Rack adapter
-Merb.start :environment =&gt; (ENV['MERB_ENV'] || 'test'),
-           :adapter     =&gt; 'runner',
-           :merb_root  =&gt; File.join(File.dirname(__FILE__), &quot;..&quot; )
+Merb.start_environment(:testing =&gt; true, :adapter =&gt; 'runner', :environment =&gt; ENV['MERB_ENV'] || 'test')
 
 Spec::Runner.configure do |config|
-  config.include(Merb::Test::RequestHelper)
+  config.include(Merb::Test::ViewHelper)
+  config.include(Merb::Test::RouteHelper)
+  config.include(Merb::Test::ControllerHelper)
 end</diff>
      <filename>merb-gen/app_generators/merb/templates/spec/spec_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,12 @@
-# TODO: Boot Merb, via the Rack test adapter
-
 $TESTING=true
+require 'rubygems'
+require 'merb-core'
+
+
+# TODO: Boot Merb, via the Test Rack adapter
+Merb.start :environment =&gt; (ENV['MERB_ENV'] || 'test'),
+           :merb_root  =&gt; File.join(File.dirname(__FILE__), &quot;..&quot; )
 
-require 'test/unit'
-require 'merb/test/fake_request'
-require 'merb/test/request_helper'
 
 class Test::Unit::TestCase
   include Merb::Test::RequestHelper</diff>
      <filename>merb-gen/app_generators/merb/templates/test/test_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 class Foo &lt; Merb::Controller
 
   def _template_location(action, type = nil, controller = controller_name)
-    &quot;#{action}.#{type}&quot;
+    controller == &quot;layout&quot; ? &quot;layout.#{action}.#{type}&quot; : &quot;#{action}.#{type}&quot;
   end
 
   def index</diff>
      <filename>merb-gen/app_generators/merb_flat/templates/application.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,9 @@
-Merb.push_path(:view, Merb.root / &quot;views&quot;)
+# Move this to application.rb if you want it to be reloadable in dev mode.
 Merb::Router.prepare do |r|
   r.match('/').to(:controller =&gt; 'foo', :action =&gt;'index')
   r.default_routes
 end
 
-require 'application'
-
 &lt;% require 'sha1' %&gt;
 Merb::Config.use { |c|
   c[:environment]         = 'production',
@@ -13,6 +11,7 @@ Merb::Config.use { |c|
   c[:log_level]           = 'debug',
   c[:use_mutex]           = false,
   c[:session_store]       = 'cookie',
+  c[:session_id_key]      = '_session_id',
   c[:session_secret_key]  = '&lt;%= SHA1.new(rand(100000000000).to_s).to_s %&gt;',
   c[:exception_details]   = true,
   c[:reload_classes]      = true,</diff>
      <filename>merb-gen/app_generators/merb_flat/templates/config/init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,5 +6,13 @@ if defined?(Merb::Plugins)
     :chickens =&gt; false
   }
   
+  Merb::BootLoader.before_app_loads do
+    # require code that must be loaded before the application
+  end
+  
+  Merb::BootLoader.after_app_loads do
+    # code that can be required after the application loads
+  end
+  
   Merb::Plugins.add_rakefiles &quot;&lt;%= base_name %&gt;/merbtasks&quot;
 end
\ No newline at end of file</diff>
      <filename>merb-gen/app_generators/merb_plugin/templates/lib/%base_name%.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,14 +2,14 @@
 
 at_exit { exit }
 
-command = ARGV.shift if %w( generate destroy update ).include?(ARGV[0])
+command = ARGV.shift if %w(generate destroy update).include?(ARGV[0])
 
 %w(rubygems merb-core).each do |file|
   require file
 end
 
 # start merb
-Merb.start :environment =&gt; 'development', :adapter =&gt; 'runner', :log_level =&gt; 'error'
+Merb.start :environment =&gt; 'development', :log_level =&gt; 'error'
 
 # remove dependency
 module Kernel
@@ -21,11 +21,57 @@ end
   require file
 end
 
-if ARGV.empty?
+app_help = &lt;&lt;-EOF
+  Application Generators:
+  To generate an application use one of the following
+  merb-gen app app_name             (for a standard application)
+  merb-gen app app_name --flat      (for a flattened application)
+  merb-gen app app_name --very-flat (for a single file application)
+  merb-gen frozen-merb          (script to run from frozen gems/framework)
+  merb-gen plugin plugin_name   (creates a plugin gem skeleton)
+
+  Other Generators:
+  merb-gen generators
+  with no args will display all availble generators for the current configuration.
+EOF
+
+# merb-gen || merb-gen help || merb-gen help app || merb-gen app
+if ARGV.empty? || (ARGV[0] == &quot;help&quot; &amp;&amp; ARGV.length == 1) || 
+  (ARGV[0] == &quot;help&quot; &amp;&amp; ARGV[1] == &quot;app&quot;) || (ARGV[0] == &quot;app&quot; &amp;&amp; ARGV.length == 1)
+  puts app_help
+  
+# merb-gen generators
+elsif ARGV[0] == &quot;generators&quot;
   # List all the Available Generators
   RubiGen::Base.use_component_sources! Merb.generator_scope
-  RubiGen::Scripts::Generate.new.run(ARGV)
-
+  RubiGen::Scripts::Generate.new.run([])
+ 
+# merb-gen help foo
+elsif ARGV[0] &amp;&amp; ARGV[0] == &quot;help&quot;
+  begin
+    RubiGen::Base.use_component_sources! Merb.generator_scope
+    RubiGen::Base.lookup(ARGV[1])
+    Merb::ComponentGenerator.run ARGV[1], ARGV[2..-1], ARGV[1], command || &quot;generate&quot;
+  rescue RubiGen::GeneratorError
+    # List all the Available Generators
+    RubiGen::Base.use_component_sources! Merb.generator_scope
+    RubiGen::Scripts::Generate.new.run([]) 
+  rescue =&gt; e
+    puts e.message
+  end
+
+# merb-gen app myapp
+elsif ARGV[0] &amp;&amp; ARGV[0] == &quot;app&quot; &amp;&amp; ARGV[1] &amp;&amp; ARGV[1] !~ /^-/
+  app_type = case ARGV[2]
+  when &quot;--flat&quot;
+    &quot;merb_flat&quot;
+  when &quot;--very-flat&quot;
+    &quot;merb_very_flat&quot;
+  else
+    &quot;merb&quot;
+  end
+  Merb::ApplicationGenerator.run ARGV[1], ARGV[3..-1], app_type, command || &quot;generate&quot;
+      
 # merb-gen plugin foo
 elsif ARGV[0] &amp;&amp; ARGV[0] == &quot;plugin&quot;
   Merb::ApplicationGenerator.run ARGV[1], ARGV[2..-1], &quot;merb_plugin&quot;, command || &quot;generate&quot;
@@ -39,32 +85,9 @@ elsif ARGV[0] &amp;&amp; ARGV[0] == &quot;frozen-merb&quot;
 elsif ARGV[1] &amp;&amp; ARGV[1] !~ /^-/
   Merb::ComponentGenerator.run ARGV[1], ARGV[1..-1], ARGV.first, command || &quot;generate&quot;
 
-# merb-gen foo --flat
-elsif ARGV[1] &amp;&amp; ARGV[1] == &quot;--flat&quot;
-  Merb::ApplicationGenerator.run ARGV.first, ARGV[2..-1], &quot;merb_flat&quot;, command || &quot;generate&quot;
-
-# merb-gen foo --very-flat
-elsif ARGV[1] &amp;&amp; ARGV[1] == &quot;--very-flat&quot;
-  Merb::ApplicationGenerator.run ARGV.first, ARGV[2..-1], &quot;merb_very_flat&quot;, command || &quot;generate&quot;
-
-
 # catch all merb-gen -??? and display help instead of creating application in -???
 elsif ARGV[0] &amp;&amp; ARGV[0] =~ /^-/
-  puts &lt;&lt;-EOF
-  Application Generators:
-  To generate an application use one of the following
-  merb-gen app_name             (for a standard application)
-  merb-gen app_name --flat      (for a flattened application)
-  merb-gen app_name --very-flat (for a single file application)
-  merb-gen frozen-merb          (script to run from frozen gems/framework)
-  merb-gen plugin plugin_name   (creates a plugin gem skeleton)
-  
-  Other Generators:
-  merb-gen
-  with no args will display all availble generators for the current configuration.
-  EOF
-
-
+  puts app_help
 
 else
   begin
@@ -72,10 +95,9 @@ else
     RubiGen::Base.use_component_sources! Merb.generator_scope
     RubiGen::Base.lookup(ARGV[0])
     Merb::ComponentGenerator.run ARGV[0], ARGV[1..-1], ARGV.first, command || &quot;generate&quot;
+  rescue RubiGen::GeneratorError
+    puts app_help
   rescue =&gt; e
     puts e.message
-    # merb-gen foo
-    # merb-gen foo --test
-    Merb::ApplicationGenerator.run ARGV.first, ARGV[1..-1], &quot;merb&quot;, command || &quot;generate&quot;
   end  
 end</diff>
      <filename>merb-gen/bin/merb-gen</filename>
    </modified>
    <modified>
      <diff>@@ -24,7 +24,7 @@ module Merb
     def self.run(name, argv, generator, command)
       app_root = Dir.pwd
       
-      # Merb.start :environment =&gt; 'development', :adapter =&gt; 'runner'
+      # Merb.start :environment =&gt; 'development'
       
       Gem.clear_paths
       Gem.path.unshift(app_root / &quot;gems&quot;)
@@ -32,7 +32,7 @@ module Merb
       require &quot;rubigen/scripts/#{command}&quot;
       
       RubiGen::Base.use_component_sources! Merb.generator_scope
-      RubiGen::Scripts.const_get(command.capitalize).new.run(argv, :generator =&gt; generator)
+      RubiGen::Scripts.const_get(command.capitalize).new.run(argv, :generator =&gt; generator, :destination =&gt; app_root)
     end
   end
 end
\ No newline at end of file</diff>
      <filename>merb-gen/lib/merb-gen.rb</filename>
    </modified>
    <modified>
      <diff>@@ -24,15 +24,16 @@ class Merb::GeneratorBase &lt; RubiGen::Base
       options[&quot;spec&quot;] = true unless options[&quot;test&quot;]
 
       # Set directories that should be optional based on command-line args
-      @choices = %w( test spec )
+      @choices = %w(test spec)
       
       # Set the assigns that should be used for path-interpolation and building templates
-      @assigns = {:base_name =&gt; File.basename(@name)}
+      @assigns = {:base_name =&gt; File.basename(@name), :test_type =&gt; options[&quot;spec&quot;] ? &quot;rspec&quot; : &quot;test_unit&quot;}
       
       FileUtils.mkdir_p @name 
       copy_dirs
       copy_files
 
+      display_framework_selections
     end
   end
   
@@ -50,4 +51,12 @@ class Merb::GeneratorBase &lt; RubiGen::Base
     opts.on(&quot;-T&quot;, &quot;--[no-]test&quot;, &quot;Generate with Test::Unit&quot;) {|t| @options[&quot;test&quot;] = true}
   end
     
+  def display_framework_selections
+    puts
+    puts &quot;Your app will use the #{@assigns[:test_type]} test framework.&quot;
+    if Gem.cache.search(&quot;merb_#{@assigns[:test_type]}&quot;).size == 0
+      puts &quot;You need to install the merb_#{@assigns[:test_type]} gem.&quot;
+    end
+    puts
+  end
 end</diff>
      <filename>merb-gen/lib/merb-gen/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,15 @@
 MAIN_BINDING = binding unless defined?(MAIN_BINDING)
 
 module Merb::GeneratorHelpers
+  
+  # Remove &quot;template/&quot; from a file name
+  # 
+  # ==== Parameters
+  # +path+&lt;String&gt;:: the path to relative-ize
+  # +dir+&lt;String&gt;::  a prefix directory to add into the relative-ized path
+  # 
+  # ==== Returns
+  # String:: a relative-ized path
   def relative(path, dir = nil)
     path.gsub(/^#{base}\/templates(\/#{dir ? dir + &quot;/&quot; : &quot;&quot;})?/, &quot;&quot;)
   end
@@ -9,53 +18,91 @@ module Merb::GeneratorHelpers
     path.gsub(/%([^\}]*)%/) {|x| assigns[$1.to_sym]}
   end  
   
+  # Establishes the directories of the template layout
   def copy_dirs
-    basedirs = Dir[&quot;#{base}/templates/**/*&quot;].
-      select {|x| File.directory?(x) &amp;&amp; (!choices.include?(relative(x)) || options[relative(x)]) }.
-      map {|x| relative(x) }
-
-    basedirs.each do |path|
+    select_template_directories.map { |x| relative(x) }.each do |path|
       m.directory interpolate_path(path)
     end
   end
   
+  # Copies all files within each directory of the template layout
   def copy_files
-    (Dir[&quot;#{base}/templates/**/*&quot;] + Dir[&quot;#{base}/templates&quot;]).each do |file|
-      
-      # Only continue if the file is a directory
-      next unless File.directory?(file)
-      
-      # Skip it if it's a choice (rspec vs. test/unit, for instance), and options[&quot;spec&quot;] is not set.
-      next if (choices.include?(relative(file)) &amp;&amp; !options[relative(file)])
-      
+    select_template_directories(true).each do |file|
       # Remove &quot;template/&quot; from the glob filename
       dir = relative(file)
       
-      # Get all the files under the directory that are not directories or in the list of excluded templates above.
-      files = Dir[&quot;#{file}/*&quot;].reject {|f| File.directory?(f)}
+      # Get all the files under the directory that are not directories or in 
+      # the list of excluded templates above.
+      files = Dir[&quot;#{file.empty? ? &quot;.&quot; : file}/*&quot;].reject { |f| File.directory?(f) }
       
       next if files.empty?
       
       # We want to templatize any files that contain &lt;% %&gt; characters
+      #--
+      # This is old code, should we need it: 
       # templates, to_copy = files.partition {|file| !(file =~ /\.erb$/) &amp;&amp; File.read(file) =~ /&lt;%.*%&gt;/}
-      templates, to_copy = files.partition {|file| File.read(file) =~ /&lt;%.*%&gt;/}
+      templates, to_copy = files.partition { |file| File.read(file) =~ /&lt;%.*%&gt;/ }
       
       # Make the paths relative to the directory we're inspecting
-      to_copy.map! {|f| relative(f, dir) }
-      templates.map! {|f| relative(f, dir) }
+      [to_copy, templates].each do |paths|
+        paths.map! { |f| relative(f, dir) }
+      end
       
       # Copy the files over
-      to_copy.each do |file_name|
-        m.file &quot;#{dir}#{&quot;/&quot; unless dir.empty?}#{file_name}&quot;, 
-          &quot;#{interpolate_path(dir)}#{&quot;/&quot; unless dir.empty?}#{interpolate_path(file_name)}&quot;
+      to_copy.each do |filename|
+        m.file(
+          file_name(dir, filename), 
+          file_name(interpolate_path(dir), filename)
+        )
       end
 
       # Copy the templates over
-      templates.each do |file_name|
-        m.template &quot;#{dir}#{&quot;/&quot; unless dir.empty?}#{file_name}&quot;, 
-          &quot;#{interpolate_path(dir)}#{&quot;/&quot; unless dir.empty?}#{interpolate_path(file_name)}&quot;, assigns
+      templates.each do |filename|
+        m.template(
+          file_name(dir, filename), 
+          file_name(interpolate_path(dir), interpolate_path(filename))
+        )
       end
     end
-  end    
+  end
+  
+private
+  
+  # Selects all *directories* in the 'templates' folder. This accounts for 
+  # +choices+ and +options+.
+  # 
+  # ==== Arguments
+  # +with_root+&lt;true,false&gt;:: whether or not to include the base/templates 
+  #                           directory
+  # 
+  # ==== Returns
+  # Array:: all directories found in the 'templates' folder.
+  def select_template_directories(with_root=false)
+    selected = Dir[&quot;#{base}/templates/**/*&quot;].compact.select do |f|
+      File.directory?(f) &amp;&amp; 
+      (!choices.include?(relative(f)) || options[relative(f)])
+    end
+    selected += [&quot;#{base}/templates&quot;] if with_root
+    return selected
+  end
+  
+  # This was extracted from +copy_files+. It appears to do the same thing as 
+  # File.join, but it doesn't account for the OS.
+  # 
+  # ==== Arguments
+  # +dir+&lt;String&gt;::  the directory to place the file in
+  # +name+&lt;String&gt;:: the name of said file
+  # 
+  # ==== Returns
+  # String:: a string representing the path for some file
+  # 
+  # ==== Examples
+  #   &gt; file_name(&quot;folder&quot;, &quot;some_file.txt&quot;)
+  #   =&gt; &quot;folder/some_file.txt&quot;
+  #   &gt; file_name(&quot;&quot;, &quot;some_file.txt&quot;)
+  #   =&gt; &quot;some_file.txt&quot;
+  def file_name(dir, name)
+    &quot;#{dir}#{&quot;/&quot; unless dir.empty?}#{name}&quot;
+  end
     
 end
\ No newline at end of file</diff>
      <filename>merb-gen/lib/merb-gen/helpers.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,6 +22,10 @@
 &lt;%= &quot;  &quot; * counter %&gt;    render
 &lt;%= &quot;  &quot; * counter %&gt;  end
 
+&lt;%= &quot;  &quot; * counter %&gt;  def delete
+&lt;%= &quot;  &quot; * counter %&gt;    render
+&lt;%= &quot;  &quot; * counter %&gt;  end
+
 &lt;%= &quot;  &quot; * counter %&gt;  def create
 &lt;%= &quot;  &quot; * counter %&gt;    render
 &lt;%= &quot;  &quot; * counter %&gt;  end</diff>
      <filename>merb-gen/merb_default_generators/resource_controller/templates/app/controllers/%controller_file_name%.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1 @@
-Your in index of the &lt;%= full_controller_const %&gt;
\ No newline at end of file
+You're in index of the &lt;%= full_controller_const %&gt;
\ No newline at end of file</diff>
      <filename>merb-gen/merb_generators/controller/templates/app/views/%controller_file_name%/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -26,12 +26,18 @@ if File.directory?(framework)
   require &quot;merb-core/core_ext/rubygems&quot;
 else
   gem = Dir.glob(__DIR__ + &quot;/gems/gems/merb-core-*&quot;).last
-  raise &quot;Can't run frozen without framework/ or loca gem&quot; unless gem
-  require gem + &quot;/lib/core_ext/kernel&quot;
-  require gem + &quot;/lib/core_ext/rubygems&quot;
+  raise &quot;Can't run frozen without framework/ or local gem&quot; unless gem
+  require gem + &quot;/lib/merb-core/core_ext/kernel&quot;
+  require gem + &quot;/lib/merb-core/core_ext/rubygems&quot;
+  
+  Gem.clear_paths
+  Gem.path.unshift(__DIR__+&quot;/gems&quot;)
 end
 
-
 require 'merb-core'
+unless %w[-a --adapter -i --irb-console -r --script-runner].any? { |o| ARGV.index(o) }
+  ARGV.push *%w[-a mongrel]
+end
+  
 Merb.frozen!
 Merb.start</diff>
      <filename>merb-gen/merb_generators/freezer/templates/script/frozen-merb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,6 @@ require File.join(File.dirname(__FILE__), &quot;&lt;%= Array.new((controller_modules.siz
 
 describe &lt;%= full_controller_const %&gt;, &quot;index action&quot; do
   before(:each) do
-    @controller = &lt;%= full_controller_const %&gt;.build(fake_request)
-    @controller.dispatch('index')
+    dispatch_to(&lt;%= full_controller_const %&gt;, :index)
   end
 end
\ No newline at end of file</diff>
      <filename>merb-gen/rspec_generators/merb_controller_test/templates/spec/controllers/%controller_full_file_path%_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,6 @@ require File.join(File.dirname(__FILE__), &quot;&lt;%= Array.new((controller_modules.siz
 
 describe &lt;%= full_controller_const %&gt;, &quot;index action&quot; do
   before(:each) do
-    @controller = &lt;%= full_controller_const %&gt;.build(fake_request)
-    @controller.dispatch('index')
+    dispatch_to(&lt;%= full_controller_const %&gt;, :index)
   end
 end
\ No newline at end of file</diff>
      <filename>merb-gen/rspec_generators/merb_resource_controller_test/templates/spec/controllers/%controller_full_file_path%_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-class MerbControllerTestGenerator &lt; Merb::GeneratorBase
+class MerbResourceControllerTestGenerator &lt; Merb::GeneratorBase
   attr_reader :controller_modules, 
               :controller_class_name, 
               :controller_file_name,</diff>
      <filename>merb-gen/test_unit_generators/merb_resource_controller_test/merb_resource_controller_test_generator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ require 'rake/gempackagetask'
 
 PLUGIN = &quot;merb-haml&quot;
 NAME = &quot;merb-haml&quot;
-VERSION = &quot;0.9.0&quot;
+VERSION = &quot;0.9.2&quot;
 AUTHOR = &quot;Yehuda Katz&quot;
 EMAIL = &quot;ykatz@engineyard.com&quot;
 HOMEPAGE = &quot;http://merb-plugins.rubyforge.org/merb-haml/&quot;
@@ -20,7 +20,7 @@ spec = Gem::Specification.new do |s|
   s.author = AUTHOR
   s.email = EMAIL
   s.homepage = HOMEPAGE
-  s.add_dependency('merb-core', '&gt;= 0.9.0')
+  s.add_dependency('merb-core', '&gt;= 0.9.2')
   s.require_path = 'lib'
   s.autorequire = PLUGIN
   s.files = %w(LICENSE README Rakefile TODO) + Dir.glob(&quot;{lib,specs}/**/*&quot;)
@@ -31,7 +31,7 @@ Rake::GemPackageTask.new(spec) do |pkg|
 end
 
 task :install =&gt; [:package] do
-  sh %{sudo gem install pkg/#{NAME}-#{VERSION}}
+  sh %{sudo gem install pkg/#{NAME}-#{VERSION} --no-update-sources}
 end
 
 namespace :jruby do</diff>
      <filename>merb-haml/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,20 @@
-require &quot;haml&quot;
-require &quot;merb-haml/template&quot;
+# make sure we're running inside Merb
+if defined?(Merb::Plugins)  
+  require &quot;haml&quot;
+  require &quot;merb-haml/template&quot;
+  Merb::Plugins.add_rakefiles(File.join(File.dirname(__FILE__) / &quot;merb-haml&quot; / &quot;merbtasks&quot;))
 
-Merb::BootLoader.after_app_loads do
-  require &quot;sass/plugin&quot; if File.directory?(Merb.dir_for(:stylesheet) / &quot;sass&quot;)  
+  Merb::BootLoader.after_app_loads do
+    if File.directory?(Merb.dir_for(:stylesheet) / &quot;sass&quot;)
+      require &quot;sass/plugin&quot; 
+      Sass::Plugin.options = Merb::Config[:sass] if Merb::Config[:sass]
+    end
+  end
+  
+  # Hack because Haml uses symbolize_keys
+  class Hash
+    def symbolize_keys!
+      self
+    end
+  end
 end
\ No newline at end of file</diff>
      <filename>merb-haml/lib/merb-haml.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,26 +1,56 @@
 module Merb::Template
 
   class Haml
+
+    # Defines a method for calling a specific HAML template.
+    #
+    # ==== Parameters
+    # path&lt;String&gt;:: Path to the template file.
+    # name&lt;~to_s&gt;:: The name of the template method.
+    # mod&lt;Class, Module&gt;::
+    #   The class or module wherein this method should be defined.
     def self.compile_template(path, name, mod)
       path = File.expand_path(path)
-      config = (Merb::Plugins.config[:haml] || {}).inject({}) do |c, (k, v)|
+      config = (Merb::Config[:haml] || {}).inject({}) do |c, (k, v)|
         c[k.to_sym] = v
         c
       end.merge :filename =&gt; path
       template = ::Haml::Engine.new(File.read(path), config)
       template.def_method(mod, name)
-      name    
+      name
     end
   
     module Mixin
-      def self.included(mod)
-        mod.alias_method :capture, :capture_haml      
-      end
-    
-      def _buffer( binding )
-        @_buffer = eval( &quot;buffer.buffer&quot;, binding )
+      # ==== Parameters
+      # string&lt;String&gt;:: The string to add to the HAML buffer.
+      # binding&lt;Binding&gt;::
+      #   Not used by HAML, but is necessary to conform to the concat_*
+      #   interface.
+      def concat_haml(string, binding)
+        haml_buffer.buffer &lt;&lt; string
       end
+      
     end
     Merb::Template.register_extensions(self, %w[haml])  
   end
 end
+
+module Haml
+  class Engine
+
+    # ==== Parameters
+    # object&lt;Class, Module&gt;::
+    #   The class or module wherein this method should be defined.
+    # name&lt;~to_s&gt;:: The name of the template method.
+    # *local_names:: Local names to define in the HAML template.
+    def def_method(object, name, *local_names)
+      method = object.is_a?(Module) ? :module_eval : :instance_eval
+
+      setup = &quot;@_engine = 'haml'&quot;
+
+      object.send(method, &quot;def #{name}(_haml_locals = {}); #{setup}; #{precompiled_with_ambles(local_names)}; end&quot;,
+                  @options[:filename], 0)
+    end
+ 
+  end
+end</diff>
      <filename>merb-haml/lib/merb-haml/template.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,15 +6,9 @@ class HamlController &lt; Merb::Controller
 end
 
 class PartialHaml &lt; HamlController
-  def index
-    render
-  end
 end
 
 class HamlConfig &lt; HamlController
-  def index
-    render
-  end
 end
 
 class PartialIvars &lt; HamlController
@@ -23,3 +17,15 @@ class PartialIvars &lt; HamlController
     render
   end
 end
+
+class CaptureHaml &lt; HamlController
+end
+
+module Merb::ConcatHamlHelper
+  def concatter(&amp;blk)
+    concat(&quot;&lt;p&gt;Concat&lt;/p&gt;&quot;, blk.binding)
+  end
+end
+
+class ConcatHaml &lt; HamlController
+end
\ No newline at end of file</diff>
      <filename>merb-haml/spec/controllers/haml.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,7 +11,7 @@ describe &quot;HAML&quot; do
     c.body.should == ::Haml::Engine.new(&quot;#foo\n  %p Partial&quot;).render
   end
 
-  it &quot;should use the haml configuration in config/plugins.yml&quot; do
+  it &quot;should use the haml configuration in Merb::Config&quot; do
     c = dispatch_to(HamlConfig, :index)
     c.body.should == ::Haml::Engine.new(&quot;#foo\n  %foo&quot;, :autoclose =&gt; [&quot;foo&quot;]).render
   end
@@ -20,4 +20,14 @@ describe &quot;HAML&quot; do
     c = dispatch_to(PartialIvars, :index)
     c.body.should == ::Haml::Engine.new(&quot;#foo\n  %p Partial HAML&quot;).render    
   end
+  
+  it &quot;should support capture&quot; do
+    c = dispatch_to(CaptureHaml, :index)
+    c.body.should == &quot;&lt;p&gt;Hello&lt;/p&gt;\n&quot;
+  end
+  
+  it &quot;should support concat&quot; do
+    c = dispatch_to(ConcatHaml, :index)
+    c.body.should == &quot;&lt;p&gt;Concat&lt;/p&gt;&quot;
+  end
 end</diff>
      <filename>merb-haml/spec/haml_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,16 +2,14 @@ $TESTING=true
 $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
 require &quot;rubygems&quot;
 require &quot;merb-core&quot;
-
-Merb::Plugins.config[:haml] = {&quot;autoclose&quot; =&gt; [&quot;foo&quot;]}
+require &quot;spec&quot;
 
 require &quot;merb-haml&quot;
 require File.dirname(__FILE__) / &quot;controllers&quot; / &quot;haml&quot;
 
-Merb.start :environment =&gt; 'test', :adapter =&gt; 'runner'
+Merb::Plugins.config[:haml] = { &quot;autoclose&quot; =&gt; [&quot;foo&quot;] }
+Merb.start :environment =&gt; 'test'
 
-require &quot;merb-core/test/fake_request&quot;
-require &quot;merb-core/test/request_helper&quot;
 Spec::Runner.configure do |config|
   config.include Merb::Test::RequestHelper  
 end</diff>
      <filename>merb-haml/spec/spec_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,10 @@
 require 'rubygems'
 require 'rake/gempackagetask'
+require &quot;spec/rake/spectask&quot;
 
 PLUGIN = &quot;merb-mailer&quot;
 NAME = &quot;merb-mailer&quot;
-VERSION = &quot;0.9.0&quot;
+VERSION = &quot;0.9.2&quot;
 AUTHOR = &quot;Yehuda Katz&quot;
 EMAIL = &quot;wycats@gmail.com&quot;
 HOMEPAGE = &quot;http://merb-plugins.rubyforge.org/merb-mailer/&quot;
@@ -20,7 +21,8 @@ spec = Gem::Specification.new do |s|
   s.author = AUTHOR
   s.email = EMAIL
   s.homepage = HOMEPAGE
-  s.add_dependency('merb-core', '&gt;= 0.9.0')
+  s.add_dependency('merb-core', '&gt;= 0.9.2')
+  s.add_dependency(&quot;mailfactory&quot;, &quot;&gt;= 1.2.3&quot;)
   s.require_path = 'lib'
   s.autorequire = PLUGIN
   s.files = %w(LICENSE README Rakefile TODO) + Dir.glob(&quot;{lib,specs}/**/*&quot;)
@@ -31,7 +33,7 @@ Rake::GemPackageTask.new(spec) do |pkg|
 end
 
 task :install =&gt; [:package] do
-  sh %{sudo gem install pkg/#{NAME}-#{VERSION}}
+  sh %{sudo gem install pkg/#{NAME}-#{VERSION} --no-update-sources}
 end
 
 namespace :jruby do
@@ -41,4 +43,10 @@ namespace :jruby do
     sh %{#{SUDO} jruby -S gem install pkg/#{NAME}-#{Merb::VERSION}.gem --no-rdoc --no-ri}
   end
   
-end
\ No newline at end of file
+end
+
+desc &quot;Run all specs&quot;
+Spec::Rake::SpecTask.new(&quot;specs&quot;) do |t|
+  t.spec_opts = [&quot;--format&quot;, &quot;specdoc&quot;, &quot;--colour&quot;]
+  t.spec_files = Dir[&quot;spec/**/*_spec.rb&quot;].sort
+end</diff>
      <filename>merb-mailer/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,3 @@
 require &quot;merb-mailer/mailer&quot;
 require &quot;merb-mailer/mail_controller&quot;
-require &quot;merb-mailer/merb_controller&quot;
\ No newline at end of file
+require &quot;merb-mailer/merb_controller&quot;</diff>
      <filename>merb-mailer/lib/merb-mailer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 module Merb
-  
+
   # Sending mail from a controller involves three steps:
   #
   # * Set mail settings in merb_init.rb (Not shown here...see the Mailer docs).
@@ -62,39 +62,64 @@ module Merb
   # * Attach files.
   # * Render layouts and other templates.
   # * Use any template engine supported by Merb.
-  
+
   class MailController &lt; AbstractController
-   
-    self._template_root = File.expand_path(self._template_root / &quot;../mailers/views&quot;)
+
     class_inheritable_accessor :_mailer_klass
     self._mailer_klass  = Merb::Mailer
-    
+
     attr_accessor :params, :mailer, :mail
     attr_reader   :session, :base_controller
-    
+
+    # ==== Parameters
+    # action&lt;~to_s&gt;:: The name of the action that will be rendered.
+    # type&lt;~to_s&gt;::
+    #    The mime-type of the template that will be rendered. Defaults to nil.
+    # controller&lt;~to_s&gt;::
+    #   The name of the controller that will be rendered. Defaults to
+    #   controller_name.
+    #
+    # ==== Returns
+    # String:: The template location, i.e. &quot;:controller/:action.:type&quot;.
     def _template_location(action, type = nil, controller = controller_name)
       &quot;#{controller}/#{action}.#{type}&quot;
     end
-    
-    # You can initialize a MailController with a series of parameters that can
-    # be used by methods in the class. You can also pass in a controller
-    # object, which will be available to the MailController methods as
-    # base_controller.
+
+    # ==== Parameters
+    # params&lt;Hash&gt;:: Configuration parameters for the MailController.
+    # controller&lt;Merb::Controller&gt;:: The base controller.
     def initialize(params = {}, controller = nil)
       @params = params
       @base_controller = controller
       @session = (controller &amp;&amp; controller.session) || {}
       super
     end
-    
+
+    # Sets the template root to the default mailer view directory.
+    #
+    # ==== Parameters
+    # klass&lt;Class&gt;::
+    #   The Merb::MailController inheriting from the base class.  
+    def self.inherited(klass)
+      super
+      klass.class_eval %{self._template_root = Merb.dir_for(:mailer) / &quot;views&quot;}
+    end
+
+    # Override filters halted to return nothing.
     def filters_halted
     end
-    
+
     # Allows you to render various types of things into the text and HTML parts
     # of an email If you include just text, the email will be sent as
     # plain-text. If you include HTML, the email will be sent as a multi-part
     # email.
     #
+    # ==== Parameters
+    # options&lt;~to_s, Hash&gt;::
+    #   Options for rendering the email or an action name. See examples below
+    #   for usage.
+    #
+    # ==== Examples
     # There are a lot of ways to use render_mail, but it works similarly to the
     # default Merb render method.
     #
@@ -159,15 +184,15 @@ module Merb
     #   render_mail :html =&gt; :foo, :text =&gt; &quot;BAR&quot;
     def render_mail(options = @method)
       @_missing_templates = false # used to make sure that at least one template was found
-      # # If the options are not a hash, normalize to an action hash
+      # If the options are not a hash, normalize to an action hash
       options = {:action =&gt; {:html =&gt; options, :text =&gt; options}} if !options.is_a?(Hash)
-      
+  
       # Take care of the options
       opts_hash = {}
       opts = options.dup
       actions = opts.delete(:action) if opts[:action].is_a?(Hash)
       templates = opts.delete(:template) if opts[:template].is_a?(Hash)
-      
+  
       # Prepare the options hash for each format
       # We need to delete anything relating to the other format here
       # before we try to render the template.
@@ -176,19 +201,16 @@ module Merb
         opts_hash[fmt] ||= actions[fmt] if actions &amp;&amp; actions[fmt]
         opts_hash[:template] = templates[fmt] if templates &amp;&amp; templates[fmt]
       end
-
-      # require 'ruby-debug'
-      # debugger if $DEBUGGER
-            
+        
       # Send the result to the mailer
       { :html =&gt; &quot;rawhtml=&quot;, :text =&gt; &quot;text=&quot;}.each do |fmt,meth|
         begin
           local_opts = opts.merge(:format =&gt; fmt)
           local_opts.merge!(:layout =&gt; false) if opts_hash[fmt].is_a?(String)
-          
+      
           value = render opts_hash[fmt], local_opts
           @mail.send(meth,value) unless value.nil? || value.empty?
-        rescue =&gt; e
+        rescue Merb::ControllerExceptions::TemplateNotFound =&gt; e
           # An error should be logged if no template is found instead of an error raised
           if @_missing_templates
             Merb.logger.error(e)
@@ -199,47 +221,56 @@ module Merb
       end
       @mail
     end
-    
+
     # Attaches a file or multiple files to an email. You call this from a
     # method in your MailController (including a before filter).
     # 
+    # ==== Parameters
+    # file_or_files&lt;File, Array[File]&gt;:: File(s) to attach.
+    # filename&lt;String&gt;::
+    # type&lt;~to_s&gt;::
+    #   The attachment MIME type. If left out, it will be determined from
+    #   file_or_files.
+    # headers&lt;String, Array&gt;:: Additional attachment headers.
+    #
+    # ==== Examples
     #   attach File.open(&quot;foo&quot;)
     #   attach [File.open(&quot;foo&quot;), File.open(&quot;bar&quot;)]
     # 
-    # You can also include the filename, mime-type, or headers in the
-    # subsequent parameters.
-    # 
     # If you are passing an array of files, you should use an array of the
     # allowed parameters:
     # 
     #   attach [[File.open(&quot;foo&quot;), &quot;bar&quot;, &quot;text/html&quot;], [File.open(&quot;baz&quot;),
-    # &quot;bat&quot;, &quot;text/css&quot;]
+    #     &quot;bat&quot;, &quot;text/css&quot;]
     # 
     #  which would attach two files (&quot;foo&quot; and &quot;baz&quot; in the filesystem) as
     # &quot;bar&quot; and &quot;bat&quot; respectively. It would also set the mime-type as
     # &quot;text/html&quot; and &quot;text/css&quot; respectively.
     def attach( file_or_files, filename = file_or_files.is_a?(File) ? File.basename(file_or_files.path) : nil, 
       type = nil, headers = nil)
-      @mail.attach(file_or_files, filename, type, headers)
+      @mailer.attach(file_or_files, filename, type, headers)
     end
-    
-    # take a method name to dispatch to and mail parameters for the MailFactory object.
-    #
-    # Available mail parameters include:
-    #   to
-    #   from
-    #   replyto
-    #   subject
-    #   body
-    #   cc
-    #
-    # Other parameters passed in will be interpreted as email headers, with _'s converted
-    # to -'s.
+
+    # ==== Parameters
+    # method&lt;~to_s&gt;:: The method name to dispatch to.
+    # mail_params&lt;Hash&gt;:: Parameters to send to MailFactory (see below).
+    #
+    # ==== Options (mail_params)
+    # MailFactory recognizes the following parameters:
+    # * :to
+    # * :from
+    # * :replyto
+    # * :subject
+    # * :body
+    # * :cc
+    #
+    # Other parameters passed in will be interpreted as email headers, with
+    # underscores converted to dashes.
     def dispatch_and_deliver(method, mail_params)
       @mailer         = self.class._mailer_klass.new(mail_params)
       @mail           = @mailer.mail
       @method         = method
-      
+  
       # dispatch and render use params[:action], so set it
       self.action_name = method
 
@@ -252,26 +283,46 @@ module Merb
       end
     end
 
-    # A convenience method that creates a blank copy of the MailController and runs
-    # dispatch_and_deliver on it.
+    # A convenience method that creates a blank copy of the MailController and
+    # runs dispatch_and_deliver on it.
+    #
+    # ==== Parameters
+    # method&lt;~to_s&gt;:: The method name to dispatch to.
+    # mail_params&lt;Hash&gt;:: Parameters to send to MailFactory.
+    # send_params&lt;Hash&gt;:: Configuration parameters for the MailController.
     def self.dispatch_and_deliver(method, mail_params, send_params = {})
       new(send_params).dispatch_and_deliver method, mail_params
     end
-    
+
     protected
+
+    # ==== Returns
+    # Hash:: The route from base controller.
     def route
       @base_controller.route if @base_controller
     end
 
     private
     # This method is here to overwrite the one in the general_controller mixin
-    # The method ensures that when a url is generated with a hash, it contains a controller
+    # The method ensures that when a url is generated with a hash, it contains
+    # a controller.
+    #
+    # ==== Parameters
+    # opts&lt;Hash&gt;:: The options to get the controller from (see below).
+    #
+    # ==== Options (opts)
+    # :controller&lt;Merb::Controller&gt;:: The controller.
+    #
+    # ==== Returns
+    # Merb::Controller::
+    #   The controller. If no controller was specified in opts, attempt to find
+    #   it in the base controller params.
     def get_controller_for_url_generation(opts)
       controller = opts[:controller] || ( @base_controller.params[:controller] if @base_controller)
-       raise &quot;No Controller Specified for url()&quot; unless controller
-       controller
+      raise &quot;No Controller Specified for url()&quot; unless controller
+      controller
     end
-    
-    
+
+
   end
 end
\ No newline at end of file</diff>
      <filename>merb-mailer/lib/merb-mailer/mail_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,15 +11,16 @@ end
 
 module Merb
 
-  # You'll need a simple config like this in merb_init.rb if you want
+  # You'll need a simple config like this in init.rb if you want
   # to actually send mail:
   #
   #   Merb::Mailer.config = {
-  #     :host=&gt;'smtp.yourserver.com',
-  #     :port=&gt;'25',              
-  #     :user=&gt;'user',
-  #     :pass=&gt;'pass',
-  #     :auth=&gt;:plain # :plain, :login, :cram_md5, the default is no auth
+  #     :host   =&gt; 'smtp.yourserver.com',
+  #     :port   =&gt; '25',              
+  #     :user   =&gt; 'user',
+  #     :pass   =&gt; 'pass',
+  #     :auth   =&gt; :plain # :plain, :login, :cram_md5, the default is no auth
+  #     :domain =&gt; &quot;localhost.localdomain&quot; # the HELO domain provided by the client to the server 
   #   }
   # 
  	#   or 
@@ -37,33 +38,48 @@ module Merb
   #   m.deliver!                     
 
   class Mailer
-    
+
     class_inheritable_accessor :config, :delivery_method, :deliveries
     attr_accessor :mail
     self.deliveries = []
-    
+
+    # Sends the mail using sendmail.
     def sendmail
       sendmail = IO.popen(&quot;#{config[:sendmail_path]} #{@mail.to}&quot;, 'w+') 
       sendmail.puts @mail.to_s
       sendmail.close
     end
-  
-    # :plain, :login, or :cram_md5
+
+    # Sends the mail using SMTP.
     def net_smtp
       Net::SMTP.start(config[:host], config[:port].to_i, config[:domain], 
                       config[:user], config[:pass], config[:auth]) { |smtp|
         smtp.send_message(@mail.to_s, @mail.from.first, @mail.to.to_s.split(/[,;]/))
       }
     end
-    
+
+    # Tests mail sending by adding the mail to deliveries.
     def test_send
       deliveries &lt;&lt; @mail
     end
-    
+
+    # Delivers the mail with the specified delivery method, defaulting to
+    # net_smtp.
     def deliver!
       send(delivery_method || :net_smtp)
     end
-      
+
+    # ==== Parameters
+    # file_or_files&lt;File, Array[File]&gt;:: File(s) to attach.
+    # filename&lt;String&gt;::
+    # type&lt;~to_s&gt;::
+    #   The attachment MIME type. If left out, it will be determined from
+    #   file_or_files.
+    # headers&lt;String, Array&gt;:: Additional attachment headers.
+    #
+    # ==== Raises
+    # ArgumentError::
+    #   file_or_files was not a File or an Array of File instances.
     def attach(file_or_files, filename = file_or_files.is_a?(File) ? File.basename(file_or_files.path) : nil, 
       type = nil, headers = nil)
       if file_or_files.is_a?(Array)
@@ -74,6 +90,8 @@ module Merb
       end
     end
       
+    # ==== Parameters
+    # o&lt;Hash{~to_s =&gt; Object}&gt;:: Configuration commands to send to MailFactory.
     def initialize(o={})
       self.config = {:sendmail_path =&gt; '/usr/sbin/sendmail'} if config.nil? 
       o[:rawhtml] = o.delete(:html)</diff>
      <filename>merb-mailer/lib/merb-mailer/mailer.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,19 +1,20 @@
 class Merb::Controller
   # Sends mail via a MailController (a tutorial can be found in the
   # MailController docs).
-  # 
-  #  send_mail FooMailer, :bar, :from =&gt; &quot;foo@bar.com&quot;, :to =&gt; &quot;baz@bat.com&quot;
-  # 
-  # would send an email via the FooMailer's bar method.
-  # 
-  # The mail_params hash would be sent to the mailer, and includes items
-  # like from, to subject, and cc. See
-  # Merb::MailController#dispatch_and_deliver for more details.
-  # 
-  # The send_params hash would be sent to the MailController, and is
-  # available to methods in the MailController as &lt;tt&gt;params&lt;/tt&gt;. If you do
-  # not send any send_params, this controller's params will be available to
-  # the MailController as &lt;tt&gt;params&lt;/tt&gt;
+  #
+  # ==== Parameters
+  # klass&lt;Class&gt;:: The mailer class.
+  # method&lt;~to_s&gt;:: The method to call on the mailer.
+  # mail_params&lt;Hash&gt;::
+  #   Mailing parameters, e.g. :to and :cc. See
+  #   Merb::MailController#dispatch_and_deliver for details.
+  # send_params&lt;Hash&gt;::
+  #   Params to send to the mailer. Defaults to the params of the current
+  #   controller.
+  #
+  # ==== Examples
+  #   # Send an email via the FooMailer's bar method.
+  #   send_mail FooMailer, :bar, :from =&gt; &quot;foo@bar.com&quot;, :to =&gt; &quot;baz@bat.com&quot;
   def send_mail(klass, method, mail_params, send_params = nil)
     klass.new(send_params || params, self).dispatch_and_deliver(method, mail_params)
   end</diff>
      <filename>merb-mailer/lib/merb-mailer/merb_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,72 +1,22 @@
-Sat, 02 Feb 2008 12:23:56 GMT  ~  info  ~  Logfile created
-Sat, 02 Feb 2008 12:23:56 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 12:24:11 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 12:24:21 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 12:25:42 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 12:30:41 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 12:30:45 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 12:33:00 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 12:34:37 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 12:38:07 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 12:38:54 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 12:43:21 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 12:44:15 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 12:44:33 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 12:48:30 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 12:51:27 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 12:51:51 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 12:52:06 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 12:52:16 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 12:53:21 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 12:57:17 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 12:57:45 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:01:00 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:01:11 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:01:19 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:02:52 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:03:00 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:04:40 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:05:02 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:05:11 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:07:12 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:08:37 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:09:59 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:10:21 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:11:04 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:11:31 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:11:47 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:12:11 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:13:24 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:13:46 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:13:56 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:15:47 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:17:23 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:17:40 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:18:56 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:21:26 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:21:38 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:21:42 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:22:31 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:22:43 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:22:46 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:23:54 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:24:05 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:24:10 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:27:16 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:31:01 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:31:17 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:32:48 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:32:58 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:33:04 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:33:17 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:36:04 GMT ~ Not Using Sessions
-Sat, 02 Feb 2008 13:36:04 GMT ~ first sent to foo@bar.com about 
-Sat, 02 Feb 2008 13:36:04 GMT ~ second sent to foo@bar.com about 
-Sat, 02 Feb 2008 13:36:04 GMT ~ third sent to foo@bar.com about 
-Sat, 02 Feb 2008 13:36:04 GMT ~ fourth sent to foo@bar.com about 
-Sat, 02 Feb 2008 13:36:04 GMT ~ fifth sent to foo@bar.com about 
-Sat, 02 Feb 2008 13:36:04 GMT ~ sixth sent to foo@bar.com about 
-Sat, 02 Feb 2008 13:36:04 GMT ~ seventh sent to foo@bar.com about 
-Sat, 02 Feb 2008 13:36:04 GMT ~ eighth sent to foo@bar.com about 
-Sat, 02 Feb 2008 13:36:04 GMT ~ ninth sent to foo@bar.com about 
-Sat, 02 Feb 2008 13:36:04 GMT ~ {:before_filters_time=&gt;5.0e-06, :after_filters_time=&gt;5.0e-06, :action_time=&gt;0.00041}
+ ~ Not Using Sessions
+ ~ first sent to foo@bar.com about 
+ ~ second sent to foo@bar.com about 
+ ~ third sent to foo@bar.com about 
+ ~ fourth sent to foo@bar.com about 
+ ~ fifth sent to foo@bar.com about 
+ ~ sixth sent to foo@bar.com about 
+ ~ seventh sent to foo@bar.com about 
+ ~ eighth sent to foo@bar.com about 
+ ~ ninth sent to foo@bar.com about 
+ ~ {:action_time=&gt;0.003697, :before_filters_time=&gt;9.0e-06, :after_filters_time=&gt;8.0e-06}
+ ~ Not Using Sessions
+ ~ first sent to foo@bar.com about 
+ ~ second sent to foo@bar.com about 
+ ~ third sent to foo@bar.com about 
+ ~ fourth sent to foo@bar.com about 
+ ~ fifth sent to foo@bar.com about 
+ ~ sixth sent to foo@bar.com about 
+ ~ seventh sent to foo@bar.com about 
+ ~ eighth sent to foo@bar.com about 
+ ~ ninth sent to foo@bar.com about 
+ ~ {:action_time=&gt;0.001046, :before_filters_time=&gt;6.0e-06, :after_filters_time=&gt;7.0e-06}</diff>
      <filename>merb-mailer/log/merb_test.log</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,5 @@
 require File.dirname(__FILE__) + '/spec_helper'
 
-require &quot;merb-core/test/fake_request&quot;
-require &quot;merb-core/test/request_helper&quot;
 Spec::Runner.configure do |config|
   config.include Merb::Test::RequestHelper  
 end
@@ -10,6 +8,8 @@ class Merb::Mailer
   self.delivery_method = :test_send
 end
 
+Merb.push_path(:mailer, File.join(File.dirname(__FILE__), &quot;mailers&quot;))
+
 class TestMailController &lt; Merb::MailController
   
   def first</diff>
      <filename>merb-mailer/spec/mail_controller_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,9 +3,5 @@ $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
 require &quot;rubygems&quot;
 require &quot;merb-core&quot;
 require &quot;merb-mailer&quot;
-module Merb
-  class MailController
-    self._template_root = File.expand_path(File.join(File.dirname(__FILE__), &quot;mailers/views&quot;))
-  end
-end
-Merb.start :environment =&gt; 'test', :adapter =&gt; 'runner'
\ No newline at end of file
+
+Merb.start :environment =&gt; 'test'
\ No newline at end of file</diff>
      <filename>merb-mailer/spec/spec_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,7 @@ require &quot;spec/rake/spectask&quot;
 
 PLUGIN = &quot;merb-parts&quot;
 NAME = &quot;merb-parts&quot;
-VERSION = &quot;0.9.0&quot;
+VERSION = &quot;0.9.2&quot;
 AUTHOR = &quot;Hassox&quot;
 EMAIL = &quot;&quot;
 HOMEPAGE = &quot;http://merb-plugins.rubyforge.org/merb-parts/&quot;
@@ -21,7 +21,7 @@ spec = Gem::Specification.new do |s|
   s.author = AUTHOR
   s.email = EMAIL
   s.homepage = HOMEPAGE
-  s.add_dependency('merb-core', '&gt;= 0.9.0')
+  s.add_dependency('merb-core', '&gt;= 0.9.2')
   s.require_path = 'lib'
   s.autorequire = PLUGIN
   s.files = %w(LICENSE README Rakefile TODO) + Dir.glob(&quot;{lib,specs}/**/*&quot;)
@@ -32,7 +32,7 @@ Rake::GemPackageTask.new(spec) do |pkg|
 end
 
 task :install =&gt; [:package] do
-  sh %{sudo gem install pkg/#{NAME}-#{VERSION}}
+  sh %{sudo gem install pkg/#{NAME}-#{VERSION} --no-update-sources}
 end
 
 namespace :jruby do
@@ -48,4 +48,4 @@ desc &quot;Run all specs&quot;
 Spec::Rake::SpecTask.new(&quot;specs&quot;) do |t|
   t.spec_opts = [&quot;--format&quot;, &quot;specdoc&quot;, &quot;--colour&quot;]
   t.spec_files = Dir[&quot;spec/**/*_spec.rb&quot;].sort
-end
\ No newline at end of file
+end</diff>
      <filename>merb-parts/Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,5 @@
 require File.join(File.dirname(__FILE__), 'merb-parts','part_controller')
 
-
 module Merb
   class Controller
     # Dispatches a PartController.</diff>
      <filename>merb-parts/lib/merb-parts.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,22 +12,42 @@ module Merb
     include Merb::Mixins::WebController
     
     attr_reader :params
-    
+
     cattr_accessor :_subclasses
     self._subclasses = Set.new
-    def self.subclasses_list() _subclasses end
-    
-    self._template_root = File.expand_path(self._template_root / &quot;../parts/views&quot;)
     
+    # ==== Returns
+    # Array[Class]:: Classes that inherit from Merb::PartController.
+    def self.subclasses_list() _subclasses end
+
+    # ==== Parameters
+    # action&lt;~to_s&gt;:: The name of the action that will be rendered.
+    # type&lt;~to_s&gt;::
+    #    The mime-type of the template that will be rendered. Defaults to nil.
+    # controller&lt;~to_s&gt;::
+    #   The name of the controller that will be rendered. Defaults to
+    #   controller_name.
+    #
+    # ==== Returns
+    # String:: The template location, i.e. &quot;:controller/:action.:type&quot;.
     def _template_location(action, type = nil, controller = controller_name)
       &quot;#{controller}/#{action}.#{type}&quot;
     end
-  
+
+    # Sets the template root to the default parts view directory.
+    #
+    # ==== Parameters
+    # klass&lt;Class&gt;::
+    #   The Merb::PartController inheriting from the base class.  
     def self.inherited(klass)
       _subclasses &lt;&lt; klass.to_s
       super
+      klass.class_eval %{self._template_root = Merb.dir_for(:part) / &quot;views&quot;}
     end
 
+    # ==== Parameters
+    # web_controller&lt;Merb::Controller&gt;:: The controller calling this part.
+    # opts&lt;Hash&gt;:: Additional options for this part.
     def initialize(web_controller, opts = {})
       @web_controller = web_controller
       @params = @web_controller.params
@@ -36,10 +56,20 @@ module Merb
       @content_type = @web_controller.content_type
     end
 
+    # ==== Parameters
+    # action&lt;~to_s&gt;:: An action to dispatch to. Defaults to :to_s.
+    #
+    # ==== Returns
+    # String:: The part body.
     def _dispatch(action=:to_s)
       self.action_name = action
       super(action)
       @body
     end    
+    
+    # Send any methods that are missing back up to the web controller
+    def method_missing(sym, *args, &amp;blk)
+      @web_controller.send(sym, *args, &amp;blk)
+    end    
   end
 end
\ No newline at end of file</diff>
      <filename>merb-parts/lib/merb-parts/part_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 class Main &lt; Merb::Controller
+  self._template_root = File.dirname(__FILE__) / &quot;..&quot; / &quot;views&quot;
   
   def index
     part TodoPart =&gt; :list
@@ -21,4 +22,8 @@ class Main &lt; Merb::Controller
     part(TodoPart =&gt; :part_with_params, :my_param =&gt; &quot;my_value&quot;)
   end
   
+  def part_within_view
+    render
+  end
+  
 end
\ No newline at end of file</diff>
      <filename>merb-parts/spec/fixtures/controllers/main.rb</filename>
    </modified>
    <modified>
      <diff>@@ -47,6 +47,11 @@ describe &quot;A Merb PartController&quot; do
     controller.body.should match( /my_param = my_value/)
   end
   
+  it &quot;should render from inside a view&quot; do
+    controller = dispatch_to(Main, :part_within_view)
+    controller.body.should match( /Do this/)
+  end
+  
   
 end  
 </diff>
      <filename>merb-parts/spec/merb-parts_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,10 +5,7 @@ require File.join( File.dirname(__FILE__), &quot;..&quot;, &quot;lib&quot;, &quot;merb-parts&quot; )
 # Require the fixtures
 Dir[File.join(File.dirname(__FILE__), &quot;fixtures&quot;, &quot;*/**.rb&quot;)].each{|f| require f }
 
-Merb.start :environment =&gt; 'test', :adapter =&gt; 'runner'
-
-require &quot;merb-core/test/fake_request&quot;
-require &quot;merb-core/test/request_helper&quot;
+Merb.start :environment =&gt; 'test'
 
 Spec::Runner.configure do |config|
   config.include Merb::Test::RequestHelper  </diff>
      <filename>merb-parts/spec/spec_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>merb-test/LICENSE</filename>
    </removed>
    <removed>
      <filename>merb-test/README</filename>
    </removed>
    <removed>
      <filename>merb-test/Rakefile</filename>
    </removed>
    <removed>
      <filename>merb-test/TODO</filename>
    </removed>
    <removed>
      <filename>merb-test/lib/helpers/controller_helper.rb</filename>
    </removed>
    <removed>
      <filename>merb-test/lib/helpers/hpricot_helper.rb</filename>
    </removed>
    <removed>
      <filename>merb-test/lib/merb-test.rb</filename>
    </removed>
    <removed>
      <filename>merb-test/lib/test_ext/hpricot.rb</filename>
    </removed>
    <removed>
      <filename>merb-test/lib/test_ext/object.rb</filename>
    </removed>
    <removed>
      <filename>merb-test/spec/helpers/hpricot_helper_spec.rb</filename>
    </removed>
    <removed>
      <filename>merb-test/spec/merb-test/fake_request_spec.rb</filename>
    </removed>
    <removed>
      <filename>merb-test/spec/merb-test/multipart_spec.rb</filename>
    </removed>
    <removed>
      <filename>merb-test/spec/spec_helper.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>bf1c5f2764d5123200899dca5ad4c0993be9df07</id>
    </parent>
    <parent>
      <id>d87c825208e831f2cae153475d461c7f93ec39ba</id>
    </parent>
  </parents>
  <author>
    <name>Simon Rozet</name>
    <email>simon@rozet.name</email>
  </author>
  <url>http://github.com/sr/merb-more/commit/1ec0dd01c760b024a74804356b37425d52dae8d6</url>
  <id>1ec0dd01c760b024a74804356b37425d52dae8d6</id>
  <committed-date>2008-03-25T12:26:36-07:00</committed-date>
  <authored-date>2008-03-25T12:26:36-07:00</authored-date>
  <message>Merge git://github.com/wycats/merb-more</message>
  <tree>be05c50014111edbd6f8da831eda491d046d73e6</tree>
  <committer>
    <name>Simon Rozet</name>
    <email>simon@rozet.name</email>
  </committer>
</commit>
