Skip to content

Commit b3f2bf4

Browse files
committed
Merge remote-tracking branch 'upstream/master' into jakarta-update
# Conflicts: # src/main/java/org/jruby/rack/servlet/ResponseCapture.java # src/spec/java/org/jruby/rack/fake/FakePageContext.java # src/spec/java/org/jruby/rack/mock/RackLoggingMockServletContext.java
2 parents c717dcb + 05c5326 commit b3f2bf4

Some content is hidden

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

42 files changed

+164
-533
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ updates:
33
- package-ecosystem: github-actions
44
directory: "/"
55
schedule:
6-
interval: monthly
6+
interval: weekly
77
groups:
88
actions-deps:
99
patterns: [ "*" ]
@@ -12,7 +12,7 @@ updates:
1212
- package-ecosystem: maven
1313
directory: "/"
1414
schedule:
15-
interval: monthly
15+
interval: weekly
1616
groups:
1717
maven-deps:
1818
dependency-type: "production"
@@ -30,9 +30,8 @@ updates:
3030
- package-ecosystem: bundler
3131
directories:
3232
- "/"
33-
- "/examples/*"
3433
schedule:
35-
interval: monthly
34+
interval: weekly
3635
allow:
3736
- dependency-type: all
3837
groups:
@@ -41,19 +40,15 @@ updates:
4140
ignore:
4241
- dependency-name: "rack"
4342
update-types: [ "version-update:semver-major" ]
44-
- dependency-name: "rails"
45-
update-types: [ "version-update:semver-minor" ]
46-
- dependency-name: "jruby-jars"
47-
update-types: [ "version-update:semver-major" ]
4843

49-
# Maintabled stable branches
44+
# Maintained stable branches
5045
- package-ecosystem: maven
5146
target-branch: "1.2-stable"
5247
commit-message:
5348
prefix: "1.2.x: "
5449
directory: "/"
5550
schedule:
56-
interval: monthly
51+
interval: weekly
5752
groups:
5853
maven-deps:
5954
dependency-type: "production"
@@ -74,9 +69,8 @@ updates:
7469
prefix: "1.2.x: "
7570
directories:
7671
- "/"
77-
- "/examples/*"
7872
schedule:
79-
interval: monthly
73+
interval: weekly
8074
allow:
8175
- dependency-type: all
8276
groups:
@@ -85,8 +79,4 @@ updates:
8579
ignore:
8680
- dependency-name: "rack"
8781
update-types: [ "version-update:semver-major" ]
88-
- dependency-name: "rails"
89-
update-types: [ "version-update:semver-minor" ]
90-
- dependency-name: "jruby-jars"
91-
update-types: [ "version-update:semver-major" ]
9282

.github/workflows/maven.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,12 @@ jobs:
9696
uses: ruby/setup-ruby@v1
9797
with:
9898
ruby-version: jruby-${{ matrix.jruby_version }}
99-
bundler-cache: 'false' # Need to install later so we can vary from Gemfile.lock as required for JRuby version compatibility
99+
bundler-cache: 'true'
100100
bundler: 'Gemfile.lock'
101101

102+
- name: Remove jruby-launcher # Coming from setup-ruby/ruby-build and causes annoying warnings
103+
run: gem uninstall -a jruby-launcher
104+
102105
- name: Run appraisal for ${{ matrix.appraisal }}
103106
run: bundle install && bundle exec rake spec
104107

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ target
33
*.log
44
log
55
activemq-data
6+
examples/*/Gemfile.lock
67
examples/*/tmp
78
examples/*/work
89
examples/*/*.war

CHANGELOG.md

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,41 @@
44

55
## 1.3.0 (UNRELEASED)
66

