jruby-rack 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/History.md +6 -0
- data/README.md +126 -109
- data/lib/jruby/rack/version.rb +1 -1
- data/lib/jruby-rack-1.2.5.jar +0 -0
- data/lib/jruby-rack.rb +1 -1
- metadata +10 -5
- data/lib/jruby-rack-1.2.4.jar +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: deb522e122e0c6e6cdb44b3cc48f1998c8faa022b6f9f40155f3443f9b29b8f7
|
4
|
+
data.tar.gz: 4575c6ef77f6fab741703a667fa04471d5190bf09736a9655c0ac74c600c8f0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5f36e4650ed62c243e66747fda304a83a8205bc8fab59f5fc53ce6bbb77a7146d033930c13e09d26d86ae9217a661d47c3bf548900727ec54e50e29fa78d270
|
7
|
+
data.tar.gz: 04c00aedf47df518653664142bcfa0e7e667d8203bbad4b5cc595ee1ef1cac8f60008594c741463c78660959786875e6f2224f205d250568f38cd49a88aea9f8
|
data/History.md
CHANGED
data/README.md
CHANGED
@@ -1,28 +1,21 @@
|
|
1
1
|
# JRuby-Rack
|
2
2
|
|
3
|
+
[][5]
|
4
|
+
[][6]
|
5
|
+
|
3
6
|
JRuby-Rack is a lightweight adapter for the Java Servlet environment that allows
|
4
7
|
any (Ruby) Rack-based application to run unmodified in a Java Servlet container.
|
5
8
|
JRuby-Rack supports Rails as well as any Rack-compatible Ruby web framework.
|
6
9
|
|
7
10
|
For more information on Rack, visit http://rack.github.io/.
|
8
11
|
|
9
|
-
**This README (master) targets JRuby-Rack 1.2. Please use the
|
10
|
-
[1.1-stable](https://github.com/jruby/jruby-rack/tree/1.1-stable) branch for
|
11
|
-
current stable 1.1.x releases.**
|
12
|
-
|
13
|
-
[][8]
|
14
|
-
[][9]
|
15
|
-
|
16
12
|
## Compatibility
|
17
13
|
|
18
|
-
JRuby-Rack
|
19
|
-
|
20
|
-
-
|
21
|
-
|
22
|
-
|
23
|
-
- aims to be compatible with JRuby >= 1.6.4 (used successfully through JRuby 9.4.x)
|
24
|
-
- supports any container compatible with Java Servlet 2.5 API (JEE 5)
|
25
|
-
|
14
|
+
| JRuby-Rack Series | Status | Rack | JRuby | Java | Rails | Target Servlet API | Notes |
|
15
|
+
|------------------------------------------------------------|------------|-----------|------------|------|-----------|---------------------|--------------------------------------------|
|
16
|
+
| [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. |
|
17
|
+
| [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. |
|
18
|
+
| 1.0 | EOL | 0.9 → 1.x | 1.1 → 1.9 | 5+ | 2.1 → 3.x | 2.5 (Java EE 5) | |
|
26
19
|
|
27
20
|
## Getting Started
|
28
21
|
|
@@ -41,9 +34,6 @@ Otherwise you'll need to download the latest [jar release][2], drop it into the
|
|
41
34
|
*WEB-INF/lib* directory and configure the `RackFilter` in your application's
|
42
35
|
*web.xml* (see following examples).
|
43
36
|
|
44
|
-
Alternatively you can use a server built upon JRuby-Rack such as [Trinidad][3]
|
45
|
-
with sensible defaults, without the need to configure a deployment descriptor.
|
46
|
-
|
47
37
|
### Rails
|
48
38
|
|
49
39
|
Here's sample *web.xml* configuration for Rails. Note the environment and
|
@@ -51,44 +41,46 @@ min/max runtime parameters. For **multi-threaded** (a.k.a. `threadsafe!`)
|
|
51
41
|
Rails with a single runtime, set min/max both to 1. Otherwise, define the size
|
52
42
|
of the runtime pool as you wish.
|
53
43
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
44
|
+
```xml
|
45
|
+
<context-param>
|
46
|
+
<param-name>rails.env</param-name>
|
47
|
+
<param-value>production</param-value>
|
48
|
+
</context-param>
|
49
|
+
<context-param>
|
50
|
+
<param-name>jruby.min.runtimes</param-name>
|
51
|
+
<param-value>1</param-value>
|
52
|
+
</context-param>
|
53
|
+
<context-param>
|
54
|
+
<param-name>jruby.max.runtimes</param-name>
|
55
|
+
<param-value>1</param-value>
|
56
|
+
</context-param>
|
57
|
+
|
58
|
+
<filter>
|
59
|
+
<filter-name>RackFilter</filter-name>
|
60
|
+
<filter-class>org.jruby.rack.RackFilter</filter-class>
|
61
|
+
<!-- optional filter configuration init-params : -->
|
62
|
+
<init-param>
|
63
|
+
<param-name>resetUnhandledResponse</param-name>
|
64
|
+
<param-value>true</param-value> <!-- true (default), false or buffer -->
|
65
|
+
</init-param>
|
66
|
+
<init-param>
|
67
|
+
<param-name>addsHtmlToPathInfo</param-name>
|
68
|
+
<param-value>true</param-value> <!-- true (default), false -->
|
69
|
+
</init-param>
|
70
|
+
<init-param>
|
71
|
+
<param-name>verifiesHtmlResource</param-name>
|
72
|
+
<param-value>false</param-value> <!-- true, false (default) -->
|
73
|
+
</init-param>
|
74
|
+
</filter>
|
75
|
+
<filter-mapping>
|
76
|
+
<filter-name>RackFilter</filter-name>
|
77
|
+
<url-pattern>/*</url-pattern>
|
78
|
+
</filter-mapping>
|
79
|
+
|
80
|
+
<listener>
|
81
|
+
<listener-class>org.jruby.rack.rails.RailsServletContextListener</listener-class>
|
82
|
+
</listener>
|
83
|
+
```
|
92
84
|
|
93
85
|
### (Other) Rack Applications
|
94
86
|
|
@@ -96,34 +88,38 @@ The main difference when using a non-Rails Rack application is that JRuby-Rack
|
|
96
88
|
looks for a "rackup" file named **config.ru** in `WEB-INF/config.ru` or
|
97
89
|
`WEB-INF/*/config.ru`. Here's a sample *web.xml* configuration :
|
98
90
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
91
|
+
```xml
|
92
|
+
<filter>
|
93
|
+
<filter-name>RackFilter</filter-name>
|
94
|
+
<filter-class>org.jruby.rack.RackFilter</filter-class>
|
95
|
+
<!-- optional filter configuration init-params (@see above) -->
|
96
|
+
</filter>
|
97
|
+
<filter-mapping>
|
98
|
+
<filter-name>RackFilter</filter-name>
|
99
|
+
<url-pattern>/*</url-pattern>
|
100
|
+
</filter-mapping>
|
101
|
+
|
102
|
+
<listener>
|
103
|
+
<listener-class>org.jruby.rack.RackServletContextListener</listener-class>
|
104
|
+
</listener>
|
105
|
+
```
|
112
106
|
|
113
107
|
If you don't have a *config.ru* or don't want to include it in your web app, you
|
114
108
|
can embed it directly in the *web.xml* as follows (using Sinatra as an example):
|
115
109
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
110
|
+
```xml
|
111
|
+
<context-param>
|
112
|
+
<param-name>rackup</param-name>
|
113
|
+
<param-value>
|
114
|
+
require 'rubygems'
|
115
|
+
gem 'sinatra', '~> 1.3'
|
116
|
+
require './lib/app'
|
117
|
+
set :run, false
|
118
|
+
set :environment, :production
|
119
|
+
run Sinatra::Application
|
120
|
+
</param-value>
|
121
|
+
</context-param>
|
122
|
+
```
|
127
123
|
|
128
124
|
Be sure to escape angle-brackets for XML !
|
129
125
|
|
@@ -178,7 +174,7 @@ JRuby runtime management and pooling is done automatically by the framework.
|
|
178
174
|
In the case of Rails, runtimes are pooled by default (the default will most
|
179
175
|
likely change with the adoption of Rails 4.0). For other Rack applications a
|
180
176
|
single shared runtime is created and shared for every request by default.
|
181
|
-
|
177
|
+
If *jruby.min.runtimes* and *jruby.max.runtimes* values are
|
182
178
|
specified pooling is supported for plain Rack applications as well.
|
183
179
|
|
184
180
|
We do recommend to boot your runtimes up-front to avoid the cost of initializing
|
@@ -279,13 +275,16 @@ provided *config.ru* the bundled (latest) version of Rack will get loaded.
|
|
279
275
|
|
280
276
|
Use **rack.version** to specify the Rack gem version to be loaded before rackup :
|
281
277
|
|
282
|
-
|
283
|
-
|
278
|
+
```ruby
|
279
|
+
# encoding: UTF-8
|
280
|
+
# rack.version: ~>2.2.10 (before code is loaded gem '~>2.2.10' will be called)
|
281
|
+
```
|
284
282
|
|
285
283
|
Or the equivalent of doing `bundle exec rackup ...` if you're using Bundler :
|
286
284
|
|
287
|
-
|
288
|
-
|
285
|
+
```ruby
|
286
|
+
# rack.version: bundler (requires 'bundler/setup' before loading the script)
|
287
|
+
```
|
289
288
|
|
290
289
|
## Logging
|
291
290
|
|
@@ -296,12 +295,12 @@ logging system, configure `jruby.rack.logging` as follows:
|
|
296
295
|
- `servlet_context` (default): Sends log messages to the servlet context.
|
297
296
|
- `stdout`: Sends log messages to the standard output stream `System.out`.
|
298
297
|
- `slf4j`: Sends log messages to SLF4J. SLF4J configuration is left up to you,
|
299
|
-
please refer to
|
300
|
-
- `log4j`: Sends log messages
|
301
|
-
|
298
|
+
please refer to https://www.slf4j.org/manual.html .
|
299
|
+
- `log4j`: Sends log messages through Log4j. Only Log4j 2.x is supported, for
|
300
|
+
- configuration please consult https://logging.apache.org/log4j/2.x/index.html .
|
302
301
|
- `commons_logging`: Routes logs to commons-logging. You still need to configure
|
303
|
-
an underlying logging implementation with JCL.
|
304
|
-
library wrapper directly
|
302
|
+
an underlying logging implementation with JCL.
|
303
|
+
We recommend rather using the logger library wrapper directly when possible.
|
305
304
|
- `jul`: Directs log messages via Java's core logging facilities (util.logging).
|
306
305
|
|
307
306
|
For those loggers that require a specific named logger, set it with the
|
@@ -312,21 +311,26 @@ For those loggers that require a specific named logger, set it with the
|
|
312
311
|
|
313
312
|
Checkout the JRuby-Rack code using [git](http://git-scm.com/) :
|
314
313
|
|
315
|
-
|
316
|
-
|
314
|
+
```shell
|
315
|
+
git clone git@github.com:jruby/jruby-rack.git
|
316
|
+
cd jruby-rack
|
317
|
+
```
|
317
318
|
|
318
|
-
Ensure you have
|
319
|
-
It is required for downloading jar artifacts that JRuby-Rack depends on.
|
319
|
+
Ensure you have a compatible JVM installed. It is required for building and compiling.
|
320
320
|
|
321
321
|
Build the .jar using Maven :
|
322
322
|
|
323
|
-
|
323
|
+
```shell
|
324
|
+
./mvnw install
|
325
|
+
```
|
324
326
|
|
325
327
|
the generated jar should be located at **target/jruby-rack-*.jar**
|
326
328
|
|
327
329
|
Alternatively use Rake, e.g. to build the gem (skipping specs) :
|
328
330
|
|
329
|
-
|
331
|
+
```shell
|
332
|
+
jruby -S rake clean gem SKIP_SPECS=true
|
333
|
+
```
|
330
334
|
|
331
335
|
You can **not** use JRuby-Rack with Bundler directly from the git (or http) URL
|
332
336
|
(`gem 'jruby-rack', :github => 'jruby/jruby-rack'`) since the included .jar file
|
@@ -335,21 +339,34 @@ package and push the .jar every time a commit changes a source file).
|
|
335
339
|
|
336
340
|
## Releasing
|
337
341
|
|
338
|
-
* Make sure auth is configured for "central" repository ID in your
|
339
|
-
* Update the version in src/main/ruby/jruby/rack/version.rb to the release version
|
340
|
-
*
|
341
|
-
*
|
342
|
-
* rake clean gem SKIP_SPECS=true and push the gem
|
342
|
+
* Make sure auth is configured for "central" repository ID in your `.m2/settings.xml`
|
343
|
+
* Update the version in `src/main/ruby/jruby/rack/version.rb` to the release version
|
344
|
+
* `./mvnw release:prepare`
|
345
|
+
* `./mvnw release:perform` (possibly with `-DuseReleaseProfile=false` due to Javadoc doclint failures for now)
|
346
|
+
* `rake clean gem SKIP_SPECS=true` and push the gem
|
347
|
+
|
348
|
+
## Adding testing for new Rails versions
|
349
|
+
|
350
|
+
* Add the new version to `.github/workflows/maven.yml` under the `matrix` section
|
351
|
+
* Add a new configuration to the `Appraisals` file, then
|
352
|
+
```bundle exec appraisal generate```
|
353
|
+
* Generate a new stub Rails application for the new version
|
354
|
+
```shell
|
355
|
+
VERSION=rails72
|
356
|
+
cd src/spec/stub
|
357
|
+
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
|
358
|
+
```
|
359
|
+
* Manual changes to make to support testing
|
360
|
+
* In `config/production.rb` comment out the default `config.logger` value so jruby-rack applies its own `RailsLogger`.
|
343
361
|
|
344
362
|
## Support
|
345
363
|
|
346
|
-
Please use [github][
|
347
|
-
More information at the [wiki][
|
364
|
+
Please use [github][3] to file bugs, patches and/or pull requests.
|
365
|
+
More information at the [wiki][4] or ask us at **#jruby**'s IRC channel.
|
348
366
|
|
349
367
|
[1]: https://github.com/jruby/warbler#warbler--
|
350
|
-
[2]: https://
|
351
|
-
[3]: https://github.com/
|
352
|
-
[4]: https://github.com/jruby/jruby-rack/
|
353
|
-
[5]:
|
354
|
-
[
|
355
|
-
[9]: https://github.com/jruby/jruby-rack/actions/workflows/maven.yml
|
368
|
+
[2]: https://central.sonatype.com/artifact/org.jruby.rack/jruby-rack
|
369
|
+
[3]: https://github.com/jruby/jruby-rack/issues
|
370
|
+
[4]: https://github.com/jruby/jruby-rack/wiki
|
371
|
+
[5]: http://badge.fury.io/rb/jruby-rack
|
372
|
+
[6]: https://github.com/jruby/jruby-rack/actions/workflows/maven.yml
|
data/lib/jruby/rack/version.rb
CHANGED
Binary file
|
data/lib/jruby-rack.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jruby-rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sieger
|
8
|
+
- Karol Bucek
|
9
|
+
- JRuby contributors
|
10
|
+
autorequire:
|
8
11
|
bindir: bin
|
9
12
|
cert_chain: []
|
10
|
-
date: 2025-
|
13
|
+
date: 2025-09-08 00:00:00.000000000 Z
|
11
14
|
dependencies: []
|
12
15
|
description: JRuby-Rack is a combined Java and Ruby library that adapts the Java Servlet
|
13
16
|
API to Rack. For JRuby only.
|
@@ -20,13 +23,14 @@ files:
|
|
20
23
|
- History.md
|
21
24
|
- LICENSE.txt
|
22
25
|
- README.md
|
23
|
-
- lib/jruby-rack-1.2.
|
26
|
+
- lib/jruby-rack-1.2.5.jar
|
24
27
|
- lib/jruby-rack.rb
|
25
28
|
- lib/jruby/rack/version.rb
|
26
29
|
homepage: http://jruby.org
|
27
30
|
licenses:
|
28
31
|
- MIT
|
29
32
|
metadata: {}
|
33
|
+
post_install_message:
|
30
34
|
rdoc_options: []
|
31
35
|
require_paths:
|
32
36
|
- lib
|
@@ -34,14 +38,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
34
38
|
requirements:
|
35
39
|
- - ">="
|
36
40
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
41
|
+
version: 2.6.0
|
38
42
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
39
43
|
requirements:
|
40
44
|
- - ">="
|
41
45
|
- !ruby/object:Gem::Version
|
42
46
|
version: '0'
|
43
47
|
requirements: []
|
44
|
-
rubygems_version: 3.
|
48
|
+
rubygems_version: 3.2.33
|
49
|
+
signing_key:
|
45
50
|
specification_version: 4
|
46
51
|
summary: Rack adapter for JRuby and Servlet Containers
|
47
52
|
test_files: []
|
data/lib/jruby-rack-1.2.4.jar
DELETED
Binary file
|