@@ -30,8 +30,8 @@ dependencies {
3030
3131| JRuby-Rack Series | Status | Rack | JRuby | Java | Rails | Target Servlet API | Notes |
3232| ------------------------------------------------------------| ------------| -----------| ------------| ------| -----------| ---------------------| --------------------------------------------|
33- | 2.0 (_ planned_ ) | Dev | 2.2 | 9.4 → 10.0 | 8+ | 5.0 → 8.0 | 5.0+ (Jakarta EE 9) | Pre 5.0 servlet APIs non functional. |
34- | 1.3 (master, _ unreleased_ ) | Dev | 2.2 | 9.4 → 10.0 | 8+ | 5.0 → 8.0 | 4.0 (Java EE 8) | Servlet 2.5 → 3.1 likely to work fine. |
33+ | 2.0 (_ planned_ ) | Dev | 2.2 | 9.4 → 10.0 | 8+ | 6.1 → 8.0 | 5.0+ (Jakarta EE 9) | Pre 5.0 servlet APIs non functional. |
34+ | 1.3 (master, _ unreleased_ ) | Dev | 2.2 | 9.4 → 10.0 | 8+ | 6.1 → 8.0 | 4.0 (Java EE 8) | Servlet 2.5 → 3.1 likely to work fine. |
3535| [ 1.2] ( https://github.com/jruby/jruby-rack/tree/1.2-stable ) | Maintained | 2.2 | 9.3 → 9.4 | 8+ | 5.0 → 7.2 | 3.0 (Java EE 6) | Servlet 3.1 → 4.0 OK with some containers. |
3636| [ 1.1] ( https://github.com/jruby/jruby-rack/tree/1.1-stable ) | EOL | 1.x → 2.2 | 1.6 → 9.4 | 6+ | 2.1 → 5.2 | 2.5 (Java EE 5) | Servlet 3.0 → 4.0 OK with some containers. |
3737| 1.0 | EOL | 0.9 → 1.x | 1.1 → 1.9 | 5+ | 2.1 → 3.x | 2.5 (Java EE 5) | |
@@ -46,16 +46,18 @@ in your WAR file when it gets built.
4646If you're assembling your own WAR using other means, you can install the
4747** jruby-rack** gem. It provides a method to locate the jar file:
4848
49- require 'jruby-rack'
50- FileUtils.cp JRubyJars.jruby_rack_jar_path, '.'
49+ ``` ruby
50+ require ' jruby-rack'
51+ FileUtils .cp JRubyJars .jruby_rack_jar_path, ' .'
52+ ```
5153
5254Otherwise you'll need to download the latest [ jar release] [ 2 ] , drop it into the
53- * WEB-INF/lib* directory and configure the ` RackFilter ` in your application's
54- * web.xml* (see following examples).
55+ ` WEB-INF/lib ` directory and configure the ` RackFilter ` in your application's
56+ ` web.xml ` (see following examples).
5557
5658### Rails
5759
58- Here's sample * web.xml* configuration for Rails. Note the environment and
60+ Here's sample ` web.xml ` configuration for Rails. Note the environment and
5961min/max runtime parameters. For ** multi-threaded** (a.k.a. ` threadsafe! ` )
6062Rails with a single runtime, set min/max both to 1. Otherwise, define the size
6163of the runtime pool as you wish.
@@ -104,8 +106,8 @@ of the runtime pool as you wish.
104106### (Other) Rack Applications
105107
106108The main difference when using a non-Rails Rack application is that JRuby-Rack
107- looks for a "rackup" file named ** config.ru** in ` WEB-INF/config.ru ` or
108- ` WEB-INF/*/config.ru ` . Here's a sample * web.xml* configuration :
109+ looks for a "rackup" file named ` config.ru ` in ` WEB-INF/config.ru ` or
110+ ` WEB-INF/*/config.ru ` . Here's a sample ` web.xml ` configuration :
109111
110112``` xml
111113<filter >
@@ -123,8 +125,8 @@ looks for a "rackup" file named **config.ru** in `WEB-INF/config.ru` or
123125</listener >
124126```
125127
126- If you don't have a * config.ru* or don't want to include it in your web app, you
127- can embed it directly in the * web.xml* as follows (using Sinatra as an example):
128+ If you don't have a ` config.ru ` or don't want to include it in your web app, you
129+ can embed it directly in the ` web.xml ` as follows (using Sinatra as an example):
128130
129131``` xml
130132<context-param >
@@ -160,7 +162,7 @@ using is `org.jruby.rack.RackFilter`, the filter supports the following
160162 only), by default "true"
161163- ** addsHtmlToPathInfo** controls whether the .html suffix is added to the URI
162164 when checking if the request is for a static page. The default behavior for
163- Rails and many other Ruby applications is to add an * .html* extension to the
165+ Rails and many other Ruby applications is to add an ` .html ` extension to the
164166 resource and attempt to handle it before serving a dynamic request on the
165167 original URI. However, this behavior may confuse other servlets in your
166168 application that have a wildcard mapping. Defaults to true.
@@ -174,9 +176,9 @@ a filter, the servlet class name is `org.jruby.rack.RackServlet`.
174176## Servlet Environment Integration
175177
176178- servlet context is accessible to any application through the Rack environment
177- variable * java.servlet_context* (as well as the ` $servlet_context ` global).
179+ variable ` java.servlet_context ` (as well as the ` $servlet_context ` global).
178180- the (native) servlet request and response objects could be obtained via the
179- * java.servlet_request* and * java.servlet_response* keys
181+ ` java.servlet_request ` and ` java.servlet_response ` keys
180182- all servlet request attributes are passed through to the Rack environment (and
181183 thus might override request headers or Rack environment variables)
182184- servlet sessions can be used as a (java) session store for Rails, session
@@ -198,13 +200,13 @@ JRuby runtime management and pooling is done automatically by the framework.
198200For Rack-only applications (and Rails ones from jruby-rack >= 1.3), a single
199201shared runtime is created and shared for every request by default.
200202
201- If * jruby.min.runtimes* and * jruby.max.runtimes* values are
203+ If ` jruby.min.runtimes ` and ` jruby.max.runtimes ` values are
202204specified pooling of runtimes can be enabled for both types of applications.
203205
204206We do recommend to boot your runtimes up-front to avoid the cost of initializing
205207one while a request kicks in and find the pool empty, this can be easily avoided
206- by setting * jruby.min.runtimes* equal to * jruby.max.runtimes* . You might also
207- want to consider tuning the * jruby.runtime.acquire.timeout* parameter to not
208+ by setting ` jruby.min.runtimes ` equal to ` jruby.max.runtimes ` . You might also
209+ want to consider tuning the ` jruby.runtime.acquire.timeout ` parameter to not
208210wait too long when all (max) runtimes from the pool are busy.
209211
210212## JRuby-Rack Configuration
@@ -214,18 +216,18 @@ as context init parameters in web.xml or as VM-wide system properties.
214216
215217- ` rackup ` : Rackup script for configuring how the Rack application is mounted.
216218 Required for Rack-based applications other than Rails. Can be omitted if a
217- * config.ru* is included in the application root.
219+ ` config.ru ` is included in the application root.
218220- ` public.root ` : Relative path to the location of your application's static
219- assets. Defaults to * /* .
221+ assets. Defaults to ` */* ` .
220222- ` rails.root ` : Root path to the location of the Rails application files.
221- Defaults to * /WEB-INF* .
223+ Defaults to ` */WEB-INF* ` .
222224- ` rails.env ` : Specify the Rails environment to run. Defaults to 'production'.
223225- ` rails.relative_url_append ` : Specify a path to be appended to the
224226 ` ActionController::Base.relative_url_root ` after the context path. Useful
225227 for running a rails app from the same war as an existing app, under a
226228 sub-path of the main servlet context root.
227229- ` gem.path ` : Relative path to the bundled gem repository. Defaults to
228- * /WEB-INF/gems* .
230+ ` /WEB-INF/gems ` .
229231- ` jruby.min.runtimes ` : For non-threadsafe Rails applications using a runtime
230232 pool, specify an integer minimum number of runtimes to hold in the pool.
231233- ` jruby.max.runtimes ` : For non-threadsafe Rails applications, an integer
@@ -270,17 +272,17 @@ as context init parameters in web.xml or as VM-wide system properties.
270272
271273There are often cases where you need to perform custom initialization of the
272274Ruby environment before booting the application. You can create a file called
273- * META-INF/init.rb* or * WEB-INF/init.rb* inside the war file for this purpose.
275+ ` META-INF/init.rb ` or ` WEB-INF/init.rb ` inside the war file for this purpose.
274276These files, if found, will be evaluated before booting the Rack environment,
275277allowing you to set environment variables, load scripts, etc.
276278
277279For plain Rack applications, JRuby-Rack also supports a magic comment to solve
278280the "rackup" chicken-egg problem (you need Rack's builder loaded before loading
279- the * config.ru* , yet you may want to setup the gem version from within the rackup
281+ the ` config.ru ` , yet you may want to setup the gem version from within the rackup
280282 file). As we ship with the Rack gem bundled, otherwise when executing the
281- provided * config.ru* the bundled (latest) version of Rack will get loaded.
283+ provided ` config.ru ` the bundled (latest) version of Rack will get loaded.
282284
283- Use ** rack.version** to specify the Rack gem version to be loaded before rackup :
285+ Use ` rack.version ` to specify the Rack gem version to be loaded before rackup :
284286
285287``` ruby
286288# encoding: UTF-8
@@ -331,7 +333,7 @@ Build the .jar using Maven :
331333./mvnw install
332334```
333335
334- the generated jar should be located at ** target/jruby-rack-* .jar**
336+ the generated jar should be located at ` target/jruby-rack-*.jar `
335337
336338Alternatively use Rake, e.g. to build the gem (skipping specs) :
337339
@@ -352,6 +354,20 @@ package and push the .jar every time a commit changes a source file).
352354* ` ./mvnw release:perform ` (possibly with ` -DuseReleaseProfile=false ` due to Javadoc doclint failures for now)
353355* ` rake clean gem SKIP_SPECS=true ` and push the gem
354356
357+ ## Adding testing for new Rails versions
358+
359+ * Add the new version to ` .github/workflows/maven.yml ` under the ` matrix ` section
360+ * Add a new configuration to the ` Appraisals ` file, then
361+ ``` bundle exec appraisal generate ```
362+ * Generate a new stub Rails application for the new version
363+ ``` shell
364+ VERSION=rails72
365+ cd src/spec/stub
366+ rm -rf $VERSION && BUNDLE_GEMFILE=~ /Projects/community/jruby-rack/gemfiles/${VERSION} _rack22.gemfile bundle exec rails new $VERSION --minimal --skip-git --skip-docker --skip-active-model --skip-active-record --skip-test --skip-system-test --skip-dev-gems --skip-bundle --skip-keeps --skip-asset-pipeline --skip-ci --skip-brakeman --skip-rubocop
367+ ```
368+ * Manual changes to make to support testing
369+ * In ` config/production.rb` comment out the default ` config.logger` value so jruby-rack applies its own ` RailsLogger` .
370+
355371# # Support
356372
357373Please use [github][3] to file bugs, patches and/or pull requests.
0 commit comments