Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 98 lines (76 sloc) 4.286 kb
3560ac0 @rtomayko Flesh out README a bit; rename to README.rdoc
rtomayko authored
1 = Contributed Rack Middleware and Utilities
2
3 This package includes a variety of add-on components for Rack, a Ruby web server
4 interface:
5
6 * Rack::JSONP - Adds JSON-P support by stripping out the callback param
7 and padding the response with the appropriate callback format.
8 * Rack::LighttpdScriptNameFix - Fixes how lighttpd sets the SCRIPT_NAME
9 and PATH_INFO variables in certain configurations.
10 * Rack::Locale - Detects the client locale using the Accept-Language request
11 header and sets a rack.locale variable in the environment.
12 * Rack::MailExceptions - Rescues exceptions raised from the app and
13 sends a useful email with the exception, stacktrace, and contents of the
14 environment.
86a2ced @mislav Add Rack::NestedParams; based on Rails UrlEncodedPairParser
mislav authored
15 * Rack::NestedParams - parses form params with subscripts (e.g., * "post[title]=Hello")
16 into a nested/recursive Hash structure (based on Rails' implementation).
3560ac0 @rtomayko Flesh out README a bit; rename to README.rdoc
rtomayko authored
17 * Rack::PostBodyContentTypeParser - Adds support for JSON request bodies. The
18 Rack parameter hash is populated by deserializing the JSON data provided in
19 the request body when the Content-Type is application/json.
b1a4195 @rtomayko Rack::ProcTitle - request status in $0
rtomayko authored
20 * Rack::ProcTitle - Displays request information in process title ($0) for
21 monitoring/inspection with ps(1).
3560ac0 @rtomayko Flesh out README a bit; rename to README.rdoc
rtomayko authored
22 * Rack::Profiler - Uses ruby-prof to measure request time.
23 * Rack::Sendfile - Enables X-Sendfile support for bodies that can be served
24 from file.
4d28e24 @josh Add Signals middleware
josh authored
25 * Rack::Signals - Installs signal handlers that are safely processed after
26 a request
3f42d3a @anupom Rack::StaticCache - auto cache headers for URLs with asset timestamps
anupom authored
27 * Rack::StaticCache - Modifies the response headers to facilitiate client and proxy caching for
28 static files that minimizes http requests and improves overall load times for second time visitors.
4ad01fe @elitheeli A few minor text changes
elitheeli authored
29 * Rack::TimeZone - Detects the client's timezone using JavaScript and sets
3560ac0 @rtomayko Flesh out README a bit; rename to README.rdoc
rtomayko authored
30 a variable in Rack's environment with the offset from UTC.
ec0fb58 @lifo Add Rack::Callbacks. Example :
lifo authored
31 * Rack::Evil - Lets the rack application return a response to the client from any place.
3502c35 @elitheeli Domain-Specific Language
elitheeli authored
32 * Rack::Callbacks - Implements DSL for pure before/after filter like Middlewares.
01533a8 @jcrosby Add Rack::Config
jcrosby authored
33 * Rack::Config - Shared configuration for cooperative middleware.
31370b7 @jcrosby Add Rack::NotFound
jcrosby authored
34 * Rack::NotFound - A default 404 application.
fe510ef @cee-dub Add Rack::CSSHTTPRequest middleware
cee-dub authored
35 * Rack::CSSHTTPRequest - Adds CSSHTTPRequest support by encoding responses as
36 CSS for cross-site AJAX-style data loading
82951d3 @tj Added Rack::Deflect - DOS protection middleware
tj authored
37 * Rack::Deflect - Helps protect against DoS attacks.
43a508f @jeremyevans Add Rack::RelativeRedirect
jeremyevans authored
38 * Rack::ResponseCache - Caches responses to requests without query strings
39 to Disk or a user provider Ruby object. Similar to Rails' page caching.
40 * Rack::RelativeRedirect - Transforms relative paths in redirects to
41 absolute URLs.
3e1d5f2 @vangberg Rack::Backstage - maintenance page middleware
vangberg authored
42 * Rack::Backstage - Returns content of specified file if it exists, which makes
43 it convenient for putting up maintenance pages.
fae344f @mynyml Fix README typo (Rack::AcceptFormat)
mynyml authored
44 * Rack::AcceptFormat - Adds a format extension at the end of the URI when there is none, corresponding to the mime-type given in the Accept HTTP header.
988cd66 @jcrosby Add Rack::HostMeta
jcrosby authored
45 * Rack::HostMeta - Configures /host-meta using a block
94fde2b @josh Rack::Cookies
josh authored
46 * Rack::Cookies - Adds simple cookie jar hash to env
4ad01fe @elitheeli A few minor text changes
elitheeli authored
47 * Rack::Access - Limits access based on IP address
48 * Rack::ResponseHeaders - Manipulates response headers object at runtime
49 * Rack::SimpleEndpoint - Creates simple endpoints with routing rules, similar to Sinatra actions
0702201 @gmarik Rack::TryStatic middleware
gmarik authored
50 * Rack::TryStatic - Tries to match request to a static file
3560ac0 @rtomayko Flesh out README a bit; rename to README.rdoc
rtomayko authored
51
52 === Use
53
54 Git is the quickest way to the rack-contrib sources:
55
b5218fe @rtomayko README and gemspec update (project URL change, mostly)
rtomayko authored
56 git clone git://github.com/rack/rack-contrib.git
3560ac0 @rtomayko Flesh out README a bit; rename to README.rdoc
rtomayko authored
57
1c22a73 @rtomayko update gem install instructions in README
rtomayko authored
58 Gems are available too:
3560ac0 @rtomayko Flesh out README a bit; rename to README.rdoc
rtomayko authored
59
1c22a73 @rtomayko update gem install instructions in README
rtomayko authored
60 gem install rack-contrib
3560ac0 @rtomayko Flesh out README a bit; rename to README.rdoc
rtomayko authored
61
62 Requiring 'rack/contrib' will add autoloads to the Rack modules for all of the
63 components included. The following example shows what a simple rackup
64 (+config.ru+) file might look like:
65
66 require 'rack'
67 require 'rack/contrib'
68
69 use Rack::Profiler if ENV['RACK_ENV'] == 'development'
70
71 use Rack::ETag
72 use Rack::MailExceptions
73
74 run theapp
75
23d9791 @brycemcd updated readme
brycemcd authored
76 === Testing
77
78 To contribute to the project, begin by cloning the repo and installing the necessary gems:
79
80 gem install json rack ruby-prof test-spec test-unit
81
82 To run the entire test suite, run
83 rake test
84
85 To run a specific component's tests run
86 specrb -Ilib:test -w test/spec_rack_thecomponent.rb
87
88 This works on ruby 1.8.7 but has problems under ruby 1.9.x.
89
90 TODO: instructions for 1.9.x and include bundler
91
3560ac0 @rtomayko Flesh out README a bit; rename to README.rdoc
rtomayko authored
92 === Links
93
b5218fe @rtomayko README and gemspec update (project URL change, mostly)
rtomayko authored
94 rack-contrib on GitHub:: <http://github.com/rack/rack-contrib>
3560ac0 @rtomayko Flesh out README a bit; rename to README.rdoc
rtomayko authored
95 Rack:: <http://rack.rubyforge.org/>
f0d2aa2 @skalnik Fixes link to Rack on GitHub in README
skalnik authored
96 Rack On GitHub:: <http://github.com/rack/rack>
3560ac0 @rtomayko Flesh out README a bit; rename to README.rdoc
rtomayko authored
97 rack-devel mailing list:: <http://groups.google.com/group/rack-devel>
Something went wrong with that request. Please try again.