<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -57,8 +57,8 @@ Warbler::Config.new do |config|
   # 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
+  # config.webxml.jruby.min.runtimes = 2
+  # config.webxml.jruby.max.runtimes = 4
 
   # JNDI data source name
   # config.webxml.jndi = 'jdbc/rails'</diff>
      <filename>generators/warble/templates/warble.rb</filename>
    </modified>
    <modified>
      <diff>@@ -51,35 +51,25 @@ module Warbler
     # the Rails application
     attr_accessor :war_name
 
-    # Extra configuration for web.xml/goldspike. These options are particular
-    # to Goldspike's Rails servlet and web.xml file.
-    #  
-    # * &lt;tt&gt;webxml.standalone&lt;/tt&gt; -- whether the .war file is &quot;standalone&quot;,
-    #   meaning JRuby, all java and gem dependencies are completely embedded
-    #   in file.  One of +true+ (default) or +false+.
-    # * &lt;tt&gt;webxml.jruby_home&lt;/tt&gt; -- required if standalone is false.  The
-    #   directory containing the JRuby installation to use when the app is
-    #   running.
-    # * &lt;tt&gt;webxml.rails_env&lt;/tt&gt; -- the Rails environment to use for the
+    # Extra configuration for web.xml. Controls how the dynamically-generated web.xml
+    # file is generated.
+    #
+    # * &lt;tt&gt;webxml.jndi&lt;/tt&gt; -- the name of one or more JNDI data sources name to be
+    #   available to the application. Places appropriate &amp;lt;resource-ref&amp;gt; entries
+    #   in the file.
+    # * &lt;tt&gt;webxml.ignored&lt;/tt&gt; -- array of key names that will be not used to
+    #   generate a context param. Defaults to ['jndi', 'booter']
+    #
+    # Any other key/value pair placed in the open structure will be dumped as a
+    # context parameter in the web.xml file. Some of the recognized values are:
+    #
+    # * &lt;tt&gt;webxml.rails.env&lt;/tt&gt; -- the Rails environment to use for the
     #   running application, usually either development or production (the
     #   default).
-    # * &lt;tt&gt;webxml.pool.maxActive&lt;/tt&gt; -- maximum number of pooled Rails
-    #   application runtimes (default 4)
-    # * &lt;tt&gt;webxml.pool.minIdle&lt;/tt&gt; -- minimum number of pooled runtimes to
-    #   keep around during idle time (default 2)
-    # * &lt;tt&gt;webxml.pool.checkInterval&lt;/tt&gt; -- how often to check whether the
-    #   pool size is within minimum and maximum limits, in milliseconds
-    #   (default 0)
-    # * &lt;tt&gt;webxml.pool.maxWait&lt;/tt&gt; -- how long a waiting thread should wait
-    #   for a runtime before giving up, in milliseconds (default 30000)
-    # * &lt;tt&gt;webxml.jndi&lt;/tt&gt; -- the name of a JNDI data source name to be
-    #   available to the application
-    # * &lt;tt&gt;webxml.servlet_name&lt;/tt&gt; -- the name of the servlet to receive all
-    #   requests.  One of +files+ or +rails+.  Goldspike's default behavior is
-    #   to route first through the FileServlet, and if the file isn't found,
-    #   it is forwarded to the RailsServlet.  Use +rails+ if your application
-    #   server is fronted by Apache or something else that will handle static
-    #   files.
+    # * &lt;tt&gt;webxml.jruby.min.runtimes&lt;/tt&gt; -- minimum number of pooled runtimes to
+    #   keep around during idle time
+    # * &lt;tt&gt;webxml.jruby.max.runtimes&lt;/tt&gt; -- maximum number of pooled Rails
+    #   application runtimes
     attr_accessor :webxml
 
     def initialize(warbler_home = WARBLER_HOME)
@@ -131,6 +121,7 @@ module Warbler
       c.rails.env  = &quot;production&quot;
       c.public.root = '/'
       c.jndi = nil
+      c.ignored = %w(jndi booter)
       c
     end
 
@@ -175,6 +166,8 @@ module Warbler
           params[k] = v.to_s
         end
       end
