rack 1.1.0 → 1.1.1.pre
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rack might be problematic. Click here for more details.
- data/RDOX +495 -0
- data/lib/rack.rb +1 -1
- data/lib/rack/server.rb +2 -2
- data/lib/rack/utils.rb +0 -6
- data/rack.gemspec +6 -3
- data/test/spec_rack_cgi.rb +1 -1
- data/test/spec_rack_utils.rb +2 -2
- data/test/spec_rackup.rb +13 -3
- metadata +120 -35
data/RDOX
CHANGED
@@ -0,0 +1,495 @@
|
|
1
|
+
|
2
|
+
== Rack::Auth::Basic
|
3
|
+
* should challenge correctly when no credentials are specified
|
4
|
+
* should rechallenge if incorrect credentials are specified
|
5
|
+
* should return application output if correct credentials are specified
|
6
|
+
* should return 400 Bad Request if different auth scheme used
|
7
|
+
* realm as optional constructor arg
|
8
|
+
|
9
|
+
== Rack::Auth::Digest::MD5
|
10
|
+
* should challenge when no credentials are specified
|
11
|
+
* should return application output if correct credentials given
|
12
|
+
* should return application output if correct credentials given (hashed passwords)
|
13
|
+
* should rechallenge if incorrect username given
|
14
|
+
* should rechallenge if incorrect password given
|
15
|
+
* should rechallenge with stale parameter if nonce is stale
|
16
|
+
* should return 400 Bad Request if incorrect qop given
|
17
|
+
* should return 400 Bad Request if incorrect uri given
|
18
|
+
* should return 400 Bad Request if different auth scheme used
|
19
|
+
* should not require credentials for unprotected path
|
20
|
+
* should challenge when no credentials are specified for protected path
|
21
|
+
* should return application output if correct credentials given for protected path
|
22
|
+
* should return application output if correct credentials given for POST
|
23
|
+
* should return application output if correct credentials given for PUT (using method override of POST)
|
24
|
+
* realm as optional constructor arg
|
25
|
+
|
26
|
+
== Rack::Builder
|
27
|
+
* chains apps by default
|
28
|
+
* has implicit #to_app
|
29
|
+
* supports blocks on use
|
30
|
+
* has explicit #to_app
|
31
|
+
* apps are initialized once
|
32
|
+
|
33
|
+
== Rack::Adapter::Camping
|
34
|
+
* works with GET
|
35
|
+
* works with POST
|
36
|
+
|
37
|
+
== Rack::Cascade
|
38
|
+
* should dispatch onward on 404 by default
|
39
|
+
* should dispatch onward on whatever is passed
|
40
|
+
* should return 404 if empty
|
41
|
+
* should append new app
|
42
|
+
|
43
|
+
== Rack::Handler::CGI
|
44
|
+
* startup (empty)
|
45
|
+
* should respond
|
46
|
+
* should be a lighttpd
|
47
|
+
* should have rack headers
|
48
|
+
* should have CGI headers on GET
|
49
|
+
* should have CGI headers on POST
|
50
|
+
* should support HTTP auth
|
51
|
+
* should set status
|
52
|
+
* shutdown
|
53
|
+
|
54
|
+
== Rack::Chunked
|
55
|
+
* chunks responses with no Content-Length
|
56
|
+
* chunks empty bodies properly
|
57
|
+
* does not modify response when Content-Length header present
|
58
|
+
* does not modify response when client is HTTP/1.0
|
59
|
+
* does not modify response when Transfer-Encoding header already present
|
60
|
+
* does not modify response when status code is 100
|
61
|
+
* does not modify response when status code is 204
|
62
|
+
* does not modify response when status code is 304
|
63
|
+
|
64
|
+
== Rack::CommonLogger
|
65
|
+
* should log to rack.errors by default
|
66
|
+
* should log to anything with +write+
|
67
|
+
* should log - content length if header is missing
|
68
|
+
* should log - content length if header is zero
|
69
|
+
|
70
|
+
== Rack::ConditionalGet
|
71
|
+
* should set a 304 status and truncate body when If-Modified-Since hits
|
72
|
+
* should set a 304 status and truncate body when If-None-Match hits
|
73
|
+
* should not affect non-GET/HEAD requests
|
74
|
+
|
75
|
+
== Rack::Config
|
76
|
+
* should accept a block that modifies the environment
|
77
|
+
|
78
|
+
== Rack::ContentLength
|
79
|
+
* sets Content-Length on String bodies if none is set
|
80
|
+
* sets Content-Length on Array bodies if none is set
|
81
|
+
* does not set Content-Length on variable length bodies
|
82
|
+
* does not change Content-Length if it is already set
|
83
|
+
* does not set Content-Length on 304 responses
|
84
|
+
* does not set Content-Length when Transfer-Encoding is chunked
|
85
|
+
|
86
|
+
== Rack::ContentType
|
87
|
+
* sets Content-Type to default text/html if none is set
|
88
|
+
* sets Content-Type to chosen default if none is set
|
89
|
+
* does not change Content-Type if it is already set
|
90
|
+
* case insensitive detection of Content-Type
|
91
|
+
|
92
|
+
== Rack::Deflater
|
93
|
+
* should be able to deflate bodies that respond to each
|
94
|
+
* should be able to deflate String bodies
|
95
|
+
* should be able to gzip bodies that respond to each
|
96
|
+
* should be able to fallback to no deflation
|
97
|
+
* should be able to skip when there is no response entity body
|
98
|
+
* should handle the lack of an acceptable encoding
|
99
|
+
* should handle gzip response with Last-Modified header
|
100
|
+
* should do nothing when no-transform Cache-Control directive present
|
101
|
+
|
102
|
+
== Rack::Directory
|
103
|
+
* serves directory indices
|
104
|
+
* passes to app if file found
|
105
|
+
* serves uri with URL encoded filenames
|
106
|
+
* does not allow directory traversal
|
107
|
+
* 404s if it can't find the file
|
108
|
+
|
109
|
+
== Rack::ETag
|
110
|
+
* sets ETag if none is set
|
111
|
+
* does not change ETag if it is already set
|
112
|
+
|
113
|
+
== Rack::Handler::FastCGI
|
114
|
+
* startup (empty)
|
115
|
+
* should respond
|
116
|
+
* should be a lighttpd
|
117
|
+
* should have rack headers
|
118
|
+
* should have CGI headers on GET
|
119
|
+
* should have CGI headers on POST
|
120
|
+
* should support HTTP auth
|
121
|
+
* should set status
|
122
|
+
* shutdown
|
123
|
+
|
124
|
+
== Rack::File
|
125
|
+
* serves files
|
126
|
+
* sets Last-Modified header
|
127
|
+
* serves files with URL encoded filenames
|
128
|
+
* does not allow directory traversal
|
129
|
+
* does not allow directory traversal with encoded periods
|
130
|
+
* 404s if it can't find the file
|
131
|
+
* detects SystemCallErrors
|
132
|
+
* returns bodies that respond to #to_path
|
133
|
+
|
134
|
+
== Rack::Handler
|
135
|
+
* has registered default handlers
|
136
|
+
* handler that doesn't exist should raise a NameError
|
137
|
+
* should get unregistered, but already required, handler by name
|
138
|
+
* should register custom handler
|
139
|
+
* should not need registration for properly coded handlers even if not already required
|
140
|
+
|
141
|
+
== Rack::Head
|
142
|
+
* response (empty)
|
143
|
+
* passes GET, POST, PUT, DELETE, OPTIONS, TRACE requests
|
144
|
+
* removes body from HEAD requests
|
145
|
+
|
146
|
+
== Rack::Lint
|
147
|
+
* passes valid request
|
148
|
+
* notices fatal errors
|
149
|
+
* notices environment errors
|
150
|
+
* notices input errors
|
151
|
+
* notices error errors
|
152
|
+
* notices status errors
|
153
|
+
* notices header errors
|
154
|
+
* notices content-type errors
|
155
|
+
* notices content-length errors
|
156
|
+
* notices body errors
|
157
|
+
* notices input handling errors
|
158
|
+
* notices error handling errors
|
159
|
+
* notices HEAD errors
|
160
|
+
* passes valid read calls
|
161
|
+
|
162
|
+
== Rack::Lint::InputWrapper
|
163
|
+
* delegates :size to underlying IO object
|
164
|
+
* delegates :rewind to underlying IO object
|
165
|
+
|
166
|
+
== Rack::Lobster::LambdaLobster
|
167
|
+
* should be a single lambda
|
168
|
+
* should look like a lobster
|
169
|
+
* should be flippable
|
170
|
+
|
171
|
+
== Rack::Lobster
|
172
|
+
* should look like a lobster
|
173
|
+
* should be flippable
|
174
|
+
* should provide crashing for testing purposes
|
175
|
+
|
176
|
+
== Rack::Lock
|
177
|
+
* should call synchronize on lock
|
178
|
+
* should set multithread flag to false
|
179
|
+
* should reset original multithread flag when exiting lock
|
180
|
+
|
181
|
+
== Rack::Logger
|
182
|
+
* logs to rack.errors
|
183
|
+
|
184
|
+
== Rack::MethodOverride
|
185
|
+
* should not affect GET requests
|
186
|
+
* _method parameter should modify REQUEST_METHOD for POST requests
|
187
|
+
* X-HTTP-Method-Override header should modify REQUEST_METHOD for POST requests
|
188
|
+
* should not modify REQUEST_METHOD if the method is unknown
|
189
|
+
* should not modify REQUEST_METHOD when _method is nil
|
190
|
+
* should store the original REQUEST_METHOD prior to overriding
|
191
|
+
|
192
|
+
== Rack::MockRequest
|
193
|
+
* should return a MockResponse
|
194
|
+
* should be able to only return the environment
|
195
|
+
* should provide sensible defaults
|
196
|
+
* should allow GET/POST/PUT/DELETE
|
197
|
+
* should set content length
|
198
|
+
* should allow posting
|
199
|
+
* should use all parts of an URL
|
200
|
+
* should set SSL port and HTTP flag on when using https
|
201
|
+
* should prepend slash to uri path
|
202
|
+
* should properly convert method name to an uppercase string
|
203
|
+
* should accept params and build query string for GET requests
|
204
|
+
* should accept raw input in params for GET requests
|
205
|
+
* should accept params and build url encoded params for POST requests
|
206
|
+
* should accept raw input in params for POST requests
|
207
|
+
* should accept params and build multipart encoded params for POST requests
|
208
|
+
* should behave valid according to the Rack spec
|
209
|
+
|
210
|
+
== Rack::MockResponse
|
211
|
+
* should provide access to the HTTP status
|
212
|
+
* should provide access to the HTTP headers
|
213
|
+
* should provide access to the HTTP body
|
214
|
+
* should provide access to the Rack errors
|
215
|
+
* should optionally make Rack errors fatal
|
216
|
+
|
217
|
+
== Rack::Handler::Mongrel
|
218
|
+
* should respond
|
219
|
+
* should be a Mongrel
|
220
|
+
* should have rack headers
|
221
|
+
* should have CGI headers on GET
|
222
|
+
* should have CGI headers on POST
|
223
|
+
* should support HTTP auth
|
224
|
+
* should set status
|
225
|
+
* should provide a .run
|
226
|
+
* should provide a .run that maps a hash
|
227
|
+
* should provide a .run that maps a urlmap
|
228
|
+
* should provide a .run that maps a urlmap restricting by host
|
229
|
+
* should stream #each part of the response
|
230
|
+
|
231
|
+
== Rack::NullLogger
|
232
|
+
* acks as a nop logger (empty)
|
233
|
+
|
234
|
+
== Rack::Recursive
|
235
|
+
* should allow for subrequests
|
236
|
+
* should raise error on requests not below the app
|
237
|
+
* should support forwarding
|
238
|
+
|
239
|
+
== Rack::Request
|
240
|
+
* wraps the rack variables
|
241
|
+
* can figure out the correct host
|
242
|
+
* can parse the query string
|
243
|
+
* raises if rack.input is missing
|
244
|
+
* can parse POST data when method is POST and no Content-Type given
|
245
|
+
* can parse POST data with explicit content type regardless of method
|
246
|
+
* does not parse POST data when media type is not form-data
|
247
|
+
* can parse POST data on PUT when media type is form-data
|
248
|
+
* rewinds input after parsing POST data
|
249
|
+
* cleans up Safari's ajax POST body
|
250
|
+
* can get value by key from params with #[]
|
251
|
+
* can set value to key on params with #[]=
|
252
|
+
* values_at answers values by keys in order given
|
253
|
+
* referrer should be extracted correct
|
254
|
+
* user agent should be extracted correct
|
255
|
+
* can cache, but invalidates the cache
|
256
|
+
* can figure out if called via XHR
|
257
|
+
* can parse cookies
|
258
|
+
* parses cookies according to RFC 2109
|
259
|
+
* provides setters
|
260
|
+
* provides the original env
|
261
|
+
* can restore the URL
|
262
|
+
* can restore the full path
|
263
|
+
* can handle multiple media type parameters
|
264
|
+
* can parse multipart form data
|
265
|
+
* can parse big multipart form data
|
266
|
+
* can detect invalid multipart form data
|
267
|
+
* shouldn't try to interpret binary as utf8
|
268
|
+
* should work around buggy 1.8.* Tempfile equality
|
269
|
+
* does conform to the Rack spec
|
270
|
+
* should parse Accept-Encoding correctly
|
271
|
+
* should provide ip information
|
272
|
+
* should allow subclass request to be instantiated after parent request
|
273
|
+
* should allow parent request to be instantiated after subclass request
|
274
|
+
|
275
|
+
== Rack::Response
|
276
|
+
* has sensible default values
|
277
|
+
* can be written to
|
278
|
+
* can set and read headers
|
279
|
+
* can set cookies
|
280
|
+
* formats the Cookie expiration date accordingly to RFC 2109
|
281
|
+
* can set secure cookies
|
282
|
+
* can set http only cookies
|
283
|
+
* can delete cookies
|
284
|
+
* can do redirects
|
285
|
+
* has a useful constructor
|
286
|
+
* has a constructor that can take a block
|
287
|
+
* doesn't return invalid responses
|
288
|
+
* knows if it's empty
|
289
|
+
* should provide access to the HTTP status
|
290
|
+
* should provide access to the HTTP headers
|
291
|
+
* does not add or change Content-Length when #finish()ing
|
292
|
+
* updates Content-Length when body appended to using #write
|
293
|
+
|
294
|
+
== Rack::RewindableInput
|
295
|
+
=== given an IO object that is already rewindable
|
296
|
+
* should be able to handle to read()
|
297
|
+
* should be able to handle to read(nil)
|
298
|
+
* should be able to handle to read(length)
|
299
|
+
* should be able to handle to read(length, buffer)
|
300
|
+
* should be able to handle to read(nil, buffer)
|
301
|
+
* should rewind to the beginning when #rewind is called
|
302
|
+
* should be able to handle gets
|
303
|
+
* should be able to handle each
|
304
|
+
* should not buffer into a Tempfile if no data has been read yet
|
305
|
+
* should buffer into a Tempfile when data has been consumed for the first time
|
306
|
+
* should close the underlying tempfile upon calling #close
|
307
|
+
* should be possibel to call #close when no data has been buffered yet (empty)
|
308
|
+
* should be possible to call #close multiple times (empty)
|
309
|
+
=== given an IO object that is not rewindable
|
310
|
+
* should be able to handle to read()
|
311
|
+
* should be able to handle to read(nil)
|
312
|
+
* should be able to handle to read(length)
|
313
|
+
* should be able to handle to read(length, buffer)
|
314
|
+
* should be able to handle to read(nil, buffer)
|
315
|
+
* should rewind to the beginning when #rewind is called
|
316
|
+
* should be able to handle gets
|
317
|
+
* should be able to handle each
|
318
|
+
* should not buffer into a Tempfile if no data has been read yet
|
319
|
+
* should buffer into a Tempfile when data has been consumed for the first time
|
320
|
+
* should close the underlying tempfile upon calling #close
|
321
|
+
* should be possibel to call #close when no data has been buffered yet (empty)
|
322
|
+
* should be possible to call #close multiple times (empty)
|
323
|
+
=== given an IO object whose rewind method raises Errno::ESPIPE
|
324
|
+
* should be able to handle to read()
|
325
|
+
* should be able to handle to read(nil)
|
326
|
+
* should be able to handle to read(length)
|
327
|
+
* should be able to handle to read(length, buffer)
|
328
|
+
* should be able to handle to read(nil, buffer)
|
329
|
+
* should rewind to the beginning when #rewind is called
|
330
|
+
* should be able to handle gets
|
331
|
+
* should be able to handle each
|
332
|
+
* should not buffer into a Tempfile if no data has been read yet
|
333
|
+
* should buffer into a Tempfile when data has been consumed for the first time
|
334
|
+
* should close the underlying tempfile upon calling #close
|
335
|
+
* should be possibel to call #close when no data has been buffered yet (empty)
|
336
|
+
* should be possible to call #close multiple times (empty)
|
337
|
+
|
338
|
+
== Rack::Runtime
|
339
|
+
* sets X-Runtime is none is set
|
340
|
+
* does not set the X-Runtime if it is already set
|
341
|
+
* should allow a suffix to be set
|
342
|
+
* should allow multiple timers to be set
|
343
|
+
|
344
|
+
== Rack::Sendfile
|
345
|
+
* does nothing when no X-Sendfile-Type header present
|
346
|
+
* sets X-Sendfile response header and discards body
|
347
|
+
* sets X-Lighttpd-Send-File response header and discards body
|
348
|
+
* sets X-Accel-Redirect response header and discards body
|
349
|
+
* writes to rack.error when no X-Accel-Mapping is specified
|
350
|
+
* does nothing when body does not respond to #to_path
|
351
|
+
|
352
|
+
== Rack::Session::Cookie
|
353
|
+
* creates a new cookie
|
354
|
+
* loads from a cookie
|
355
|
+
* survives broken cookies
|
356
|
+
* barks on too big cookies
|
357
|
+
* loads from a cookie wih integrity hash
|
358
|
+
* ignores tampered with session cookies
|
359
|
+
|
360
|
+
== Rack::Session::Memcache
|
361
|
+
* faults on no connection
|
362
|
+
* connect to existing server (empty)
|
363
|
+
* creates a new cookie
|
364
|
+
* determines session from a cookie
|
365
|
+
* survives nonexistant cookies
|
366
|
+
* maintains freshness
|
367
|
+
* deletes cookies with :drop option
|
368
|
+
* provides new session id with :renew option
|
369
|
+
* omits cookie with :defer option
|
370
|
+
* deep hashes are correctly updated
|
371
|
+
* multithread: should cleanly merge sessions (empty)
|
372
|
+
|
373
|
+
== Rack::Session::Pool
|
374
|
+
* creates a new cookie
|
375
|
+
* determines session from a cookie
|
376
|
+
* survives nonexistant cookies
|
377
|
+
* deletes cookies with :drop option
|
378
|
+
* provides new session id with :renew option
|
379
|
+
* omits cookie with :defer option
|
380
|
+
* multithread: should merge sessions (empty)
|
381
|
+
|
382
|
+
== Rack::ShowExceptions
|
383
|
+
* catches exceptions
|
384
|
+
|
385
|
+
== Rack::ShowStatus
|
386
|
+
* should provide a default status message
|
387
|
+
* should let the app provide additional information
|
388
|
+
* should not replace existing messages
|
389
|
+
* should pass on original headers
|
390
|
+
* should replace existing messages if there is detail
|
391
|
+
|
392
|
+
== Rack::Static
|
393
|
+
* serves files
|
394
|
+
* 404s if url root is known but it can't find the file
|
395
|
+
* calls down the chain if url root is not known
|
396
|
+
|
397
|
+
== Rack::Handler::Thin
|
398
|
+
* should respond
|
399
|
+
* should be a Thin
|
400
|
+
* should have rack headers
|
401
|
+
* should have CGI headers on GET
|
402
|
+
* should have CGI headers on POST
|
403
|
+
* should support HTTP auth
|
404
|
+
* should set status
|
405
|
+
|
406
|
+
== Rack::URLMap
|
407
|
+
* dispatches paths correctly
|
408
|
+
* dispatches hosts correctly
|
409
|
+
* should be nestable
|
410
|
+
* should route root apps correctly
|
411
|
+
* should not squeeze slashes
|
412
|
+
|
413
|
+
== Rack::Utils
|
414
|
+
* should escape correctly
|
415
|
+
* should escape correctly for multibyte characters
|
416
|
+
* should unescape correctly
|
417
|
+
* should parse query strings correctly
|
418
|
+
* should parse nested query strings correctly
|
419
|
+
* should build query strings correctly
|
420
|
+
* should build nested query strings correctly
|
421
|
+
* should figure out which encodings are acceptable
|
422
|
+
* should return the bytesize of String
|
423
|
+
* should return status code for integer
|
424
|
+
* should return status code for string
|
425
|
+
* should return status code for symbol
|
426
|
+
|
427
|
+
== Rack::Utils::HeaderHash
|
428
|
+
* should retain header case
|
429
|
+
* should check existence of keys case insensitively
|
430
|
+
* should merge case-insensitively
|
431
|
+
* should overwrite case insensitively and assume the new key's case
|
432
|
+
* should be converted to real Hash
|
433
|
+
* should convert Array values to Strings when converting to Hash
|
434
|
+
* should replace hashes correctly
|
435
|
+
* should be able to delete the given key case-sensitively
|
436
|
+
* should be able to delete the given key case-insensitively
|
437
|
+
* should return the deleted value when #delete is called on an existing key
|
438
|
+
* should return nil when #delete is called on a non-existant key
|
439
|
+
* should avoid unnecessary object creation if possible
|
440
|
+
* should convert Array values to Strings when responding to #each
|
441
|
+
|
442
|
+
== Rack::Utils::Context
|
443
|
+
* should set context correctly
|
444
|
+
* should alter app on recontexting
|
445
|
+
* should run different apps
|
446
|
+
|
447
|
+
== Rack::Utils::Multipart
|
448
|
+
* should return nil if content type is not multipart
|
449
|
+
* should parse multipart upload with text file
|
450
|
+
* should parse multipart upload with nested parameters
|
451
|
+
* should parse multipart upload with binary file
|
452
|
+
* should parse multipart upload with empty file
|
453
|
+
* should parse multipart upload with filename with semicolons
|
454
|
+
* should not include file params if no file was selected
|
455
|
+
* should parse IE multipart upload and clean up filename
|
456
|
+
* rewinds input after parsing upload
|
457
|
+
* builds multipart body
|
458
|
+
* builds nested multipart body
|
459
|
+
* can parse fields that end at the end of the buffer
|
460
|
+
* builds complete params with the chunk size of 16384 slicing exactly on boundary
|
461
|
+
* should return nil if no UploadedFiles were used
|
462
|
+
* should raise ArgumentError if params is not a Hash
|
463
|
+
|
464
|
+
== Rack::Handler::WEBrick
|
465
|
+
* should respond
|
466
|
+
* should be a WEBrick
|
467
|
+
* should have rack headers
|
468
|
+
* should have CGI headers on GET
|
469
|
+
* should have CGI headers on POST
|
470
|
+
* should support HTTP auth
|
471
|
+
* should set status
|
472
|
+
* should correctly set cookies
|
473
|
+
* should provide a .run
|
474
|
+
|
475
|
+
== rackup
|
476
|
+
* rackup
|
477
|
+
* rackup --help
|
478
|
+
* rackup --port
|
479
|
+
* rackup --debug
|
480
|
+
* rackup --eval
|
481
|
+
* rackup --warn
|
482
|
+
* rackup --include
|
483
|
+
* rackup --require
|
484
|
+
* rackup --server
|
485
|
+
* rackup --host
|
486
|
+
* rackup --daemonize --pid
|
487
|
+
* rackup --pid
|
488
|
+
* rackup --version
|
489
|
+
* rackup --env development includes lint
|
490
|
+
* rackup --env deployment does not include lint
|
491
|
+
* rackup --env none does not include lint
|
492
|
+
* rackup --env deployment does log
|
493
|
+
* rackup --env none does not log
|
494
|
+
|
495
|
+
390 specifications, 13 empty (1340 requirements), 0 failures
|
data/lib/rack.rb
CHANGED
data/lib/rack/server.rb
CHANGED
@@ -57,7 +57,7 @@ module Rack
|
|
57
57
|
}
|
58
58
|
|
59
59
|
opts.on("-P", "--pid FILE", "file to store PID (default: rack.pid)") { |f|
|
60
|
-
options[:pid] = f
|
60
|
+
options[:pid] = ::File.expand_path(f, Dir.pwd)
|
61
61
|
}
|
62
62
|
|
63
63
|
opts.separator ""
|
@@ -100,7 +100,7 @@ module Rack
|
|
100
100
|
:Port => 9292,
|
101
101
|
:Host => "0.0.0.0",
|
102
102
|
:AccessLog => [],
|
103
|
-
:config => "config.ru"
|
103
|
+
:config => ::File.expand_path("config.ru", Dir.pwd)
|
104
104
|
}
|
105
105
|
end
|
106
106
|
|
data/lib/rack/utils.rb
CHANGED
@@ -38,9 +38,6 @@ module Rack
|
|
38
38
|
|
39
39
|
(qs || '').split(d ? /[#{d}] */n : DEFAULT_SEP).each do |p|
|
40
40
|
k, v = p.split('=', 2).map { |x| unescape(x) }
|
41
|
-
if v =~ /^("|')(.*)\1$/
|
42
|
-
v = $2.gsub('\\'+$1, $1)
|
43
|
-
end
|
44
41
|
if cur = params[k]
|
45
42
|
if cur.class == Array
|
46
43
|
params[k] << v
|
@@ -69,9 +66,6 @@ module Rack
|
|
69
66
|
module_function :parse_nested_query
|
70
67
|
|
71
68
|
def normalize_params(params, name, v = nil)
|
72
|
-
if v and v =~ /^("|')(.*)\1$/
|
73
|
-
v = $2.gsub('\\'+$1, $1)
|
74
|
-
end
|
75
69
|
name =~ %r(\A[\[\]]*([^\[\]]+)\]*)
|
76
70
|
k = $1 || ''
|
77
71
|
after = $' || ''
|
data/rack.gemspec
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
+
$:.unshift(File.expand_path('../lib', __FILE__))
|
2
|
+
require 'rack' # For Rack.release
|
3
|
+
|
1
4
|
Gem::Specification.new do |s|
|
2
5
|
s.name = "rack"
|
3
|
-
s.version =
|
6
|
+
s.version = Rack.release
|
4
7
|
s.platform = Gem::Platform::RUBY
|
5
8
|
s.summary = "a modular Ruby webserver interface"
|
6
9
|
|
@@ -30,9 +33,9 @@ EOF
|
|
30
33
|
|
31
34
|
s.add_development_dependency 'test-spec'
|
32
35
|
|
33
|
-
s.add_development_dependency 'camping'
|
36
|
+
s.add_development_dependency 'camping', '< 1.5'
|
34
37
|
s.add_development_dependency 'fcgi'
|
35
38
|
s.add_development_dependency 'memcache-client'
|
36
39
|
s.add_development_dependency 'mongrel'
|
37
|
-
s.add_development_dependency 'thin'
|
40
|
+
s.add_development_dependency 'thin', '< 1.2' # since 1.2 or so, specs fail on Method
|
38
41
|
end
|
data/test/spec_rack_cgi.rb
CHANGED
@@ -47,7 +47,7 @@ context "Rack::Handler::CGI" do
|
|
47
47
|
response["REQUEST_METHOD"].should.equal "GET"
|
48
48
|
response["SCRIPT_NAME"].should.equal "/test"
|
49
49
|
response["REQUEST_PATH"].should.equal "/"
|
50
|
-
response["PATH_INFO"].should.
|
50
|
+
response["PATH_INFO"].should.be nil
|
51
51
|
response["QUERY_STRING"].should.equal ""
|
52
52
|
response["test.postdata"].should.equal ""
|
53
53
|
|
data/test/spec_rack_utils.rb
CHANGED
@@ -33,7 +33,7 @@ context "Rack::Utils" do
|
|
33
33
|
Rack::Utils.parse_query("foo=bar").
|
34
34
|
should.equal "foo" => "bar"
|
35
35
|
Rack::Utils.parse_query("foo=\"bar\"").
|
36
|
-
should.equal "foo" => "bar"
|
36
|
+
should.equal "foo" => "\"bar\""
|
37
37
|
Rack::Utils.parse_query("foo=bar&foo=quux").
|
38
38
|
should.equal "foo" => ["bar", "quux"]
|
39
39
|
Rack::Utils.parse_query("foo=1&bar=2").
|
@@ -51,7 +51,7 @@ context "Rack::Utils" do
|
|
51
51
|
Rack::Utils.parse_nested_query("foo=bar").
|
52
52
|
should.equal "foo" => "bar"
|
53
53
|
Rack::Utils.parse_nested_query("foo=\"bar\"").
|
54
|
-
should.equal "foo" => "bar"
|
54
|
+
should.equal "foo" => "\"bar\""
|
55
55
|
|
56
56
|
Rack::Utils.parse_nested_query("foo=bar&foo=quux").
|
57
57
|
should.equal "foo" => "quux"
|
data/test/spec_rackup.rb
CHANGED
@@ -16,15 +16,24 @@ context "rackup" do
|
|
16
16
|
@port = options[:port] || 9292
|
17
17
|
|
18
18
|
Dir.chdir("#{root}/test/rackup") do
|
19
|
-
@in, @rackup, @err = Open3.popen3("#{
|
19
|
+
@in, @rackup, @err = Open3.popen3("#{ruby} -S #{rackup} #{flags}")
|
20
20
|
end
|
21
21
|
|
22
22
|
return if options[:port] == false
|
23
23
|
|
24
24
|
# Wait until the server is available
|
25
|
+
i = 0
|
25
26
|
begin
|
26
27
|
GET("/")
|
27
28
|
rescue
|
29
|
+
i += 1
|
30
|
+
if i > 40
|
31
|
+
Dir["#{root}/**/*.pid"].each {|f|
|
32
|
+
Process.kill(9, File.read(f)) rescue nil
|
33
|
+
File.delete(f)
|
34
|
+
}
|
35
|
+
raise "Server did not start"
|
36
|
+
end
|
28
37
|
sleep 0.05
|
29
38
|
retry
|
30
39
|
end
|
@@ -39,6 +48,7 @@ context "rackup" do
|
|
39
48
|
GET "/die" rescue nil
|
40
49
|
|
41
50
|
Dir["#{root}/**/*.pid"].each do |file|
|
51
|
+
Process.kill(9, File.read(file).strip.to_i) rescue nil
|
42
52
|
File.delete(file)
|
43
53
|
end
|
44
54
|
|
@@ -101,7 +111,7 @@ context "rackup" do
|
|
101
111
|
end
|
102
112
|
|
103
113
|
specify "rackup --daemonize --pid" do
|
104
|
-
run_rackup
|
114
|
+
run_rackup "--daemonize --pid testing.pid"
|
105
115
|
status.should.be 200
|
106
116
|
@rackup.should.be.eof?
|
107
117
|
Dir["#{root}/**/testing.pid"].should.not.be.empty?
|
@@ -115,7 +125,7 @@ context "rackup" do
|
|
115
125
|
|
116
126
|
specify "rackup --version" do
|
117
127
|
run_rackup %{--version}, :port => false
|
118
|
-
output.should =~ /1.
|
128
|
+
output.should =~ /Rack 1.1/
|
119
129
|
end
|
120
130
|
|
121
131
|
specify "rackup --env development includes lint" do
|
metadata
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 961915992
|
5
|
+
prerelease: 6
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 1
|
9
|
+
- 1
|
10
|
+
- pre
|
11
|
+
version: 1.1.1.pre
|
5
12
|
platform: ruby
|
6
13
|
authors:
|
7
14
|
- Christian Neukirchen
|
@@ -9,69 +16,95 @@ autorequire:
|
|
9
16
|
bindir: bin
|
10
17
|
cert_chain: []
|
11
18
|
|
12
|
-
date:
|
19
|
+
date: 2011-02-09 00:00:00 -08:00
|
13
20
|
default_executable:
|
14
21
|
dependencies:
|
15
22
|
- !ruby/object:Gem::Dependency
|
16
23
|
name: test-spec
|
17
|
-
|
18
|
-
|
19
|
-
|
24
|
+
prerelease: false
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
20
27
|
requirements:
|
21
28
|
- - ">="
|
22
29
|
- !ruby/object:Gem::Version
|
30
|
+
hash: 3
|
31
|
+
segments:
|
32
|
+
- 0
|
23
33
|
version: "0"
|
24
|
-
|
34
|
+
type: :development
|
35
|
+
version_requirements: *id001
|
25
36
|
- !ruby/object:Gem::Dependency
|
26
37
|
name: camping
|
27
|
-
|
28
|
-
|
29
|
-
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
30
41
|
requirements:
|
31
|
-
- -
|
42
|
+
- - <
|
32
43
|
- !ruby/object:Gem::Version
|
33
|
-
|
34
|
-
|
44
|
+
hash: 5
|
45
|
+
segments:
|
46
|
+
- 1
|
47
|
+
- 5
|
48
|
+
version: "1.5"
|
49
|
+
type: :development
|
50
|
+
version_requirements: *id002
|
35
51
|
- !ruby/object:Gem::Dependency
|
36
52
|
name: fcgi
|
37
|
-
|
38
|
-
|
39
|
-
|
53
|
+
prerelease: false
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
40
56
|
requirements:
|
41
57
|
- - ">="
|
42
58
|
- !ruby/object:Gem::Version
|
59
|
+
hash: 3
|
60
|
+
segments:
|
61
|
+
- 0
|
43
62
|
version: "0"
|
44
|
-
|
63
|
+
type: :development
|
64
|
+
version_requirements: *id003
|
45
65
|
- !ruby/object:Gem::Dependency
|
46
66
|
name: memcache-client
|
47
|
-
|
48
|
-
|
49
|
-
|
67
|
+
prerelease: false
|
68
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
50
70
|
requirements:
|
51
71
|
- - ">="
|
52
72
|
- !ruby/object:Gem::Version
|
73
|
+
hash: 3
|
74
|
+
segments:
|
75
|
+
- 0
|
53
76
|
version: "0"
|
54
|
-
|
77
|
+
type: :development
|
78
|
+
version_requirements: *id004
|
55
79
|
- !ruby/object:Gem::Dependency
|
56
80
|
name: mongrel
|
57
|
-
|
58
|
-
|
59
|
-
|
81
|
+
prerelease: false
|
82
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
60
84
|
requirements:
|
61
85
|
- - ">="
|
62
86
|
- !ruby/object:Gem::Version
|
87
|
+
hash: 3
|
88
|
+
segments:
|
89
|
+
- 0
|
63
90
|
version: "0"
|
64
|
-
|
91
|
+
type: :development
|
92
|
+
version_requirements: *id005
|
65
93
|
- !ruby/object:Gem::Dependency
|
66
94
|
name: thin
|
67
|
-
|
68
|
-
|
69
|
-
|
95
|
+
prerelease: false
|
96
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
70
98
|
requirements:
|
71
|
-
- -
|
99
|
+
- - <
|
72
100
|
- !ruby/object:Gem::Version
|
73
|
-
|
74
|
-
|
101
|
+
hash: 11
|
102
|
+
segments:
|
103
|
+
- 1
|
104
|
+
- 2
|
105
|
+
version: "1.2"
|
106
|
+
type: :development
|
107
|
+
version_requirements: *id006
|
75
108
|
description: |
|
76
109
|
Rack provides minimal, modular and adaptable interface for developing
|
77
110
|
web applications in Ruby. By wrapping HTTP requests and responses in
|
@@ -159,6 +192,50 @@ files:
|
|
159
192
|
- RDOX
|
160
193
|
- README
|
161
194
|
- SPEC
|
195
|
+
- test/spec_rack_auth_basic.rb
|
196
|
+
- test/spec_rack_auth_digest.rb
|
197
|
+
- test/spec_rack_builder.rb
|
198
|
+
- test/spec_rack_camping.rb
|
199
|
+
- test/spec_rack_cascade.rb
|
200
|
+
- test/spec_rack_cgi.rb
|
201
|
+
- test/spec_rack_chunked.rb
|
202
|
+
- test/spec_rack_commonlogger.rb
|
203
|
+
- test/spec_rack_conditionalget.rb
|
204
|
+
- test/spec_rack_config.rb
|
205
|
+
- test/spec_rack_content_length.rb
|
206
|
+
- test/spec_rack_content_type.rb
|
207
|
+
- test/spec_rack_deflater.rb
|
208
|
+
- test/spec_rack_directory.rb
|
209
|
+
- test/spec_rack_etag.rb
|
210
|
+
- test/spec_rack_fastcgi.rb
|
211
|
+
- test/spec_rack_file.rb
|
212
|
+
- test/spec_rack_handler.rb
|
213
|
+
- test/spec_rack_head.rb
|
214
|
+
- test/spec_rack_lint.rb
|
215
|
+
- test/spec_rack_lobster.rb
|
216
|
+
- test/spec_rack_lock.rb
|
217
|
+
- test/spec_rack_logger.rb
|
218
|
+
- test/spec_rack_methodoverride.rb
|
219
|
+
- test/spec_rack_mock.rb
|
220
|
+
- test/spec_rack_mongrel.rb
|
221
|
+
- test/spec_rack_nulllogger.rb
|
222
|
+
- test/spec_rack_recursive.rb
|
223
|
+
- test/spec_rack_request.rb
|
224
|
+
- test/spec_rack_response.rb
|
225
|
+
- test/spec_rack_rewindable_input.rb
|
226
|
+
- test/spec_rack_runtime.rb
|
227
|
+
- test/spec_rack_sendfile.rb
|
228
|
+
- test/spec_rack_session_cookie.rb
|
229
|
+
- test/spec_rack_session_memcache.rb
|
230
|
+
- test/spec_rack_session_pool.rb
|
231
|
+
- test/spec_rack_showexceptions.rb
|
232
|
+
- test/spec_rack_showstatus.rb
|
233
|
+
- test/spec_rack_static.rb
|
234
|
+
- test/spec_rack_thin.rb
|
235
|
+
- test/spec_rack_urlmap.rb
|
236
|
+
- test/spec_rack_utils.rb
|
237
|
+
- test/spec_rack_webrick.rb
|
238
|
+
- test/spec_rackup.rb
|
162
239
|
has_rdoc: true
|
163
240
|
homepage: http://rack.rubyforge.org
|
164
241
|
licenses: []
|
@@ -169,21 +246,29 @@ rdoc_options: []
|
|
169
246
|
require_paths:
|
170
247
|
- lib
|
171
248
|
required_ruby_version: !ruby/object:Gem::Requirement
|
249
|
+
none: false
|
172
250
|
requirements:
|
173
251
|
- - ">="
|
174
252
|
- !ruby/object:Gem::Version
|
253
|
+
hash: 3
|
254
|
+
segments:
|
255
|
+
- 0
|
175
256
|
version: "0"
|
176
|
-
version:
|
177
257
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
258
|
+
none: false
|
178
259
|
requirements:
|
179
|
-
- - "
|
260
|
+
- - ">"
|
180
261
|
- !ruby/object:Gem::Version
|
181
|
-
|
182
|
-
|
262
|
+
hash: 25
|
263
|
+
segments:
|
264
|
+
- 1
|
265
|
+
- 3
|
266
|
+
- 1
|
267
|
+
version: 1.3.1
|
183
268
|
requirements: []
|
184
269
|
|
185
270
|
rubyforge_project: rack
|
186
|
-
rubygems_version: 1.
|
271
|
+
rubygems_version: 1.5.0
|
187
272
|
signing_key:
|
188
273
|
specification_version: 3
|
189
274
|
summary: a modular Ruby webserver interface
|