rack-client 0.3.0 → 0.3.1.pre.a
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +12 -14
- data/lib/rack/client/adapter/base.rb +23 -14
- data/lib/rack/client/adapter/base.rbc +1802 -0
- data/lib/rack/client/adapter/simple.rb +53 -21
- data/lib/rack/client/adapter/simple.rbc +2063 -0
- data/lib/rack/client/adapter.rbc +225 -0
- data/lib/rack/client/{dual_band.rb → core/dual_band.rb} +0 -0
- data/lib/rack/client/core/dual_band.rbc +380 -0
- data/lib/rack/client/{headers.rb → core/headers.rb} +1 -1
- data/lib/rack/client/core/headers.rbc +1811 -0
- data/lib/rack/client/core/response.rb +50 -0
- data/lib/rack/client/core/response.rbc +1105 -0
- data/lib/rack/client/core.rb +3 -0
- data/lib/rack/client/core.rbc +85 -0
- data/lib/rack/client/handler/em-http.rb +3 -7
- data/lib/rack/client/handler/em-http.rbc +1648 -0
- data/lib/rack/client/handler/excon.rb +6 -14
- data/lib/rack/client/handler/excon.rbc +1270 -0
- data/lib/rack/client/handler/net_http.rb +7 -4
- data/lib/rack/client/handler/net_http.rbc +2400 -0
- data/lib/rack/client/handler/typhoeus.rb +12 -5
- data/lib/rack/client/handler/typhoeus.rbc +1885 -0
- data/lib/rack/client/handler.rbc +340 -0
- data/lib/rack/client/{auth → middleware/auth}/abstract/challenge.rb +0 -0
- data/lib/rack/client/middleware/auth/abstract/challenge.rbc +1453 -0
- data/lib/rack/client/{auth → middleware/auth}/basic.rb +0 -0
- data/lib/rack/client/middleware/auth/basic.rbc +1566 -0
- data/lib/rack/client/{auth → middleware/auth}/digest/challenge.rb +0 -0
- data/lib/rack/client/middleware/auth/digest/challenge.rbc +1124 -0
- data/lib/rack/client/{auth → middleware/auth}/digest/md5.rb +0 -0
- data/lib/rack/client/middleware/auth/digest/md5.rbc +2241 -0
- data/lib/rack/client/{auth → middleware/auth}/digest/params.rb +0 -0
- data/lib/rack/client/middleware/auth/digest/params.rbc +365 -0
- data/lib/rack/client/middleware/auth.rb +5 -0
- data/lib/rack/client/middleware/auth.rbc +117 -0
- data/lib/rack/client/{cache → middleware/cache}/cachecontrol.rb +0 -0
- data/lib/rack/client/middleware/cache/cachecontrol.rbc +1610 -0
- data/lib/rack/client/{cache → middleware/cache}/context.rb +12 -3
- data/lib/rack/client/middleware/cache/context.rbc +2074 -0
- data/lib/rack/client/{cache → middleware/cache}/entitystore.rb +0 -0
- data/lib/rack/client/middleware/cache/entitystore.rbc +1619 -0
- data/lib/rack/client/{cache → middleware/cache}/key.rb +0 -0
- data/lib/rack/client/middleware/cache/key.rbc +1217 -0
- data/lib/rack/client/{cache → middleware/cache}/metastore.rb +0 -0
- data/lib/rack/client/middleware/cache/metastore.rbc +2754 -0
- data/lib/rack/client/{cache → middleware/cache}/options.rb +0 -0
- data/lib/rack/client/middleware/cache/options.rbc +1844 -0
- data/lib/rack/client/{cache → middleware/cache}/request.rb +0 -0
- data/lib/rack/client/middleware/cache/request.rbc +1020 -0
- data/lib/rack/client/{cache → middleware/cache}/response.rb +19 -0
- data/lib/rack/client/middleware/cache/response.rbc +1540 -0
- data/lib/rack/client/{cache → middleware/cache}/storage.rb +0 -0
- data/lib/rack/client/middleware/cache/storage.rbc +1106 -0
- data/lib/rack/client/middleware/cache.rb +19 -0
- data/lib/rack/client/middleware/cache.rbc +528 -0
- data/lib/rack/client/{cookie_jar → middleware/cookie_jar}/context.rb +0 -0
- data/lib/rack/client/middleware/cookie_jar/context.rbc +1576 -0
- data/lib/rack/client/{cookie_jar → middleware/cookie_jar}/cookie.rb +0 -0
- data/lib/rack/client/middleware/cookie_jar/cookie.rbc +2393 -0
- data/lib/rack/client/{cookie_jar → middleware/cookie_jar}/cookiestore.rb +0 -0
- data/lib/rack/client/middleware/cookie_jar/cookiestore.rbc +1209 -0
- data/lib/rack/client/{cookie_jar → middleware/cookie_jar}/options.rb +0 -0
- data/lib/rack/client/middleware/cookie_jar/options.rbc +1305 -0
- data/lib/rack/client/{cookie_jar → middleware/cookie_jar}/request.rb +0 -0
- data/lib/rack/client/middleware/cookie_jar/request.rbc +568 -0
- data/lib/rack/client/{cookie_jar → middleware/cookie_jar}/response.rb +0 -0
- data/lib/rack/client/middleware/cookie_jar/response.rbc +616 -0
- data/lib/rack/client/{cookie_jar → middleware/cookie_jar}/storage.rb +0 -0
- data/lib/rack/client/middleware/cookie_jar/storage.rbc +894 -0
- data/lib/rack/client/middleware/cookie_jar.rb +17 -0
- data/lib/rack/client/middleware/cookie_jar.rbc +471 -0
- data/lib/rack/client/{follow_redirects.rb → middleware/follow_redirects.rb} +0 -0
- data/lib/rack/client/middleware/follow_redirects.rbc +1344 -0
- data/lib/rack/client/middleware.rb +4 -0
- data/lib/rack/client/middleware.rbc +101 -0
- data/lib/rack/client/parser/base.rbc +898 -0
- data/lib/rack/client/parser/body_collection.rbc +1220 -0
- data/lib/rack/client/parser/context.rbc +540 -0
- data/lib/rack/client/parser/request.rbc +631 -0
- data/lib/rack/client/parser/response.rbc +663 -0
- data/lib/rack/client/parser.rbc +484 -0
- data/lib/rack/client/version.rb +1 -1
- data/lib/rack/client/version.rbc +203 -0
- data/lib/rack/client.rb +3 -13
- data/lib/rack/client.rbc +701 -0
- data/spec/core/headers_spec.rb +47 -0
- data/spec/core/headers_spec.rbc +1674 -0
- data/spec/core/response_spec.rb +78 -0
- data/spec/core/response_spec.rbc +2244 -0
- data/spec/handler/em_http_spec.rb +4 -19
- data/spec/handler/em_http_spec.rbc +224 -0
- data/spec/handler/excon_spec.rb +4 -4
- data/spec/handler/excon_spec.rbc +224 -0
- data/spec/handler/net_http_spec.rb +7 -4
- data/spec/handler/net_http_spec.rbc +307 -0
- data/spec/handler/typhoeus_spec.rb +6 -17
- data/spec/handler/typhoeus_spec.rbc +307 -0
- data/spec/helpers/async_helper.rb +31 -0
- data/spec/helpers/async_helper.rbc +843 -0
- data/spec/helpers/em_http_helper.rb +24 -0
- data/spec/helpers/em_http_helper.rbc +663 -0
- data/spec/helpers/excon_helper.rb +13 -0
- data/spec/helpers/excon_helper.rbc +461 -0
- data/spec/helpers/handler_helper.rb +68 -0
- data/spec/helpers/handler_helper.rbc +1769 -0
- data/spec/helpers/net_http_helper.rb +26 -0
- data/spec/helpers/net_http_helper.rbc +806 -0
- data/spec/helpers/sync_helper.rb +9 -0
- data/spec/helpers/sync_helper.rbc +311 -0
- data/spec/helpers/typhoeus_helper.rb +32 -0
- data/spec/helpers/typhoeus_helper.rbc +936 -0
- data/spec/middleware/cache_spec.rb +25 -0
- data/spec/middleware/cache_spec.rbc +712 -0
- data/spec/middleware/cookie_jar_spec.rb +19 -0
- data/spec/middleware/cookie_jar_spec.rbc +614 -0
- data/spec/middleware/etag_spec.rb +10 -0
- data/spec/middleware/etag_spec.rbc +438 -0
- data/spec/middleware/follow_redirects_spec.rb +12 -0
- data/spec/middleware/follow_redirects_spec.rbc +402 -0
- data/spec/middleware/lint_spec.rb +10 -0
- data/spec/middleware/lint_spec.rbc +392 -0
- data/spec/shared/handler_api.rb +33 -0
- data/spec/shared/handler_api.rbc +1340 -0
- data/spec/shared/streamed_response_api.rb +14 -0
- data/spec/shared/streamed_response_api.rbc +508 -0
- data/spec/spec_apps/cache.ru +14 -0
- data/spec/spec_apps/cookie.ru +12 -0
- data/spec/spec_apps/delete.ru +10 -0
- data/spec/spec_apps/get.ru +13 -0
- data/spec/spec_apps/head.ru +10 -0
- data/spec/spec_apps/hello_world.ru +1 -0
- data/spec/spec_apps/redirect.ru +13 -0
- data/spec/spec_apps/stream.ru +9 -0
- data/spec/spec_config.ru +10 -0
- data/spec/spec_helper.rb +14 -12
- metadata +190 -64
- data/lib/rack/client/cache.rb +0 -19
- data/lib/rack/client/cookie_jar.rb +0 -17
- data/lib/rack/client/response.rb +0 -9
- data/spec/apps/example.org.ru +0 -128
- data/spec/auth/basic_spec.rb +0 -69
- data/spec/auth/digest/md5_spec.rb +0 -69
- data/spec/cache_spec.rb +0 -40
- data/spec/cookie_jar_spec.rb +0 -37
- data/spec/endpoint_spec.rb +0 -30
- data/spec/follow_redirect_spec.rb +0 -27
- data/spec/handler/async_api_spec.rb +0 -69
- data/spec/handler/sync_api_spec.rb +0 -55
- data/spec/middleware_helper.rb +0 -37
- data/spec/middleware_spec.rb +0 -53
- data/spec/parser/json_spec.rb +0 -22
- data/spec/parser/yaml_spec.rb +0 -22
- data/spec/server_helper.rb +0 -72
@@ -0,0 +1,438 @@
|
|
1
|
+
!RBIX
|
2
|
+
0
|
3
|
+
x
|
4
|
+
M
|
5
|
+
1
|
6
|
+
n
|
7
|
+
n
|
8
|
+
x
|
9
|
+
10
|
10
|
+
__script__
|
11
|
+
i
|
12
|
+
24
|
13
|
+
5
|
14
|
+
7
|
15
|
+
0
|
16
|
+
64
|
17
|
+
47
|
18
|
+
49
|
19
|
+
1
|
20
|
+
1
|
21
|
+
15
|
22
|
+
5
|
23
|
+
45
|
24
|
+
2
|
25
|
+
3
|
26
|
+
43
|
27
|
+
4
|
28
|
+
56
|
29
|
+
5
|
30
|
+
47
|
31
|
+
50
|
32
|
+
6
|
33
|
+
1
|
34
|
+
15
|
35
|
+
2
|
36
|
+
11
|
37
|
+
I
|
38
|
+
3
|
39
|
+
I
|
40
|
+
0
|
41
|
+
I
|
42
|
+
0
|
43
|
+
I
|
44
|
+
0
|
45
|
+
n
|
46
|
+
p
|
47
|
+
7
|
48
|
+
s
|
49
|
+
11
|
50
|
+
spec_helper
|
51
|
+
x
|
52
|
+
7
|
53
|
+
require
|
54
|
+
x
|
55
|
+
4
|
56
|
+
Rack
|
57
|
+
n
|
58
|
+
x
|
59
|
+
4
|
60
|
+
ETag
|
61
|
+
M
|
62
|
+
1
|
63
|
+
p
|
64
|
+
2
|
65
|
+
x
|
66
|
+
9
|
67
|
+
for_block
|
68
|
+
t
|
69
|
+
n
|
70
|
+
x
|
71
|
+
9
|
72
|
+
__block__
|
73
|
+
i
|
74
|
+
13
|
75
|
+
5
|
76
|
+
45
|
77
|
+
0
|
78
|
+
1
|
79
|
+
43
|
80
|
+
2
|
81
|
+
56
|
82
|
+
3
|
83
|
+
47
|
84
|
+
50
|
85
|
+
4
|
86
|
+
1
|
87
|
+
11
|
88
|
+
I
|
89
|
+
4
|
90
|
+
I
|
91
|
+
0
|
92
|
+
I
|
93
|
+
0
|
94
|
+
I
|
95
|
+
0
|
96
|
+
I
|
97
|
+
-2
|
98
|
+
p
|
99
|
+
5
|
100
|
+
x
|
101
|
+
4
|
102
|
+
Rack
|
103
|
+
n
|
104
|
+
x
|
105
|
+
4
|
106
|
+
ETag
|
107
|
+
M
|
108
|
+
1
|
109
|
+
p
|
110
|
+
2
|
111
|
+
x
|
112
|
+
9
|
113
|
+
for_block
|
114
|
+
t
|
115
|
+
n
|
116
|
+
x
|
117
|
+
9
|
118
|
+
__block__
|
119
|
+
i
|
120
|
+
11
|
121
|
+
5
|
122
|
+
7
|
123
|
+
0
|
124
|
+
64
|
125
|
+
56
|
126
|
+
1
|
127
|
+
47
|
128
|
+
50
|
129
|
+
2
|
130
|
+
1
|
131
|
+
11
|
132
|
+
I
|
133
|
+
4
|
134
|
+
I
|
135
|
+
0
|
136
|
+
I
|
137
|
+
0
|
138
|
+
I
|
139
|
+
0
|
140
|
+
I
|
141
|
+
-2
|
142
|
+
p
|
143
|
+
3
|
144
|
+
s
|
145
|
+
46
|
146
|
+
will work with Rack::ETag right out of the box
|
147
|
+
M
|
148
|
+
1
|
149
|
+
p
|
150
|
+
2
|
151
|
+
x
|
152
|
+
9
|
153
|
+
for_block
|
154
|
+
t
|
155
|
+
n
|
156
|
+
x
|
157
|
+
9
|
158
|
+
__block__
|
159
|
+
i
|
160
|
+
16
|
161
|
+
5
|
162
|
+
56
|
163
|
+
0
|
164
|
+
47
|
165
|
+
50
|
166
|
+
1
|
167
|
+
0
|
168
|
+
15
|
169
|
+
5
|
170
|
+
56
|
171
|
+
2
|
172
|
+
47
|
173
|
+
50
|
174
|
+
3
|
175
|
+
0
|
176
|
+
11
|
177
|
+
I
|
178
|
+
3
|
179
|
+
I
|
180
|
+
0
|
181
|
+
I
|
182
|
+
0
|
183
|
+
I
|
184
|
+
0
|
185
|
+
I
|
186
|
+
-2
|
187
|
+
p
|
188
|
+
4
|
189
|
+
M
|
190
|
+
1
|
191
|
+
p
|
192
|
+
2
|
193
|
+
x
|
194
|
+
9
|
195
|
+
for_block
|
196
|
+
t
|
197
|
+
n
|
198
|
+
x
|
199
|
+
9
|
200
|
+
__block__
|
201
|
+
i
|
202
|
+
9
|
203
|
+
5
|
204
|
+
7
|
205
|
+
0
|
206
|
+
64
|
207
|
+
47
|
208
|
+
49
|
209
|
+
1
|
210
|
+
1
|
211
|
+
11
|
212
|
+
I
|
213
|
+
3
|
214
|
+
I
|
215
|
+
0
|
216
|
+
I
|
217
|
+
0
|
218
|
+
I
|
219
|
+
0
|
220
|
+
I
|
221
|
+
-2
|
222
|
+
p
|
223
|
+
2
|
224
|
+
s
|
225
|
+
12
|
226
|
+
/hello_world
|
227
|
+
x
|
228
|
+
3
|
229
|
+
get
|
230
|
+
p
|
231
|
+
3
|
232
|
+
I
|
233
|
+
0
|
234
|
+
I
|
235
|
+
6
|
236
|
+
I
|
237
|
+
9
|
238
|
+
x
|
239
|
+
56
|
240
|
+
/Users/ben/code/rack-client/spec/middleware/etag_spec.rb
|
241
|
+
p
|
242
|
+
0
|
243
|
+
x
|
244
|
+
7
|
245
|
+
request
|
246
|
+
M
|
247
|
+
1
|
248
|
+
p
|
249
|
+
2
|
250
|
+
x
|
251
|
+
9
|
252
|
+
for_block
|
253
|
+
t
|
254
|
+
n
|
255
|
+
x
|
256
|
+
9
|
257
|
+
__block__
|
258
|
+
i
|
259
|
+
36
|
260
|
+
5
|
261
|
+
48
|
262
|
+
0
|
263
|
+
7
|
264
|
+
1
|
265
|
+
64
|
266
|
+
49
|
267
|
+
2
|
268
|
+
1
|
269
|
+
49
|
270
|
+
3
|
271
|
+
0
|
272
|
+
7
|
273
|
+
4
|
274
|
+
45
|
275
|
+
5
|
276
|
+
6
|
277
|
+
43
|
278
|
+
7
|
279
|
+
5
|
280
|
+
48
|
281
|
+
8
|
282
|
+
49
|
283
|
+
9
|
284
|
+
1
|
285
|
+
47
|
286
|
+
49
|
287
|
+
10
|
288
|
+
0
|
289
|
+
7
|
290
|
+
4
|
291
|
+
63
|
292
|
+
3
|
293
|
+
83
|
294
|
+
11
|
295
|
+
11
|
296
|
+
I
|
297
|
+
5
|
298
|
+
I
|
299
|
+
0
|
300
|
+
I
|
301
|
+
0
|
302
|
+
I
|
303
|
+
0
|
304
|
+
I
|
305
|
+
-2
|
306
|
+
p
|
307
|
+
12
|
308
|
+
x
|
309
|
+
7
|
310
|
+
headers
|
311
|
+
s
|
312
|
+
4
|
313
|
+
ETag
|
314
|
+
x
|
315
|
+
2
|
316
|
+
[]
|
317
|
+
x
|
318
|
+
6
|
319
|
+
should
|
320
|
+
s
|
321
|
+
1
|
322
|
+
"
|
323
|
+
x
|
324
|
+
6
|
325
|
+
Digest
|
326
|
+
n
|
327
|
+
x
|
328
|
+
3
|
329
|
+
MD5
|
330
|
+
x
|
331
|
+
4
|
332
|
+
body
|
333
|
+
x
|
334
|
+
9
|
335
|
+
hexdigest
|
336
|
+
x
|
337
|
+
4
|
338
|
+
to_s
|
339
|
+
x
|
340
|
+
2
|
341
|
+
==
|
342
|
+
p
|
343
|
+
3
|
344
|
+
I
|
345
|
+
0
|
346
|
+
I
|
347
|
+
7
|
348
|
+
I
|
349
|
+
24
|
350
|
+
x
|
351
|
+
56
|
352
|
+
/Users/ben/code/rack-client/spec/middleware/etag_spec.rb
|
353
|
+
p
|
354
|
+
0
|
355
|
+
x
|
356
|
+
8
|
357
|
+
response
|
358
|
+
p
|
359
|
+
7
|
360
|
+
I
|
361
|
+
0
|
362
|
+
I
|
363
|
+
5
|
364
|
+
I
|
365
|
+
0
|
366
|
+
I
|
367
|
+
6
|
368
|
+
I
|
369
|
+
8
|
370
|
+
I
|
371
|
+
7
|
372
|
+
I
|
373
|
+
10
|
374
|
+
x
|
375
|
+
56
|
376
|
+
/Users/ben/code/rack-client/spec/middleware/etag_spec.rb
|
377
|
+
p
|
378
|
+
0
|
379
|
+
x
|
380
|
+
2
|
381
|
+
it
|
382
|
+
p
|
383
|
+
5
|
384
|
+
I
|
385
|
+
0
|
386
|
+
I
|
387
|
+
4
|
388
|
+
I
|
389
|
+
0
|
390
|
+
I
|
391
|
+
5
|
392
|
+
I
|
393
|
+
b
|
394
|
+
x
|
395
|
+
56
|
396
|
+
/Users/ben/code/rack-client/spec/middleware/etag_spec.rb
|
397
|
+
p
|
398
|
+
0
|
399
|
+
x
|
400
|
+
21
|
401
|
+
sync_handler_contexts
|
402
|
+
p
|
403
|
+
5
|
404
|
+
I
|
405
|
+
0
|
406
|
+
I
|
407
|
+
3
|
408
|
+
I
|
409
|
+
0
|
410
|
+
I
|
411
|
+
4
|
412
|
+
I
|
413
|
+
d
|
414
|
+
x
|
415
|
+
56
|
416
|
+
/Users/ben/code/rack-client/spec/middleware/etag_spec.rb
|
417
|
+
p
|
418
|
+
0
|
419
|
+
x
|
420
|
+
8
|
421
|
+
describe
|
422
|
+
p
|
423
|
+
5
|
424
|
+
I
|
425
|
+
0
|
426
|
+
I
|
427
|
+
1
|
428
|
+
I
|
429
|
+
9
|
430
|
+
I
|
431
|
+
3
|
432
|
+
I
|
433
|
+
18
|
434
|
+
x
|
435
|
+
56
|
436
|
+
/Users/ben/code/rack-client/spec/middleware/etag_spec.rb
|
437
|
+
p
|
438
|
+
0
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Rack::Client::FollowRedirects do
|
4
|
+
handler_contexts(Rack::Client::FollowRedirects) do
|
5
|
+
|
6
|
+
it 'will follow a single redirect' do
|
7
|
+
request { get('/redirect/') }
|
8
|
+
response { body.should == 'Redirected' }
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
12
|
+
end
|