Skip to content

Commit 636fcd9

Browse files
authored
Merge pull request #273 from chadlwilson/jruby-10
[v1.3.x] Introduce compatibility with JRuby 10
2 parents 7e82c73 + d794a22 commit 636fcd9

File tree

17 files changed

+252
-158
lines changed

17 files changed

+252
-158
lines changed

.github/workflows/maven.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
strategy:
2020
matrix:
21-
jruby_version: [ '9.3.15.0', '9.4.12.1' ] # , '10.0.0.1'
21+
jruby_version: [ '9.3.15.0', '9.4.12.1', '10.0.0.1' ]
2222
java_version: [ '8', '11', '17', '21' ]
2323
exclude:
2424
- jruby_version: '10.0.0.1'
@@ -54,16 +54,20 @@ jobs:
5454

5555
strategy:
5656
matrix:
57-
jruby_version: [ '9.3.15.0', '9.4.12.1' ] # , '10.0.0.1'
57+
jruby_version: [ '9.3.15.0', '9.4.12.1', '10.0.0.1' ]
5858
java_version: [ '8', '11', '17', '21' ]
59-
appraisal: [ 'rails50', 'rails52', 'rails60', 'rails61', 'rails70', 'rails71', 'rails72' ]
59+
appraisal: [ 'rails50', 'rails52', 'rails60', 'rails61', 'rails70', 'rails71', 'rails72', 'rails80' ]
6060
exclude:
6161
- jruby_version: '9.3.15.0'
6262
appraisal: 'rails70' # Requires Ruby 2.7 compatibility, which JRuby 9.3 does not support
6363
- jruby_version: '9.3.15.0'
6464
appraisal: 'rails71' # Requires Ruby 2.7 compatibility, which JRuby 9.3 does not support
6565
- jruby_version: '9.3.15.0'
6666
appraisal: 'rails72' # Requires Ruby 3.1 compatibility, which JRuby 9.3 does not support
67+
- jruby_version: '9.3.15.0'
68+
appraisal: 'rails80' # Requires Ruby 3.4 compatibility, which JRuby 9.3 does not support
69+
- jruby_version: '9.4.12.1'
70+
appraisal: 'rails80' # Requires Ruby 3.4 compatibility, which JRuby 9.4 does not support
6771
- jruby_version: '10.0.0.1'
6872
java_version: '8' # JRuby 10 requires Java 21
6973
- jruby_version: '10.0.0.1'

Appraisals

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ end
2525
appraise "rails72" do
2626
gem "rails", "~> 7.2.0"
2727
end
28+
29+
appraise "rails80" do
30+
gem "rails", "~> 8.0.0"
31+
end

History.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 1.3.0 (UNRELEASED)
2+
3+
- Adds basic compatibility with JRuby 10.0
4+
- Drop unnecessary jruby.compat.version and RackConfig.getCompatVersion() API
5+
16
## 1.2.4 (UNRELEASED)
27

38
- update (bundled) rack to 2.2.16

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ JRuby-Rack supports Rails as well as any Rack-compatible Ruby web framework.
66

77
For more information on Rack, visit http://rack.github.io/.
88