+      params.delete 'ignored'
+      self.ignored.each {|k| params.delete k }
       params
     end
   end</diff>
      <filename>lib/warbler/config.rb</filename>
    </modified>
    <modified>
      <diff>@@ -76,6 +76,11 @@ describe Warbler::Config do
     config.webxml.servlet_context_listener.should == &quot;org.jruby.rack.rails.RailsServletContextListener&quot;
   end
 
+  it &quot;should not include ignored webxml keys in the context params hash&quot; do
+    Warbler::Config.new.webxml.context_params.should_not have_key('jndi')
+    Warbler::Config.new.webxml.context_params.should_not have_key('booter')
+  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>@@ -85,6 +85,51 @@ describe Warbler::Task do
       ).first.text.should == &quot;5&quot;
   end
 
+  it &quot;should include custom context parameters&quot; do
+    @config.webxml.some.custom.config = &quot;myconfig&quot;
+    define_tasks &quot;webxml&quot;
+    Rake::Task[&quot;warble:webxml&quot;].invoke
+    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()='some.custom.config']&quot;
+      ).should_not be_empty
+    elements.to_a(
+      &quot;context-param/param-name[text()='some.custom.config']/../param-value&quot;
+      ).first.text.should == &quot;myconfig&quot;
+  end
+
+  it &quot;should allow one jndi resource to be included&quot; do
+    @config.webxml.jndi = 'jndi/rails'
+    define_tasks &quot;webxml&quot;
+    Rake::Task[&quot;warble:webxml&quot;].invoke
+    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;resource-ref/res-ref-name[text()='jndi/rails']&quot;
+      ).should_not be_empty
+  end
+
+  it &quot;should allow multiple jndi resources to be included&quot; do
+    @config.webxml.jndi = ['jndi/rails1', 'jndi/rails2']
+    define_tasks &quot;webxml&quot;
+    Rake::Task[&quot;warble:webxml&quot;].invoke
+    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;resource-ref/res-ref-name[text()='jndi/rails1']&quot;
+      ).should_not be_empty
+    elements.to_a(
+      &quot;resource-ref/res-ref-name[text()='jndi/rails2']&quot;
+      ).should_not be_empty
+  end
+
   it &quot;should use a config/web.xml if it exists&quot; do
     define_tasks &quot;webxml&quot;
     mkdir_p &quot;config&quot;</diff>
      <filename>spec/warbler/task_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,11 +22,11 @@
     &lt;listener-class&gt;&lt;%= webxml.servlet_context_listener %&gt;&lt;/listener-class&gt;
   &lt;/listener&gt;
 
-&lt;% if webxml.jndi %&gt;
+&lt;% if webxml.jndi then webxml.jndi.each do |jndi| %&gt;
   &lt;resource-ref&gt;
-    &lt;res-ref-name&gt;&lt;%= webxml.jndi %&gt;&lt;/res-ref-name&gt;
+    &lt;res-ref-name&gt;&lt;%= 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;% end; end %&gt;
 &lt;/web-app&gt;
\ No newline at end of file</diff>
      <filename>web.xml.erb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a5c01687d1f2b0f4a69e690808df257de94fc16d</id>
    </parent>
  </parents>
  <author>
    <name>Nick Sieger</name>
    <email>nick@nicksieger.com</email>
  </author>
  <url>http://github.com/nicksieger/warbler/commit/a453fa37d94732534cf877a3c9f1699e09b21de3</url>
  <id>a453fa37d94732534cf877a3c9f1699e09b21de3</id>
  <committed-date>2008-05-04T17:18:03-07:00</committed-date>
  <authored-date>2008-05-04T17:18:03-07:00</authored-date>
  <message>Further work to support arbitrary custom context parameters in web.xml.

- Update config.webxml attribute rdoc
- Allow for more than one jndi name/resoure-ref</message>
  <tree>447659e90e54a2868b104f54b1a9dccebc120435</tree>
  <committer>
    <name>Nick Sieger</name>
    <email>nick@nicksieger.com</email>
  </committer>
</commit>
