Skip to content

Commit 3e58600

Browse files
committed
[chore] Tidy markdown formatting for consistency
1 parent c3b9709 commit 3e58600

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

README.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,18 @@ in your WAR file when it gets built.
2929
If you're assembling your own WAR using other means, you can install the
3030
**jruby-rack** gem. It provides a method to locate the jar file:
3131

32-
require 'jruby-rack'
33-
FileUtils.cp JRubyJars.jruby_rack_jar_path, '.'
32+
```ruby
33+
require 'jruby-rack'
34+
FileUtils.cp JRubyJars.jruby_rack_jar_path, '.'
35+
```
3436

3537
Otherwise you'll need to download the latest [jar release][2], drop it into the
36-
*WEB-INF/lib* directory and configure the `RackFilter` in your application's
37-
*web.xml* (see following examples).
38+
`WEB-INF/lib` directory and configure the `RackFilter` in your application's
39+
`web.xml` (see following examples).
3840

3941
### Rails
4042

41-
Here's sample *web.xml* configuration for Rails. Note the environment and
43+
Here's sample `web.xml` configuration for Rails. Note the environment and
4244
min/max runtime parameters. For **multi-threaded** (a.k.a. `threadsafe!`)
4345
Rails with a single runtime, set min/max both to 1. Otherwise, define the size
4446
of the runtime pool as you wish.
@@ -87,8 +89,8 @@ of the runtime pool as you wish.
8789
### (Other) Rack Applications
8890

8991
The main difference when using a non-Rails Rack application is that JRuby-Rack
90-
looks for a "rackup" file named **config.ru** in `WEB-INF/config.ru` or
91-
`WEB-INF/*/config.ru`. Here's a sample *web.xml* configuration :
92+
looks for a "rackup" file named `config.ru` in `WEB-INF/config.ru` or
93+
`WEB-INF/*/config.ru`. Here's a sample `web.xml` configuration :
9294

9395
```xml
9496
<filter>
@@ -106,8 +108,8 @@ looks for a "rackup" file named **config.ru** in `WEB-INF/config.ru` or
106108
</listener>
107109
```
108110

109-
If you don't have a *config.ru* or don't want to include it in your web app, you
110-
can embed it directly in the *web.xml* as follows (using Sinatra as an example):
111+
If you don't have a `config.ru` or don't want to include it in your web app, you
112+
can embed it directly in the `web.xml` as follows (using Sinatra as an example):
111113

