wrest 1.0.0.beta2-universal-java-1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. data/CHANGELOG +59 -0
  2. data/LICENCE +7 -0
  3. data/README.rdoc +127 -0
  4. data/bin/wrest +3 -0
  5. data/bin/wrest_shell.rb +21 -0
  6. data/lib/wrest.rb +101 -0
  7. data/lib/wrest.rbc +1900 -0
  8. data/lib/wrest/components.rb +20 -0
  9. data/lib/wrest/components.rbc +217 -0
  10. data/lib/wrest/components/container.rb +185 -0
  11. data/lib/wrest/components/container.rbc +2466 -0
  12. data/lib/wrest/components/container/alias_accessors.rb +66 -0
  13. data/lib/wrest/components/container/alias_accessors.rbc +905 -0
  14. data/lib/wrest/components/container/typecaster.rb +127 -0
  15. data/lib/wrest/components/container/typecaster.rbc +1985 -0
  16. data/lib/wrest/components/mutators.rb +39 -0
  17. data/lib/wrest/components/mutators.rbc +650 -0
  18. data/lib/wrest/components/mutators/base.rb +56 -0
  19. data/lib/wrest/components/mutators/base.rbc +702 -0
  20. data/lib/wrest/components/mutators/camel_to_snake_case.rb +22 -0
  21. data/lib/wrest/components/mutators/camel_to_snake_case.rbc +360 -0
  22. data/lib/wrest/components/mutators/xml_mini_type_caster.rb +43 -0
  23. data/lib/wrest/components/mutators/xml_mini_type_caster.rbc +679 -0
  24. data/lib/wrest/components/mutators/xml_simple_type_caster.rb +37 -0
  25. data/lib/wrest/components/mutators/xml_simple_type_caster.rbc +559 -0
  26. data/lib/wrest/components/translators.rb +28 -0
  27. data/lib/wrest/components/translators.rbc +517 -0
  28. data/lib/wrest/components/translators/content_types.rb +20 -0
  29. data/lib/wrest/components/translators/content_types.rbc +339 -0
  30. data/lib/wrest/components/translators/json.rb +25 -0
  31. data/lib/wrest/components/translators/json.rbc +462 -0
  32. data/lib/wrest/components/translators/xml.rb +24 -0
  33. data/lib/wrest/components/translators/xml.rbc +457 -0
  34. data/lib/wrest/core_ext/hash.rb +5 -0
  35. data/lib/wrest/core_ext/hash.rbc +182 -0
  36. data/lib/wrest/core_ext/hash/conversions.rb +44 -0
  37. data/lib/wrest/core_ext/hash/conversions.rbc +501 -0
  38. data/lib/wrest/core_ext/string.rb +5 -0
  39. data/lib/wrest/core_ext/string.rbc +182 -0
  40. data/lib/wrest/core_ext/string/conversions.rb +23 -0
  41. data/lib/wrest/core_ext/string/conversions.rbc +471 -0
  42. data/lib/wrest/curl.rb +49 -0
  43. data/lib/wrest/curl.rbc +704 -0
  44. data/lib/wrest/curl/delete.rb +23 -0
  45. data/lib/wrest/curl/get.rb +23 -0
  46. data/lib/wrest/curl/options.rb +16 -0
  47. data/lib/wrest/curl/post.rb +23 -0
  48. data/lib/wrest/curl/put.rb +23 -0
  49. data/lib/wrest/curl/request.rb +97 -0
  50. data/lib/wrest/curl/response.rb +71 -0
  51. data/lib/wrest/curl/session.rb +57 -0
  52. data/lib/wrest/exceptions.rb +33 -0
  53. data/lib/wrest/exceptions.rbc +312 -0
  54. data/lib/wrest/http_shared.rb +23 -0
  55. data/lib/wrest/http_shared.rbc +279 -0
  56. data/lib/wrest/http_shared/headers.rb +343 -0
  57. data/lib/wrest/http_shared/headers.rbc +353 -0
  58. data/lib/wrest/http_shared/standard_headers.rb +21 -0
  59. data/lib/wrest/http_shared/standard_headers.rbc +336 -0
  60. data/lib/wrest/http_shared/standard_tokens.rb +18 -0
  61. data/lib/wrest/http_shared/standard_tokens.rbc +316 -0
  62. data/lib/wrest/multipart.rb +52 -0
  63. data/lib/wrest/native.rb +33 -0
  64. data/lib/wrest/native.rbc +513 -0
  65. data/lib/wrest/native/connection_factory.rb +23 -0
  66. data/lib/wrest/native/connection_factory.rbc +445 -0
  67. data/lib/wrest/native/delete.rb +23 -0
  68. data/lib/wrest/native/delete.rbc +371 -0
  69. data/lib/wrest/native/get.rb +51 -0
  70. data/lib/wrest/native/get.rbc +855 -0
  71. data/lib/wrest/native/options.rb +23 -0
  72. data/lib/wrest/native/options.rbc +347 -0
  73. data/lib/wrest/native/post.rb +23 -0
  74. data/lib/wrest/native/post.rbc +388 -0
  75. data/lib/wrest/native/post_multipart.rb +32 -0
  76. data/lib/wrest/native/put.rb +23 -0
  77. data/lib/wrest/native/put.rbc +388 -0
  78. data/lib/wrest/native/put_multipart.rb +32 -0
  79. data/lib/wrest/native/redirection.rb +38 -0
  80. data/lib/wrest/native/redirection.rbc +520 -0
  81. data/lib/wrest/native/request.rb +94 -0
  82. data/lib/wrest/native/request.rbc +1675 -0
  83. data/lib/wrest/native/response.rb +120 -0
  84. data/lib/wrest/native/response.rbc +2150 -0
  85. data/lib/wrest/native/session.rb +57 -0
  86. data/lib/wrest/native/session.rbc +1372 -0
  87. data/lib/wrest/resource.rb +18 -0
  88. data/lib/wrest/resource.rbc +163 -0
  89. data/lib/wrest/resource/base.rb +99 -0
  90. data/lib/wrest/resource/base.rbc +2115 -0
  91. data/lib/wrest/resource/collection.rb +12 -0
  92. data/lib/wrest/resource/state.rb +6 -0
  93. data/lib/wrest/test.rb +1 -0
  94. data/lib/wrest/test/request_patches.rb +5 -0
  95. data/lib/wrest/uri.rb +160 -0
  96. data/lib/wrest/uri.rbc +2599 -0
  97. data/lib/wrest/uri_template.rb +49 -0
  98. data/lib/wrest/uri_template.rbc +505 -0
  99. data/lib/wrest/version.rb +23 -0
  100. data/lib/wrest/version.rbc +372 -0
  101. metadata +231 -0
