sucker 1.3.0.pre.3 → 1.3.0
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.
- data/README.md +17 -47
- data/lib/sucker/hash.rb +44 -0
- data/lib/sucker/hash.rbc +914 -0
- data/lib/sucker/parameters.rb +1 -1
- data/lib/sucker/parameters.rbc +157 -81
- data/lib/sucker/request.rb +1 -0
- data/lib/sucker/request.rbc +853 -1014
- data/lib/sucker/response.rb +1 -2
- data/lib/sucker/response.rbc +127 -505
- data/lib/sucker/version.rb +1 -1
- data/lib/sucker/version.rbc +9 -9
- data/lib/sucker.rb +0 -2
- data/lib/sucker.rbc +25 -41
- data/spec/spec_helper.rbc +5 -5
- data/spec/sucker/hash_spec.rb +39 -0
- data/spec/sucker/hash_spec.rbc +861 -0
- data/spec/sucker/parameters_spec.rb +1 -1
- data/spec/sucker/parameters_spec.rbc +38 -39
- data/spec/sucker/request_spec.rbc +86 -468
- data/spec/sucker/response_spec.rb +6 -0
- data/spec/sucker/response_spec.rbc +164 -394
- data/spec/sucker_spec.rbc +9 -9
- data/spec/support/amazon_credentials.rbc +5 -5
- data/spec/support/asins.rbc +9 -9
- data/spec/support/vcr.rbc +7 -7
- metadata +11 -8
- data/lib/sucker/response/hash.rb +0 -46
- data/spec/sucker/response/hash_spec.rb +0 -43
data/lib/sucker/version.rb
CHANGED
data/lib/sucker/version.rbc
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
!RBIX
|
2
|
-
|
2
|
+
10937318184790222022
|
3
3
|
x
|
4
4
|
M
|
5
5
|
1
|
@@ -94,8 +94,8 @@ x
|
|
94
94
|
7
|
95
95
|
VERSION
|
96
96
|
s
|
97
|
-
|
98
|
-
1.3.0
|
97
|
+
5
|
98
|
+
1.3.0
|
99
99
|
x
|
100
100
|
9
|
101
101
|
const_set
|
@@ -104,12 +104,12 @@ p
|
|
104
104
|
I
|
105
105
|
2
|
106
106
|
I
|
107
|
-
|
107
|
+
2
|
108
108
|
I
|
109
109
|
c
|
110
110
|
x
|
111
|
-
|
112
|
-
/Users/
|
111
|
+
44
|
112
|
+
/Users/snl/code/sucker/lib/sucker/version.rb
|
113
113
|
p
|
114
114
|
0
|
115
115
|
x
|
@@ -120,11 +120,11 @@ p
|
|
120
120
|
I
|
121
121
|
0
|
122
122
|
I
|
123
|
-
|
123
|
+
1
|
124
124
|
I
|
125
125
|
1c
|
126
126
|
x
|
127
|
-
|
128
|
-
/Users/
|
127
|
+
44
|
128
|
+
/Users/snl/code/sucker/lib/sucker/version.rb
|
129
129
|
p
|
130
130
|
0
|
data/lib/sucker.rb
CHANGED
data/lib/sucker.rbc
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
!RBIX
|
2
|
-
|
2
|
+
10937318184790222022
|
3
3
|
x
|
4
4
|
M
|
5
5
|
1
|
@@ -9,7 +9,7 @@ x
|
|
9
9
|
10
|
10
10
|
__script__
|
11
11
|
i
|
12
|
-
|
12
|
+
46
|
13
13
|
5
|
14
14
|
7
|
15
15
|
0
|
@@ -28,39 +28,30 @@ i
|
|
28
28
|
1
|
29
29
|
1
|
30
30
|
15
|
31
|
-
5
|
32
|
-
7
|
33
|
-
3
|
34
|
-
64
|
35
|
-
47
|
36
|
-
49
|
37
|
-
1
|
38
|
-
1
|
39
|
-
15
|
40
31
|
99
|
41
32
|
7
|
42
|
-
|
33
|
+
3
|
43
34
|
65
|
44
35
|
49
|
45
|
-
|
36
|
+
4
|
46
37
|
2
|
47
38
|
13
|
48
39
|
99
|
49
40
|
12
|
50
41
|
7
|
51
|
-
|
42
|
+
5
|
52
43
|
12
|
53
44
|
7
|
54
|
-
|
45
|
+
6
|
55
46
|
12
|
56
47
|
65
|
57
48
|
12
|
58
49
|
49
|
59
|
-
|
50
|
+
7
|
60
51
|
4
|
61
52
|
15
|
62
53
|
49
|
63
|
-
|
54
|
+
5
|
64
55
|
0
|
65
56
|
15
|
66
57
|
2
|
@@ -75,17 +66,14 @@ I
|
|
75
66
|
0
|
76
67
|
n
|
77
68
|
p
|
78
|
-
|
69
|
+
8
|
79
70
|
s
|
80
|
-
|
81
|
-
sucker/
|
71
|
+
14
|
72
|
+
sucker/request
|
82
73
|
x
|
83
74
|
7
|
84
75
|
require
|
85
76
|
s
|
86
|
-
14
|
87
|
-
sucker/request
|
88
|
-
s
|
89
77
|
15
|
90
78
|
sucker/response
|
91
79
|
x
|
@@ -220,16 +208,16 @@ p
|
|
220
208
|
I
|
221
209
|
-1
|
222
210
|
I
|
223
|
-
|
211
|
+
10
|
224
212
|
I
|
225
213
|
e
|
226
214
|
I
|
227
|
-
|
215
|
+
11
|
228
216
|
I
|
229
217
|
2b
|
230
218
|
x
|
231
|
-
|
232
|
-
/Users/
|
219
|
+
36
|
220
|
+
/Users/snl/code/sucker/lib/sucker.rb
|
233
221
|
p
|
234
222
|
1
|
235
223
|
x
|
@@ -243,39 +231,35 @@ p
|
|
243
231
|
I
|
244
232
|
2
|
245
233
|
I
|
246
|
-
|
234
|
+
10
|
247
235
|
I
|
248
236
|
d
|
249
237
|
x
|
250
|
-
|
251
|
-
/Users/
|
238
|
+
36
|
239
|
+
/Users/snl/code/sucker/lib/sucker.rb
|
252
240
|
p
|
253
241
|
0
|
254
242
|
x
|
255
243
|
13
|
256
244
|
attach_method
|
257
245
|
p
|
258
|
-
|
246
|
+
7
|
259
247
|
I
|
260
248
|
0
|
261
249
|
I
|
262
|
-
|
250
|
+
1
|
263
251
|
I
|
264
252
|
9
|
265
253
|
I
|
266
|
-
|
254
|
+
2
|
267
255
|
I
|
268
256
|
12
|
269
257
|
I
|
270
|
-
|
271
|
-
I
|
272
|
-
1b
|
273
|
-
I
|
274
|
-
a
|
258
|
+
7
|
275
259
|
I
|
276
|
-
|
260
|
+
2e
|
277
261
|
x
|
278
|
-
|
279
|
-
/Users/
|
262
|
+
36
|
263
|
+
/Users/snl/code/sucker/lib/sucker.rb
|
280
264
|
p
|
281
265
|
0
|
data/spec/spec_helper.rbc
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
!RBIX
|
2
|
-
|
2
|
+
10937318184790222022
|
3
3
|
x
|
4
4
|
M
|
5
5
|
1
|
@@ -189,8 +189,8 @@ I
|
|
189
189
|
I
|
190
190
|
c
|
191
191
|
x
|
192
|
-
|
193
|
-
/Users/
|
192
|
+
42
|
193
|
+
/Users/snl/code/sucker/spec/spec_helper.rb
|
194
194
|
p
|
195
195
|
1
|
196
196
|
x
|
@@ -224,7 +224,7 @@ I
|
|
224
224
|
I
|
225
225
|
4d
|
226
226
|
x
|
227
|
-
|
228
|
-
/Users/
|
227
|
+
42
|
228
|
+
/Users/snl/code/sucker/spec/spec_helper.rb
|
229
229
|
p
|
230
230
|
0
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module Sucker
|
4
|
+
describe Hash do
|
5
|
+
let(:xml) do
|
6
|
+
xml = <<-XML
|
7
|
+
<?xml version=\"1.0\" ?>
|
8
|
+
<ItemAttributes>
|
9
|
+
<Title>Anti-Oedipus</Title>
|
10
|
+
<Author>Gilles Deleuze</Author>
|
11
|
+
<Author>Felix Guattari</Author>
|
12
|
+
<Creator Role="Translator">Robert Hurley</Creator>
|
13
|
+
</ItemAttributes>
|
14
|
+
XML
|
15
|
+
xml.gsub!(/>\s+</, '><')
|
16
|
+
Nokogiri::XML(xml)
|
17
|
+
end
|
18
|
+
|
19
|
+
describe '.from_xml' do
|
20
|
+
it 'returns a hash' do
|
21
|
+
Hash.from_xml(xml).should be_an_instance_of Hash
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'handles only childs' do
|
25
|
+
Hash.from_xml(xml)['Title'].should eql 'Anti-Oedipus'
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'handles arrays' do
|
29
|
+
Hash.from_xml(xml)['Author'].should be_a Array
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'handles attributes' do
|
33
|
+
node = Hash.from_xml(xml)['Creator']
|
34
|
+
node['Role'].should eql 'Translator'
|
35
|
+
node['__content__'].should eql 'Robert Hurley'
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|