wrest 1.0.0.beta2-universal-java-1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,20 @@
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::Translators
12
+ # Maps content types to deserialisers
13
+ CONTENT_TYPES = {
14
+ 'application/xml' => Wrest::Components::Translators::Xml,
15
+ 'text/xml' => Wrest::Components::Translators::Xml,
16
+ 'application/json' => Wrest::Components::Translators::Json,
17
+ 'text/javascript' => Wrest::Components::Translators::Json
18
+ }
19
+ end
20
+ end
@@ -0,0 +1,339 @@
1
+ !RBIX
2
+ 0
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 28
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
+ 2
40
+ 11
41
+ I
42
+ 6
43
+ I
44
+ 0
45
+ I
46
+ 0
47
+ I
48
+ 0
49
+ n
50
+ p
51
+ 5
52
+ x
53
+ 5
54
+ Wrest
55
+ x
56
+ 11
57
+ open_module
58
+ x
59
+ 15
60
+ __module_init__
61
+ M
62
+ 1
63
+ n
64
+ n
65
+ x
66
+ 5
67
+ Wrest
68
+ i
69
+ 30
70
+ 5
71
+ 66
72
+ 99
73
+ 7
74
+ 0
75
+ 45
76
+ 1
77
+ 2
78
+ 49
79
+ 3
80
+ 2
81
+ 13
82
+ 99
83
+ 12
84
+ 7
85
+ 4
86
+ 12
87
+ 7
88
+ 5
89
+ 12
90
+ 65
91
+ 12
92
+ 49
93
+ 6
94
+ 4
95
+ 15
96
+ 49
97
+ 4
98
+ 0
99
+ 11
100
+ I
101
+ 6
102
+ I
103
+ 0
104
+ I
105
+ 0
106
+ I
107
+ 0
108
+ n
109
+ p
110
+ 7
111
+ x
112
+ 11
113
+ Translators
114
+ x
115
+ 10
116
+ Components
117
+ n
118
+ x
119
+ 17
120
+ open_module_under
121
+ x
122
+ 15
123
+ __module_init__
124
+ M
125
+ 1
126
+ n
127
+ n
128
+ x
129
+ 11
130
+ Translators
131
+ i
132
+ 85
133
+ 5
134
+ 66
135
+ 65
136
+ 7
137
+ 0
138
+ 44
139
+ 43
140
+ 1
141
+ 4
142
+ 4
143
+ 49
144
+ 2
145
+ 1
146
+ 13
147
+ 7
148
+ 3
149
+ 64
150
+ 45
151
+ 4
152
+ 5
153
+ 43
154
+ 6
155
+ 43
156
+ 7
157
+ 43
158
+ 8
159
+ 49
160
+ 9
161
+ 2
162
+ 15
163
+ 13
164
+ 7
165
+ 10
166
+ 64
167
+ 45
168
+ 4
169
+ 11
170
+ 43
171
+ 6
172
+ 43
173
+ 7
174
+ 43
175
+ 8
176
+ 49
177
+ 9
178
+ 2
179
+ 15
180
+ 13
181
+ 7
182
+ 12
183
+ 64
184
+ 45
185
+ 4
186
+ 13
187
+ 43
188
+ 6
189
+ 43
190
+ 7
191
+ 43
192
+ 14
193
+ 49
194
+ 9
195
+ 2
196
+ 15
197
+ 13
198
+ 7
199
+ 15
200
+ 64
201
+ 45
202
+ 4
203
+ 16
204
+ 43
205
+ 6
206
+ 43
207
+ 7
208
+ 43
209
+ 14
210
+ 49
211
+ 9
212
+ 2
213
+ 15
214
+ 49
215
+ 17
216
+ 2
217
+ 11
218
+ I
219
+ 6
220
+ I
221
+ 0
222
+ I
223
+ 0
224
+ I
225
+ 0
226
+ n
227
+ p
228
+ 18
229
+ x
230
+ 13
231
+ CONTENT_TYPES
232
+ x
233
+ 4
234
+ Hash
235
+ x
236
+ 16
237
+ new_from_literal
238
+ s
239
+ 15
240
+ application/xml
241
+ x
242
+ 5
243
+ Wrest
244
+ n
245
+ x
246
+ 10
247
+ Components
248
+ x
249
+ 11
250
+ Translators
251
+ x
252
+ 3
253
+ Xml
254
+ x
255
+ 3
256
+ []=
257
+ s
258
+ 8
259
+ text/xml
260
+ n
261
+ s
262
+ 16
263
+ application/json
264
+ n
265
+ x
266
+ 4
267
+ Json
268
+ s
269
+ 15
270
+ text/javascript
271
+ n
272
+ x
273
+ 9
274
+ const_set
275
+ p
276
+ 13
277
+ I
278
+ 2
279
+ I
280
+ d
281
+ I
282
+ 5
283
+ I
284
+ 12
285
+ I
286
+ e
287
+ I
288
+ e
289
+ I
290
+ 1f
291
+ I
292
+ f
293
+ I
294
+ 30
295
+ I
296
+ 10
297
+ I
298
+ 41
299
+ I
300
+ 11
301
+ I
302
+ 55
303
+ x
304
+ 72
305
+ /Users/sidu/Work/wrest/lib/wrest/components/translators/content_types.rb
306
+ p
307
+ 0
308
+ x
309
+ 13
310
+ attach_method
311
+ p
312
+ 3
313
+ I
314
+ 2
315
+ I
316
+ b
317
+ I
318
+ 1e
319
+ x
320
+ 72
321
+ /Users/sidu/Work/wrest/lib/wrest/components/translators/content_types.rb
322
+ p
323
+ 0
324
+ x
325
+ 13
326
+ attach_method
327
+ p
328
+ 3
329
+ I
330
+ 0
331
+ I
332
+ a
333
+ I
334
+ 1c
335
+ x
336
+ 72
337
+ /Users/sidu/Work/wrest/lib/wrest/components/translators/content_types.rb
338
+ p
339
+ 0
@@ -0,0 +1,25 @@
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
+
11
+ module Wrest
12
+ module Components
13
+ module Translators::Json
14
+ extend self
15
+
16
+ def deserialise(response)
17
+ ActiveSupport::JSON.decode(response.body)
18
+ end
19
+
20
+ def serialise(hash, options = {})
21
+ hash.to_json(options)
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,462 @@
1
+ !RBIX
2
+ 0
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 28
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
+ 2
40
+ 11
41
+ I
42
+ 6
43
+ I
44
+ 0
45
+ I
46
+ 0
47
+ I
48
+ 0
49
+ n
50
+ p
51
+ 5
52
+ x
53
+ 5
54
+ Wrest
55
+ x
56
+ 11
57
+ open_module
58
+ x
59
+ 15
60
+ __module_init__
61
+ M
62
+ 1
63
+ n
64
+ n
65
+ x
66
+ 5
67
+ Wrest
68
+ i
69
+ 28
70
+ 5
71
+ 66
72
+ 99
73
+ 7
74
+ 0
75
+ 65
76
+ 49
77
+ 1
78
+ 2
79
+ 13
80
+ 99
81
+ 12
82
+ 7
83
+ 2
84
+ 12
85
+ 7
86
+ 3
87
+ 12
88
+ 65
89
+ 12
90
+ 49
91
+ 4
92
+ 4
93
+ 15
94
+ 49
95
+ 2
96
+ 0
97
+ 11
98
+ I
99
+ 6
100
+ I
101
+ 0
102
+ I
103
+ 0
104
+ I
105
+ 0
106
+ n
107
+ p
108
+ 5
109
+ x
110
+ 10
111
+ Components
112
+ x
113
+ 11
114
+ open_module
115
+ x
116
+ 15
117
+ __module_init__
118
+ M
119
+ 1
120
+ n
121
+ n
122
+ x
123
+ 10
124
+ Components
125
+ i
126
+ 30
127
+ 5
128
+ 66
129
+ 99
130
+ 7
131
+ 0
132
+ 45
133
+ 1
134
+ 2
135
+ 49
136
+ 3
137
+ 2
138
+ 13
139
+ 99
140
+ 12
141
+ 7
142
+ 4
143
+ 12
144
+ 7
145
+ 5
146
+ 12
147
+ 65
148
+ 12
149
+ 49
150
+ 6
151
+ 4
152
+ 15
153
+ 49
154
+ 4
155
+ 0
156
+ 11
157
+ I
158
+ 6
159
+ I
160
+ 0
161
+ I
162
+ 0
163
+ I
164
+ 0
165
+ n
166
+ p
167
+ 7
168
+ x
169
+ 4
170
+ Json
171
+ x
172
+ 11
173
+ Translators
174
+ n
175
+ x
176
+ 17
177
+ open_module_under
178
+ x
179
+ 15
180
+ __module_init__
181
+ M
182
+ 1
183
+ n
184
+ n
185
+ x
186
+ 4
187
+ Json
188
+ i
189
+ 37
190
+ 5
191
+ 66
192
+ 5
193
+ 5
194
+ 47
195
+ 49
196
+ 0
197
+ 1
198
+ 15
199
+ 99
200
+ 7
201
+ 1
202
+ 7
203
+ 2
204
+ 65
205
+ 67
206
+ 49
207
+ 3
208
+ 0
209
+ 49
210
+ 4
211
+ 4
212
+ 15
213
+ 99
214
+ 7
215
+ 5
216
+ 7
217
+ 6
218
+ 65
219
+ 67
220
+ 49
221
+ 3
222
+ 0
223
+ 49
224
+ 4
225
+ 4
226
+ 11
227
+ I
228
+ 5
229
+ I
230
+ 0
231
+ I
232
+ 0
233
+ I
234
+ 0
235
+ n
236
+ p
237
+ 7
238
+ x
239
+ 6
240
+ extend
241
+ x
242
+ 11
243
+ deserialise
244
+ M
245
+ 1
246
+ n
247
+ n
248
+ x
249
+ 11
250
+ deserialise
251
+ i
252
+ 14
253
+ 45
254
+ 0
255
+ 1
256
+ 43
257
+ 2
258
+ 20
259
+ 0
260
+ 49
261
+ 3
262
+ 0
263
+ 49
264
+ 4
265
+ 1
266
+ 11
267
+ I
268
+ 3
269
+ I
270
+ 1
271
+ I
272
+ 1
273
+ I
274
+ 1
275
+ n
276
+ p
277
+ 5
278
+ x
279
+ 13
280
+ ActiveSupport
281
+ n
282
+ x
283
+ 4
284
+ JSON
285
+ x
286
+ 4
287
+ body
288
+ x
289
+ 6
290
+ decode
291
+ p
292
+ 5
293
+ I
294
+ 0
295
+ I
296
+ 10
297
+ I
298
+ 0
299
+ I
300
+ 11
301
+ I
302
+ e
303
+ x
304
+ 63
305
+ /Users/sidu/Work/wrest/lib/wrest/components/translators/json.rb
306
+ p
307
+ 1
308
+ x
309
+ 8
310
+ response
311
+ x
312
+ 17
313
+ method_visibility
314
+ x
315
+ 15
316
+ add_defn_method
317
+ x
318
+ 9
319
+ serialise
320
+ M
321
+ 1
322
+ n
323
+ n
324
+ x
325
+ 9
326
+ serialise
327
+ i
328
+ 22
329
+ 23
330
+ 1
331
+ 10
332
+ 14
333
+ 44
334
+ 43
335
+ 0
336
+ 78
337
+ 49
338
+ 1
339
+ 1
340
+ 19
341
+ 1
342
+ 15
343
+ 20
344
+ 0
345
+ 20
346
+ 1
347
+ 49
348
+ 2
349
+ 1
350
+ 11
351
+ I
352
+ 4
353
+ I
354
+ 2
355
+ I
356
+ 1
357
+ I
358
+ 2
359
+ n
360
+ p
361
+ 3
362
+ x
363
+ 4
364
+ Hash
365
+ x
366
+ 16
367
+ new_from_literal
368
+ x
369
+ 7
370
+ to_json
371
+ p
372
+ 5
373
+ I
374
+ 0
375
+ I
376
+ 14
377
+ I
378
+ e
379
+ I
380
+ 15
381
+ I
382
+ 16
383
+ x
384
+ 63
385
+ /Users/sidu/Work/wrest/lib/wrest/components/translators/json.rb
386
+ p
387
+ 2
388
+ x
389
+ 4
390
+ hash
391
+ x
392
+ 7
393
+ options
394
+ p
395
+ 7
396
+ I
397
+ 2
398
+ I
399
+ e
400
+ I
401
+ 9
402
+ I
403
+ 10
404
+ I
405
+ 17
406
+ I
407
+ 14
408
+ I
409
+ 25
410
+ x
411
+ 63
412
+ /Users/sidu/Work/wrest/lib/wrest/components/translators/json.rb
413
+ p
414
+ 0
415
+ x
416
+ 13
417
+ attach_method
418
+ p
419
+ 3
420
+ I
421
+ 2
422
+ I
423
+ d
424
+ I
425
+ 1e
426
+ x
427
+ 63
428
+ /Users/sidu/Work/wrest/lib/wrest/components/translators/json.rb
429
+ p
430
+ 0
431
+ x
432
+ 13
433
+ attach_method
434
+ p
435
+ 3
436
+ I
437
+ 2
438
+ I
439
+ c
440
+ I
441
+ 1c
442
+ x
443
+ 63
444
+ /Users/sidu/Work/wrest/lib/wrest/components/translators/json.rb
445
+ p
446
+ 0
447
+ x
448
+ 13
449
+ attach_method
450
+ p
451
+ 3
452
+ I
453
+ 0
454
+ I
455
+ b
456
+ I
457
+ 1c
458
+ x
459
+ 63
460
+ /Users/sidu/Work/wrest/lib/wrest/components/translators/json.rb
461
+ p
462
+ 0