Skip to content
Draft
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
18 changes: 14 additions & 4 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
matrix:
jruby_version: [ '9.4.14.0', '10.0.2.0' ]
java_version: [ '8', '11', '17', '21', '25' ]
rack_version: [ '~> 2.2.0' ]
rack_version: [ '~> 2.2.0', '~> 3.1.0', '~> 3.2.0' ]
exclude:
- jruby_version: '10.0.2.0'
java_version: '8' # JRuby 10 requires Java 21
Expand Down Expand Up @@ -61,9 +61,10 @@ jobs:
appraisal: [
'rails61_rack22',
'rails70_rack22',
'rails71_rack22',
'rails72_rack22',
'rails80_rack22',
'rails71_rack22', 'rails71_rack31',
'rails72_rack22', 'rails72_rack31',
'rails80_rack22', 'rails80_rack31', 'rails80_rack32',
'rails81_rack31', 'rails81_rack32',
]
jruby_version: [ '9.4.14.0', '10.0.2.0' ]
java_version: [ '8', '11', '17', '21', '25' ]
Expand All @@ -76,6 +77,15 @@ jobs:
java_version: '17' # JRuby 10 requires Java 21
- appraisal: 'rails80_rack22'
jruby_version: '9.4.14.0' # Rails 8 requires Ruby 3.4 compatibility, which JRuby 9.4 does not support
- appraisal: 'rails80_rack31'
jruby_version: '9.4.14.0' # Rails 8 requires Ruby 3.4 compatibility, which JRuby 9.4 does not support
- appraisal: 'rails80_rack32'
jruby_version: '9.4.14.0' # Rails 8 requires Ruby 3.4 compatibility, which JRuby 9.4 does not support
- appraisal: 'rails81_rack31'
jruby_version: '9.4.14.0' # Rails 8 requires Ruby 3.4 compatibility, which JRuby 9.4 does not support
- appraisal: 'rails81_rack32'
jruby_version: '9.4.14.0' # Rails 8 requires Ruby 3.4 compatibility, which JRuby 9.4 does not support

fail-fast: false

