warbler 0.9.5 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,15 @@
1
+ == 0.9.9
2
+
3
+ * Now shipping with JRuby-Rack 0.9!
4
+ * Upgrade to JRuby 1.1.1
5
+ * warble.rb and web.xml.erb have changed as a result of the change to JRuby-Rack -- we
6
+ recommend comparing the new base copies with any existing configuration you have to
7
+ make sure you pick up the differences.
8
+ * Config changes:
9
+ ** config.webxml.booter chooses what kind of application to use (:rails, :merb or plain :rack).
10
+ ** config.webxml.pool.* have been replaced by config.webxml.jruby.(min|max).runtimes
11
+ ** config.webxml.standalone and config.webxml.jruby_home no longer have any effect.
12
+
1
13
  == 0.9.5
2
14
 
3
15
  * Fix bug in plugin warbler.rake task file that would favor loading warbler from gems before the version
data/LICENSES.txt CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Warbler is provided under the terms of the MIT license.
4
4
 
5
- (c) Copyright 2007-08 Nick Sieger <nicksieger@gmail.com>
5
+ (c) Copyright 2007-2008 Sun Microsystems, Inc.
6
6
 
7
7
  Permission is hereby granted, free of charge, to any person
8
8
  obtaining a copy of this software and associated documentation files
@@ -26,10 +26,12 @@ SOFTWARE.
26
26
 
27
27
  = Additional Bundled Software
28
28
 
29
- Goldspike (goldspike-*.jar) is distributed under the terms of the MIT license. See http://jruby-extras.rubyforge.org/svn/trunk/rails-integration/LICENSE.txt for details.
29
+ JRuby-Rack (jruby-rack-*.jar) is distributed under the terms of the MIT license.
30
+ See http://svn.codehaus.org/jruby-contrib/trunk/rack/LICENSE.txt
31
+ for details.
30
32
 
