Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

strategy:
matrix:
jruby_version: [ '9.3.15.0', '9.4.14.0', '10.0.5.0' ]
jruby_version: [ '9.3.15.0', '9.4.14.0', '10.0.5.0', '10.1.0.0' ]
java_version: [ '8', '11', '17', '21', '25' ]
rack_version: [ '~> 2.2.0' ]
exclude:
Expand All @@ -29,6 +29,12 @@ jobs:
java_version: '11' # JRuby 10 requires Java 21
- jruby_version: '10.0.5.0'
java_version: '17' # JRuby 10 requires Java 21
- jruby_version: '10.1.0.0'
java_version: '8' # JRuby 10 requires Java 21
- jruby_version: '10.1.0.0'
java_version: '11' # JRuby 10 requires Java 21
- jruby_version: '10.1.0.0'
java_version: '17' # JRuby 10 requires Java 21
fail-fast: false

steps:
Expand Down Expand Up @@ -68,7 +74,7 @@ jobs:
'rails72_rack22',
'rails80_rack22',
]
jruby_version: [ '9.3.15.0', '9.4.14.0', '10.0.5.0' ]
jruby_version: [ '9.3.15.0', '9.4.14.0', '10.0.5.0', '10.1.0.0' ]
java_version: [ '8', '11', '17', '21', '25' ]
exclude:
- jruby_version: '10.0.5.0'
Expand All @@ -77,6 +83,12 @@ jobs:
java_version: '11' # JRuby 10 requires Java 21
- jruby_version: '10.0.5.0'
java_version: '17' # JRuby 10 requires Java 21
- jruby_version: '10.1.0.0'
java_version: '8' # JRuby 10 requires Java 21
- jruby_version: '10.1.0.0'
java_version: '11' # JRuby 10 requires Java 21
- jruby_version: '10.1.0.0'
java_version: '17' # JRuby 10 requires Java 21
- appraisal: 'rails70_rack22' # Requires Ruby 2.7 compatibility, which JRuby 9.3 does not support
jruby_version: '9.3.15.0'
- appraisal: 'rails71_rack22' # Requires Ruby 2.7 compatibility, which JRuby 9.3 does not support
Expand Down
8 changes: 4 additions & 4 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ version_spec = ->(prefix, desc) { "~> #{desc.split(prefix).last.insert(1, ".")}.

# rails#{MAJOR}#{MINOR} => config_obj
{
"rails50" => {racks: %w[rack22], ext_gems: %w[mutex_m bigdecimal base64]},
"rails52" => {racks: %w[rack22], ext_gems: %w[mutex_m bigdecimal]},
"rails60" => {racks: %w[rack22], ext_gems: %w[mutex_m bigdecimal]},
"rails61" => {racks: %w[rack22], ext_gems: %w[mutex_m bigdecimal]},
"rails50" => {racks: %w[rack22], ext_gems: %w[mutex_m bigdecimal benchmark base64]},
"rails52" => {racks: %w[rack22], ext_gems: %w[mutex_m bigdecimal benchmark]},
"rails60" => {racks: %w[rack22], ext_gems: %w[mutex_m bigdecimal benchmark]},
"rails61" => {racks: %w[rack22], ext_gems: %w[mutex_m bigdecimal benchmark]},
"rails70" => {racks: %w[rack22]},
"rails71" => {racks: %w[rack22]},
"rails72" => {racks: %w[rack22]},
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 1.2.7 (UNRELEASED)

- Fix compatibility with JRuby 10.0 and Rails 8.0 (#419)
- Ensure compatibility with JRuby 10.0 and 10.1 (#419)
- Ensure compatibility with Rails 8.0 (#419)
- Fix ability to include and forward to JSPs under Rails (#370)
- Update (bundled) rack to 2.2.23 (#417)

Expand Down
7 changes: 5 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ group :development do
gem 'appraisal', :require => nil
end

gem 'rake', '~> 13.4', :group => :test, :require => nil
gem 'rspec', :group => :test
group :test do
gem 'rake', '~> 13.4', :require => nil
gem 'rspec'
gem 'logger'
end
15 changes: 15 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ GEM
rake
thor (>= 0.14.0)
diff-lcs (1.6.2)
logger (1.7.0)
rack (2.2.23)
rake (13.4.2)
rspec (3.13.2)
Expand Down Expand Up @@ -34,6 +35,20 @@ PLATFORMS

DEPENDENCIES
appraisal
logger
rack (~> 2.2.23)
rake (~> 13.4)
rspec

CHECKSUMS
appraisal (2.5.0) sha256=36989221be127913b0dba8d114da2001e6b2dceea7bd4951200eaba764eed3ce
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
rack (2.2.23) sha256=a8fe9d7e07064770b8ec123663fded8a59ef7e2b6db5cda7173d45a5718ab69c
rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587
rspec-core (3.13.6) sha256=a8823c6411667b60a8bca135364351dda34cd55e44ff94c4be4633b37d828b2d
rspec-expectations (3.13.5) sha256=33a4d3a1d95060aea4c94e9f237030a8f9eae5615e9bd85718fe3a09e4b58836
rspec-mocks (3.13.8) sha256=086ad3d3d17533f4237643de0b5c42f04b66348c28bf6b9c2d3f4a3b01af1d47
rspec-support (3.13.7) sha256=0640e5570872aafefd79867901deeeeb40b0c9875a36b983d85f54fb7381c47c
thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ For more information on Rack, visit http://rack.github.io/.

| JRuby-Rack Series | Status | Rack | JRuby | Java | Rails | Target Servlet API | Notes |
|----------------------------------------------------------------|---------------|-----------|------------|------|-----------|--------------------|----------------------------------------------------------------|
| [**1.2**](https://github.com/jruby/jruby-rack/tree/1.2-stable) | Maintained | 2.2 | 9.3 → 10.0 | 8+ | 5.0 → 8.0 | 3.0 (Java EE 6) | ✅ _Unofficial_: Servlet 3.1 → 4.0 also OK with most containers |
| [**1.2**](https://github.com/jruby/jruby-rack/tree/1.2-stable) | Maintained | 2.2 | 9.3 → 10.1 | 8+ | 5.0 → 8.0 | 3.0 (Java EE 6) | ✅ _Unofficial_: Servlet 3.1 → 4.0 also OK with most containers |
| [**1.1**](https://github.com/jruby/jruby-rack/tree/1.1-stable) | EOL @ 2024-05 | 1.x → 2.2 | 1.6 → 9.4 | 6+ | 2.1 → 5.2 | 2.5 (Java EE 5) | ✅ _Unofficial_: Servlet 3.0 → 4.0 also OK with most containers |
| [**1.0**](https://github.com/jruby/jruby-rack/tree/1.0.10) | EOL @ 2011-11 | 0.9 → 1.x | 1.1 → 1.9 | 5+ | 2.1 → 3.x | 2.5 (Java EE 5) | |

Expand Down
10 changes: 7 additions & 3 deletions gemfiles/rails50_rack22.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@

source "https://rubygems.org"

gem "rake", "~> 13.4", group: :test, require: nil
gem "rspec", group: :test

group :default do
gem "rack", "~> 2.2.0"
gem "rails", "~> 5.0.0"
gem "mutex_m"
gem "bigdecimal"
gem "benchmark"
gem "base64"
end

group :development do
gem "appraisal", require: nil
end

group :test do
gem "rake", "~> 13.4", require: nil
gem "rspec"
gem "logger"
end
10 changes: 7 additions & 3 deletions gemfiles/rails52_rack22.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@

source "https://rubygems.org"

gem "rake", "~> 13.4", group: :test, require: nil
gem "rspec", group: :test

group :default do
gem "rack", "~> 2.2.0"
gem "rails", "~> 5.2.0"
gem "mutex_m"
gem "bigdecimal"
gem "benchmark"
end

group :development do
gem "appraisal", require: nil
end

group :test do
gem "rake", "~> 13.4", require: nil
gem "rspec"
gem "logger"
end
10 changes: 7 additions & 3 deletions gemfiles/rails60_rack22.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@

source "https://rubygems.org"

gem "rake", "~> 13.4", group: :test, require: nil
gem "rspec", group: :test

group :default do
gem "rack", "~> 2.2.0"
gem "rails", "~> 6.0.0"
gem "mutex_m"
gem "bigdecimal"
gem "benchmark"
end

group :development do
gem "appraisal", require: nil
end

group :test do
gem "rake", "~> 13.4", require: nil
gem "rspec"
gem "logger"
end
10 changes: 7 additions & 3 deletions gemfiles/rails61_rack22.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@

source "https://rubygems.org"

gem "rake", "~> 13.4", group: :test, require: nil
gem "rspec", group: :test

group :default do
gem "rack", "~> 2.2.0"
gem "rails", "~> 6.1.0"
gem "mutex_m"
gem "bigdecimal"
gem "benchmark"
end

group :development do
gem "appraisal", require: nil
end

group :test do
gem "rake", "~> 13.4", require: nil
gem "rspec"
gem "logger"
end
9 changes: 6 additions & 3 deletions gemfiles/rails70_rack22.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

source "https://rubygems.org"

gem "rake", "~> 13.4", group: :test, require: nil
gem "rspec", group: :test

group :default do
gem "rack", "~> 2.2.0"
gem "rails", "~> 7.0.0"
Expand All @@ -13,3 +10,9 @@ end
group :development do
gem "appraisal", require: nil
end

group :test do
gem "rake", "~> 13.4", require: nil
gem "rspec"
gem "logger"
end
9 changes: 6 additions & 3 deletions gemfiles/rails71_rack22.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

source "https://rubygems.org"

gem "rake", "~> 13.4", group: :test, require: nil
gem "rspec", group: :test

group :default do
gem "rack", "~> 2.2.0"
gem "rails", "~> 7.1.0"
Expand All @@ -13,3 +10,9 @@ end
group :development do
gem "appraisal", require: nil
end

group :test do
gem "rake", "~> 13.4", require: nil
gem "rspec"
gem "logger"
end
9 changes: 6 additions & 3 deletions gemfiles/rails72_rack22.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

source "https://rubygems.org"

gem "rake", "~> 13.4", group: :test, require: nil
gem "rspec", group: :test

group :default do
gem "rack", "~> 2.2.0"
gem "rails", "~> 7.2.0"
Expand All @@ -13,3 +10,9 @@ end
group :development do
gem "appraisal", require: nil
end

group :test do
gem "rake", "~> 13.4", require: nil
gem "rspec"
gem "logger"
end
9 changes: 6 additions & 3 deletions gemfiles/rails80_rack22.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

source "https://rubygems.org"

gem "rake", "~> 13.4", group: :test, require: nil
gem "rspec", group: :test

group :default do
gem "rack", "~> 2.2.0"
gem "rails", "~> 8.0.0"
Expand All @@ -13,3 +10,9 @@ end
group :development do
gem "appraisal", require: nil
end

group :test do
gem "rake", "~> 13.4", require: nil
gem "rspec"
gem "logger"
end
7 changes: 3 additions & 4 deletions src/main/java/org/jruby/rack/DefaultErrorApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ static Exception getException(RackEnvironment env) {
private class Response implements RackResponse {

private int status = 500;
@SuppressWarnings("rawtypes")
private Map headers = Collections.EMPTY_MAP;
private Map<String, ?> headers = Collections.emptyMap();
private String body;

protected final RackEnvironment env;
Expand All @@ -99,9 +98,9 @@ public Map getHeaders() {
return headers;
}

@SuppressWarnings("unused")
@SuppressWarnings({"unused", "unchecked"})
public void setHeaders(@SuppressWarnings("rawtypes") Map headers) {
this.headers = headers == null ? Collections.EMPTY_MAP : headers;
this.headers = headers == null ? Collections.emptyMap() : headers;
}

@Override
Expand Down
7 changes: 1 addition & 6 deletions src/main/java/org/jruby/rack/DefaultRackApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,8 @@ public RackResponse call(final RackEnvironment env) {
final IRubyObject app = getApplication();
final Ruby runtime = getRuntime();
final IRubyObject servlet_env = JavaEmbedUtils.javaToRuby(runtime, env);
//try { // app.call(env) :
final IRubyObject response = app.callMethod(runtime.getCurrentContext(), "call", servlet_env);
return (RackResponse) response.toJava(RackResponse.class);
//}
//catch (RuntimeException e) {
// throw ExceptionUtils.wrapException(runtime, e);
//}
return response.toJava(RackResponse.class);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public IRubyObject createErrorApplicationObject(final Ruby runtime) {

public RackApplication newErrorApplication() {
Boolean error = rackContext.getConfig().getBooleanProperty("jruby.rack.error");
if ( error != null && ! error.booleanValue() ) { // jruby.rack.error = false
if ( error != null && !error) { // jruby.rack.error = false
return new DefaultErrorApplication(rackContext);
}
try {
Expand Down Expand Up @@ -585,7 +585,7 @@ private void configureDefaults() {
if (iniSize == null) iniSize = RewindableInputStream.INI_BUFFER_SIZE;
Integer maxSize = config.getMaximumMemoryBufferSize();
if (maxSize == null) maxSize = RewindableInputStream.MAX_BUFFER_SIZE;
if (iniSize.intValue() > maxSize.intValue()) iniSize = maxSize;
if (iniSize > maxSize) iniSize = maxSize;

RewindableInputStream.setDefaultInitialBufferSize(iniSize);
RewindableInputStream.setDefaultMaximumBufferSize(maxSize);
Expand Down
Loading