env:
Expand Down
7 changes: 4 additions & 3 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ version_spec = ->(prefix, desc) { "~> #{desc.split(prefix).last.insert(1, ".")}.
{
"rails61" => %w[rack22],
"rails70" => %w[rack22],
"rails71" => %w[rack22],
"rails72" => %w[rack22],
"rails80" => %w[rack22]
"rails71" => %w[rack22 rack31],
"rails72" => %w[rack22 rack31],
"rails80" => %w[rack22 rack31 rack32],
"rails81" => %w[rack31 rack32],
}.each do |rails_desc, rack_descs|
rack_descs.each do |rack_desc|

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Officially support Javax Servlet API 4.0 (JEE 8)
- Officially support JRuby 10.0
- Support Rack 3.0 -> 3.2 (default vendored Rack is still 2.2)

Breaking compatibility changes
- Drop support for JRuby 9.3
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ For more information on Rack, visit http://rack.github.io/.

| JRuby-Rack Series | Status | Rack | JRuby | Java | Rails | Target Servlet API | Notes |
|------------------------------------------------------------|------------|-----------|------------|------|-----------|---------------------|--------------------------------------------|
| 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. |
| 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. |
| 2.0 (_planned_) | Dev | 2.2 → 3.2 | 9.4 → 10.0 | 8+ | 6.1 → 8.1 | 5.0+ (Jakarta EE 9) | Pre 5.0 servlet APIs non functional. |
| 1.3 (master, _unreleased_) | Dev | 2.2 → 3.2 | 9.4 → 10.0 | 8+ | 6.1 → 8.1 | 4.0 (Java EE 8) | Servlet 2.5 → 3.1 likely to work fine. |
| [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. |
| [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. |
| 1.0 | EOL | 0.9 → 1.x | 1.1 → 1.9 | 5+ | 2.1 → 3.x | 2.5 (Java EE 5) | |
Expand Down Expand Up @@ -357,7 +357,7 @@ package and push the .jar every time a commit changes a source file).
```shell
VERSION=rails72
cd src/spec/stub
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
rm -rf $VERSION && BUNDLE_GEMFILE=~/Projects/community/jruby-rack/gemfiles/${VERSION}_rack32.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
```
* Manual changes to make to support testing
* In `config/production.rb` comment out the default `config.logger` value so jruby-rack applies its own `RailsLogger`.
Expand Down
12 changes: 6 additions & 6 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This directory includes samples using JRuby-Rack to build Rack web applications
into Java app servers.

- All use [Warbler](https://github.com/jruby/warbler) to do so for easy of packaging.
- Require JRuby `9.4` and a compatible JVM (Java `8` -> `25`).
- Require JRuby `10.x` and a compatible JVM (Java `21` -> `25`).

### Building/running

Expand All @@ -30,11 +30,11 @@ As an executable jar within Jetty:

| Example | Component | Embedded Route | Deployed War Route |
|---------|-------------------------------|-----------------------------------|------------------------------------------|
| Rails 7 | Status Page | http://localhost:8080/up | http://localhost:8080/rails7/up |
| Rails 7 | Snoop Dump | http://localhost:8080/snoop | http://localhost:8080/rails7/snoop |
| Rails 7 | Embedded JSP (non-functional) | http://localhost:8080/jsp/ | http://localhost:8080/rails7/jsp/ |
| Rails 7 | Simple Form submission | http://localhost:8080/simple_form | http://localhost:8080/rails7/simple_form |
| Rails 7 | Body Posts | http://localhost:8080/body | http://localhost:8080/rails7/body |
| Rails 8 | Status Page | http://localhost:8080/up | http://localhost:8080/rails7/up |
| Rails 8 | Snoop Dump | http://localhost:8080/snoop | http://localhost:8080/rails7/snoop |
| Rails 8 | Embedded JSP (non-functional) | http://localhost:8080/jsp/ | http://localhost:8080/rails7/jsp/ |
| Rails 8 | Simple Form submission | http://localhost:8080/simple_form | http://localhost:8080/rails7/simple_form |
| Rails 8 | Body Posts | http://localhost:8080/body | http://localhost:8080/rails7/body |
| Sinatra | Demo Index | http://localhost:8080/ | http://localhost:8080/sinatra |
| Sinatra | Info | http://localhost:8080/info | http://localhost:8080/sinatra/info |
| Sinatra | Snoop Dump | http://localhost:8080/env | http://localhost:8080/sinatra/env |
Expand Down
6 changes: 3 additions & 3 deletions examples/camping/Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
source 'https://rubygems.org'

ruby '~> 3.1.0'
ruby '~> 3.4.0'

gem 'camping', '< 3'
gem 'rack', '~> 2.2.0'
gem 'rack', '~> 3.2.0'

group :development do
if !ENV['WARBLER_SRC']; gem 'warbler' else gem 'warbler', path: '../../../warbler' end
if !ENV['JRUBY_RACK_SRC']; gem 'jruby-rack' else gem 'jruby-rack', path: '../../target' end
gem 'jruby-jars', '~> 9.4.0'
gem 'jruby-jars', '~> 10.0.0'
end
79 changes: 0 additions & 79 deletions examples/rails7/config/environments/production.rb

This file was deleted.

13 changes: 0 additions & 13 deletions examples/rails7/config/initializers/permissions_policy.rb

This file was deleted.

1 change: 0 additions & 1 deletion examples/rails7/config/master.key

This file was deleted.

34 changes: 0 additions & 34 deletions examples/rails7/config/puma.rb

This file was deleted.

File renamed without changes.
8 changes: 4 additions & 4 deletions examples/rails7/Gemfile → examples/rails8/Gemfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
source 'https://rubygems.org'

ruby '~> 3.1.0'
ruby '~> 3.4.0'

gem 'rails', '~> 7.2.0'
gem 'rack', '~> 2.2.0'
gem 'rails', '~> 8.1.0'
gem 'rack', '~> 3.2.0'
gem 'sprockets-rails'

group :development do
if !ENV['WARBLER_SRC']; gem 'warbler' else gem 'warbler', path: '../../../warbler' end
if !ENV['JRUBY_RACK_SRC']; gem 'jruby-rack' else gem 'jruby-rack', path: '../../target' end
gem 'jruby-jars', '~> 9.4.0'
gem 'jruby-jars', '~> 10.0.0'
end
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def index
private
def body_size
bytes = 0
request.body.rewind # Need to rewind to re-read body with Rack 3 - and rewindable bodies are not mandatory...
while str = request.body.read(1024)
bytes += str.size
end
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module Rails7
module Rails81
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.2
config.load_defaults 8.1

# Please, add to the `ignore` list any other `lib` subdirectories that do
# not contain `.rb` files, or that should not be reloaded or eager loaded.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

# In the development environment your application's code is reloaded any time
# it changes. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
# Make code changes take effect immediately without server restart.
config.enable_reloading = true

# Do not eager load code on boot.
Expand All @@ -17,32 +15,22 @@
# Enable server timing.
config.server_timing = true

# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
# Enable/disable Action Controller caching. By default Action Controller caching is disabled.
# Run rails dev:cache to toggle Action Controller caching.
if Rails.root.join("tmp/caching-dev.txt").exist?
config.action_controller.perform_caching = true
config.action_controller.enable_fragment_cache_logging = true

config.cache_store = :memory_store
config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" }
config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" }
else
config.action_controller.perform_caching = false

config.cache_store = :null_store
end

# Change to :null_store to avoid any caching.
config.cache_store = :memory_store

# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log

# Raise exceptions for disallowed deprecations.
config.active_support.disallowed_deprecation = :raise

# Tell Active Support which deprecation messages to disallow.
config.active_support.disallowed_deprecation_warnings = []

# Suppress logger output for asset requests.
config.assets.quiet = true

# Raises error for missing translations.
# config.i18n.raise_on_missing_translations = true

Expand Down
Loading