@@ -0,0 +1,39 @@
1
+ # Copyright 2009 Sidu Ponnappa
2
+
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ # Unless required by applicable law or agreed to in writing, software distributed under the License
7
+ # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8
+ # See the License for the specific language governing permissions and limitations under the License.
9
+
10
+ module Wrest
11
+ module Components
12
+ # A mutator understands how to transform
13
+ # one tuple(key/value pair) from a hash
14
+ # into another
15
+ module Mutators
16
+ # All sublasses of Mutators::Base are automatically
17
+ # registered here by underscored, symbolised class name.
18
+ REGISTRY = {}
19
+
20
+ # Makes referencing and chaining mutators easy.
21
+ #
22
+ # Example:
23
+ # Mutators.chain(:xml_mini_type_caster, :camel_to_snake_case)
24
+ # is equivalent to
25
+ # Wrest::Components::Mutators::XmlMiniTypeCaster.new(Wrest::Components::Mutators::CamelToSnakeCase.new)
26
+ def self.chain(*mutator_keys)
27
+ mutator_key = mutator_keys.pop
28
+ mutator_keys.reverse.inject(REGISTRY[mutator_key].new) do |next_instance, next_key|
29
+ REGISTRY[next_key].new(next_instance)
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+
36
+ require "#{Wrest::Root}/wrest/components/mutators/base"
37
+ require "#{Wrest::Root}/wrest/components/mutators/xml_simple_type_caster"
38
+ require "#{Wrest::Root}/wrest/components/mutators/xml_mini_type_caster"
39
+ require "#{Wrest::Root}/wrest/components/mutators/camel_to_snake_case"
@@ -0,0 +1,650 @@
1
+ !RBIX
2
+ 0
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 104
13
+ 99
14
+ 7
15
+ 0
16
+ 65
17
+ 49
18
+ 1
19
+ 2
20
+ 13
21
+ 99
22
+ 12
23
+ 7
24
+ 2
25
+ 12
26
+ 7
27
+ 3
28
+ 12
29
+ 65
30
+ 12
31
+ 49
32
+ 4
33
+ 4
34
+ 15
35
+ 49
36
+ 2
37
+ 0
38
+ 15
39
+ 5
40
+ 45
41
+ 0
42
+ 5
43
+ 43
44
+ 6
45
+ 47
46
+ 49
47
+ 7
48
+ 0
49
+ 7
50
+ 8
51
+ 63
52
+ 2
53
+ 47
54
+ 49
55
+ 9
56
+ 1
57
+ 15
58
+ 5
59
+ 45
60
+ 0
61
+ 10
62
+ 43
63
+ 6
64
+ 47
65
+ 49
66
+ 7
67
+ 0
68
+ 7
69
+ 11
70
+ 63
71
+ 2
72
+ 47
73
+ 49
74
+ 9
75
+ 1
76
+ 15
77
+ 5
78
+ 45
79
+ 0
80
+ 12
81
+ 43
82
+ 6
83
+ 47
84
+ 49
85
+ 7
86
+ 0
87
+ 7
88
+ 13
89
+ 63
90
+ 2
91
+ 47
92
+ 49
93
+ 9
94
+ 1
95
+ 15
96
+ 5
97
+ 45
98
+ 0
99
+ 14
100
+ 43
101
+ 6
102
+ 47
103
+ 49
104
+ 7
105
+ 0
106
+ 7
107
+ 15
108
+ 63
109
+ 2
110
+ 47
111
+ 49
112
+ 9
113
+ 1
114
+ 15
115
+ 2
116
+ 11
117
+ I
118
+ 6
119
+ I
120
+ 0
121
+ I
122
+ 0
123
+ I
124
+ 0
125
+ n
126
+ p
127
+ 16
128
+ x
129
+ 5
130
+ Wrest
131
+ x
132
+ 11
133
+ open_module
134
+ x
135
+ 15
136
+ __module_init__
137
+ M
138
+ 1
139
+ n
140
+ n
141
+ x
142
+ 5
143
+ Wrest
144
+ i
145
+ 28
146
+ 5
147
+ 66
148
+ 99
149
+ 7
150
+ 0
151
+ 65
152
+ 49
153
+ 1
154
+ 2
155
+ 13
156
+ 99
157
+ 12
158
+ 7
159
+ 2
160
+ 12
161
+ 7
162
+ 3
163
+ 12
164
+ 65
165
+ 12
166
+ 49
167
+ 4
168
+ 4
169
+ 15
170
+ 49
171
+ 2
172
+ 0
173
+ 11
174
+ I
175
+ 6
176
+ I
177
+ 0
178
+ I
179
+ 0
180
+ I
181
+ 0
182
+ n
183
+ p
184
+ 5
185
+ x
186
+ 10
187
+ Components
188
+ x
189
+ 11
190
+ open_module
191
+ x
192
+ 15
193
+ __module_init__
194
+ M
195
+ 1
196
+ n
197
+ n
198
+ x
199
+ 10
200
+ Components
201
+ i
202
+ 28
203
+ 5
204
+ 66
205
+ 99
206
+ 7
207
+ 0
208
+ 65
209
+ 49
210
+ 1
211
+ 2
212
+ 13
213
+ 99
214
+ 12
215
+ 7
216
+ 2
217
+ 12
218
+ 7
219
+ 3
220
+ 12
221
+ 65
222
+ 12
223
+ 49
224
+ 4
225
+ 4
226
+ 15
227
+ 49
228
+ 2
229
+ 0
230
+ 11
231
+ I
232
+ 6
233
+ I
234
+ 0
235
+ I
236
+ 0
237
+ I
238
+ 0
239
+ n
240
+ p
241
+ 5
242
+ x
243
+ 8
244
+ Mutators
245
+ x
246
+ 11
247
+ open_module
248
+ x
249
+ 15
250
+ __module_init__
251
+ M
252
+ 1
253
+ n
254
+ n
255
+ x
256
+ 8
257
+ Mutators
258
+ i
259
+ 27
260
+ 5
261
+ 66
262
+ 65
263
+ 7
264
+ 0
265
+ 44
266
+ 43
267
+ 1
268
+ 78
269
+ 49
270
+ 2
271
+ 1
272
+ 49
273
+ 3
274
+ 2
275
+ 15
276
+ 99
277
+ 7
278
+ 4
279
+ 7
280
+ 5
281
+ 65
282
+ 5
283
+ 49
284
+ 6
285
+ 4
286
+ 11
287
+ I
288
+ 5
289
+ I
290
+ 0
291
+ I
292
+ 0
293
+ I
294
+ 0
295
+ n
296
+ p
297
+ 7
298
+ x
299
+ 8
300
+ REGISTRY
301
+ x
302
+ 4
303
+ Hash
304
+ x
305
+ 16
306
+ new_from_literal
307
+ x
308
+ 9
309
+ const_set
310
+ x
311
+ 5
312
+ chain
313
+ M
314
+ 1
315
+ n
316
+ n
317
+ x
318
+ 5
319
+ chain
320
+ i
321
+ 48
322
+ 20
323
+ 0
324
+ 49
325
+ 0
326
+ 0
327
+ 19
328
+ 1
329
+ 15
330
+ 20
331
+ 0
332
+ 49
333
+ 1
334
+ 0
335
+ 45
336
+ 2
337
+ 3
338
+ 20
339
+ 1
340
+ 49
341
+ 4
342
+ 1
343
+ 13
344
+ 71
345
+ 5
346
+ 47
347
+ 9
348
+ 39
349
+ 47
350
+ 49
351
+ 6
352
+ 0
353
+ 13
354
+ 47
355
+ 49
356
+ 7
357
+ 0
358
+ 15
359
+ 8
360
+ 42
361
+ 49
362
+ 5
363
+ 0
364
+ 56
365
+ 8
366
+ 50
367
+ 9
368
+ 1
369
+ 11
370
+ I
371
+ 5
372
+ I
373
+ 2
374
+ I
375
+ 0
376
+ I
377
+ 0
378
+ I
379
+ 0
380
+ p
381
+ 10
382
+ x
383
+ 3
384
+ pop
385
+ x
386
+ 7
387
+ reverse
388
+ x
389
+ 8
390
+ REGISTRY
391
+ n
392
+ x
393
+ 2
394
+ []
395
+ x
396
+ 3
397
+ new
398
+ x
399
+ 8
400
+ allocate
401
+ x
402
+ 10
403
+ initialize
404
+ M
405
+ 1
406
+ p
407
+ 2
408
+ x
409
+ 9
410
+ for_block
411
+ t
412
+ n
413
+ x
414
+ 5
415
+ chain
416
+ i
417
+ 44
418
+ 58
419
+ 37
420
+ 19
421
+ 0
422
+ 15
423
+ 37
424
+ 19
425
+ 1
426
+ 15
427
+ 15
428
+ 45
429
+ 0
430
+ 1
431
+ 20
432
+ 1
433
+ 49
434
+ 2
435
+ 1
436
+ 13
437
+ 71
438
+ 3
439
+ 47
440
+ 9
441
+ 38
442
+ 47
443
+ 49
444
+ 4
445
+ 0
446
+ 13
447
+ 20
448
+ 0
449
+ 47
450
+ 49
451
+ 5
452
+ 1
453
+ 15
454
+ 8
455
+ 43
456
+ 20
457
+ 0
458
+ 49
459
+ 3
460
+ 1
461
+ 11
462
+ I
463
+ 6
464
+ I
465
+ 2
466
+ I
467
+ 2
468
+ I
469
+ 2
470
+ n
471
+ p
472
+ 6
473
+ x
474
+ 8
475
+ REGISTRY
476
+ n
477
+ x
478
+ 2
479
+ []
480
+ x
481
+ 3
482
+ new
483
+ x
484
+ 8
485
+ allocate
486
+ x
487
+ 10
488
+ initialize
489
+ p
490
+ 5
491
+ I
492
+ 0
493
+ I
494
+ 1c
495
+ I
496
+ a
497
+ I
498
+ 1d
499
+ I
500
+ 2c
501
+ x
502
+ 55
503
+ /Users/sidu/Work/wrest/lib/wrest/components/mutators.rb
504
+ p
505
+ 2
506
+ x
507
+ 13
508
+ next_instance
509
+ x
510
+ 8
511
+ next_key
512
+ x
513
+ 6
514
+ inject
515
+ p
516
+ 7
517
+ I
518
+ 0
519
+ I
520
+ 1a
521
+ I
522
+ 0
523
+ I
524
+ 1b
525
+ I
526
+ 8
527
+ I
528
+ 1c
529
+ I
530
+ 30
531
+ x
532
+ 55
533
+ /Users/sidu/Work/wrest/lib/wrest/components/mutators.rb
534
+ p
535
+ 2
536
+ x
537
+ 12
538
+ mutator_keys
539
+ x
540
+ 11
541
+ mutator_key
542
+ x
543
+ 13
544
+ attach_method
545
+ p
546
+ 5
547
+ I
548
+ 2
549
+ I
550
+ 12
551
+ I
552
+ 10
553
+ I
554
+ 1a
555
+ I
556
+ 1b
557
+ x
558
+ 55
559
+ /Users/sidu/Work/wrest/lib/wrest/components/mutators.rb
560
+ p
561
+ 0
562
+ x
563
+ 13
564
+ attach_method
565
+ p
566
+ 3
567
+ I
568
+ 2
569
+ I
570
+ f
571
+ I
572
+ 1c
573
+ x
574
+ 55
575
+ /Users/sidu/Work/wrest/lib/wrest/components/mutators.rb
576
+ p
577
+ 0
578
+ x
579
+ 13
580
+ attach_method
581
+ p
582
+ 3
583
+ I
584
+ 2
585
+ I
586
+ b
587
+ I
588
+ 1c
589
+ x
590
+ 55
591
+ /Users/sidu/Work/wrest/lib/wrest/components/mutators.rb
592
+ p
593
+ 0
594
+ x
595
+ 13
596
+ attach_method
597
+ n
598
+ x
599
+ 4
600
+ Root
601
+ x
602
+ 4
603
+ to_s
604
+ s
605
+ 31
606
+ /wrest/components/mutators/base
607
+ x
608
+ 7
609
+ require
610
+ n
611
+ s
612
+ 49
613
+ /wrest/components/mutators/xml_simple_type_caster
614
+ n
615
+ s
616
+ 47
617
+ /wrest/components/mutators/xml_mini_type_caster
618
+ n
619
+ s
620
+ 46
621
+ /wrest/components/mutators/camel_to_snake_case
622
+ p
623
+ 11
624
+ I
625
+ 0
626
+ I
627
+ a
628
+ I
629
+ 1a
630
+ I
631
+ 24
632
+ I
633
+ 2d
634
+ I
635
+ 25
636
+ I
637
+ 40
638
+ I
639
+ 26
640
+ I
641
+ 53
642
+ I
643
+ 27
644
+ I
645
+ 68
646
+ x
647
+ 55
648
+ /Users/sidu/Work/wrest/lib/wrest/components/mutators.rb
649
+ p
650
+ 0