7-
- Support Javax Servlet API 4.0 (JEE 8)
8-
- Adds basic compatibility with JRuby 10.0
7+
- Officially support Javax Servlet API 4.0 (JEE 8)
8+
- Officially support JRuby 10.0
9+
10+
Breaking compatibility changes
911
- Drop support for JRuby 9.3
1012
- Drop support for Rails < 6.1
11-
- Drop unnecessary `jruby.compat.version` and `RackConfig.getCompatVersion()` API
13+
14+
Breaking behavioral changes
15+
- Change context listener to throw by default in case of an exception during initialization
16+
- Change rails context listener to assume a thread-safe application by default
17+
18+
Breaking Java API changes
1219
- Drop JMS support
13-
- Drop deprecated `RackLogger` string (level) constants
14-
- Drop `jruby.rack.jruby.version` and `jruby.rack.rack.release` keys from rack `env` Hash
20+
- Drop unnecessary `jruby.compat.version` and `RackConfig.getCompatVersion()` API
21+
- Drop deprecated `org.jruby.rack.RackInput` alias for `org.jruby.rack.ext.Input` class
22+
- Drop/rename deprecated `RackConfig` and `ServletRackEnvironment` API methods per their earlier comments
23+
- Drop deprecated `RackLogger` string (`level`) constants
24+
- Custom `RackLogger` implementations must accept `CharSequence` rather than `String` to allow `RubyString` passthrough
25+
26+
Breaking Ruby API changes
27+
- Drop deprecated `JRuby::Rack::RailsFileSystemLayout` alias for `JRuby::Rack::FileSystemLayout`
28+
- Drop deprecated `JRuby::Rack::Errors` alias for `JRuby::Rack::ErrorApp`
1529
- Drop deprecated `Rack::Handler::Servlet::Env` and `Rack::Handler::Servlet::LazyEnv` types (replaced by `DefaultEnv`)
16-
- Drop undocumented and deprecated jruby-rack 1.0 backwards compat properties `jruby.runtime.timeout.sec`, `jruby.runtime.initializer.threads`, `jruby.init.serial`, `jruby.rack.request.size.threshold.bytes`
30+
- Drop deprecated setting of global `$servlet_context` variable during embedded usage (replaced by `JRuby::Rack.context`)
31+
32+
Breaking configuration capability changes
33+
- Drop `jruby.rack.jruby.version` and `jruby.rack.rack.release` keys from rack `env` Hash
34+
- Drop deprecated and undocumented jruby-rack 1.0 backwards compat properties `jruby.runtime.timeout.sec`, `jruby.runtime.initializer.threads`, `jruby.init.serial`, `jruby.rack.request.size.threshold.bytes`
1735
- Drop deprecated `jruby.rack.ignore.env` property, replaced long ago by `jruby.runtime.env` and optional `jruby.runtime.env.rubyopt`
1836
- Drop deprecated `jruby.rack.filter.*` properties, replaced long ago by init parameters `addsHtmlToPathInfo` and `verifiesHtmlResource`
19-
- Drop deprecated `JRuby::Rack::RailsFileSystemLayout` alias for `JRuby::Rack::FileSystemLayout`
20-
- Drop deprecated `JRuby::Rack::Errors` alias for `JRuby::Rack::ErrorApp`
21-
- Drop deprecated `org.jruby.rack.RackInput` alias for `org.jruby.rack.ext.Input` class
22-
- Drop/rename deprecated `RackConfig` and `ServletRackEnvironment` API methods per their earlier comments
23-
- Change context listener to throw, in case of an exception during initialization, by default
24-
- Change rails context listener to assume a thread-safe application by default
37+
38+
## 1.2.7 (UNRELEASED)
39+
40+
- Fix ability to include and forward to JSPs under Rails (#370)
41+
- Update (bundled) rack to 2.2.21 (#374)
2542

2643
## 1.2.6
2744

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ group :default do
44
if rack_version = ENV['RACK_VERSION']
55
gem 'rack', rack_version
66
else
7-
gem 'rack', '~> 2.2.20'
7+
gem 'rack', '~> 2.2.21'
88
end
99
end
1010

Gemfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ GEM
66
rake
77
thor (>= 0.14.0)
88
diff-lcs (1.6.2)
9-
rack (2.2.20)
10-
rake (13.3.0)
11-
rspec (3.13.1)
9+
rack (2.2.21)
10+
rake (13.3.1)
11+
rspec (3.13.2)
1212
rspec-core (~> 3.13.0)
1313
rspec-expectations (~> 3.13.0)
1414
rspec-mocks (~> 3.13.0)
15-
rspec-core (3.13.5)
15+
rspec-core (3.13.6)
1616
rspec-support (~> 3.13.0)
1717
rspec-expectations (3.13.5)
1818
diff-lcs (>= 1.2.0, < 2.0)
1919
rspec-support (~> 3.13.0)
20-
rspec-mocks (3.13.6)
20+
rspec-mocks (3.13.7)
2121
diff-lcs (>= 1.2.0, < 2.0)
2222
rspec-support (~> 3.13.0)
2323
rspec-support (3.13.6)
@@ -33,6 +33,6 @@ PLATFORMS
3333

3434
DEPENDENCIES
3535
appraisal
36-
rack (~> 2.2.20)
36+
rack (~> 2.2.21)
3737
rake (~> 13.3)
3838
rspec

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ can embed it directly in the `web.xml` as follows (using Sinatra as an example):
127127
</context-param>
128128
```
129129

130-
Be sure to escape angle-brackets for XML !
130+
Be sure to escape angle-brackets for XML!
131131

132132

133133
## Servlet Filter
@@ -306,6 +306,9 @@ logging system, configure `jruby.rack.logging` as follows:
306306
For those loggers that require a specific named logger, set it with the
307307
`jruby.rack.logging.name` option, by default "jruby.rack" name will be used.
308308

309+
## Examples
310+
311+
Some example demo applications are available at [./examples](./examples).
309312

310313
## Building
311314

examples/Kirkfile

Lines changed: 0 additions & 15 deletions
This file was deleted.

examples/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
## JRuby-Rack Examples
2+
3+
This directory includes samples using JRuby-Rack to build Rack web applications for deployment
4+
into Java app servers.
5+
6+
- All use [Warbler](https://github.com/jruby/warbler) to do so for easy of packaging.
7+
- Require JRuby `9.4` and a compatible JVM (Java `8` -> `25`).
8+
9+
### Building/running
10+
11+
For deployment into a separate webserver:
12+
13+
1. ```bash
14+
bundle
15+
bundle exec warble war
16+
```
17+
2. Drop the war into a relevant Java app server running a compatible JVM version
18+
19+
As an executable jar within Jetty:
20+
21+
1. ```bash
22+
bundle
23+
bundle exec warble executable war
24+
```
25+
2. ```shell
26+
java -jar *.war
27+
```
28+
29+
## Demo routes
30+
31+
| Example | Component | Embedded Route | Deployed War Route |
32+
|---------|------------------------|-------------------------------------|---------------------------------------------|
33+
| Rails 7 | Status Page | http://localhost:8080/up | http://localhost:8080/rails7/up |
34+
| Rails 7 | Snoop Dump | http://localhost:8080/snoop | http://localhost:8080/rails7/snoop |
35+
| Rails 7 | Simple Form submission | http://localhost:8080/simple_form | http://localhost:8080/rails7/simple_form |
36+
| Rails 7 | Body Posts | http://localhost:8080/body | http://localhost:8080/rails7/body |
37+
| Rails 7 | JSP (render) | http://localhost:8080/jsp/ | http://localhost:8080/rails7/jsp/ |
38+
| Rails 7 | JSP (forward to) | http://localhost:8080/jsp-forward/ | http://localhost:8080/rails7/jsp-forward/ |
39+
| Rails 7 | JSP (include) | http://localhost:8080/jsp-include/ | http://localhost:8080/rails7/jsp-include/ |
40+
| Sinatra | Demo Index | http://localhost:8080/ | http://localhost:8080/sinatra |
41+
| Sinatra | Info | http://localhost:8080/info | http://localhost:8080/sinatra/info |
42+
| Sinatra | Snoop Dump | http://localhost:8080/env | http://localhost:8080/sinatra/env |
43+
| Sinatra | JSP (render) | http://localhost:8080/jsp/index.jsp | http://localhost:8080/sinatra/jsp/index.jsp |
44+
| Sinatra | JSP (forward to) | http://localhost:8080/jsp_forward | http://localhost:8080/sinatra/jsp_forward |
45+
| Sinatra | JSP (include) | http://localhost:8080/jsp_include | http://localhost:8080/sinatra/jsp_include |
46+
| Sinatra | Streaming Demo | http://localhost:8080/stream | http://localhost:8080/sinatra/stream |
47+
| Camping | Demo Index | http://localhost:8080/ | http://localhost:8080/camping |
48+
| Camping | Snoop Dump | http://localhost:8080/snoop | http://localhost:8080/camping/snoop |
49+
50+
## Development
51+
52+
You can run the examples using local source for warbler or jruby-rack using env vars, e.g
53+
54+
```shell
55+
export WARBLER_SRC=true JRUBY_RACK_SRC=true && bundle && bundle exec warble executable war && java -Dwarbler.debug=true -jar rails*.war
56+
```
57+
58+
- Warbler can run directly from source
59+
- jruby-rack needs to be built, since it does not define a gemspec
60+
- There are alternate ways to do this by replacing the jruby-rack jar within the warbled jar/war, however this is more
61+
complex and error-prone that using the gem and ensuring compatibility since warbler itself depends on the jruby-rack gem.

examples/camping/Gemfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ source 'https://rubygems.org'
22

33
ruby '~> 3.1.0'
44

5-
gem 'rack', '~> 2.2.20'
6-
gem 'rackup'
75
gem 'camping', '< 3'
8-
gem 'markaby'
6+
gem 'rack', '~> 2.2.0'
97

108
group :development do
11-
gem 'warbler', '~> 2.1'
12-
gem 'jruby-jars', '< 10'
13-
end
9+
if !ENV['WARBLER_SRC']; gem 'warbler' else gem 'warbler', path: '../../../warbler' end
10+
if !ENV['JRUBY_RACK_SRC']; gem 'jruby-rack' else gem 'jruby-rack', path: '../../target' end
11+
gem 'jruby-jars', '~> 9.4.0'
12+
end

0 commit comments

Comments
 (0)