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.
- data/CHANGELOG +59 -0
- data/LICENCE +7 -0
- data/README.rdoc +127 -0
- data/bin/wrest +3 -0
- data/bin/wrest_shell.rb +21 -0
- data/lib/wrest.rb +101 -0
- data/lib/wrest.rbc +1900 -0
- data/lib/wrest/components.rb +20 -0
- data/lib/wrest/components.rbc +217 -0
- data/lib/wrest/components/container.rb +185 -0
- data/lib/wrest/components/container.rbc +2466 -0
- data/lib/wrest/components/container/alias_accessors.rb +66 -0
- data/lib/wrest/components/container/alias_accessors.rbc +905 -0
- data/lib/wrest/components/container/typecaster.rb +127 -0
- data/lib/wrest/components/container/typecaster.rbc +1985 -0
- data/lib/wrest/components/mutators.rb +39 -0
- data/lib/wrest/components/mutators.rbc +650 -0
- data/lib/wrest/components/mutators/base.rb +56 -0
- data/lib/wrest/components/mutators/base.rbc +702 -0
- data/lib/wrest/components/mutators/camel_to_snake_case.rb +22 -0
- data/lib/wrest/components/mutators/camel_to_snake_case.rbc +360 -0
- data/lib/wrest/components/mutators/xml_mini_type_caster.rb +43 -0
- data/lib/wrest/components/mutators/xml_mini_type_caster.rbc +679 -0
- data/lib/wrest/components/mutators/xml_simple_type_caster.rb +37 -0
- data/lib/wrest/components/mutators/xml_simple_type_caster.rbc +559 -0
- data/lib/wrest/components/translators.rb +28 -0
- data/lib/wrest/components/translators.rbc +517 -0
- data/lib/wrest/components/translators/content_types.rb +20 -0
- data/lib/wrest/components/translators/content_types.rbc +339 -0
- data/lib/wrest/components/translators/json.rb +25 -0
- data/lib/wrest/components/translators/json.rbc +462 -0
- data/lib/wrest/components/translators/xml.rb +24 -0
- data/lib/wrest/components/translators/xml.rbc +457 -0
- data/lib/wrest/core_ext/hash.rb +5 -0
- data/lib/wrest/core_ext/hash.rbc +182 -0
- data/lib/wrest/core_ext/hash/conversions.rb +44 -0
- data/lib/wrest/core_ext/hash/conversions.rbc +501 -0
- data/lib/wrest/core_ext/string.rb +5 -0
- data/lib/wrest/core_ext/string.rbc +182 -0
- data/lib/wrest/core_ext/string/conversions.rb +23 -0
- data/lib/wrest/core_ext/string/conversions.rbc +471 -0
- data/lib/wrest/curl.rb +49 -0
- data/lib/wrest/curl.rbc +704 -0
- data/lib/wrest/curl/delete.rb +23 -0
- data/lib/wrest/curl/get.rb +23 -0
- data/lib/wrest/curl/options.rb +16 -0
- data/lib/wrest/curl/post.rb +23 -0
- data/lib/wrest/curl/put.rb +23 -0
- data/lib/wrest/curl/request.rb +97 -0
- data/lib/wrest/curl/response.rb +71 -0
- data/lib/wrest/curl/session.rb +57 -0
- data/lib/wrest/exceptions.rb +33 -0
- data/lib/wrest/exceptions.rbc +312 -0
- data/lib/wrest/http_shared.rb +23 -0
- data/lib/wrest/http_shared.rbc +279 -0
- data/lib/wrest/http_shared/headers.rb +343 -0
- data/lib/wrest/http_shared/headers.rbc +353 -0
- data/lib/wrest/http_shared/standard_headers.rb +21 -0
- data/lib/wrest/http_shared/standard_headers.rbc +336 -0
- data/lib/wrest/http_shared/standard_tokens.rb +18 -0
- data/lib/wrest/http_shared/standard_tokens.rbc +316 -0
- data/lib/wrest/multipart.rb +52 -0
- data/lib/wrest/native.rb +33 -0
- data/lib/wrest/native.rbc +513 -0
- data/lib/wrest/native/connection_factory.rb +23 -0
- data/lib/wrest/native/connection_factory.rbc +445 -0
- data/lib/wrest/native/delete.rb +23 -0
- data/lib/wrest/native/delete.rbc +371 -0
- data/lib/wrest/native/get.rb +51 -0
- data/lib/wrest/native/get.rbc +855 -0
- data/lib/wrest/native/options.rb +23 -0
- data/lib/wrest/native/options.rbc +347 -0
- data/lib/wrest/native/post.rb +23 -0
- data/lib/wrest/native/post.rbc +388 -0
- data/lib/wrest/native/post_multipart.rb +32 -0
- data/lib/wrest/native/put.rb +23 -0
- data/lib/wrest/native/put.rbc +388 -0
- data/lib/wrest/native/put_multipart.rb +32 -0
- data/lib/wrest/native/redirection.rb +38 -0
- data/lib/wrest/native/redirection.rbc +520 -0
- data/lib/wrest/native/request.rb +94 -0
- data/lib/wrest/native/request.rbc +1675 -0
- data/lib/wrest/native/response.rb +120 -0
- data/lib/wrest/native/response.rbc +2150 -0
- data/lib/wrest/native/session.rb +57 -0
- data/lib/wrest/native/session.rbc +1372 -0
- data/lib/wrest/resource.rb +18 -0
- data/lib/wrest/resource.rbc +163 -0
- data/lib/wrest/resource/base.rb +99 -0
- data/lib/wrest/resource/base.rbc +2115 -0
- data/lib/wrest/resource/collection.rb +12 -0
- data/lib/wrest/resource/state.rb +6 -0
- data/lib/wrest/test.rb +1 -0
- data/lib/wrest/test/request_patches.rb +5 -0
- data/lib/wrest/uri.rb +160 -0
- data/lib/wrest/uri.rbc +2599 -0
- data/lib/wrest/uri_template.rb +49 -0
- data/lib/wrest/uri_template.rbc +505 -0
- data/lib/wrest/version.rb +23 -0
- data/lib/wrest/version.rbc +372 -0
- metadata +231 -0
@@ -0,0 +1,24 @@
|
|
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
|
+
module Xml
|
13
|
+
extend self
|
14
|
+
|
15
|
+
def deserialise(response)
|
16
|
+
Hash.from_xml(response.body)
|
17
|
+
end
|
18
|
+
|
19
|
+
def serialise(hash, options = {})
|
20
|
+
hash.to_xml(options)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,457 @@
|
|
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
|
+
28
|
133
|
+
5
|
134
|
+
66
|
135
|
+
99
|
136
|
+
7
|
137
|
+
0
|
138
|
+
65
|
139
|
+
49
|
140
|
+
1
|
141
|
+
2
|
142
|
+
13
|
143
|
+
99
|
144
|
+
12
|
145
|
+
7
|
146
|
+
2
|
147
|
+
12
|
148
|
+
7
|
149
|
+
3
|
150
|
+
12
|
151
|
+
65
|
152
|
+
12
|
153
|
+
49
|
154
|
+
4
|
155
|
+
4
|
156
|
+
15
|
157
|
+
49
|
158
|
+
2
|
159
|
+
0
|
160
|
+
11
|
161
|
+
I
|
162
|
+
6
|
163
|
+
I
|
164
|
+
0
|
165
|
+
I
|
166
|
+
0
|
167
|
+
I
|
168
|
+
0
|
169
|
+
n
|
170
|
+
p
|
171
|
+
5
|
172
|
+
x
|
173
|
+
3
|
174
|
+
Xml
|
175
|
+
x
|
176
|
+
11
|
177
|
+
open_module
|
178
|
+
x
|
179
|
+
15
|
180
|
+
__module_init__
|
181
|
+
M
|
182
|
+
1
|
183
|
+
n
|
184
|
+
n
|
185
|
+
x
|
186
|
+
3
|
187
|
+
Xml
|
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
|
+
12
|
253
|
+
45
|
254
|
+
0
|
255
|
+
1
|
256
|
+
20
|
257
|
+
0
|
258
|
+
49
|
259
|
+
2
|
260
|
+
0
|
261
|
+
49
|
262
|
+
3
|
263
|
+
1
|
264
|
+
11
|
265
|
+
I
|
266
|
+
3
|
267
|
+
I
|
268
|
+
1
|
269
|
+
I
|
270
|
+
1
|
271
|
+
I
|
272
|
+
1
|
273
|
+
n
|
274
|
+
p
|
275
|
+
4
|
276
|
+
x
|
277
|
+
4
|
278
|
+
Hash
|
279
|
+
n
|
280
|
+
x
|
281
|
+
4
|
282
|
+
body
|
283
|
+
x
|
284
|
+
8
|
285
|
+
from_xml
|
286
|
+
p
|
287
|
+
5
|
288
|
+
I
|
289
|
+
0
|
290
|
+
I
|
291
|
+
f
|
292
|
+
I
|
293
|
+
0
|
294
|
+
I
|
295
|
+
10
|
296
|
+
I
|
297
|
+
c
|
298
|
+
x
|
299
|
+
62
|
300
|
+
/Users/sidu/Work/wrest/lib/wrest/components/translators/xml.rb
|
301
|
+
p
|
302
|
+
1
|
303
|
+
x
|
304
|
+
8
|
305
|
+
response
|
306
|
+
x
|
307
|
+
17
|
308
|
+
method_visibility
|
309
|
+
x
|
310
|
+
15
|
311
|
+
add_defn_method
|
312
|
+
x
|
313
|
+
9
|
314
|
+
serialise
|
315
|
+
M
|
316
|
+
1
|
317
|
+
n
|
318
|
+
n
|
319
|
+
x
|
320
|
+
9
|
321
|
+
serialise
|
322
|
+
i
|
323
|
+
22
|
324
|
+
23
|
325
|
+
1
|
326
|
+
10
|
327
|
+
14
|
328
|
+
44
|
329
|
+
43
|
330
|
+
0
|
331
|
+
78
|
332
|
+
49
|
333
|
+
1
|
334
|
+
1
|
335
|
+
19
|
336
|
+
1
|
337
|
+
15
|
338
|
+
20
|
339
|
+
0
|
340
|
+
20
|
341
|
+
1
|
342
|
+
49
|
343
|
+
2
|
344
|
+
1
|
345
|
+
11
|
346
|
+
I
|
347
|
+
4
|
348
|
+
I
|
349
|
+
2
|
350
|
+
I
|
351
|
+
1
|
352
|
+
I
|
353
|
+
2
|
354
|
+
n
|
355
|
+
p
|
356
|
+
3
|
357
|
+
x
|
358
|
+
4
|
359
|
+
Hash
|
360
|
+
x
|
361
|
+
16
|
362
|
+
new_from_literal
|
363
|
+
x
|
364
|
+
6
|
365
|
+
to_xml
|
366
|
+
p
|
367
|
+
5
|
368
|
+
I
|
369
|
+
0
|
370
|
+
I
|
371
|
+
13
|
372
|
+
I
|
373
|
+
e
|
374
|
+
I
|
375
|
+
14
|
376
|
+
I
|
377
|
+
16
|
378
|
+
x
|
379
|
+
62
|
380
|
+
/Users/sidu/Work/wrest/lib/wrest/components/translators/xml.rb
|
381
|
+
p
|
382
|
+
2
|
383
|
+
x
|
384
|
+
4
|
385
|
+
hash
|
386
|
+
x
|
387
|
+
7
|
388
|
+
options
|
389
|
+
p
|
390
|
+
7
|
391
|
+
I
|
392
|
+
2
|
393
|
+
I
|
394
|
+
d
|
395
|
+
I
|
396
|
+
9
|
397
|
+
I
|
398
|
+
f
|
399
|
+
I
|
400
|
+
17
|
401
|
+
I
|
402
|
+
13
|
403
|
+
I
|
404
|
+
25
|
405
|
+
x
|
406
|
+
62
|
407
|
+
/Users/sidu/Work/wrest/lib/wrest/components/translators/xml.rb
|
408
|
+
p
|
409
|
+
0
|
410
|
+
x
|
411
|
+
13
|
412
|
+
attach_method
|
413
|
+
p
|
414
|
+
3
|
415
|
+
I
|
416
|
+
2
|
417
|
+
I
|
418
|
+
c
|
419
|
+
I
|
420
|
+
1c
|
421
|
+
x
|
422
|
+
62
|
423
|
+
/Users/sidu/Work/wrest/lib/wrest/components/translators/xml.rb
|
424
|
+
p
|
425
|
+
0
|
426
|
+
x
|
427
|
+
13
|
428
|
+
attach_method
|
429
|
+
p
|
430
|
+
3
|
431
|
+
I
|
432
|
+
2
|
433
|
+
I
|
434
|
+
b
|
435
|
+
I
|
436
|
+
1e
|
437
|
+
x
|
438
|
+
62
|
439
|
+
/Users/sidu/Work/wrest/lib/wrest/components/translators/xml.rb
|
440
|
+
p
|
441
|
+
0
|
442
|
+
x
|
443
|
+
13
|
444
|
+
attach_method
|
445
|
+
p
|
446
|
+
3
|
447
|
+
I
|
448
|
+
0
|
449
|
+
I
|
450
|
+
a
|
451
|
+
I
|
452
|
+
1c
|
453
|
+
x
|
454
|
+
62
|
455
|
+
/Users/sidu/Work/wrest/lib/wrest/components/translators/xml.rb
|
456
|
+
p
|
457
|
+
0
|