edgar-rack 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +18 -0
- data/KNOWN-ISSUES +21 -0
- data/README +401 -0
- data/Rakefile +101 -0
- data/SPEC +171 -0
- data/bin/rackup +4 -0
- data/contrib/rack_logo.svg +111 -0
- data/example/lobster.ru +4 -0
- data/example/protectedlobster.rb +14 -0
- data/example/protectedlobster.ru +8 -0
- data/lib/rack.rb +81 -0
- data/lib/rack/auth/abstract/handler.rb +37 -0
- data/lib/rack/auth/abstract/request.rb +43 -0
- data/lib/rack/auth/basic.rb +58 -0
- data/lib/rack/auth/digest/md5.rb +124 -0
- data/lib/rack/auth/digest/nonce.rb +51 -0
- data/lib/rack/auth/digest/params.rb +53 -0
- data/lib/rack/auth/digest/request.rb +40 -0
- data/lib/rack/builder.rb +80 -0
- data/lib/rack/cascade.rb +41 -0
- data/lib/rack/chunked.rb +52 -0
- data/lib/rack/commonlogger.rb +49 -0
- data/lib/rack/conditionalget.rb +63 -0
- data/lib/rack/config.rb +15 -0
- data/lib/rack/content_length.rb +29 -0
- data/lib/rack/content_type.rb +23 -0
- data/lib/rack/deflater.rb +96 -0
- data/lib/rack/directory.rb +157 -0
- data/lib/rack/etag.rb +59 -0
- data/lib/rack/file.rb +118 -0
- data/lib/rack/handler.rb +88 -0
- data/lib/rack/handler/cgi.rb +61 -0
- data/lib/rack/handler/evented_mongrel.rb +8 -0
- data/lib/rack/handler/fastcgi.rb +90 -0
- data/lib/rack/handler/lsws.rb +61 -0
- data/lib/rack/handler/mongrel.rb +90 -0
- data/lib/rack/handler/scgi.rb +59 -0
- data/lib/rack/handler/swiftiplied_mongrel.rb +8 -0
- data/lib/rack/handler/thin.rb +17 -0
- data/lib/rack/handler/webrick.rb +73 -0
- data/lib/rack/head.rb +19 -0
- data/lib/rack/lint.rb +567 -0
- data/lib/rack/lobster.rb +65 -0
- data/lib/rack/lock.rb +44 -0
- data/lib/rack/logger.rb +18 -0
- data/lib/rack/methodoverride.rb +27 -0
- data/lib/rack/mime.rb +210 -0
- data/lib/rack/mock.rb +185 -0
- data/lib/rack/nulllogger.rb +18 -0
- data/lib/rack/recursive.rb +61 -0
- data/lib/rack/reloader.rb +109 -0
- data/lib/rack/request.rb +307 -0
- data/lib/rack/response.rb +151 -0
- data/lib/rack/rewindable_input.rb +104 -0
- data/lib/rack/runtime.rb +27 -0
- data/lib/rack/sendfile.rb +139 -0
- data/lib/rack/server.rb +289 -0
- data/lib/rack/session/abstract/id.rb +348 -0
- data/lib/rack/session/cookie.rb +152 -0
- data/lib/rack/session/memcache.rb +93 -0
- data/lib/rack/session/pool.rb +79 -0
- data/lib/rack/showexceptions.rb +378 -0
- data/lib/rack/showstatus.rb +113 -0
- data/lib/rack/static.rb +53 -0
- data/lib/rack/urlmap.rb +55 -0
- data/lib/rack/utils.rb +698 -0
- data/rack.gemspec +39 -0
- data/test/cgi/lighttpd.conf +25 -0
- data/test/cgi/rackup_stub.rb +6 -0
- data/test/cgi/sample_rackup.ru +5 -0
- data/test/cgi/test +9 -0
- data/test/cgi/test.fcgi +8 -0
- data/test/cgi/test.ru +5 -0
- data/test/gemloader.rb +6 -0
- data/test/multipart/bad_robots +259 -0
- data/test/multipart/binary +0 -0
- data/test/multipart/empty +10 -0
- data/test/multipart/fail_16384_nofile +814 -0
- data/test/multipart/file1.txt +1 -0
- data/test/multipart/filename_and_modification_param +7 -0
- data/test/multipart/filename_with_escaped_quotes +6 -0
- data/test/multipart/filename_with_escaped_quotes_and_modification_param +7 -0
- data/test/multipart/filename_with_percent_escaped_quotes +6 -0
- data/test/multipart/filename_with_unescaped_quotes +6 -0
- data/test/multipart/ie +6 -0
- data/test/multipart/nested +10 -0
- data/test/multipart/none +9 -0
- data/test/multipart/semicolon +6 -0
- data/test/multipart/text +15 -0
- data/test/rackup/config.ru +31 -0
- data/test/spec_auth_basic.rb +70 -0
- data/test/spec_auth_digest.rb +241 -0
- data/test/spec_builder.rb +123 -0
- data/test/spec_cascade.rb +45 -0
- data/test/spec_cgi.rb +102 -0
- data/test/spec_chunked.rb +60 -0
- data/test/spec_commonlogger.rb +56 -0
- data/test/spec_conditionalget.rb +86 -0
- data/test/spec_config.rb +23 -0
- data/test/spec_content_length.rb +36 -0
- data/test/spec_content_type.rb +29 -0
- data/test/spec_deflater.rb +125 -0
- data/test/spec_directory.rb +57 -0
- data/test/spec_etag.rb +75 -0
- data/test/spec_fastcgi.rb +107 -0
- data/test/spec_file.rb +92 -0
- data/test/spec_handler.rb +49 -0
- data/test/spec_head.rb +30 -0
- data/test/spec_lint.rb +515 -0
- data/test/spec_lobster.rb +43 -0
- data/test/spec_lock.rb +142 -0
- data/test/spec_logger.rb +28 -0
- data/test/spec_methodoverride.rb +58 -0
- data/test/spec_mock.rb +241 -0
- data/test/spec_mongrel.rb +182 -0
- data/test/spec_nulllogger.rb +12 -0
- data/test/spec_recursive.rb +69 -0
- data/test/spec_request.rb +774 -0
- data/test/spec_response.rb +245 -0
- data/test/spec_rewindable_input.rb +118 -0
- data/test/spec_runtime.rb +39 -0
- data/test/spec_sendfile.rb +83 -0
- data/test/spec_server.rb +8 -0
- data/test/spec_session_abstract_id.rb +43 -0
- data/test/spec_session_cookie.rb +171 -0
- data/test/spec_session_memcache.rb +289 -0
- data/test/spec_session_pool.rb +200 -0
- data/test/spec_showexceptions.rb +87 -0
- data/test/spec_showstatus.rb +79 -0
- data/test/spec_static.rb +48 -0
- data/test/spec_thin.rb +86 -0
- data/test/spec_urlmap.rb +213 -0
- data/test/spec_utils.rb +678 -0
- data/test/spec_webrick.rb +141 -0
- data/test/testrequest.rb +78 -0
- data/test/unregistered_handler/rack/handler/unregistered.rb +7 -0
- data/test/unregistered_handler/rack/handler/unregistered_long_one.rb +7 -0
- metadata +329 -0
data/COPYING
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Copyright (c) 2007, 2008, 2009, 2010 Christian Neukirchen <purl.org/net/chneukirchen>
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to
|
5
|
+
deal in the Software without restriction, including without limitation the
|
6
|
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
7
|
+
sell copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
16
|
+
THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
17
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
18
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/KNOWN-ISSUES
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
= Known issues with Rack and Web servers
|
2
|
+
|
3
|
+
* Lighttpd sets wrong SCRIPT_NAME and PATH_INFO if you mount your
|
4
|
+
FastCGI app at "/". This can be fixed by using this middleware:
|
5
|
+
|
6
|
+
class LighttpdScriptNameFix
|
7
|
+
def initialize(app)
|
8
|
+
@app = app
|
9
|
+
end
|
10
|
+
|
11
|
+
def call(env)
|
12
|
+
env["PATH_INFO"] = env["SCRIPT_NAME"].to_s + env["PATH_INFO"].to_s
|
13
|
+
env["SCRIPT_NAME"] = ""
|
14
|
+
@app.call(env)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
Of course, use this only when your app runs at "/".
|
19
|
+
|
20
|
+
Since lighttpd 1.4.23, you also can use the "fix-root-scriptname" flag
|
21
|
+
in fastcgi.server.
|
data/README
ADDED
@@ -0,0 +1,401 @@
|
|
1
|
+
= Rack, a modular Ruby webserver interface
|
2
|
+
|
3
|
+
Rack provides a minimal, modular and adaptable interface for developing
|
4
|
+
web applications in Ruby. By wrapping HTTP requests and responses in
|
5
|
+
the simplest way possible, it unifies and distills the API for web
|
6
|
+
servers, web frameworks, and software in between (the so-called
|
7
|
+
middleware) into a single method call.
|
8
|
+
|
9
|
+
The exact details of this are described in the Rack specification,
|
10
|
+
which all Rack applications should conform to.
|
11
|
+
|
12
|
+
== Supported web servers
|
13
|
+
|
14
|
+
The included *handlers* connect all kinds of web servers to Rack:
|
15
|
+
* Mongrel
|
16
|
+
* EventedMongrel
|
17
|
+
* SwiftipliedMongrel
|
18
|
+
* WEBrick
|
19
|
+
* FCGI
|
20
|
+
* CGI
|
21
|
+
* SCGI
|
22
|
+
* LiteSpeed
|
23
|
+
* Thin
|
24
|
+
|
25
|
+
These web servers include Rack handlers in their distributions:
|
26
|
+
* Ebb
|
27
|
+
* Fuzed
|
28
|
+
* Glassfish v3
|
29
|
+
* Phusion Passenger (which is mod_rack for Apache and for nginx)
|
30
|
+
* Rainbows!
|
31
|
+
* Unicorn
|
32
|
+
* Zbatery
|
33
|
+
|
34
|
+
Any valid Rack app will run the same on all these handlers, without
|
35
|
+
changing anything.
|
36
|
+
|
37
|
+
== Supported web frameworks
|
38
|
+
|
39
|
+
These frameworks include Rack adapters in their distributions:
|
40
|
+
* Camping
|
41
|
+
* Coset
|
42
|
+
* Halcyon
|
43
|
+
* Mack
|
44
|
+
* Maveric
|
45
|
+
* Merb
|
46
|
+
* Racktools::SimpleApplication
|
47
|
+
* Ramaze
|
48
|
+
* Ruby on Rails
|
49
|
+
* Rum
|
50
|
+
* Sinatra
|
51
|
+
* Sin
|
52
|
+
* Vintage
|
53
|
+
* Waves
|
54
|
+
* Wee
|
55
|
+
* ... and many others.
|
56
|
+
|
57
|
+
Current links to these projects can be found at
|
58
|
+
http://wiki.ramaze.net/Home#other-frameworks
|
59
|
+
|
60
|
+
== Available middleware
|
61
|
+
|
62
|
+
Between the server and the framework, Rack can be customized to your
|
63
|
+
applications needs using middleware, for example:
|
64
|
+
* Rack::URLMap, to route to multiple applications inside the same process.
|
65
|
+
* Rack::CommonLogger, for creating Apache-style logfiles.
|
66
|
+
* Rack::ShowException, for catching unhandled exceptions and
|
67
|
+
presenting them in a nice and helpful way with clickable backtrace.
|
68
|
+
* Rack::File, for serving static files.
|
69
|
+
* ...many others!
|
70
|
+
|
71
|
+
All these components use the same interface, which is described in
|
72
|
+
detail in the Rack specification. These optional components can be
|
73
|
+
used in any way you wish.
|
74
|
+
|
75
|
+
== Convenience
|
76
|
+
|
77
|
+
If you want to develop outside of existing frameworks, implement your
|
78
|
+
own ones, or develop middleware, Rack provides many helpers to create
|
79
|
+
Rack applications quickly and without doing the same web stuff all
|
80
|
+
over:
|
81
|
+
* Rack::Request, which also provides query string parsing and
|
82
|
+
multipart handling.
|
83
|
+
* Rack::Response, for convenient generation of HTTP replies and
|
84
|
+
cookie handling.
|
85
|
+
* Rack::MockRequest and Rack::MockResponse for efficient and quick
|
86
|
+
testing of Rack application without real HTTP round-trips.
|
87
|
+
|
88
|
+
== rack-contrib
|
89
|
+
|
90
|
+
The plethora of useful middleware created the need for a project that
|
91
|
+
collects fresh Rack middleware. rack-contrib includes a variety of
|
92
|
+
add-on components for Rack and it is easy to contribute new modules.
|
93
|
+
|
94
|
+
* http://github.com/rack/rack-contrib
|
95
|
+
|
96
|
+
== rackup
|
97
|
+
|
98
|
+
rackup is a useful tool for running Rack applications, which uses the
|
99
|
+
Rack::Builder DSL to configure middleware and build up applications
|
100
|
+
easily.
|
101
|
+
|
102
|
+
rackup automatically figures out the environment it is run in, and
|
103
|
+
runs your application as FastCGI, CGI, or standalone with Mongrel or
|
104
|
+
WEBrick---all from the same configuration.
|
105
|
+
|
106
|
+
== Quick start
|
107
|
+
|
108
|
+
Try the lobster!
|
109
|
+
|
110
|
+
Either with the embedded WEBrick starter:
|
111
|
+
|
112
|
+
ruby -Ilib lib/rack/lobster.rb
|
113
|
+
|
114
|
+
Or with rackup:
|
115
|
+
|
116
|
+
bin/rackup -Ilib example/lobster.ru
|
117
|
+
|
118
|
+
By default, the lobster is found at http://localhost:9292.
|
119
|
+
|
120
|
+
== Installing with RubyGems
|
121
|
+
|
122
|
+
A Gem of Rack is available at gemcutter.org. You can install it with:
|
123
|
+
|
124
|
+
gem install rack
|
125
|
+
|
126
|
+
I also provide a local mirror of the gems (and development snapshots)
|
127
|
+
at my site:
|
128
|
+
|
129
|
+
gem install rack --source http://chneukirchen.org/releases/gems/
|
130
|
+
|
131
|
+
== Running the tests
|
132
|
+
|
133
|
+
Testing Rack requires the bacon testing framework:
|
134
|
+
|
135
|
+
gem install bacon
|
136
|
+
|
137
|
+
There are two rake-based test tasks:
|
138
|
+
|
139
|
+
rake test tests all the fast tests (no Handlers or Adapters)
|
140
|
+
rake fulltest runs all the tests
|
141
|
+
|
142
|
+
The fast testsuite has no dependencies outside of the core Ruby
|
143
|
+
installation and bacon.
|
144
|
+
|
145
|
+
To run the test suite completely, you need:
|
146
|
+
|
147
|
+
* fcgi
|
148
|
+
* memcache-client
|
149
|
+
* mongrel
|
150
|
+
* thin
|
151
|
+
|
152
|
+
The full set of tests test FCGI access with lighttpd (on port
|
153
|
+
9203) so you will need lighttpd installed as well as the FCGI
|
154
|
+
libraries and the fcgi gem:
|
155
|
+
|
156
|
+
Download and install lighttpd:
|
157
|
+
|
158
|
+
http://www.lighttpd.net/download
|
159
|
+
|
160
|
+
Installing the FCGI libraries:
|
161
|
+
|
162
|
+
curl -O http://www.fastcgi.com/dist/fcgi-2.4.0.tar.gz
|
163
|
+
tar xzvf fcgi-2.4.0.tar.gz
|
164
|
+
cd fcgi-2.4.0
|
165
|
+
./configure --prefix=/usr/local
|
166
|
+
make
|
167
|
+
sudo make install
|
168
|
+
cd ..
|
169
|
+
|
170
|
+
Installing the Ruby fcgi gem:
|
171
|
+
|
172
|
+
gem install fcgi
|
173
|
+
|
174
|
+
Furthermore, to test Memcache sessions, you need memcached (will be
|
175
|
+
run on port 11211) and memcache-client installed.
|
176
|
+
|
177
|
+
== History
|
178
|
+
|
179
|
+
* March 3rd, 2007: First public release 0.1.
|
180
|
+
|
181
|
+
* May 16th, 2007: Second public release 0.2.
|
182
|
+
* HTTP Basic authentication.
|
183
|
+
* Cookie Sessions.
|
184
|
+
* Static file handler.
|
185
|
+
* Improved Rack::Request.
|
186
|
+
* Improved Rack::Response.
|
187
|
+
* Added Rack::ShowStatus, for better default error messages.
|
188
|
+
* Bug fixes in the Camping adapter.
|
189
|
+
* Removed Rails adapter, was too alpha.
|
190
|
+
|
191
|
+
* February 26th, 2008: Third public release 0.3.
|
192
|
+
* LiteSpeed handler, by Adrian Madrid.
|
193
|
+
* SCGI handler, by Jeremy Evans.
|
194
|
+
* Pool sessions, by blink.
|
195
|
+
* OpenID authentication, by blink.
|
196
|
+
* :Port and :File options for opening FastCGI sockets, by blink.
|
197
|
+
* Last-Modified HTTP header for Rack::File, by blink.
|
198
|
+
* Rack::Builder#use now accepts blocks, by Corey Jewett.
|
199
|
+
(See example/protectedlobster.ru)
|
200
|
+
* HTTP status 201 can contain a Content-Type and a body now.
|
201
|
+
* Many bugfixes, especially related to Cookie handling.
|
202
|
+
|
203
|
+
* August 21st, 2008: Fourth public release 0.4.
|
204
|
+
* New middleware, Rack::Deflater, by Christoffer Sawicki.
|
205
|
+
* OpenID authentication now needs ruby-openid 2.
|
206
|
+
* New Memcache sessions, by blink.
|
207
|
+
* Explicit EventedMongrel handler, by Joshua Peek <josh@joshpeek.com>
|
208
|
+
* Rack::Reloader is not loaded in rackup development mode.
|
209
|
+
* rackup can daemonize with -D.
|
210
|
+
* Many bugfixes, especially for pool sessions, URLMap, thread safety
|
211
|
+
and tempfile handling.
|
212
|
+
* Improved tests.
|
213
|
+
* Rack moved to Git.
|
214
|
+
|
215
|
+
* January 6th, 2009: Fifth public release 0.9.
|
216
|
+
* Rack is now managed by the Rack Core Team.
|
217
|
+
* Rack::Lint is stricter and follows the HTTP RFCs more closely.
|
218
|
+
* Added ConditionalGet middleware.
|
219
|
+
* Added ContentLength middleware.
|
220
|
+
* Added Deflater middleware.
|
221
|
+
* Added Head middleware.
|
222
|
+
* Added MethodOverride middleware.
|
223
|
+
* Rack::Mime now provides popular MIME-types and their extension.
|
224
|
+
* Mongrel Header now streams.
|
225
|
+
* Added Thin handler.
|
226
|
+
* Official support for swiftiplied Mongrel.
|
227
|
+
* Secure cookies.
|
228
|
+
* Made HeaderHash case-preserving.
|
229
|
+
* Many bugfixes and small improvements.
|
230
|
+
|
231
|
+
* January 9th, 2009: Sixth public release 0.9.1.
|
232
|
+
* Fix directory traversal exploits in Rack::File and Rack::Directory.
|
233
|
+
|
234
|
+
* April 25th, 2009: Seventh public release 1.0.0.
|
235
|
+
* SPEC change: Rack::VERSION has been pushed to [1,0].
|
236
|
+
* SPEC change: header values must be Strings now, split on "\n".
|
237
|
+
* SPEC change: Content-Length can be missing, in this case chunked transfer
|
238
|
+
encoding is used.
|
239
|
+
* SPEC change: rack.input must be rewindable and support reading into
|
240
|
+
a buffer, wrap with Rack::RewindableInput if it isn't.
|
241
|
+
* SPEC change: rack.session is now specified.
|
242
|
+
* SPEC change: Bodies can now additionally respond to #to_path with
|
243
|
+
a filename to be served.
|
244
|
+
* NOTE: String bodies break in 1.9, use an Array consisting of a
|
245
|
+
single String instead.
|
246
|
+
* New middleware Rack::Lock.
|
247
|
+
* New middleware Rack::ContentType.
|
248
|
+
* Rack::Reloader has been rewritten.
|
249
|
+
* Major update to Rack::Auth::OpenID.
|
250
|
+
* Support for nested parameter parsing in Rack::Response.
|
251
|
+
* Support for redirects in Rack::Response.
|
252
|
+
* HttpOnly cookie support in Rack::Response.
|
253
|
+
* The Rakefile has been rewritten.
|
254
|
+
* Many bugfixes and small improvements.
|
255
|
+
|
256
|
+
* October 18th, 2009: Eighth public release 1.0.1.
|
257
|
+
* Bump remainder of rack.versions.
|
258
|
+
* Support the pure Ruby FCGI implementation.
|
259
|
+
* Fix for form names containing "=": split first then unescape components
|
260
|
+
* Fixes the handling of the filename parameter with semicolons in names.
|
261
|
+
* Add anchor to nested params parsing regexp to prevent stack overflows
|
262
|
+
* Use more compatible gzip write api instead of "<<".
|
263
|
+
* Make sure that Reloader doesn't break when executed via ruby -e
|
264
|
+
* Make sure WEBrick respects the :Host option
|
265
|
+
* Many Ruby 1.9 fixes.
|
266
|
+
|
267
|
+
* January 3rd, 2010: Ninth public release 1.1.0.
|
268
|
+
* Moved Auth::OpenID to rack-contrib.
|
269
|
+
* SPEC change that relaxes Lint slightly to allow subclasses of the
|
270
|
+
required types
|
271
|
+
* SPEC change to document rack.input binary mode in greator detail
|
272
|
+
* SPEC define optional rack.logger specification
|
273
|
+
* File servers support X-Cascade header
|
274
|
+
* Imported Config middleware
|
275
|
+
* Imported ETag middleware
|
276
|
+
* Imported Runtime middleware
|
277
|
+
* Imported Sendfile middleware
|
278
|
+
* New Logger and NullLogger middlewares
|
279
|
+
* Added mime type for .ogv and .manifest.
|
280
|
+
* Don't squeeze PATH_INFO slashes
|
281
|
+
* Use Content-Type to determine POST params parsing
|
282
|
+
* Update Rack::Utils::HTTP_STATUS_CODES hash
|
283
|
+
* Add status code lookup utility
|
284
|
+
* Response should call #to_i on the status
|
285
|
+
* Add Request#user_agent
|
286
|
+
* Request#host knows about forwared host
|
287
|
+
* Return an empty string for Request#host if HTTP_HOST and
|
288
|
+
SERVER_NAME are both missing
|
289
|
+
* Allow MockRequest to accept hash params
|
290
|
+
* Optimizations to HeaderHash
|
291
|
+
* Refactored rackup into Rack::Server
|
292
|
+
* Added Utils.build_nested_query to complement Utils.parse_nested_query
|
293
|
+
* Added Utils::Multipart.build_multipart to complement
|
294
|
+
Utils::Multipart.parse_multipart
|
295
|
+
* Extracted set and delete cookie helpers into Utils so they can be
|
296
|
+
used outside Response
|
297
|
+
* Extract parse_query and parse_multipart in Request so subclasses
|
298
|
+
can change their behavior
|
299
|
+
* Enforce binary encoding in RewindableInput
|
300
|
+
* Set correct external_encoding for handlers that don't use RewindableInput
|
301
|
+
|
302
|
+
* June 13th, 2010: Tenth public release 1.2.0.
|
303
|
+
* Removed Camping adapter: Camping 2.0 supports Rack as-is
|
304
|
+
* Removed parsing of quoted values
|
305
|
+
* Add Request.trace? and Request.options?
|
306
|
+
* Add mime-type for .webm and .htc
|
307
|
+
* Fix HTTP_X_FORWARDED_FOR
|
308
|
+
* Various multipart fixes
|
309
|
+
* Switch test suite to bacon
|
310
|
+
|
311
|
+
* June 15th, 2010: Eleventh public release 1.2.1.
|
312
|
+
* Make CGI handler rewindable
|
313
|
+
* Rename spec/ to test/ to not conflict with SPEC on lesser
|
314
|
+
operating systems
|
315
|
+
|
316
|
+
== Contact
|
317
|
+
|
318
|
+
Please post bugs, suggestions and patches to
|
319
|
+
the bug tracker at <http://github.com/rack/rack/issues>.
|
320
|
+
|
321
|
+
Mailing list archives are available at
|
322
|
+
<http://groups.google.com/group/rack-devel>.
|
323
|
+
|
324
|
+
Git repository (send Git patches to the mailing list):
|
325
|
+
* http://github.com/rack/rack
|
326
|
+
* http://git.vuxu.org/cgi-bin/gitweb.cgi?p=rack-github.git
|
327
|
+
|
328
|
+
You are also welcome to join the #rack channel on irc.freenode.net.
|
329
|
+
|
330
|
+
== Thanks
|
331
|
+
|
332
|
+
The Rack Core Team, consisting of
|
333
|
+
|
334
|
+
* Christian Neukirchen (chneukirchen)
|
335
|
+
* James Tucker (raggi)
|
336
|
+
* Josh Peek (josh)
|
337
|
+
* Michael Fellinger (manveru)
|
338
|
+
* Ryan Tomayko (rtomayko)
|
339
|
+
* Scytrin dai Kinthra (scytrin)
|
340
|
+
|
341
|
+
would like to thank:
|
342
|
+
|
343
|
+
* Adrian Madrid, for the LiteSpeed handler.
|
344
|
+
* Christoffer Sawicki, for the first Rails adapter and Rack::Deflater.
|
345
|
+
* Tim Fletcher, for the HTTP authentication code.
|
346
|
+
* Luc Heinrich for the Cookie sessions, the static file handler and bugfixes.
|
347
|
+
* Armin Ronacher, for the logo and racktools.
|
348
|
+
* Alex Beregszaszi, Alexander Kahn, Anil Wadghule, Aredridel, Ben
|
349
|
+
Alpert, Dan Kubb, Daniel Roethlisberger, Matt Todd, Tom Robinson,
|
350
|
+
Phil Hagelberg, S. Brent Faulkner, Bosko Milekic, Daniel Rodríguez
|
351
|
+
Troitiño, Genki Takiuchi, Geoffrey Grosenbach, Julien Sanchez, Kamal
|
352
|
+
Fariz Mahyuddin, Masayoshi Takahashi, Patrick Aljordm, Mig, Kazuhiro
|
353
|
+
Nishiyama, Jon Bardin, Konstantin Haase, Larry Siden, Matias
|
354
|
+
Korhonen, Sam Ruby, Simon Chiang, Tim Connor, Timur Batyrshin, and
|
355
|
+
Zach Brock for bug fixing and other improvements.
|
356
|
+
* Eric Wong, Hongli Lai, Jeremy Kemper for their continuous support
|
357
|
+
and API improvements.
|
358
|
+
* Yehuda Katz and Carl Lerche for refactoring rackup.
|
359
|
+
* Brian Candler, for Rack::ContentType.
|
360
|
+
* Graham Batty, for improved handler loading.
|
361
|
+
* Stephen Bannasch, for bug reports and documentation.
|
362
|
+
* Gary Wright, for proposing a better Rack::Response interface.
|
363
|
+
* Jonathan Buch, for improvements regarding Rack::Response.
|
364
|
+
* Armin Röhrl, for tracking down bugs in the Cookie generator.
|
365
|
+
* Alexander Kellett for testing the Gem and reviewing the announcement.
|
366
|
+
* Marcus Rückert, for help with configuring and debugging lighttpd.
|
367
|
+
* The WSGI team for the well-done and documented work they've done and
|
368
|
+
Rack builds up on.
|
369
|
+
* All bug reporters and patch contributers not mentioned above.
|
370
|
+
|
371
|
+
== Copyright
|
372
|
+
|
373
|
+
Copyright (C) 2007, 2008, 2009, 2010 Christian Neukirchen <http://purl.org/net/chneukirchen>
|
374
|
+
|
375
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
376
|
+
of this software and associated documentation files (the "Software"), to
|
377
|
+
deal in the Software without restriction, including without limitation the
|
378
|
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
379
|
+
sell copies of the Software, and to permit persons to whom the Software is
|
380
|
+
furnished to do so, subject to the following conditions:
|
381
|
+
|
382
|
+
The above copyright notice and this permission notice shall be included in
|
383
|
+
all copies or substantial portions of the Software.
|
384
|
+
|
385
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
386
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
387
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
388
|
+
THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
389
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
390
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
391
|
+
|
392
|
+
== Links
|
393
|
+
|
394
|
+
Rack:: <http://rack.rubyforge.org/>
|
395
|
+
Rack's Rubyforge project:: <http://rubyforge.org/projects/rack>
|
396
|
+
Official Rack repositories:: <http://github.com/rack>
|
397
|
+
Rack Lighthouse Bug Tracking:: <http://rack.lighthouseapp.com/>
|
398
|
+
rack-devel mailing list:: <http://groups.google.com/group/rack-devel>
|
399
|
+
|
400
|
+
Christian Neukirchen:: <http://chneukirchen.org/>
|
401
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
# Rakefile for Rack. -*-ruby-*-
|
2
|
+
require 'rake/rdoctask'
|
3
|
+
|
4
|
+
desc "Run all the tests"
|
5
|
+
task :default => [:test]
|
6
|
+
|
7
|
+
desc "Make an archive as .tar.gz"
|
8
|
+
task :dist => [:chmod, :changelog, :rdoc, "SPEC"] do
|
9
|
+
sh "git archive --format=tar --prefix=#{release}/ HEAD^{tree} >#{release}.tar"
|
10
|
+
sh "pax -waf #{release}.tar -s ':^:#{release}/:' SPEC ChangeLog doc rack.gemspec"
|
11
|
+
sh "gzip -f -9 #{release}.tar"
|
12
|
+
end
|
13
|
+
|
14
|
+
desc "Make an official release"
|
15
|
+
task :officialrelease do
|
16
|
+
puts "Official build for #{release}..."
|
17
|
+
sh "rm -rf stage"
|
18
|
+
sh "git clone --shared . stage"
|
19
|
+
sh "cd stage && rake officialrelease_really"
|
20
|
+
sh "mv stage/#{release}.tar.gz stage/#{release}.gem ."
|
21
|
+
end
|
22
|
+
|
23
|
+
task :officialrelease_really => ["SPEC", :dist, :gem] do
|
24
|
+
sh "sha1sum #{release}.tar.gz #{release}.gem"
|
25
|
+
end
|
26
|
+
|
27
|
+
def release
|
28
|
+
"rack-#{File.read("rack.gemspec")[/s.version *= *"(.*?)"/, 1]}"
|
29
|
+
end
|
30
|
+
|
31
|
+
desc "Make binaries executable"
|
32
|
+
task :chmod do
|
33
|
+
Dir["bin/*"].each { |binary| File.chmod(0775, binary) }
|
34
|
+
Dir["test/cgi/test*"].each { |binary| File.chmod(0775, binary) }
|
35
|
+
end
|
36
|
+
|
37
|
+
desc "Generate a ChangeLog"
|
38
|
+
task :changelog do
|
39
|
+
File.open("ChangeLog", "w") { |out|
|
40
|
+
`git log -z`.split("\0").map { |chunk|
|
41
|
+
author = chunk[/Author: (.*)/, 1].strip
|
42
|
+
date = chunk[/Date: (.*)/, 1].strip
|
43
|
+
desc, detail = $'.strip.split("\n", 2)
|
44
|
+
detail ||= ""
|
45
|
+
detail = detail.gsub(/.*darcs-hash:.*/, '')
|
46
|
+
detail.rstrip!
|
47
|
+
out.puts "#{date} #{author}"
|
48
|
+
out.puts " * #{desc.strip}"
|
49
|
+
out.puts detail unless detail.empty?
|
50
|
+
out.puts
|
51
|
+
}
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
|
56
|
+
file 'lib/rack/lint.rb'
|
57
|
+
desc "Generate Rack Specification"
|
58
|
+
file "SPEC" => 'lib/rack/lint.rb' do
|
59
|
+
File.open("SPEC", "wb") { |file|
|
60
|
+
IO.foreach("lib/rack/lint.rb") { |line|
|
61
|
+
if line =~ /## (.*)/
|
62
|
+
file.puts $1
|
63
|
+
end
|
64
|
+
}
|
65
|
+
}
|
66
|
+
end
|
67
|
+
|
68
|
+
desc "Run all the fast tests"
|
69
|
+
task :test => 'SPEC' do
|
70
|
+
opts = ENV['TEST'] || '-a'
|
71
|
+
specopts = ENV['TESTOPTS'] ||
|
72
|
+
"-q -t '^(?!Rack::Adapter|Rack::Session::Memcache|rackup)'"
|
73
|
+
|
74
|
+
sh "bacon -I./lib:./test -w #{opts} #{specopts}"
|
75
|
+
end
|
76
|
+
|
77
|
+
desc "Run all the tests"
|
78
|
+
task :fulltest => %w[SPEC chmod] do
|
79
|
+
opts = ENV['TEST'] || '-a'
|
80
|
+
specopts = ENV['TESTOPTS'] || '-q'
|
81
|
+
sh "bacon -rtest/gemloader -I./lib:./test -w #{opts} #{specopts}"
|
82
|
+
end
|
83
|
+
|
84
|
+
task :gem => ["SPEC"] do
|
85
|
+
sh "gem build rack.gemspec"
|
86
|
+
end
|
87
|
+
|
88
|
+
desc "Generate RDoc documentation"
|
89
|
+
task :rdoc => ["SPEC"] do
|
90
|
+
sh(*%w{rdoc --line-numbers --main README
|
91
|
+
--title 'Rack\ Documentation' --charset utf-8 -U -o doc} +
|
92
|
+
%w{README KNOWN-ISSUES SPEC} +
|
93
|
+
Dir["lib/**/*.rb"])
|
94
|
+
end
|
95
|
+
|
96
|
+
task :pushsite => [:rdoc] do
|
97
|
+
sh "cd site && git gc"
|
98
|
+
sh "rsync -avz doc/ chneukirchen@rack.rubyforge.org:/var/www/gforge-projects/rack/doc/"
|
99
|
+
sh "rsync -avz site/ chneukirchen@rack.rubyforge.org:/var/www/gforge-projects/rack/"
|
100
|
+
sh "cd site && git push"
|
101
|
+
end
|