31
- JRuby (jruby-complete-*.jar) is distrubuted under the terms of the Common 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).
32
-
33
- 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.
34
-
35
- 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.
33
+ JRuby (jruby-complete-*.jar) is distrubuted under the terms of the Common
34
+ Public License. See http://www.eclipse.org/legal/cpl-v10.html for details. At
35
+ your option, JRuby is also available under the GPL or LGPL licenses. See the
36
+ file COPYING in the JRuby distribution for details
37
+ (http://svn.codehaus.org/jruby/trunk/jruby/COPYING).
data/Manifest.txt CHANGED
@@ -9,10 +9,8 @@ generators/warble
9
9
  generators/warble/templates
10
10
  generators/warble/templates/warble.rb
11
11
  generators/warble/warble_generator.rb
12
- lib/activation-1.1.jar
13
- lib/commons-pool-1.3.jar
14
- lib/goldspike-1.6.1.jar
15
- lib/jruby-complete-1.1.jar
12
+ lib/jruby-complete-1.1.1.jar
13
+ lib/jruby-rack-0.9.jar
16
14
  lib/warbler
17
15
  lib/warbler/config.rb
18
16
  lib/warbler/gems.rb
data/README.txt CHANGED
@@ -7,7 +7,7 @@ application server.
7
7
  Warbler provides a sane set of out-of-the box defaults that should allow most Rails applications
8
8
  without external gem dependencies (aside from Rails itself) to assemble and Just Work.
9
9
 
10
- Warbler bundles JRuby and the Goldspike servlet for dispatching requests to your application inside
10
+ Warbler bundles JRuby and the JRuby-Rack servlet adapter for dispatching requests to your application inside
11
11
  the java application server, and assembles all jar files in WARBLER_HOME/lib/*.jar into
12
12
  your application. No external dependencies are downloaded.
13
13
 
@@ -64,7 +64,7 @@ Once Warbler is installed as a plugin, you can use +rake+ to build the war (with
64
64
 
65
65
  === Web.xml
66
66
 
67
- 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.
67
+ 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.
68
68
 
69
69
  1. If you just want a static web.xml file whose contents you manually control, you may copy the one generated for you in <tt>tmp/war/WEB-INF/web.xml</tt> to <tt>config/web.xml</tt>. It will be copied into the webapp for you.
70
70
  2. If you want to inject some dynamic information into the file, copy the <tt>WARBLER_HOME/web.xml.erb</tt> to <tt>config/web.xml.erb</tt>. 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 <tt>config.webxml.customkey</tt> values in your <tt>config/warble.rb</tt> file.
@@ -80,16 +80,6 @@ If Warbler isn't packaging the files you were expecting, there are several debug
80
80
  assembly. Valid values of <tt>X</tt> are <tt>app, java_libs, gems, public, includes,
81
81
  excludes</tt>.
82
82
 
83
- == Caveats
84
-
85
- 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.
86
-
87
- For Rails 1.2.3, the items that may need your attention are:
88
-
89
- * Page caching will not work unless you set <tt>ActionController::Base.page_cache_directory = "#{RAILS_ROOT}/.."</tt>
90
- * Asset tag timestamp calculation (e.g., <tt>javascripts/prototype.js?1188482864</tt>) will not happen. The workaround is to control this manually by setting the RAILS_ASSET_ID environment variable.
91
- * Automatic inclusion of <tt>application.js</tt> through <tt>javascript_include_tag :defaults</tt> will not work. The workaround is to include it yourself with <tt>javascript_include_tag "application"</tt>.
92
-
93
83
  == Source
94
84
 
95
85
  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
104
94
 
105
95
  Warbler is provided under the terms of the MIT license.
106
96
 
107
- Warbler (c) 2007-08 Nick Sieger <nicksieger@gmail.com>
97
+ Warbler (c) 2007-08 Sun Microsystems, Inc.
108
98
 
109
- Warbler also bundles several other pieces of software. Please read the file LICENSES.txt to ensure
99
+ Warbler also bundles several other pieces of software for convenience. Please read the file LICENSES.txt to ensure
110
100
  that you agree with the terms of all the components.
data/bin/warble CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
3
  #--
4
- # (c) Copyright 2007-2008 Nick Sieger <nicksieger@gmail.com>
4
+ # (c) Copyright 2007-2008 Sun Microsystems, Inc.
5
5
  # See the file LICENSES.txt included with the distribution for
6
6
  # software license details.
7
7
  #++
@@ -13,8 +13,8 @@ Warbler::Config.new do |config|
13
13
  # config.excludes = FileList["lib/tasks/*"]
14
14
 
15
15
  # Additional Java .jar files to include. Note that if .jar files are placed
16
- # in lib (and not otherwise excluded) then they need not be mentioned here
17
- # JRuby and Goldspike are pre-loaded in this list. Be sure to include your
16
+ # in lib (and not otherwise excluded) then they need not be mentioned here.
17
+ # JRuby and JRuby-Rack are pre-loaded in this list. Be sure to include your
18
18
  # own versions if you directly set the value
19
19
  # config.java_libs += FileList["lib/java/*.jar"]
20
20
 
@@ -48,21 +48,17 @@ Warbler::Config.new do |config|
48
48
  # of RAILS_ROOT
49
49
  # config.war_name = "mywar"
50
50
 
51
- # True if the webapp has no external dependencies
52
- config.webxml.standalone = true
53
-
54
- # Location of JRuby, required for non-standalone apps
55
- # config.webxml.jruby_home = <jruby/home>
56
-
57
51
  # Value of RAILS_ENV for the webapp
58
- config.webxml.rails_env = 'production'
52
+ config.webxml.rails.env = 'production'
53
+
54
+ # Application booter to use, one of :rack, :rails, or :merb. (Default :rails)
55
+ # config.webxml.booter = :rails
59
56
 
60
- # Control the pool of Rails runtimes
61
- # (Goldspike-specific; see README for details)
62
- # config.webxml.pool.maxActive = 4
63
- # config.webxml.pool.minIdle = 2
64
- # config.webxml.pool.checkInterval = 0
65
- # config.webxml.pool.maxWait = 30000
57
+ # Control the pool of Rails runtimes. Leaving unspecified means
58
+ # the pool will grow as needed to service requests. It is recommended
59
+ # that you fix these values when running a production server!
60
+ # config.webxml.jruby.min.runtimes = 2
61
+ # config.webxml.jruby.max.runtimes = 4
66
62
 
67
63
  # JNDI data source name
68
64
  # config.webxml.jndi = 'jdbc/rails'
@@ -1,5 +1,5 @@
1
1
  #--
2
- # (c) Copyright 2007-2008 Nick Sieger <nicksieger@gmail.com>
2
+ # (c) Copyright 2007-2008 Sun Microsystems, Inc.
3
3
  # See the file LICENSES.txt included with the distribution for
4
4
  # software license details.
5
5
  #++
Binary file
@@ -1,5 +1,5 @@
1
1
  #--
2
- # (c) Copyright 2007-2008 Nick Sieger <nicksieger@gmail.com>
2
+ # (c) Copyright 2007-2008 Sun Microsystems, Inc.
3
3
  # See the file LICENSES.txt included with the distribution for
4
4
  # software license details.
5
5
  #++
@@ -51,35 +51,25 @@ module Warbler
51
51
  # the Rails application
52
52
  attr_accessor :war_name
53
53
 
54
- # Extra configuration for web.xml/goldspike. These options are particular
55
- # to Goldspike's Rails servlet and web.xml file.
56
- #
57
- # * <tt>webxml.standalone</tt> -- whether the .war file is "standalone",
58
- # meaning JRuby, all java and gem dependencies are completely embedded
59
- # in file. One of +true+ (default) or +false+.
60
- # * <tt>webxml.jruby_home</tt> -- required if standalone is false. The
61
- # directory containing the JRuby installation to use when the app is
62
- # running.
63
- # * <tt>webxml.rails_env</tt> -- the Rails environment to use for the
54
+ # Extra configuration for web.xml. Controls how the dynamically-generated web.xml
55
+ # file is generated.
56
+ #
57
+ # * <tt>webxml.jndi</tt> -- the name of one or more JNDI data sources name to be
58
+ # available to the application. Places appropriate &lt;resource-ref&gt; entries
59
+ # in the file.
60
+ # * <tt>webxml.ignored</tt> -- array of key names that will be not used to
61
+ # generate a context param. Defaults to ['jndi', 'booter']
62
+ #
63
+ # Any other key/value pair placed in the open structure will be dumped as a
64
+ # context parameter in the web.xml file. Some of the recognized values are:
65
+ #
66
+ # * <tt>webxml.rails.env</tt> -- the Rails environment to use for the
64
67
  # running application, usually either development or production (the
65
68
  # default).
66
- # * <tt>webxml.pool.maxActive</tt> -- maximum number of pooled Rails
67
- # application runtimes (default 4)
68
- # * <tt>webxml.pool.minIdle</tt> -- minimum number of pooled runtimes to
69
- # keep around during idle time (default 2)
70
- # * <tt>webxml.pool.checkInterval</tt> -- how often to check whether the
71
- # pool size is within minimum and maximum limits, in milliseconds
72
- # (default 0)
73
- # * <tt>webxml.pool.maxWait</tt> -- how long a waiting thread should wait
74
- # for a runtime before giving up, in milliseconds (default 30000)
75
- # * <tt>webxml.jndi</tt> -- the name of a JNDI data source name to be
76
- # available to the application
77
- # * <tt>webxml.servlet_name</tt> -- the name of the servlet to receive all
78
- # requests. One of +files+ or +rails+. Goldspike's default behavior is
79
- # to route first through the FileServlet, and if the file isn't found,
80
- # it is forwarded to the RailsServlet. Use +rails+ if your application
81
- # server is fronted by Apache or something else that will handle static
82
- # files.
69
+ # * <tt>webxml.jruby.min.runtimes</tt> -- minimum number of pooled runtimes to
70
+ # keep around during idle time
71
+ # * <tt>webxml.jruby.max.runtimes</tt> -- maximum number of pooled Rails
72
+ # application runtimes
83
73
  attr_accessor :webxml
84
74
 
85
75
  def initialize(warbler_home = WARBLER_HOME)
@@ -127,10 +117,11 @@ module Warbler
127
117
  end
128
118
 
129
119
  def default_webxml_config
130
- c = OpenStruct.new
131
- c.standalone = true
132
- c.rails_env = "production"
133
- c.pool = OpenStruct.new
120
+ c = WebxmlOpenStruct.new
121
+ c.rails.env = "production"
122
+ c.public.root = '/'
123
+ c.jndi = nil
124
+ c.ignored = %w(jndi booter)
134
125
  c
135
126
  end
136
127
 
@@ -144,6 +135,39 @@ module Warbler
144
135
  gems << "rails" unless File.directory?("vendor/rails")
145
136
  gems
146
137
  end
147
-
138
+ end
139
+
140
+ class WebxmlOpenStruct < OpenStruct
141
+ def initialize
142
+ @table = Hash.new {|h,k| h[k] = WebxmlOpenStruct.new }
143
+ end
144
+
145
+ def servlet_context_listener
146
+ case self.booter
147
+ when :rack
148
+ "org.jruby.rack.RackServletContextListener"
149
+ when :merb
150
+ "org.jruby.rack.merb.MerbServletContextListener"
151
+ else # :rails, default
152
+ "org.jruby.rack.rails.RailsServletContextListener"
153
+ end
154
+ end
155
+
156
+ def context_params
157
+ params = {}
158
+ @table.each do |k,v|
159
+ case v
160
+ when WebxmlOpenStruct
161
+ nested_params = v.context_params
162
+ nested_params.each do |nk,nv|
163
+ params["#{k}.#{nk}"] = nv
164
+ end
165
+ else
166
+ params[k] = v.to_s
167
+ end
168
+ end
169
+ params.delete_if {|k,v| ['ignored', *ignored].include?(k.to_s) }
170
+ params
171
+ end
148
172
  end
149
173
  end
data/lib/warbler/gems.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # (c) Copyright 2008 Robert Egglestone <r.egglestone@auckland.ac.nz>
2
+ # (c) Copyright 2007-2008 Sun Microsystems, Inc.
3
3
  # See the file LICENSES.txt included with the distribution for
4
4
  # software license details.
5
5
  #++
data/lib/warbler/task.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # (c) Copyright 2007-2008 Nick Sieger <nicksieger@gmail.com>
2
+ # (c) Copyright 2007-2008 Sun Microsystems, Inc.
3
3
  # See the file LICENSES.txt included with the distribution for
4
4
  # software license details.
5
5
  #++
@@ -1,9 +1,9 @@
1
1
  #--
2
- # (c) Copyright 2007-2008 Nick Sieger <nicksieger@gmail.com>
2
+ # (c) Copyright 2007-2008 Sun Microsystems, Inc.
3
3
  # See the file LICENSES.txt included with the distribution for
4
4
  # software license details.
5
5
  #++
6
6
 
7
7
  module Warbler
8
- VERSION = "0.9.5"
8
+ VERSION = "0.9.9"
9
9
  end
data/lib/warbler.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # (c) Copyright 2007-2008 Nick Sieger <nicksieger@gmail.com>
2
+ # (c) Copyright 2007-2008 Sun Microsystems, Inc.
3
3
  # See the file LICENSES.txt included with the distribution for
4
4
  # software license details.
5
5
  #++
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # (c) Copyright 2007-2008 Nick Sieger <nicksieger@gmail.com>
2
+ # (c) Copyright 2007-2008 Sun Microsystems, Inc.
3
3
  # See the file LICENSES.txt included with the distribution for
4
4
  # software license details.
5
5
  #++
@@ -1,5 +1,5 @@
1
1
  #--
2
- # (c) Copyright 2007-2008 Nick Sieger <nicksieger@gmail.com>
2
+ # (c) Copyright 2007-2008 Sun Microsystems, Inc.
3
3
  # See the file LICENSES.txt included with the distribution for
4
4
  # software license details.
5
5
  #++
@@ -19,7 +19,6 @@ describe Warbler::Config do
19
19
  config.java_libs.should_not be_empty
20
20
  config.war_name.size.should > 0
21
21
  config.webxml.should be_kind_of(OpenStruct)
22
- config.webxml.pool.should be_kind_of(OpenStruct)
23
22
  config.pathmaps.should be_kind_of(OpenStruct)
24
23
  config.pathmaps.public_html.should == ["%{public/,}p"]
25
24
  end
@@ -48,7 +47,41 @@ describe Warbler::Config do
48
47
  config = Warbler::Config.new File.join(Dir.getwd, "vendor", "plugins", "warbler")
49
48
  config.excludes.include?("vendor/plugins/warbler").should == true
50
49
  end
51
-
50
+
51
+ it "should generate context parameters from the webxml openstruct" do
52
+ config = Warbler::Config.new
53
+ config.webxml.a.b.c = "123"
54
+ config.webxml.rails.env = 'staging'
55
+ config.webxml.jruby.min.runtimes = 2
56
+ config.webxml.jruby.max.runtimes = 4
57
+ params = config.webxml.context_params
58
+ params.should have_key('a.b.c')
59
+ params.should have_key('rails.env')
60
+ params.should have_key('jruby.min.runtimes')
61
+ params.should have_key('jruby.max.runtimes')
62
+ params['a.b.c'].should == "123"
63
+ params['rails.env'].should == "staging"
64
+ params['jruby.min.runtimes'].should == "2"
65
+ params['jruby.max.runtimes'].should == "4"
66
+ end
67
+
68
+ it "should determine the context listener from the webxml.booter parameter" do
69
+ config = Warbler::Config.new
70
+ config.webxml.booter = :rack
71
+ config.webxml.servlet_context_listener.should == "org.jruby.rack.RackServletContextListener"
72
+ config = Warbler::Config.new
73
+ config.webxml.booter = :merb
74
+ config.webxml.servlet_context_listener.should == "org.jruby.rack.merb.MerbServletContextListener"
75
+ config = Warbler::Config.new
76
+ config.webxml.servlet_context_listener.should == "org.jruby.rack.rails.RailsServletContextListener"
77
+ end
78
+
79
+ it "should not include ignored webxml keys in the context params hash" do
80
+ Warbler::Config.new.webxml.context_params.should_not have_key('ignored')
81
+ Warbler::Config.new.webxml.context_params.should_not have_key('jndi')
82
+ Warbler::Config.new.webxml.context_params.should_not have_key('booter')
83
+ end
84
+
52
85
  #it "should automatically gems used by the web application" do
53
86
  # gem "actionpack"
54
87
  # config = Warbler::Config.new
@@ -1,5 +1,5 @@
1
1
  #--
2
- # (c) Copyright 2008 Robert Egglestone <r.egglestone@auckland.ac.nz>
2
+ # (c) Copyright 2007-2008 Sun Microsystems, Inc.
3
3
  # See the file LICENSES.txt included with the distribution for
4
4
  # software license details.
5
5
  #++
@@ -1,5 +1,5 @@
1
1
  #--
2
- # (c) Copyright 2007-2008 Nick Sieger <nicksieger@gmail.com>
2
+ # (c) Copyright 2007-2008 Sun Microsystems, Inc.
3
3
  # See the file LICENSES.txt included with the distribution for
4
4
  # software license details.
5
5
  #++
@@ -18,7 +18,7 @@ describe Warbler::Task do
18
18
  config.gems = ["rake"]
19
19
  config.dirs = %w(bin generators lib)
20
20
  config.public_html = FileList["public/**/*", "tasks/**/*"]
21
- config.webxml.pool.maxActive = 5
21
+ config.webxml.jruby.max.runtimes = 5
22
22
  end
23
23
  verbose(false)
24
24
  end
@@ -68,23 +68,70 @@ describe Warbler::Task do
68
68
  file_list(%r{WEB-INF/gems/specifications/rake.*\.gemspec}).should_not be_empty
69
69
  end
70
70
 
71
- it "should define a webxml task for creating web.xml" do
71
+ def expand_webxml
72
72
  define_tasks "webxml"
73
73
  Rake::Task["warble:webxml"].invoke
74
- file_list(%r{WEB-INF/web.xml$}).should_not be_empty
75
74
  require 'rexml/document'
76
-
77
- elements = File.open("#{@config.staging_dir}/WEB-INF/web.xml") do |f|
75
+ File.open("#{@config.staging_dir}/WEB-INF/web.xml") do |f|
78
76
  REXML::Document.new(f).root.elements
79
77
  end
78
+ end
79
+
80
+ it "should define a webxml task for creating web.xml" do
81
+ elements = expand_webxml
80
82
  elements.to_a(
81
- "context-param/param-name[text()='jruby.pool.maxActive']"
83
+ "context-param/param-name[text()='jruby.max.runtimes']"
82
84
  ).should_not be_empty
83
85
  elements.to_a(
84
- "context-param/param-name[text()='jruby.pool.maxActive']/../param-value"
86
+ "context-param/param-name[text()='jruby.max.runtimes']/../param-value"
85
87
  ).first.text.should == "5"
86
88
  end
87
89
 
90
+ it "should include custom context parameters" do
91
+ @config.webxml.some.custom.config = "myconfig"
92
+ elements = expand_webxml
93
+ elements.to_a(
94
+ "context-param/param-name[text()='some.custom.config']"
95
+ ).should_not be_empty
96
+ elements.to_a(
97
+ "context-param/param-name[text()='some.custom.config']/../param-value"
98
+ ).first.text.should == "myconfig"
99
+ end
100
+
101
+ it "should allow one jndi resource to be included" do
102
+ @config.webxml.jndi = 'jndi/rails'
103
+ elements = expand_webxml
104
+ elements.to_a(
105
+ "resource-ref/res-ref-name[text()='jndi/rails']"
106
+ ).should_not be_empty
107
+ end
108
+
109
+ it "should allow multiple jndi resources to be included" do
110
+ @config.webxml.jndi = ['jndi/rails1', 'jndi/rails2']
111
+ elements = expand_webxml
112
+ elements.to_a(
113
+ "resource-ref/res-ref-name[text()='jndi/rails1']"
114
+ ).should_not be_empty
115
+ elements.to_a(
116
+ "resource-ref/res-ref-name[text()='jndi/rails2']"
117
+ ).should_not be_empty
118
+ end
119
+
120
+ it "should not include any ignored context parameters" do
121
+ @config.webxml.foo = "bar"
122
+ @config.webxml.ignored << "foo"
123
+ elements = expand_webxml
124
+ elements.to_a(
125
+ "context-param/param-name[text()='foo']"
126
+ ).should be_empty
127
+ elements.to_a(
128
+ "context-param/param-name[text()='ignored']"
129
+ ).should be_empty
130
+ elements.to_a(
131
+ "context-param/param-name[text()='jndi']"
132
+ ).should be_empty
133
+ end
134
+
88
135
  it "should use a config/web.xml if it exists" do
89
136
  define_tasks "webxml"
90
137
  mkdir_p "config"
@@ -98,11 +145,11 @@ describe Warbler::Task do
98
145
  it "should use a config/web.xml.erb if it exists" do
99
146
  define_tasks "webxml"
100
147
  mkdir_p "config"
101
- File.open("config/web.xml.erb", "w") {|f| f << "Hi <%= webxml.standalone %>" }
148
+ File.open("config/web.xml.erb", "w") {|f| f << "Hi <%= webxml.public.root %>" }
102
149
  Rake::Task["warble:webxml"].invoke
103
150
  files = file_list(%r{WEB-INF/web.xml$})
104
151
  files.should_not be_empty
105
- File.open(files.first) {|f| f.read}.should == "Hi true"
152
+ File.open(files.first) {|f| f.read}.should == "Hi /"
106
153
  end
107
154
 
108
155
  it "should define a java_libs task for copying java libraries" do
data/tasks/warbler.rake CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # (c) Copyright 2007-2008 Nick Sieger <nicksieger@gmail.com>
2
+ # (c) Copyright 2007-2008 Sun Microsystems, Inc.
3
3
  # See the file LICENSES.txt included with the distribution for
4
4
  # software license details.
5
5
  #++
data/web.xml.erb CHANGED
@@ -2,78 +2,31 @@
2
2
  "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
3
3
  "http://java.sun.com/dtd/web-app_2_3.dtd">
4
4
  <web-app>
5
-
6
- <context-param>
7
- <param-name>jruby.standalone</param-name>
8
- <param-value><%= webxml.standalone %></param-value>
9
- </context-param>
10
-
11
- <% if !webxml.standalone && webxml.jruby_home %>
12
- <!-- jruby.home can be set either here, or as the system property jruby.home -->
13
- <context-param>
14
- <param-name>jruby.home</param-name>
15
- <param-value><%= webxml.jruby_home %></param-value>
16
- </context-param>
17
- <% end %>
18
-
19
- <context-param>
20
- <param-name>rails.root</param-name>
21
- <param-value>/WEB-INF</param-value>
22
- </context-param>
23
-
24
- <context-param>
25
- <param-name>rails.env</param-name>
26
- <param-value><%= webxml.rails_env || 'production' %></param-value>
27
- </context-param>
28
-
29
- <% webxml.pool.marshal_dump.each do |k,v| %>
30
- <context-param>
31
- <param-name>jruby.pool.<%= k %></param-name>
32
- <param-value><%= v %></param-value>
33
- </context-param>
34
- <% end %>
35
-
36
- <context-param>
37
- <param-name>files.default</param-name>
38
- <param-value>rails</param-value>
39
- <description>
40
- The files servlet should forward to the rails servlet if no file could be found
41
- </description>
42
- </context-param>
43
-
44
- <context-param>
45
- <param-name>files.prefix</param-name>
46
- <param-value></param-value>
47
- <description>
48
- Prefix added to static files
49
- </description>
50
- </context-param>
51
-
52
- <listener>
53
- <listener-class>org.jruby.webapp.RailsContextListener</listener-class>
54
- </listener>
55
-
56
- <servlet>
57
- <servlet-name>rails</servlet-name>
58
- <servlet-class>org.jruby.webapp.RailsServlet</servlet-class>
59
- </servlet>
60
- <servlet>
61
- <servlet-name>files</servlet-name>
62
- <servlet-class>org.jruby.webapp.FileServlet</servlet-class>
63
- </servlet>
64
-
65
- <!-- Allow all requests to go to the files servlet first -->
66
- <servlet-mapping>
67
- <servlet-name><%= webxml.servlet_name || 'files' %></servlet-name>
68
- <url-pattern>/</url-pattern>
69
- </servlet-mapping>
70
-
71
- <% if webxml.jndi %>
72
- <resource-ref>
73
- <res-ref-name><%= webxml.jndi %></res-ref-name>
74
- <res-type>javax.sql.DataSource</res-type>
75
- <res-auth>Container</res-auth>
76
- </resource-ref>
77
- <% end %>
78
-
5
+ <% webxml.context_params.each do |k,v| %>
6
+ <context-param>
7
+ <param-name><%= k %></param-name>
8
+ <param-value><%= v %></param-value>
9
+ </context-param>
10
+ <% end %>
11
+
12
+ <filter>
13
+ <filter-name>RackFilter</filter-name>
14
+ <filter-class>org.jruby.rack.RackFilter</filter-class>
15
+ </filter>
16
+ <filter-mapping>
17
+ <filter-name>RackFilter</filter-name>
18
+ <url-pattern>/*</url-pattern>
19
+ </filter-mapping>
20
+
21
+ <listener>
22
+ <listener-class><%= webxml.servlet_context_listener %></listener-class>
23
+ </listener>
24
+
25
+ <% if webxml.jndi then webxml.jndi.each do |jndi| %>
26
+ <resource-ref>
27
+ <res-ref-name><%= jndi %></res-ref-name>
28
+ <res-type>javax.sql.DataSource</res-type>
29
+ <res-auth>Container</res-auth>
30
+ </resource-ref>
31
+ <% end; end %>
79
32
  </web-app>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sieger
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-04-05 00:00:00 -05:00
12
+ date: 2008-05-08 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -44,10 +44,8 @@ files:
44
44
  - generators/warble/templates
45
45
  - generators/warble/templates/warble.rb
46
46
  - generators/warble/warble_generator.rb
47
- - lib/activation-1.1.jar
48
- - lib/commons-pool-1.3.jar
49
- - lib/goldspike-1.6.1.jar
50
- - lib/jruby-complete-1.1.jar
47
+ - lib/jruby-complete-1.1.1.jar
48
+ - lib/jruby-rack-0.9.jar
51
49
  - lib/warbler
52
50
  - lib/warbler/config.rb
53
51
  - lib/warbler/gems.rb
Binary file
Binary file
Binary file