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,32 @@
|
|
1
|
+
# Copyright 2009 - 2010 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
|
+
require 'net/http/post/multipart'
|
10
|
+
|
11
|
+
module Wrest::Native
|
12
|
+
class PostMultipart < Request
|
13
|
+
def initialize(wrest_uri, parameters = {}, headers = {}, options = {})
|
14
|
+
super(
|
15
|
+
wrest_uri,
|
16
|
+
Net::HTTP::Post::Multipart,
|
17
|
+
parameters,
|
18
|
+
nil,
|
19
|
+
headers,
|
20
|
+
options
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def build_request(request_klass, uri, parameters, headers)
|
25
|
+
request_klass.new(uri.full_path, parameters, headers)
|
26
|
+
end
|
27
|
+
|
28
|
+
def do_request
|
29
|
+
@connection.request(@http_request)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,23 @@
|
|
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::Native
|
11
|
+
class Put < Request
|
12
|
+
def initialize(wrest_uri, body = '', headers = {}, parameters = {}, options = {})
|
13
|
+
super(
|
14
|
+
wrest_uri,
|
15
|
+
Net::HTTP::Put,
|
16
|
+
parameters,
|
17
|
+
body,
|
18
|
+
headers,
|
19
|
+
options
|
20
|
+
)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,388 @@
|
|
1
|
+
!RBIX
|
2
|
+
0
|
3
|
+
x
|
4
|
+
M
|
5
|
+
1
|
6
|
+
n
|
7
|
+
n
|
8
|
+
x
|
9
|
+
10
|
10
|
+
__script__
|
11
|
+
i
|
12
|
+
30
|
13
|
+
99
|
14
|
+
7
|
15
|
+
0
|
16
|
+
45
|
17
|
+
1
|
18
|
+
2
|
19
|
+
49
|
20
|
+
3
|
21
|
+
2
|
22
|
+
13
|
23
|
+
99
|
24
|
+
12
|
25
|
+
7
|
26
|
+
4
|
27
|
+
12
|
28
|
+
7
|
29
|
+
5
|
30
|
+
12
|
31
|
+
65
|
32
|
+
12
|
33
|
+
49
|
34
|
+
6
|
35
|
+
4
|
36
|
+
15
|
37
|
+
49
|
38
|
+
4
|
39
|
+
0
|
40
|
+
15
|
41
|
+
2
|
42
|
+
11
|
43
|
+
I
|
44
|
+
6
|
45
|
+
I
|
46
|
+
0
|
47
|
+
I
|
48
|
+
0
|
49
|
+
I
|
50
|
+
0
|
51
|
+
n
|
52
|
+
p
|
53
|
+
7
|
54
|
+
x
|
55
|
+
6
|
56
|
+
Native
|
57
|
+
x
|
58
|
+
5
|
59
|
+
Wrest
|
60
|
+
n
|
61
|
+
x
|
62
|
+
17
|
63
|
+
open_module_under
|
64
|
+
x
|
65
|
+
15
|
66
|
+
__module_init__
|
67
|
+
M
|
68
|
+
1
|
69
|
+
n
|
70
|
+
n
|
71
|
+
x
|
72
|
+
6
|
73
|
+
Native
|
74
|
+
i
|
75
|
+
31
|
76
|
+
5
|
77
|
+
66
|
78
|
+
99
|
79
|
+
7
|
80
|
+
0
|
81
|
+
45
|
82
|
+
1
|
83
|
+
2
|
84
|
+
65
|
85
|
+
49
|
86
|
+
3
|
87
|
+
3
|
88
|
+
13
|
89
|
+
99
|
90
|
+
12
|
91
|
+
7
|
92
|
+
4
|
93
|
+
12
|
94
|
+
7
|
95
|
+
5
|
96
|
+
12
|
97
|
+
65
|
98
|
+
12
|
99
|
+
49
|
100
|
+
6
|
101
|
+
4
|
102
|
+
15
|
103
|
+
49
|
104
|
+
4
|
105
|
+
0
|
106
|
+
11
|
107
|
+
I
|
108
|
+
6
|
109
|
+
I
|
110
|
+
0
|
111
|
+
I
|
112
|
+
0
|
113
|
+
I
|
114
|
+
0
|
115
|
+
n
|
116
|
+
p
|
117
|
+
7
|
118
|
+
x
|
119
|
+
3
|
120
|
+
Put
|
121
|
+
x
|
122
|
+
7
|
123
|
+
Request
|
124
|
+
n
|
125
|
+
x
|
126
|
+
10
|
127
|
+
open_class
|
128
|
+
x
|
129
|
+
14
|
130
|
+
__class_init__
|
131
|
+
M
|
132
|
+
1
|
133
|
+
n
|
134
|
+
n
|
135
|
+
x
|
136
|
+
3
|
137
|
+
Put
|
138
|
+
i
|
139
|
+
16
|
140
|
+
5
|
141
|
+
66
|
142
|
+
99
|
143
|
+
7
|
144
|
+
0
|
145
|
+
7
|
146
|
+
1
|
147
|
+
65
|
148
|
+
67
|
149
|
+
49
|
150
|
+
2
|
151
|
+
0
|
152
|
+
49
|
153
|
+
3
|
154
|
+
4
|
155
|
+
11
|
156
|
+
I
|
157
|
+
5
|
158
|
+
I
|
159
|
+
0
|
160
|
+
I
|
161
|
+
0
|
162
|
+
I
|
163
|
+
0
|
164
|
+
n
|
165
|
+
p
|
166
|
+
4
|
167
|
+
x
|
168
|
+
10
|
169
|
+
initialize
|
170
|
+
M
|
171
|
+
1
|
172
|
+
n
|
173
|
+
n
|
174
|
+
x
|
175
|
+
10
|
176
|
+
initialize
|
177
|
+
i
|
178
|
+
74
|
179
|
+
23
|
180
|
+
1
|
181
|
+
10
|
182
|
+
10
|
183
|
+
7
|
184
|
+
0
|
185
|
+
64
|
186
|
+
19
|
187
|
+
1
|
188
|
+
15
|
189
|
+
23
|
190
|
+
2
|
191
|
+
10
|
192
|
+
24
|
193
|
+
44
|
194
|
+
43
|
195
|
+
1
|
196
|
+
78
|
197
|
+
49
|
198
|
+
2
|
199
|
+
1
|
200
|
+
19
|
201
|
+
2
|
202
|
+
15
|
203
|
+
23
|
204
|
+
3
|
205
|
+
10
|
206
|
+
38
|
207
|
+
44
|
208
|
+
43
|
209
|
+
1
|
210
|
+
78
|
211
|
+
49
|
212
|
+
2
|
213
|
+
1
|
214
|
+
19
|
215
|
+
3
|
216
|
+
15
|
217
|
+
23
|
218
|
+
4
|
219
|
+
10
|
220
|
+
52
|
221
|
+
44
|
222
|
+
43
|
223
|
+
1
|
224
|
+
78
|
225
|
+
49
|
226
|
+
2
|
227
|
+
1
|
228
|
+
19
|
229
|
+
4
|
230
|
+
15
|
231
|
+
20
|
232
|
+
0
|
233
|
+
45
|
234
|
+
3
|
235
|
+
4
|
236
|
+
43
|
237
|
+
5
|
238
|
+
43
|
239
|
+
6
|
240
|
+
20
|
241
|
+
3
|
242
|
+
20
|
243
|
+
1
|
244
|
+
20
|
245
|
+
2
|
246
|
+
20
|
247
|
+
4
|
248
|
+
54
|
249
|
+
52
|
250
|
+
7
|
251
|
+
6
|
252
|
+
11
|
253
|
+
I
|
254
|
+
c
|
255
|
+
I
|
256
|
+
5
|
257
|
+
I
|
258
|
+
1
|
259
|
+
I
|
260
|
+
5
|
261
|
+
n
|
262
|
+
p
|
263
|
+
8
|
264
|
+
s
|
265
|
+
0
|
266
|
+
|
267
|
+
x
|
268
|
+
4
|
269
|
+
Hash
|
270
|
+
x
|
271
|
+
16
|
272
|
+
new_from_literal
|
273
|
+
x
|
274
|
+
3
|
275
|
+
Net
|
276
|
+
n
|
277
|
+
x
|
278
|
+
4
|
279
|
+
HTTP
|
280
|
+
x
|
281
|
+
3
|
282
|
+
Put
|
283
|
+
x
|
284
|
+
10
|
285
|
+
initialize
|
286
|
+
p
|
287
|
+
15
|
288
|
+
I
|
289
|
+
0
|
290
|
+
I
|
291
|
+
c
|
292
|
+
I
|
293
|
+
34
|
294
|
+
I
|
295
|
+
e
|
296
|
+
I
|
297
|
+
36
|
298
|
+
I
|
299
|
+
f
|
300
|
+
I
|
301
|
+
3d
|
302
|
+
I
|
303
|
+
10
|
304
|
+
I
|
305
|
+
3f
|
306
|
+
I
|
307
|
+
11
|
308
|
+
I
|
309
|
+
41
|
310
|
+
I
|
311
|
+
12
|
312
|
+
I
|
313
|
+
43
|
314
|
+
I
|
315
|
+
13
|
316
|
+
I
|
317
|
+
4a
|
318
|
+
x
|
319
|
+
46
|
320
|
+
/Users/sidu/Work/wrest/lib/wrest/native/put.rb
|
321
|
+
p
|
322
|
+
5
|
323
|
+
x
|
324
|
+
9
|
325
|
+
wrest_uri
|
326
|
+
x
|
327
|
+
4
|
328
|
+
body
|
329
|
+
x
|
330
|
+
7
|
331
|
+
headers
|
332
|
+
x
|
333
|
+
10
|
334
|
+
parameters
|
335
|
+
x
|
336
|
+
7
|
337
|
+
options
|
338
|
+
x
|
339
|
+
17
|
340
|
+
method_visibility
|
341
|
+
x
|
342
|
+
15
|
343
|
+
add_defn_method
|
344
|
+
p
|
345
|
+
3
|
346
|
+
I
|
347
|
+
2
|
348
|
+
I
|
349
|
+
c
|
350
|
+
I
|
351
|
+
10
|
352
|
+
x
|
353
|
+
46
|
354
|
+
/Users/sidu/Work/wrest/lib/wrest/native/put.rb
|
355
|
+
p
|
356
|
+
0
|
357
|
+
x
|
358
|
+
13
|
359
|
+
attach_method
|
360
|
+
p
|
361
|
+
3
|
362
|
+
I
|
363
|
+
2
|
364
|
+
I
|
365
|
+
b
|
366
|
+
I
|
367
|
+
1f
|
368
|
+
x
|
369
|
+
46
|
370
|
+
/Users/sidu/Work/wrest/lib/wrest/native/put.rb
|
371
|
+
p
|
372
|
+
0
|
373
|
+
x
|
374
|
+
13
|
375
|
+
attach_method
|
376
|
+
p
|
377
|
+
3
|
378
|
+
I
|
379
|
+
0
|
380
|
+
I
|
381
|
+
a
|
382
|
+
I
|
383
|
+
1e
|
384
|
+
x
|
385
|
+
46
|
386
|
+
/Users/sidu/Work/wrest/lib/wrest/native/put.rb
|
387
|
+
p
|
388
|
+
0
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Copyright 2009 - 2010 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
|
+
require 'net/http/post/multipart'
|
10
|
+
|
11
|
+
module Wrest::Native
|
12
|
+
class PutMultipart < Request
|
13
|
+
def initialize(wrest_uri, parameters = {}, headers = {}, options = {})
|
14
|
+
super(
|
15
|
+
wrest_uri,
|
16
|
+
Net::HTTP::Put::Multipart,
|
17
|
+
parameters,
|
18
|
+
nil,
|
19
|
+
headers,
|
20
|
+
options
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def build_request(request_klass, uri, parameters, headers)
|
25
|
+
request_klass.new(uri.full_path, parameters, headers)
|
26
|
+
end
|
27
|
+
|
28
|
+
def do_request
|
29
|
+
@connection.request(@http_request)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|