Skip to content

Commit 6f8578d

Browse files
committed
Merge remote-tracking branch 'upstream/master' into gocd-master
2 parents 3529127 + d94bd4d commit 6f8578d

File tree

91 files changed

+1013
-642
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1013
-642
lines changed

.github/workflows/maven.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
env:
1010
# Default versions for canonical release build
11-
DEFAULT_JAVA_VERSION: '11'
11+
DEFAULT_JAVA_VERSION: '8'
1212
DEFAULT_JRUBY_VERSION: '9.4.13.0' # Should match pom.xml <jruby.version> property (AND a version inside the test matrix)
1313

1414
jobs:
@@ -18,12 +18,14 @@ jobs:
1818

1919
strategy:
2020
matrix:
21-
jruby_version: [ '9.4.13.0', '10.0.1.0' ]
22-
java_version: [ '11', '17', '21' ]
21+
jruby_version: [ '9.4.13.0', '10.0.2.0' ]
22+
java_version: [ '8', '11', '17', '21' ]
2323
exclude:
24-
- jruby_version: '10.0.1.0'
24+
- jruby_version: '10.0.2.0'
25+
java_version: '8' # JRuby 10 requires Java 21
26+
- jruby_version: '10.0.2.0'
2527
java_version: '11' # JRuby 10 requires Java 21
26-
- jruby_version: '10.0.1.0'
28+
- jruby_version: '10.0.2.0'
2729
java_version: '17' # JRuby 10 requires Java 21
2830
fail-fast: false
2931

@@ -52,15 +54,17 @@ jobs:
5254

5355
strategy:
5456
matrix:
55-
jruby_version: [ '9.4.13.0', '10.0.1.0' ]
56-
java_version: [ '11', '17', '21' ]
57+
jruby_version: [ '9.4.13.0', '10.0.2.0' ]
58+
java_version: [ '8', '11', '17', '21' ]
5759
appraisal: [ 'rails50', 'rails52', 'rails60', 'rails61', 'rails70', 'rails71', 'rails72', 'rails80' ]
5860
exclude:
5961
- jruby_version: '9.4.13.0'
6062
appraisal: 'rails80' # Requires Ruby 3.4 compatibility, which JRuby 9.4 does not support
61-
- jruby_version: '10.0.1.0'
63+
- jruby_version: '10.0.2.0'
64+
java_version: '8' # JRuby 10 requires Java 21
65+
- jruby_version: '10.0.2.0'
6266
java_version: '11' # JRuby 10 requires Java 21
63-
- jruby_version: '10.0.1.0'
67+
- jruby_version: '10.0.2.0'
6468
java_version: '17' # JRuby 10 requires Java 21
6569
fail-fast: false
6670

@@ -79,7 +83,7 @@ jobs:
7983
cache: maven
8084

8185
- name: Setup JRuby
82-
uses: ruby/setup-ruby@2a7b30092b0caf9c046252510f9273b4875f3db9 # v1.254.0
86+
uses: ruby/setup-ruby@829114fc20da43a41d27359103ec7a63020954d4 # v1.255.0
8387
with:
8488
ruby-version: jruby-${{ matrix.jruby_version }}
8589
bundler-cache: 'false' # Need to install later so we can vary from Gemfile.lock as required for JRuby version compatibility

Gemfile.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ GEM
2424
thor (1.4.0)
2525

2626
PLATFORMS
27+
universal-java-1.8
2728
universal-java-11
2829
universal-java-17
2930
universal-java-21

History.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
## 1.3.0 (UNRELEASED)
22

3-
- Require Java 11 or later
43
- Support Javax Servlet API 4.0 (JEE 8)
54
- Adds basic compatibility with JRuby 10.0
65
- Drop support for JRuby 9.3

README.md