9-
**This README (master) targets JRuby-Rack 1.2. Please use the
9+
**This README (master) targets JRuby-Rack 1.3. Please use the
1010
[1.1-stable](https://github.com/jruby/jruby-rack/tree/1.1-stable) branch for
1111
current stable 1.1.x releases.**
1212

@@ -15,12 +15,16 @@ current stable 1.1.x releases.**
1515

1616
## Compatibility
1717

18+
JRuby-Rack 1.3.x
19+
- aims to be compatible with JRuby 9.3 -> 10.0 and their supported JDK versions
20+
- supports any container compatible with Java Servlet 3.0 API
21+
1822
JRuby-Rack 1.2.x
19-
- aims to be compatible with JRuby >= 9.3 and its supported JDK versions
23+
- compatible with JRuby 9.3 -> 9.4 and their supported JDK versions
2024
- supports any container compatible with Java Servlet 3.0 API
2125

2226
JRuby-Rack 1.1.x
23-
- aims to be compatible with JRuby >= 1.6.4 (used successfully through JRuby 9.4.x)
27+
- aims to be compatible with JRuby >= 1.6.4 (used successfully through JRuby 9.4)
2428
- supports any container compatible with Java Servlet 2.5 API (JEE 5)
2529

2630

@@ -206,8 +210,6 @@ as context init parameters in web.xml or as VM-wide system properties.
206210
sub-path of the main servlet context root.
207211
- `gem.path`: Relative path to the bundled gem repository. Defaults to
208212
*/WEB-INF/gems*.
209-
- `jruby.compat.version`: Set to "1.8" or "1.9" to make JRuby run a specific
210-
version of Ruby (same as the --1.8 / --1.9 command line flags).
211213
- `jruby.min.runtimes`: For non-threadsafe Rails applications using a runtime
212214
pool, specify an integer minimum number of runtimes to hold in the pool.
213215
- `jruby.max.runtimes`: For non-threadsafe Rails applications, an integer

gemfiles/rails80.gemfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rake", "~> 13.2", group: :test, require: nil
6+
gem "rspec", group: :test
7+
gem "rails", "~> 8.0.0"
8+
9+
group :default do
10+
gem "rack", "~> 2.2"
11+
end
12+
13+
group :development do
14+
gem "appraisal", require: nil
15+
end

gemfiles/rails80.gemfile.lock

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
actioncable (8.0.2)
5+
actionpack (= 8.0.2)
6+
activesupport (= 8.0.2)
7+
nio4r (~> 2.0)
8+
websocket-driver (>= 0.6.1)
9+
zeitwerk (~> 2.6)
10+
actionmailbox (8.0.2)
11+
actionpack (= 8.0.2)
12+
activejob (= 8.0.2)
13+
activerecord (= 8.0.2)
14+
activestorage (= 8.0.2)
15+
activesupport (= 8.0.2)
16+
mail (>= 2.8.0)
17+
actionmailer (8.0.2)
18+
actionpack (= 8.0.2)
19+
actionview (= 8.0.2)
20+
activejob (= 8.0.2)
21+
activesupport (= 8.0.2)
22+
mail (>= 2.8.0)
23+
rails-dom-testing (~> 2.2)
24+
actionpack (8.0.2)
25+
actionview (= 8.0.2)
26+
activesupport (= 8.0.2)
27+
nokogiri (>= 1.8.5)
28+
rack (>= 2.2.4)
29+
rack-session (>= 1.0.1)
30+
rack-test (>= 0.6.3)
31+
rails-dom-testing (~> 2.2)
32+
rails-html-sanitizer (~> 1.6)
33+
useragent (~> 0.16)
34+
actiontext (8.0.2)
35+
actionpack (= 8.0.2)
36+
activerecord (= 8.0.2)
37+
activestorage (= 8.0.2)
38+
activesupport (= 8.0.2)
39+
globalid (>= 0.6.0)
40+
nokogiri (>= 1.8.5)
41+
actionview (8.0.2)
42+
activesupport (= 8.0.2)
43+
builder (~> 3.1)
44+
erubi (~> 1.11)
45+
rails-dom-testing (~> 2.2)
46+
rails-html-sanitizer (~> 1.6)
47+
activejob (8.0.2)
48+
activesupport (= 8.0.2)
49+
globalid (>= 0.3.6)
50+
activemodel (8.0.2)
51+
activesupport (= 8.0.2)
52+
activerecord (8.0.2)
53+
activemodel (= 8.0.2)
54+
activesupport (= 8.0.2)
55+
timeout (>= 0.4.0)
56+
activestorage (8.0.2)
57+
actionpack (= 8.0.2)
58+
activejob (= 8.0.2)
59+
activerecord (= 8.0.2)
60+
activesupport (= 8.0.2)
61+
marcel (~> 1.0)
62+
activesupport (8.0.2)
63+
base64
64+
benchmark (>= 0.3)
65+
bigdecimal
66+
concurrent-ruby (~> 1.0, >= 1.3.1)
67+
connection_pool (>= 2.2.5)
68+
drb
69+
i18n (>= 1.6, < 2)
70+
logger (>= 1.4.2)
71+
minitest (>= 5.1)
72+
securerandom (>= 0.3)
73+
tzinfo (~> 2.0, >= 2.0.5)
74+
uri (>= 0.13.1)
75+
appraisal (2.5.0)
76+
bundler
77+
rake
78+
thor (>= 0.14.0)
79+
base64 (0.2.0)
80+
benchmark (0.4.0)
81+
bigdecimal (3.1.9-java)
82+
builder (3.3.0)
83+
concurrent-ruby (1.3.5)
84+
connection_pool (2.5.3)
85+
crass (1.0.6)
86+
date (3.4.1-java)
87+
diff-lcs (1.6.2)
88+
drb (2.2.1)
89+
erubi (1.13.1)
90+
globalid (1.2.1)
91+
activesupport (>= 6.1)
92+
i18n (1.14.7)
93+
concurrent-ruby (~> 1.0)
94+
io-console (0.8.0-java)
95+
irb (1.15.2)
96+
pp (>= 0.6.0)
97+
rdoc (>= 4.0.0)
98+
reline (>= 0.4.2)
99+
jar-dependencies (0.5.5)
100+
logger (1.7.0)
101+
loofah (2.24.1)
102+
crass (~> 1.0.2)
103+
nokogiri (>= 1.12.0)
104+
mail (2.8.1)
105+
mini_mime (>= 0.1.1)
106+
net-imap
107+
net-pop
108+
net-smtp
109+
marcel (1.0.4)
110+
mini_mime (1.1.5)
111+
minitest (5.25.5)
112+
net-imap (0.5.8)
113+
date
114+
net-protocol
115+
net-pop (0.1.2)
116+
net-protocol
117+
net-protocol (0.2.2)
118+
timeout
119+
net-smtp (0.5.1)
120+
net-protocol
121+
nio4r (2.7.4-java)
122+
nokogiri (1.18.8-java)
123+
racc (~> 1.4)
124+
pp (0.6.2)
125+
prettyprint
126+
prettyprint (0.2.0)
127+
psych (5.2.6-java)
128+
date
129+
jar-dependencies (>= 0.1.7)
130+
racc (1.8.1-java)
131+
rack (2.2.15)
132+
rack-session (1.0.2)
133+
rack (< 3)
134+
rack-test (2.2.0)
135+
rack (>= 1.3)
136+
rackup (1.0.1)
137+
rack (< 3)
138+
webrick
139+
rails (8.0.2)
140+
actioncable (= 8.0.2)
141+
actionmailbox (= 8.0.2)
142+
actionmailer (= 8.0.2)
143+
actionpack (= 8.0.2)
144+
actiontext (= 8.0.2)
145+
actionview (= 8.0.2)
146+
activejob (= 8.0.2)
147+
activemodel (= 8.0.2)
148+
activerecord (= 8.0.2)
149+
activestorage (= 8.0.2)
150+
activesupport (= 8.0.2)
151+
bundler (>= 1.15.0)
152+
railties (= 8.0.2)
153+
rails-dom-testing (2.2.0)
154+
activesupport (>= 5.0.0)
155+
minitest
156+
nokogiri (>= 1.6)
157+
rails-html-sanitizer (1.6.2)
158+
loofah (~> 2.21)
159+
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
160+
railties (8.0.2)
161+
actionpack (= 8.0.2)
162+
activesupport (= 8.0.2)
163+
irb (~> 1.13)
164+
rackup (>= 1.0.0)
165+
rake (>= 12.2)
166+
thor (~> 1.0, >= 1.2.2)
167+
zeitwerk (~> 2.6)
168+
rake (13.2.1)
169+
rdoc (6.13.1)
170+
psych (>= 4.0.0)
171+
reline (0.6.1)
172+
io-console (~> 0.5)
173+
rspec (3.13.0)
174+
rspec-core (~> 3.13.0)
175+
rspec-expectations (~> 3.13.0)
176+
rspec-mocks (~> 3.13.0)
177+
rspec-core (3.13.3)
178+
rspec-support (~> 3.13.0)
179+
rspec-expectations (3.13.4)
180+
diff-lcs (>= 1.2.0, < 2.0)
181+
rspec-support (~> 3.13.0)
182+
rspec-mocks (3.13.4)
183+
diff-lcs (>= 1.2.0, < 2.0)
184+
rspec-support (~> 3.13.0)
185+
rspec-support (3.13.3)
186+
securerandom (0.4.1)
187+
thor (1.3.2)
188+
timeout (0.4.3)
189+
tzinfo (2.0.6)
190+
concurrent-ruby (~> 1.0)
191+
uri (1.0.3)
192+
useragent (0.16.11)
193+
webrick (1.9.1)
194+
websocket-driver (0.7.7-java)
195+
base64
196+
websocket-extensions (>= 0.1.0)
197+
websocket-extensions (0.1.5)
198+
zeitwerk (2.7.2)
199+
200+
PLATFORMS
201+
universal-java-21
202+
203+
DEPENDENCIES
204+
appraisal
205+
rack (~> 2.2)
206+
rails (~> 8.0.0)
207+
rake (~> 13.2)
208+
rspec
209+
210+
BUNDLED WITH
211+
2.6.3

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<groupId>org.jruby.rack</groupId>
1212
<artifactId>jruby-rack</artifactId>
13-
<version>1.2.4-SNAPSHOT</version>
13+
<version>1.3.0-SNAPSHOT</version>
1414
<name>JRuby-Rack</name>
1515
<url>https://github.com/jruby/jruby-rack/</url>
1616
<description>

src/main/java/org/jruby/rack/DefaultRackApplicationFactory.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,6 @@ protected RubyInstanceConfig initRuntimeConfig(final RubyInstanceConfig config)
309309
// Process arguments, namely any that might be in RUBYOPT
310310
config.processArguments(rackConfig.getRuntimeArguments());
311311

312-
if ( rackConfig.getCompatVersion() != null ) {
313-
config.setCompatVersion(rackConfig.getCompatVersion());
314-
}
315-
316312
try { // try to set jruby home to jar file path
317313
final URL resource = Ruby.class.getResource("/META-INF/jruby.home");
318314
if ( resource != null && "jar".equals( resource.getProtocol() ) ) {

src/main/java/org/jruby/rack/DefaultRackConfig.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@
1717
import java.util.HashMap;
1818
import java.util.LinkedHashMap;
1919
import java.util.Map;
20-
import java.util.regex.Matcher;
21-
import java.util.regex.Pattern;
22-
import org.jruby.CompatVersion;
2320
import org.jruby.rack.logging.OutputStreamLogger;
2421
import org.jruby.rack.logging.StandardOutLogger;
2522
import org.jruby.util.SafePropertyAccessor;
26-
import static org.jruby.rack.RackLogger.Level.*;
2723

2824
/**
2925
* A base implementation of that retrieves settings from system properties.
@@ -77,28 +73,6 @@ public void setQuiet(boolean quiet) {
7773
this.quiet = quiet;
7874
}
7975

80-
@Override
81-
public CompatVersion getCompatVersion() {
82-
final String version = getProperty("jruby.compat.version");
83-
if ( version != null ) {
84-
// we handle 1.8, RUBY1_9, --2.0 1_9 2.1.0.dev etc :
85-
final Pattern pattern = Pattern.compile("([123])[._]([8901234567])");
86-
final Matcher matcher = pattern.matcher(version);
87-
if ( matcher.find() ) {
88-
final String name = "RUBY" +
89-
matcher.group(1) + '_' + matcher.group(2);
90-
try {
91-
return Enum.valueOf(CompatVersion.class, name);
92-
}
93-
catch (IllegalArgumentException e) {
94-
getLogger().log(WARN,
95-
"could not resolve compat version from '"+ version +"' will use default", e);
96-
}
97-
}
98-
}
99-
return null;
100-
}
101-
10276
@Override
10377
public String getRackup() {
10478
return getProperty("rackup");

src/main/java/org/jruby/rack/RackConfig.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
package org.jruby.rack;
99

10-
import org.jruby.CompatVersion;
11-
1210
import java.io.PrintStream;
1311
import java.util.Map;
1412

@@ -32,12 +30,6 @@ public interface RackConfig {
3230
* @return <code>STDERR</code>
3331
*/
3432
PrintStream getErr();
35-
36-
/**
37-
* Return the Ruby version that JRuby should run.
38-
* @return <code>RUBY_VERSION</code> (e.g. 1.8, 1.9)
39-
*/
40-
CompatVersion getCompatVersion();
4133

4234
/**
4335
* Return the rackup Ruby script to be used to launch the application.

0 commit comments

Comments
 (0)