<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -26,8 +26,8 @@ SOFTWARE.
 
 = Additional Bundled Software
 
-Goldspike (goldspike-*.jar) is distributed under the terms of the MIT license.
-See http://jruby-extras.rubyforge.org/svn/trunk/rails-integration/LICENSE.txt
+JRuby-Rack (jruby-rack-*.jar) is distributed under the terms of the MIT license.
+See http://svn.codehaus.org/jruby-contrib/trunk/rack/LICENSE.txt
 for details.
 
 JRuby (jruby-complete-*.jar) is distrubuted under the terms of the Common
@@ -35,11 +35,3 @@ Public License. See http://www.eclipse.org/legal/cpl-v10.html for details. At
 your option, JRuby is also available under the GPL or LGPL licenses. See the
 file COPYING in the JRuby distribution for details
 (http://svn.codehaus.org/jruby/trunk/jruby/COPYING).
-
-JavaBeans Activation Framework (activation-*.jar) is distributed under the
-terms of the Common Development and Distribution License (CDDL) v1.0, see
-http://www.sun.com/cddl/cddl.html for details.
-
-Commons-pool (commons-pool-*.jar) is distributed under the terms of the Apache
-Software License, version 2.0. See http://www.apache.org/licenses/LICENSE-2.0
-for details.
\ No newline at end of file</diff>
      <filename>LICENSES.txt</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ application server.
 Warbler provides a sane set of out-of-the box defaults that should allow most Rails applications
 without external gem dependencies (aside from Rails itself) to assemble and Just Work.
 
-Warbler bundles JRuby and the Goldspike servlet for dispatching requests to your application inside
+Warbler bundles JRuby and the JRuby-Rack servlet adapter for dispatching requests to your application inside
 the java application server, and assembles all jar files in WARBLER_HOME/lib/*.jar into
 your application. No external dependencies are downloaded.
 
@@ -64,7 +64,7 @@ Once Warbler is installed as a plugin, you can use +rake+ to build the war (with
 
 === Web.xml
 
-Java web applications are configured mainly through this file, and Warbler creates a suitable default file for you for use with the bundled Goldspike bits.  However, if you need to customize it in any way, you have two options.
+Java web applications are configured mainly through this file, and Warbler creates a suitable default file for you for use.  However, if you need to customize it in any way, you have two options.
 
 1. If you just want a static web.xml file whose contents you manually control, you may copy the one generated for you in &lt;tt&gt;tmp/war/WEB-INF/web.xml&lt;/tt&gt; to &lt;tt&gt;config/web.xml&lt;/tt&gt;.  It will be copied into the webapp for you.
 2. If you want to inject some dynamic information into the file, copy the &lt;tt&gt;WARBLER_HOME/web.xml.erb&lt;/tt&gt; to &lt;tt&gt;config/web.xml.erb&lt;/tt&gt;.  Its contents will be evaluated for you and put in the webapp.  Note that you can also pass arbitrary properties to the ERb template by setting &lt;tt&gt;config.webxml.customkey&lt;/tt&gt; values in your &lt;tt&gt;config/warble.rb&lt;/tt&gt; file.
@@ -80,16 +80,6 @@ If Warbler isn't packaging the files you were expecting, there are several debug
   assembly. Valid values of &lt;tt&gt;X&lt;/tt&gt; are &lt;tt&gt;app, java_libs, gems, public, includes,
   excludes&lt;/tt&gt;.
 
-== Caveats
-
-Warbler requires that RAILS_ROOT will effectively be set to /WEB-INF when running inside the war, while the application public files will be in the root directory.  The purpose is to make the application structure match the Java webapp archive structure, where WEB-INF is a protected directory not visible to the web server.  Because of this change, features of Rails that expect the public assets directory to live in RAILS_ROOT/public may not function properly.  However, we feel that the added security of conforming to the webapp structure is worth these minor inconveniences.
-
-For Rails 1.2.3, the items that may need your attention are:
-
-* Page caching will not work unless you set &lt;tt&gt;ActionController::Base.page_cache_directory = &quot;#{RAILS_ROOT}/..&quot;&lt;/tt&gt;
-* Asset tag timestamp calculation (e.g., &lt;tt&gt;javascripts/prototype.js?1188482864&lt;/tt&gt;) will not happen.  The workaround is to control this manually by setting the RAILS_ASSET_ID environment variable.
-* Automatic inclusion of &lt;tt&gt;application.js&lt;/tt&gt; through &lt;tt&gt;javascript_include_tag :defaults&lt;/tt&gt; will not work.  The workaround is to include it yourself with &lt;tt&gt;javascript_include_tag &quot;application&quot;&lt;/tt&gt;.
-
 == Source
 
 You can get the Warbler source using Git, in any of the following ways:
@@ -104,7 +94,7 @@ You can also download a tarball of Warbler source at http://github.com/nicksiege
 
 Warbler is provided under the terms of the MIT license.
 
-    Warbler (c) 2007-08 Nick Sieger &lt;nicksieger@gmail.com&gt;
+    Warbler (c) 2007-08 Sun Microsystems, Inc.
 
-Warbler also bundles several other pieces of software. Please read the file LICENSES.txt to ensure
+Warbler also bundles several other pieces of software for convenience. Please read the file LICENSES.txt to ensure
 that you agree with the terms of all the components.</diff>
      <filename>README.txt</filename>
    </modified>
    <modified>
      <diff>@@ -13,8 +13,8 @@ Warbler::Config.new do |config|
   # config.excludes = FileList[&quot;lib/tasks/*&quot;]
 
   # Additional Java .jar files to include.  Note that if .jar files are placed
-  # in lib (and not otherwise excluded) then they need not be mentioned here
-  # JRuby and Goldspike are pre-loaded in this list.  Be sure to include your
+  # in lib (and not otherwise excluded) then they need not be mentioned here.
+  # JRuby and JRuby-Rack are pre-loaded in this list.  Be sure to include your
   # own versions if you directly set the value
   # config.java_libs += FileList[&quot;lib/java/*.jar&quot;]
 
@@ -48,21 +48,17 @@ Warbler::Config.new do |config|
   # of RAILS_ROOT
   # config.war_name = &quot;mywar&quot;
 
-  # True if the webapp has no external dependencies
-  config.webxml.standalone = true
-
-  # Location of JRuby, required for non-standalone apps
-  # config.webxml.jruby_home = &lt;jruby/home&gt;
-
   # Value of RAILS_ENV for the webapp
-  config.webxml.rails_env = 'production'
+  config.webxml.rails.env = 'production'
+
+  # Application booter to use, one of :rack, :rails, or :merb. (Default :rails)
+  # config.webxml.booter = :rails
 
-  # Control the pool of Rails runtimes
-  # (Goldspike-specific; see README for details)
-  # config.webxml.pool.maxActive = 4
-  # config.webxml.pool.minIdle = 2
-  # config.webxml.pool.checkInterval = 0
-  # config.webxml.pool.maxWait = 30000
+  # Control the pool of Rails runtimes. Leaving unspecified means
+  # the pool will grow as needed to service requests. It is recommended
+  # that you fix these values when running a production server!
+  # config.webxml.min.runtimes = 2
+  # config.webxml.max.runtimes = 4
 
   # JNDI data source name
   # config.webxml.jndi = 'jdbc/rails'</diff>
      <filename>generators/warble/templates/warble.rb</filename>
    </modified>
    <modified>
      <diff>@@ -127,10 +127,10 @@ module Warbler
     end
 
     def default_webxml_config
-      c = OpenStruct.new
-      c.standalone = true
-      c.rails_env  = &quot;production&quot;
-      c.pool       = OpenStruct.new
+      c = WebxmlOpenStruct.new
+      c.rails.env  = &quot;production&quot;
+      c.public.root = '/'
+      c.jndi = nil
       c
     end
 
@@ -144,6 +144,38 @@ module Warbler
       gems &lt;&lt; &quot;rails&quot; unless File.directory?(&quot;vendor/rails&quot;)
       gems
     end
-    
+  end
+
+  class WebxmlOpenStruct &lt; OpenStruct
+    def initialize
+      @table = Hash.new {|h,k| h[k] = WebxmlOpenStruct.new }
+    end
+
+    def servlet_context_listener
+      case self.booter
+      when :rack
+        &quot;org.jruby.rack.RackServletContextListener&quot;
+      when :merb
+        &quot;org.jruby.rack.merb.MerbServletContextListener&quot;
+      else # :rails, default
+        &quot;org.jruby.rack.rails.RailsServletContextListener&quot;
+      end
+    end
+
+    def context_params
+      params = {}
+      @table.each do |k,v|
+        case v
+        when WebxmlOpenStruct
+          nested_params = v.context_params
+          nested_params.each do |nk,nv|
+            params[&quot;#{k}.#{nk}&quot;] = nv
+          end
+        else
+          params[k] = v.to_s
+        end
+      end
+      params
+    end
   end
 end
\ No newline at end of file</diff>
      <filename>lib/warbler/config.rb</filename>
    </modified>
    <modified>
      <diff>@@ -19,7 +19,6 @@ describe Warbler::Config do
     config.java_libs.should_not be_empty
     config.war_name.size.should &gt; 0
     config.webxml.should be_kind_of(OpenStruct)
-    config.webxml.pool.should be_kind_of(OpenStruct)
     config.pathmaps.should be_kind_of(OpenStruct)
     config.pathmaps.public_html.should == [&quot;%{public/,}p&quot;]
   end
@@ -48,7 +47,35 @@ describe Warbler::Config do
     config = Warbler::Config.new File.join(Dir.getwd, &quot;vendor&quot;, &quot;plugins&quot;, &quot;warbler&quot;)
     config.excludes.include?(&quot;vendor/plugins/warbler&quot;).should == true
   end
-  
+
+  it &quot;should generate context parameters from the webxml openstruct&quot; do
+    config = Warbler::Config.new
+    config.webxml.a.b.c = &quot;123&quot;
+    config.webxml.rails.env = 'staging'
+    config.webxml.jruby.min.runtimes = 2
+    config.webxml.jruby.max.runtimes = 4
+    params = config.webxml.context_params
+    params.should have_key('a.b.c')
+    params.should have_key('rails.env')
+    params.should have_key('jruby.min.runtimes')
+    params.should have_key('jruby.max.runtimes')
+    params['a.b.c'].should == &quot;123&quot;
+    params['rails.env'].should == &quot;staging&quot;
+    params['jruby.min.runtimes'].should == &quot;2&quot;
+    params['jruby.max.runtimes'].should == &quot;4&quot;
+  end
+
+  it &quot;should determine the context listener from the webxml.booter parameter&quot; do
+    config = Warbler::Config.new
+    config.webxml.booter = :rack
+    config.webxml.servlet_context_listener.should == &quot;org.jruby.rack.RackServletContextListener&quot;
+    config = Warbler::Config.new
+    config.webxml.booter = :merb
+    config.webxml.servlet_context_listener.should == &quot;org.jruby.rack.merb.MerbServletContextListener&quot;
+    config = Warbler::Config.new
+    config.webxml.servlet_context_listener.should == &quot;org.jruby.rack.rails.RailsServletContextListener&quot;
+  end
+
   #it &quot;should automatically gems used by the web application&quot; do
   #  gem &quot;actionpack&quot;
   #  config = Warbler::Config.new</diff>
      <filename>spec/warbler/config_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,7 +18,7 @@ describe Warbler::Task do
       config.gems = [&quot;rake&quot;]
       config.dirs = %w(bin generators lib)
       config.public_html = FileList[&quot;public/**/*&quot;, &quot;tasks/**/*&quot;]