112114
```xml
113115
<context-param>
@@ -143,7 +145,7 @@ using is `org.jruby.rack.RackFilter`, the filter supports the following
143145
only), by default "true"
144146
- **addsHtmlToPathInfo** controls whether the .html suffix is added to the URI
145147
when checking if the request is for a static page. The default behavior for
146-
Rails and many other Ruby applications is to add an *.html* extension to the
148+
Rails and many other Ruby applications is to add an `.html` extension to the
147149
resource and attempt to handle it before serving a dynamic request on the
148150
original URI. However, this behavior may confuse other servlets in your
149151
application that have a wildcard mapping. Defaults to true.
@@ -157,9 +159,9 @@ a filter, the servlet class name is `org.jruby.rack.RackServlet`.
157159
## Servlet Environment Integration
158160

159161
- servlet context is accessible to any application through the Rack environment
160-
variable *java.servlet_context* (as well as the `$servlet_context` global).
162+
variable `java.servlet_context` (as well as the `$servlet_context` global).
161163
- the (native) servlet request and response objects could be obtained via the
162-
*java.servlet_request* and *java.servlet_response* keys
164+
`java.servlet_request` and `java.servlet_response` keys
163165
- all servlet request attributes are passed through to the Rack environment (and
164166
thus might override request headers or Rack environment variables)
165167
- servlet sessions can be used as a (java) session store for Rails, session
@@ -181,13 +183,13 @@ JRuby runtime management and pooling is done automatically by the framework.
181183
For Rack-only applications (and Rails ones from jruby-rack >= 1.3), a single
182184
shared runtime is created and shared for every request by default.
183185

184-
If *jruby.min.runtimes* and *jruby.max.runtimes* values are
186+
If `jruby.min.runtimes` and `jruby.max.runtimes` values are
185187
specified pooling of runtimes can be enabled for both types of applications.
186188

187189
We do recommend to boot your runtimes up-front to avoid the cost of initializing
188190
one while a request kicks in and find the pool empty, this can be easily avoided
189-
by setting *jruby.min.runtimes* equal to *jruby.max.runtimes*. You might also
190-
want to consider tuning the *jruby.runtime.acquire.timeout* parameter to not
191+
by setting `jruby.min.runtimes` equal to `jruby.max.runtimes`. You might also
192+
want to consider tuning the `jruby.runtime.acquire.timeout` parameter to not
191193
wait too long when all (max) runtimes from the pool are busy.
192194

193195
## JRuby-Rack Configuration
@@ -197,18 +199,18 @@ as context init parameters in web.xml or as VM-wide system properties.
197199

198200
- `rackup`: Rackup script for configuring how the Rack application is mounted.
199201
Required for Rack-based applications other than Rails. Can be omitted if a
200-
*config.ru* is included in the application root.
202+
`config.ru` is included in the application root.
201203
- `public.root`: Relative path to the location of your application's static
202-
assets. Defaults to */*.
204+
assets. Defaults to `*/*`.
203205
- `rails.root`: Root path to the location of the Rails application files.
204-
Defaults to */WEB-INF*.
206+
Defaults to `*/WEB-INF*`.
205207
- `rails.env`: Specify the Rails environment to run. Defaults to 'production'.
206208
- `rails.relative_url_append`: Specify a path to be appended to the
207209
`ActionController::Base.relative_url_root` after the context path. Useful
208210
for running a rails app from the same war as an existing app, under a
209211
sub-path of the main servlet context root.
210212
- `gem.path`: Relative path to the bundled gem repository. Defaults to
211-
*/WEB-INF/gems*.
213+
`/WEB-INF/gems`.
212214
- `jruby.min.runtimes`: For non-threadsafe Rails applications using a runtime
213215
pool, specify an integer minimum number of runtimes to hold in the pool.
214216
- `jruby.max.runtimes`: For non-threadsafe Rails applications, an integer
@@ -253,17 +255,17 @@ as context init parameters in web.xml or as VM-wide system properties.
253255

254256
There are often cases where you need to perform custom initialization of the
255257
Ruby environment before booting the application. You can create a file called
256-
*META-INF/init.rb* or *WEB-INF/init.rb* inside the war file for this purpose.
258+
`META-INF/init.rb` or `WEB-INF/init.rb` inside the war file for this purpose.
257259
These files, if found, will be evaluated before booting the Rack environment,
258260
allowing you to set environment variables, load scripts, etc.
259261

260262
For plain Rack applications, JRuby-Rack also supports a magic comment to solve
261263
the "rackup" chicken-egg problem (you need Rack's builder loaded before loading
262-
the *config.ru*, yet you may want to setup the gem version from within the rackup
264+
the `config.ru`, yet you may want to setup the gem version from within the rackup
263265
file). As we ship with the Rack gem bundled, otherwise when executing the
264-
provided *config.ru* the bundled (latest) version of Rack will get loaded.
266+
provided `config.ru` the bundled (latest) version of Rack will get loaded.
265267

266-
Use **rack.version** to specify the Rack gem version to be loaded before rackup :
268+
Use `rack.version` to specify the Rack gem version to be loaded before rackup :
267269

268270
```ruby
269271
# encoding: UTF-8
@@ -314,7 +316,7 @@ Build the .jar using Maven :
314316
./mvnw install
315317
```
316318

317-
the generated jar should be located at **target/jruby-rack-*.jar**
319+
the generated jar should be located at `target/jruby-rack-*.jar`
318320

319321
Alternatively use Rake, e.g. to build the gem (skipping specs) :
320322

0 commit comments

Comments
 (0)