Lines changed: 96 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ dependencies {
2828

2929
## Compatibility
3030

31-
| JRuby-Rack Version | Status | JRuby Compat | Java Compat | Target Servlet API | Target Java EE | Notes |
32-
|--------------------------------------------------------------|------------|--------------|-------------|--------------------|----------------|---------------------------------------------------|
33-
| 1.4.x (_planned_) | Dev | 9.4 → 10.0 | Java 17+ | 5.0 | Jakarta EE 9 | |
34-
| 1.3.x (master, _unreleased_) | Dev | 9.4 → 10.0 | Java 11+ | 4.0 | Java EE 8 | |
35-
| [1.2.x](https://github.com/jruby/jruby-rack/tree/1.2-stable) | Maintained | 9.3 → 9.4 | Java 8+ | 3.0 | Java EE 6 | Servlet 3.1 → 4.0 tested OK with some containers. |
36-
| [1.1.x](https://github.com/jruby/jruby-rack/tree/1.1-stable) | EOL | 1.6 → 9.4 | Java 8+ | 2.5 | Java EE 5 | Servlet 3.0 → 4.0 tested OK with some containers. |
31+
| JRuby-Rack Version | Status | Rack | JRuby | Java | Target Servlet API | Target Java EE | Notes |
32+
|--------------------------------------------------------------|------------|-----------|------------|---------|--------------------|----------------|--------------------------------------------|
33+
| 2.0.x (_planned_) | Dev | 2.2 | 9.4 → 10.0 | Java 8+ | 5.0+ | Jakarta EE 9 | Pre 5.0 servlet APIs non functional. |
34+
| 1.3.x (master, _unreleased_) | Dev | 2.2 | 9.4 → 10.0 | Java 8+ | 4.0 | Java EE 8 | Servlet 2.5 → 3.1 likely to work fine. |
35+
| [1.2.x](https://github.com/jruby/jruby-rack/tree/1.2-stable) | Maintained | 2.2 | 9.3 → 9.4 | Java 8+ | 3.0 | Java EE 6 | Servlet 3.1 → 4.0 OK with some containers. |
36+
| [1.1.x](https://github.com/jruby/jruby-rack/tree/1.1-stable) | EOL | 1.x → 2.2 | 1.6 → 9.4 | Java 8+ | 2.5 | Java EE 5 | Servlet 3.0 → 4.0 OK with some containers. |
3737

3838
## Getting Started
3939

@@ -62,79 +62,85 @@ min/max runtime parameters. For **multi-threaded** (a.k.a. `threadsafe!`)
6262
Rails with a single runtime, set min/max both to 1. Otherwise, define the size
6363
of the runtime pool as you wish.
6464

65-
<context-param>
66-
<param-name>rails.env</param-name>
67-
<param-value>production</param-value>
68-
</context-param>
69-
<context-param>
70-
<param-name>jruby.min.runtimes</param-name>
71-
<param-value>1</param-value>
72-
</context-param>
73-
<context-param>
74-
<param-name>jruby.max.runtimes</param-name>
75-
<param-value>1</param-value>
76-
</context-param>
77-
78-
<filter>
79-
<filter-name>RackFilter</filter-name>
80-
<filter-class>org.jruby.rack.RackFilter</filter-class>
81-
<!-- optional filter configuration init-params : -->
82-
<init-param>
83-
<param-name>resetUnhandledResponse</param-name>
84-
<param-value>true</param-value> <!-- true (default), false or buffer -->
85-
</init-param>
86-
<init-param>
87-
<param-name>addsHtmlToPathInfo</param-name>
88-
<param-value>true</param-value> <!-- true (default), false -->
89-
</init-param>
90-
<init-param>
91-
<param-name>verifiesHtmlResource</param-name>
92-
<param-value>false</param-value> <!-- true, false (default) -->
93-
</init-param>
94-
</filter>
95-
<filter-mapping>
96-
<filter-name>RackFilter</filter-name>
97-
<url-pattern>/*</url-pattern>
98-
</filter-mapping>
99-
100-
<listener>
101-
<listener-class>org.jruby.rack.rails.RailsServletContextListener</listener-class>
102-
</listener>
65+
```xml
66+
<context-param>
67+
<param-name>rails.env</param-name>
68+
<param-value>production</param-value>
69+
</context-param>
70+
<context-param>
71+
<param-name>jruby.min.runtimes</param-name>
72+
<param-value>1</param-value>
73+
</context-param>
74+
<context-param>
75+
<param-name>jruby.max.runtimes</param-name>
76+
<param-value>1</param-value>
77+
</context-param>
78+
79+
<filter>
80+
<filter-name>RackFilter</filter-name>
81+
<filter-class>org.jruby.rack.RackFilter</filter-class>
82+
<!-- optional filter configuration init-params : -->
83+
<init-param>
84+
<param-name>resetUnhandledResponse</param-name>
85+
<param-value>true</param-value> <!-- true (default), false or buffer -->
86+
</init-param>
87+
<init-param>
88+
<param-name>addsHtmlToPathInfo</param-name>
89+
<param-value>true</param-value> <!-- true (default), false -->
90+
</init-param>
91+
<init-param>
92+
<param-name>verifiesHtmlResource</param-name>
93+
<param-value>false</param-value> <!-- true, false (default) -->
94+
</init-param>
95+
</filter>
96+
<filter-mapping>
97+
<filter-name>RackFilter</filter-name>
98+
<url-pattern>/*</url-pattern>
99+
</filter-mapping>
100+
101+
<listener>
102+
<listener-class>org.jruby.rack.rails.RailsServletContextListener</listener-class>
103+
</listener>
104+
```
103105

104106
### (Other) Rack Applications
105107

106108
The main difference when using a non-Rails Rack application is that JRuby-Rack
107109
looks for a "rackup" file named **config.ru** in `WEB-INF/config.ru` or
108110
`WEB-INF/*/config.ru`. Here's a sample *web.xml* configuration :
109111

110-
<filter>
111-
<filter-name>RackFilter</filter-name>
112-
<filter-class>org.jruby.rack.RackFilter</filter-class>
113-
<!-- optional filter configuration init-params (@see above) -->
114-
</filter>
115-
<filter-mapping>
116-
<filter-name>RackFilter</filter-name>
117-
<url-pattern>/*</url-pattern>
118-
</filter-mapping>
119-
120-
<listener>
121-
<listener-class>org.jruby.rack.RackServletContextListener</listener-class>
122-
</listener>
112+
```xml
113+
<filter>
114+
<filter-name>RackFilter</filter-name>
115+
<filter-class>org.jruby.rack.RackFilter</filter-class>
116+
<!-- optional filter configuration init-params (@see above) -->
117+
</filter>
118+
<filter-mapping>
119+
<filter-name>RackFilter</filter-name>
120+
<url-pattern>/*</url-pattern>
121+
</filter-mapping>
122+
123+
<listener>
124+
<listener-class>org.jruby.rack.RackServletContextListener</listener-class>
125+
</listener>
126+
```
123127

124128
If you don't have a *config.ru* or don't want to include it in your web app, you
125129
can embed it directly in the *web.xml* as follows (using Sinatra as an example):
126130

127-
<context-param>
128-
<param-name>rackup</param-name>
129-
<param-value>
130-
require 'rubygems'
131-
gem 'sinatra', '~&gt; 1.3'
132-
require './lib/app'
133-
set :run, false
134-
set :environment, :production
135-
run Sinatra::Application
136-
</param-value>
137-
</context-param>
131+
```xml
132+
<context-param>
133+
<param-name>rackup</param-name>
134+
<param-value>
135+
require 'rubygems'
136+
gem 'sinatra', '~&gt; 1.3'
137+
require './lib/app'
138+
set :run, false
139+
set :environment, :production
140+
run Sinatra::Application
141+
</param-value>
142+
</context-param>
143+
```
138144

139145
Be sure to escape angle-brackets for XML !
140146

@@ -288,13 +294,16 @@ provided *config.ru* the bundled (latest) version of Rack will get loaded.
288294

289295
Use **rack.version** to specify the Rack gem version to be loaded before rackup :
290296

291-
# encoding: UTF-8
292-
# rack.version: ~>2.2.10 (before code is loaded gem '~>2.2.10' will be called)
297+
```ruby
298+
# encoding: UTF-8
299+
# rack.version: ~>2.2.10 (before code is loaded gem '~>2.2.10' will be called)
300+
```
293301

294302
Or the equivalent of doing `bundle exec rackup ...` if you're using Bundler :
295303

296-
# rack.version: bundler (requires 'bundler/setup' before loading the script)
297-
304+
```ruby
305+
# rack.version: bundler (requires 'bundler/setup' before loading the script)
306+
```
298307

299308
## Logging
300309

@@ -305,12 +314,12 @@ logging system, configure `jruby.rack.logging` as follows:
305314
- `servlet_context` (default): Sends log messages to the servlet context.
306315
- `stdout`: Sends log messages to the standard output stream `System.out`.
307316
- `slf4j`: Sends log messages to SLF4J. SLF4J configuration is left up to you,
308-
please refer to http://www.slf4j.org/docs.html .
309-
- `log4j`: Sends log messages to log4J. Again, Log4J configuration is
310-
left up to you, consult http://logging.apache.org/log4j/ .
317+
please refer to https://www.slf4j.org/manual.html .
318+
- `log4j`: Sends log messages through Log4j. Only Log4j 2.x is supported, for
319+
- configuration please consult https://logging.apache.org/log4j/2.x/index.html .
311320
- `commons_logging`: Routes logs to commons-logging. You still need to configure
312-
an underlying logging implementation with JCL. We recommend using the logger
313-
library wrapper directly if possible, see http://commons.apache.org/logging/ .
321+
an underlying logging implementation with JCL.
322+
We recommend rather using the logger library wrapper directly when possible.
314323
- `jul`: Directs log messages via Java's core logging facilities (util.logging).
315324

316325
For those loggers that require a specific named logger, set it with the
@@ -321,21 +330,27 @@ For those loggers that require a specific named logger, set it with the
321330

322331
Checkout the JRuby-Rack code using [git](http://git-scm.com/) :
323332

324-
git clone git://github.com/jruby/jruby-rack.git
325-
cd jruby-rack
333+
```shell
334+
git clone git://github.com/jruby/jruby-rack.git
335+
cd jruby-rack
336+
```
326337

327338
Ensure you have [Maven](http://maven.apache.org/) installed.
328339
It is required for downloading jar artifacts that JRuby-Rack depends on.
329340

330341
Build the .jar using Maven :
331342

332-
mvn install
343+
```shell
344+
mvn install
345+
```
333346

334347
the generated jar should be located at **target/jruby-rack-*.jar**
335348

336349
Alternatively use Rake, e.g. to build the gem (skipping specs) :
337350

338-
jruby -S rake clean gem SKIP_SPECS=true
351+
```shell
352+
jruby -S rake clean gem SKIP_SPECS=true
353+
```
339354

340355
You can **not** use JRuby-Rack with Bundler directly from the git (or http) URL
341356
(`gem 'jruby-rack', :github => 'jruby/jruby-rack'`) since the included .jar file

Rakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ task :speconly => [ :resources, :test_resources ] do
108108
if ENV['SKIP_SPECS'].to_s == 'true'
109109
puts "Skipping specs due to SKIP_SPECS=#{ENV['SKIP_SPECS']}"
110110
else
111-
opts = ENV['SPEC_OPTS'] ? ENV['SPEC_OPTS'] : %q{ --format documentation --color }
111+
opts = ENV['SPEC_OPTS'] ? ENV['SPEC_OPTS'] : %q{ --format documentation --force-color }
112112
spec = ENV['SPEC'] || File.join(Dir.getwd, "src/spec/ruby/**/*_spec.rb")
113113
opts = opts.split(' ').push *FileList[spec].to_a
114114
ruby = ENV['RUBY'] || 'jruby'
@@ -165,7 +165,7 @@ end
165165

166166
desc "Build the jruby-rack-#{GEM_VERSION}.gem"
167167
task :gem => [target_jar, target_jruby_rack, target_jruby_rack_version] do
168-
Rake::Task['spec'].invoke unless ENV['SKIP_SPEC'] == 'true'
168+
Rake::Task['spec'].invoke unless ENV['SKIP_SPECS'] == 'true'
169169
cp FileList["History.md", "LICENSE.txt", "README.md"], "target/gem"
170170
cp target_jar, "target/gem/lib"
171171
if (jars = FileList["target/gem/lib/*.jar"].to_a).size > 1

gemfiles/rails50.gemfile.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ GEM
138138
websocket-extensions (0.1.5)
139139

140140
PLATFORMS
141+
universal-java-1.8
141142
universal-java-11
142143
universal-java-17
143144
universal-java-21

gemfiles/rails52.gemfile.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ GEM
146146
websocket-extensions (0.1.5)
147147

148148
PLATFORMS
149+
universal-java-1.8
149150
universal-java-11
150151
universal-java-17
151152
universal-java-21

gemfiles/rails60.gemfile.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ GEM
162162
zeitwerk (2.6.18)
163163

164164
PLATFORMS
165+
universal-java-1.8
165166
universal-java-11
166167
universal-java-17
167168
universal-java-21

gemfiles/rails61.gemfile.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ GEM
165165
zeitwerk (2.6.18)
166166

167167
PLATFORMS
168+
universal-java-1.8
168169
universal-java-11
169170
universal-java-17
170171
universal-java-21

gemfiles/rails70.gemfile.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ GEM
162162
zeitwerk (2.6.18)
163163

164164
PLATFORMS
165+
universal-java-1.8
165166
universal-java-11
166167
universal-java-17
167168
universal-java-21

0 commit comments

Comments
 (0)