-      config.webxml.pool.maxActive = 5
+      config.webxml.jruby.max.runtimes = 5
     end
     verbose(false)
   end
@@ -73,15 +73,15 @@ describe Warbler::Task do
     Rake::Task[&quot;warble:webxml&quot;].invoke
     file_list(%r{WEB-INF/web.xml$}).should_not be_empty
     require 'rexml/document'
-    
+
     elements = File.open(&quot;#{@config.staging_dir}/WEB-INF/web.xml&quot;) do |f|
       REXML::Document.new(f).root.elements
     end
     elements.to_a(
-      &quot;context-param/param-name[text()='jruby.pool.maxActive']&quot;
+      &quot;context-param/param-name[text()='jruby.max.runtimes']&quot;
       ).should_not be_empty
     elements.to_a(
-      &quot;context-param/param-name[text()='jruby.pool.maxActive']/../param-value&quot;
+      &quot;context-param/param-name[text()='jruby.max.runtimes']/../param-value&quot;
       ).first.text.should == &quot;5&quot;
   end
 
@@ -98,11 +98,11 @@ describe Warbler::Task do
   it &quot;should use a config/web.xml.erb if it exists&quot; do
     define_tasks &quot;webxml&quot;
     mkdir_p &quot;config&quot;
-    File.open(&quot;config/web.xml.erb&quot;, &quot;w&quot;) {|f| f &lt;&lt; &quot;Hi &lt;%= webxml.standalone %&gt;&quot; }
+    File.open(&quot;config/web.xml.erb&quot;, &quot;w&quot;) {|f| f &lt;&lt; &quot;Hi &lt;%= webxml.public.root %&gt;&quot; }
     Rake::Task[&quot;warble:webxml&quot;].invoke
     files = file_list(%r{WEB-INF/web.xml$})
     files.should_not be_empty
-    File.open(files.first) {|f| f.read}.should == &quot;Hi true&quot;
+    File.open(files.first) {|f| f.read}.should == &quot;Hi /&quot;
   end
 
   it &quot;should define a java_libs task for copying java libraries&quot; do</diff>
      <filename>spec/warbler/task_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,78 +2,31 @@
   &quot;-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN&quot;
   &quot;http://java.sun.com/dtd/web-app_2_3.dtd&quot;&gt;
 &lt;web-app&gt;
-
-	&lt;context-param&gt;
-		&lt;param-name&gt;jruby.standalone&lt;/param-name&gt;
-		&lt;param-value&gt;&lt;%= webxml.standalone %&gt;&lt;/param-value&gt;
-	&lt;/context-param&gt;
-
-	&lt;% if !webxml.standalone &amp;&amp; webxml.jruby_home %&gt;
-	&lt;!-- jruby.home can be set either here, or as the system property jruby.home --&gt;
-	&lt;context-param&gt;
-		&lt;param-name&gt;jruby.home&lt;/param-name&gt;
-		&lt;param-value&gt;&lt;%= webxml.jruby_home %&gt;&lt;/param-value&gt;
-	&lt;/context-param&gt;
-	&lt;% end %&gt;
-
-	&lt;context-param&gt;
-		&lt;param-name&gt;rails.root&lt;/param-name&gt;
-		&lt;param-value&gt;/WEB-INF&lt;/param-value&gt;
-	&lt;/context-param&gt;
-
-	&lt;context-param&gt;
-		&lt;param-name&gt;rails.env&lt;/param-name&gt;
-		&lt;param-value&gt;&lt;%= webxml.rails_env || 'production' %&gt;&lt;/param-value&gt;
-	&lt;/context-param&gt;
-
-  &lt;% webxml.pool.marshal_dump.each do |k,v| %&gt;
-	&lt;context-param&gt;
-		&lt;param-name&gt;jruby.pool.&lt;%= k %&gt;&lt;/param-name&gt;
-		&lt;param-value&gt;&lt;%= v %&gt;&lt;/param-value&gt;
-	&lt;/context-param&gt;
+  &lt;% webxml.context_params.each do |k,v| %&gt;
+  &lt;context-param&gt;
+    &lt;param-name&gt;&lt;%= k %&gt;&lt;/param-name&gt;
+    &lt;param-value&gt;&lt;%= v %&gt;&lt;/param-value&gt;
+  &lt;/context-param&gt;
   &lt;% end %&gt;
 
-	&lt;context-param&gt;
-		&lt;param-name&gt;files.default&lt;/param-name&gt;
-		&lt;param-value&gt;rails&lt;/param-value&gt;
-		&lt;description&gt;
-		  The files servlet should forward to the rails servlet if no file could be found
-    &lt;/description&gt;
-	&lt;/context-param&gt;
-
-	&lt;context-param&gt;
-		&lt;param-name&gt;files.prefix&lt;/param-name&gt;
-		&lt;param-value&gt;&lt;/param-value&gt;
-		&lt;description&gt;
-		  Prefix added to static files
-    &lt;/description&gt;
-	&lt;/context-param&gt;
-
-	&lt;listener&gt;
-		&lt;listener-class&gt;org.jruby.webapp.RailsContextListener&lt;/listener-class&gt;
-	&lt;/listener&gt;
-
-	&lt;servlet&gt;
-		&lt;servlet-name&gt;rails&lt;/servlet-name&gt;
-		&lt;servlet-class&gt;org.jruby.webapp.RailsServlet&lt;/servlet-class&gt;
-	&lt;/servlet&gt;
-	&lt;servlet&gt;
-		&lt;servlet-name&gt;files&lt;/servlet-name&gt;
-		&lt;servlet-class&gt;org.jruby.webapp.FileServlet&lt;/servlet-class&gt;
-	&lt;/servlet&gt;
-
-	&lt;!-- Allow all requests to go to the files servlet first --&gt;
-	&lt;servlet-mapping&gt;
-		&lt;servlet-name&gt;&lt;%= webxml.servlet_name || 'files' %&gt;&lt;/servlet-name&gt;
-		&lt;url-pattern&gt;/&lt;/url-pattern&gt;
-	&lt;/servlet-mapping&gt;
-
-	&lt;% if webxml.jndi %&gt;
-	&lt;resource-ref&gt;
-		&lt;res-ref-name&gt;&lt;%= webxml.jndi %&gt;&lt;/res-ref-name&gt;
-		&lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
-		&lt;res-auth&gt;Container&lt;/res-auth&gt;
-	&lt;/resource-ref&gt;
-	&lt;% end %&gt;
-
+  &lt;filter&gt;
+    &lt;filter-name&gt;RackFilter&lt;/filter-name&gt;
+    &lt;filter-class&gt;org.jruby.rack.RackFilter&lt;/filter-class&gt;
+  &lt;/filter&gt;
+  &lt;filter-mapping&gt;
+    &lt;filter-name&gt;RackFilter&lt;/filter-name&gt;
+    &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
+  &lt;/filter-mapping&gt;
+
+  &lt;listener&gt;
+    &lt;listener-class&gt;&lt;%= webxml.servlet_context_listener %&gt;&lt;/listener-class&gt;
+  &lt;/listener&gt;
+
+  &lt;% if webxml.jndi %&gt;
+  &lt;resource-ref&gt;
+    &lt;res-ref-name&gt;&lt;%= webxml.jndi %&gt;&lt;/res-ref-name&gt;
+    &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
+    &lt;res-auth&gt;Container&lt;/res-auth&gt;
+  &lt;/resource-ref&gt;
+  &lt;% end %&gt;
 &lt;/web-app&gt;
\ No newline at end of file</diff>
      <filename>web.xml.erb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/activation-1.1.jar</filename>
    </removed>
    <removed>
      <filename>lib/commons-pool-1.3.jar</filename>
    </removed>
    <removed>
      <filename>lib/goldspike-1.6.1.jar</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>8da99db9491fcb55dd67e211dea6cb3c135081e4</id>
    </parent>
  </parents>
  <author>
    <name>Nick Sieger</name>
    <email>nick@nicksieger.com</email>
  </author>
  <url>http://github.com/nicksieger/warbler/commit/a8d5ad6f9a58244334b1ddcfc58ff2b8efde6c3f</url>
  <id>a8d5ad6f9a58244334b1ddcfc58ff2b8efde6c3f</id>
  <committed-date>2008-05-03T11:54:26-07:00</committed-date>
  <authored-date>2008-05-03T11:54:26-07:00</authored-date>
  <message>Revamp config preparing for jruby-rack switch</message>
  <tree>eacc65748e65b07753241e6c58ac81e5b04900d2</tree>
  <committer>
    <name>Nick Sieger</name>
    <email>nick@nicksieger.com</email>
  </committer>
</commit>
