sucker 1.0.0.beta.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. data/CHANGELOG.md +12 -2
  2. data/README.md +5 -2
  3. data/lib/sucker.rbc +341 -0
  4. data/lib/sucker/request.rb +1 -1
  5. data/lib/sucker/request.rbc +2481 -0
  6. data/lib/sucker/response.rb +19 -7
  7. data/lib/sucker/response.rbc +1554 -0
  8. data/lib/sucker/version.rb +2 -2
  9. data/lib/sucker/version.rbc +130 -0
  10. data/spec/fixtures/asins.txt +9406 -406
  11. data/spec/fixtures/cassette_library/integration/alternate_versions.yml +27 -0
  12. data/spec/fixtures/cassette_library/integration/errors.yml +27 -0
  13. data/spec/fixtures/cassette_library/integration/france.yml +27 -0
  14. data/spec/fixtures/cassette_library/integration/images.yml +27 -0
  15. data/spec/fixtures/cassette_library/integration/item_lookup/multiple.yml +27 -0
  16. data/spec/fixtures/cassette_library/integration/item_lookup/single.yml +27 -0
  17. data/spec/fixtures/cassette_library/integration/item_search.yml +27 -0
  18. data/spec/fixtures/cassette_library/integration/japan.yml +27 -0
  19. data/spec/fixtures/cassette_library/integration/keyword_search.yml +27 -0
  20. data/spec/fixtures/cassette_library/integration/kindle.yml +27 -0
  21. data/spec/fixtures/cassette_library/integration/kindle_2.yml +27 -0
  22. data/spec/fixtures/cassette_library/integration/multiple_locales.yml +157 -0
  23. data/spec/fixtures/cassette_library/integration/power_search.yml +27 -0
  24. data/spec/fixtures/cassette_library/integration/related_items/child.yml +27 -0
  25. data/spec/fixtures/cassette_library/integration/related_items/parent.yml +27 -0
  26. data/spec/fixtures/cassette_library/integration/seller_listings_search.yml +27 -0
  27. data/spec/fixtures/cassette_library/integration/twenty_items.yml +27 -0
  28. data/spec/fixtures/cassette_library/unit/sucker/request.yml +29 -0
  29. data/spec/fixtures/cassette_library/unit/sucker/response.yml +27 -0
  30. data/spec/integration/alternate_versions_spec.rb +28 -20
  31. data/spec/integration/alternate_versions_spec.rbc +843 -0
  32. data/spec/integration/errors_spec.rb +10 -6
  33. data/spec/integration/errors_spec.rbc +964 -0
  34. data/spec/integration/france_spec.rb +33 -25
  35. data/spec/integration/france_spec.rbc +1012 -0
  36. data/spec/integration/images_spec.rb +32 -24
  37. data/spec/integration/images_spec.rbc +1047 -0
  38. data/spec/integration/item_lookup_spec.rb +11 -3
  39. data/spec/integration/item_lookup_spec.rbc +1723 -0
  40. data/spec/integration/item_search_spec.rb +6 -2
  41. data/spec/integration/item_search_spec.rbc +926 -0
  42. data/spec/integration/japan_spec.rb +27 -19
  43. data/spec/integration/japan_spec.rbc +849 -0
  44. data/spec/integration/keyword_search_spec.rb +5 -0
  45. data/spec/integration/keyword_search_spec.rbc +838 -0
  46. data/spec/integration/kindle_spec.rb +13 -5
  47. data/spec/integration/kindle_spec.rbc +1425 -0
  48. data/spec/integration/multiple_locales_spec.rb +34 -26
  49. data/spec/integration/multiple_locales_spec.rbc +1090 -0
  50. data/spec/integration/power_search_spec.rb +5 -0
  51. data/spec/integration/power_search_spec.rbc +838 -0
  52. data/spec/integration/related_items_spec.rb +41 -29
  53. data/spec/integration/related_items_spec.rbc +1228 -0
  54. data/spec/integration/seller_listing_search_spec.rb +3 -0
  55. data/spec/integration/seller_listing_search_spec.rbc +852 -0
  56. data/spec/integration/twenty_items_spec.rb +41 -34
  57. data/spec/integration/twenty_items_spec.rbc +1166 -0
  58. data/spec/spec_helper.rbc +231 -0
  59. data/spec/support/amazon.yml +3 -0
  60. data/spec/support/amazon.yml.example +1 -0
  61. data/spec/support/amazon_credentials.rbc +154 -0
  62. data/spec/support/asins.rb +6 -1
  63. data/spec/support/asins.rbc +335 -0
  64. data/spec/support/vcr.rbc +360 -0
  65. data/spec/unit/sucker/request_spec.rb +57 -23
  66. data/spec/unit/sucker/request_spec.rbc +4031 -0
  67. data/spec/unit/sucker/response_spec.rb +100 -26
  68. data/spec/unit/sucker/response_spec.rbc +3787 -0
  69. data/spec/unit/sucker_spec.rb +5 -1
  70. data/spec/unit/sucker_spec.rbc +299 -0
  71. metadata +94 -12
@@ -0,0 +1,231 @@
1
+ !RBIX
2
+ 0
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 78
13
+ 5
14
+ 7
15
+ 0
16
+ 64
17
+ 47
18
+ 49
19
+ 1
20
+ 1
21
+ 15
22
+ 5
23
+ 7
24
+ 2
25
+ 64
26
+ 47
27
+ 49
28
+ 1
29
+ 1
30
+ 15
31
+ 5
32
+ 7
33
+ 3
34
+ 64
35
+ 47
36
+ 49
37
+ 1
38
+ 1
39
+ 15
40
+ 5
41
+ 45
42
+ 4
43
+ 5
44
+ 7
45
+ 6
46
+ 64
47
+ 65
48
+ 49
49
+ 7
50
+ 0
51
+ 49
52
+ 8
53
+ 2
54
+ 47
55
+ 49
56
+ 1
57
+ 1
58
+ 15
59
+ 45
60
+ 9
61
+ 10
62
+ 45
63
+ 4
64
+ 11
65
+ 65
66
+ 49
67
+ 7
68
+ 0
69
+ 49
70
+ 12
71
+ 1
72
+ 47
73
+ 49
74
+ 13
75
+ 0
76
+ 7
77
+ 14
78
+ 63
79
+ 2
80
+ 49
81
+ 15
82
+ 1
83
+ 56
84
+ 16
85
+ 50
86
+ 17
87
+ 0
88
+ 15
89
+ 2
90
+ 11
91
+ I
92
+ 4
93
+ I
94
+ 0
95
+ I
96
+ 0
97
+ I
98
+ 0
99
+ n
100
+ p
101
+ 18
102
+ s
103
+ 8
104
+ rubygems
105
+ x
106
+ 7
107
+ require
108
+ s
109
+ 13
110
+ bundler/setup
111
+ s
112
+ 5
113
+ rspec
114
+ x
115
+ 4
116
+ File
117
+ n
118
+ s
119
+ 16
120
+ ../../lib/sucker
121
+ x
122
+ 11
123
+ active_path
124
+ x
125
+ 11
126
+ expand_path
127
+ x
128
+ 3
129
+ Dir
130
+ n
131
+ n
132
+ x
133
+ 7
134
+ dirname
135
+ x
136
+ 4
137
+ to_s
138
+ s
139
+ 16
140
+ /support/**/*.rb
141
+ x
142
+ 2
143
+ []
144
+ M
145
+ 1
146
+ p
147
+ 2
148
+ x
149
+ 9
150
+ for_block
151
+ t
152
+ n
153
+ x
154
+ 9
155
+ __block__
156
+ i
157
+ 12
158
+ 57
159
+ 19
160
+ 0
161
+ 15
162
+ 5
163
+ 20
164
+ 0
165
+ 47
166
+ 49
167
+ 0
168
+ 1
169
+ 11
170
+ I
171
+ 4
172
+ I
173
+ 1
174
+ I
175
+ 1
176
+ I
177
+ 1
178
+ n
179
+ p
180
+ 1
181
+ x
182
+ 7
183
+ require
184
+ p
185
+ 3
186
+ I
187
+ 0
188
+ I
189
+ 7
190
+ I
191
+ c
192
+ x
193
+ 42
194
+ /Users/snl/code/sucker/spec/spec_helper.rb
195
+ p
196
+ 1
197
+ x
198
+ 1
199
+ f
200
+ x
201
+ 4
202
+ each
203
+ p
204
+ 11
205
+ I
206
+ 0
207
+ I
208
+ 1
209
+ I
210
+ 9
211
+ I
212
+ 2
213
+ I
214
+ 12
215
+ I
216
+ 3
217
+ I
218
+ 1b
219
+ I
220
+ 5
221
+ I
222
+ 2e
223
+ I
224
+ 7
225
+ I
226
+ 4e
227
+ x
228
+ 42
229
+ /Users/snl/code/sucker/spec/spec_helper.rb
230
+ p
231
+ 0
@@ -0,0 +1,3 @@
1
+ key: 1KQ3TQHXVQ54ZSYSCVG2
2
+ secret: uY66ZoZ0+lZZtB1R5p0XjIkx0Hs21R9BykAUJ32C
3
+ associate_tag: papecava-20
@@ -1,2 +1,3 @@
1
1
  key: KEY
2
2
  secret: SECRET
3
+ associate_tag: AFFILIATE
@@ -0,0 +1,154 @@
1
+ !RBIX
2
+ 0
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 16
13
+ 99
14
+ 7
15
+ 0
16
+ 7
17
+ 1
18
+ 65
19
+ 67
20
+ 49
21
+ 2
22
+ 0
23
+ 49
24
+ 3
25
+ 4
26
+ 15
27
+ 2
28
+ 11
29
+ I
30
+ 5
31
+ I
32
+ 0
33
+ I
34
+ 0
35
+ I
36
+ 0
37
+ n
38
+ p
39
+ 4
40
+ x
41
+ 6
42
+ amazon
43
+ M
44
+ 1
45
+ n
46
+ n
47
+ x
48
+ 6
49
+ amazon
50
+ i
51
+ 30
52
+ 39
53
+ 0
54
+ 13
55
+ 10
56
+ 29
57
+ 15
58
+ 45
59
+ 1
60
+ 2
61
+ 45
62
+ 3
63
+ 4
64
+ 65
65
+ 49
66
+ 5
67
+ 0
68
+ 49
69
+ 6
70
+ 1
71
+ 7
72
+ 7
73
+ 64
74
+ 81
75
+ 8
76
+ 49
77
+ 9
78
+ 1
79
+ 38
80
+ 0
81
+ 11
82
+ I
83
+ 3
84
+ I
85
+ 0
86
+ I
87
+ 0
88
+ I
89
+ 0
90
+ n
91
+ p
92
+ 10
93
+ x
94
+ 7
95
+ @amazon
96
+ x
97
+ 4
98
+ YAML
99
+ n
100
+ x
101
+ 4
102
+ File
103
+ n
104
+ x
105
+ 11
106
+ active_path
107
+ x
108
+ 7
109
+ dirname
110
+ s
111
+ 11
112
+ /amazon.yml
113
+ x
114
+ 1
115
+ +
116
+ x
117
+ 9
118
+ load_file
119
+ p
120
+ 5
121
+ I
122
+ 0
123
+ I
124
+ 1
125
+ I
126
+ 0
127
+ I
128
+ 2
129
+ I
130
+ 1e
131
+ x
132
+ 57
133
+ /Users/snl/code/sucker/spec/support/amazon_credentials.rb
134
+ p
135
+ 0
136
+ x
137
+ 17
138
+ method_visibility
139
+ x
140
+ 15
141
+ add_defn_method
142
+ p
143
+ 3
144
+ I
145
+ 0
146
+ I
147
+ 1
148
+ I
149
+ 10
150
+ x
151
+ 57
152
+ /Users/snl/code/sucker/spec/support/amazon_credentials.rb
153
+ p
154
+ 0
@@ -1,3 +1,8 @@
1
1
  def asins_fixture
2
- File.new(File.expand_path("../../fixtures/asins.txt", __FILE__), "r").map { |line| line.chomp }
2
+ asins = File.new(File.expand_path("../../fixtures/asins.txt", __FILE__), "r").map { |line| line.chomp }
3
+ if block_given?
4
+ asins.each { |asin| yield asin }
5
+ end
6
+
7
+ asins
3
8
  end
@@ -0,0 +1,335 @@
1
+ !RBIX
2
+ 0
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 16
13
+ 99
14
+ 7
15
+ 0
16
+ 7
17
+ 1
18
+ 65
19
+ 67
20
+ 49
21
+ 2
22
+ 0
23
+ 49
24
+ 3
25
+ 4
26
+ 15
27
+ 2
28
+ 11
29
+ I
30
+ 5
31
+ I
32
+ 0
33
+ I
34
+ 0
35
+ I
36
+ 0
37
+ n
38
+ p
39
+ 4
40
+ x
41
+ 13
42
+ asins_fixture
43
+ M
44
+ 1
45
+ n
46
+ n
47
+ x
48
+ 13
49
+ asins_fixture
50
+ i
51
+ 81
52
+ 45
53
+ 0
54
+ 1
55
+ 13
56
+ 71
57
+ 2
58
+ 47
59
+ 9
60
+ 37
61
+ 47
62
+ 49
63
+ 3
64
+ 0
65
+ 13
66
+ 45
67
+ 0
68
+ 4
69
+ 7
70
+ 5
71
+ 64
72
+ 65
73
+ 49
74
+ 6
75
+ 0
76
+ 49
77
+ 7
78
+ 2
79
+ 7
80
+ 8
81
+ 64
82
+ 47
83
+ 49
84
+ 9
85
+ 2
86
+ 15
87
+ 8
88
+ 56
89
+ 45
90
+ 0
91
+ 10
92
+ 7
93
+ 5
94
+ 64
95
+ 65
96
+ 49
97
+ 6
98
+ 0
99
+ 49
100
+ 7
101
+ 2
102
+ 7
103
+ 8
104
+ 64
105
+ 49
106
+ 2
107
+ 2
108
+ 56
109
+ 11
110
+ 50
111
+ 12
112
+ 0
113
+ 19
114
+ 0
115
+ 15
116
+ 94
117
+ 9
118
+ 76
119
+ 20
120
+ 0
121
+ 56
122
+ 13
123
+ 50
124
+ 14
125
+ 0
126
+ 8
127
+ 77
128
+ 1
129
+ 15
130
+ 20
131
+ 0
132
+ 11
133
+ I
134
+ 6
135
+ I
136
+ 1
137
+ I
138
+ 0
139
+ I
140
+ 0
141
+ n
142
+ p
143
+ 15
144
+ x
145
+ 4
146
+ File
147
+ n
148
+ x
149
+ 3
150
+ new
151
+ x
152
+ 8
153
+ allocate
154
+ n
155
+ s
156
+ 24
157
+ ../../fixtures/asins.txt
158
+ x
159
+ 11
160
+ active_path
161
+ x
162
+ 11
163
+ expand_path
164
+ s
165
+ 1
166
+ r
167
+ x
168
+ 10
169
+ initialize
170
+ n
171
+ M
172
+ 1
173
+ p
174
+ 2
175
+ x
176
+ 9
177
+ for_block
178
+ t
179
+ n
180
+ x
181
+ 13
182
+ asins_fixture
183
+ i
184
+ 10
185
+ 57
186
+ 19
187
+ 0
188
+ 15
189
+ 20
190
+ 0
191
+ 49
192
+ 0
193
+ 0
194
+ 11
195
+ I
196
+ 3
197
+ I
198
+ 1
199
+ I
200
+ 1
201
+ I
202
+ 1
203
+ n
204
+ p
205
+ 1
206
+ x
207
+ 5
208
+ chomp
209
+ p
210
+ 3
211
+ I
212
+ 0
213
+ I
214
+ 2
215
+ I
216
+ a
217
+ x
218
+ 44
219
+ /Users/snl/code/sucker/spec/support/asins.rb
220
+ p
221
+ 1
222
+ x
223
+ 4
224
+ line
225
+ x
226
+ 3
227
+ map
228
+ M
229
+ 1
230
+ p
231
+ 2
232
+ x
233
+ 9
234
+ for_block
235
+ t
236
+ n
237
+ x
238
+ 13
239
+ asins_fixture
240
+ i
241
+ 9
242
+ 57
243
+ 19
244
+ 0
245
+ 15
246
+ 20
247
+ 0
248
+ 60
249
+ 1
250
+ 11
251
+ I
252
+ 3
253
+ I
254
+ 1
255
+ I
256
+ 1
257
+ I
258
+ 1
259
+ n
260
+ p
261
+ 0
262
+ p
263
+ 3
264
+ I
265
+ 0
266
+ I
267
+ 4
268
+ I
269
+ 9
270
+ x
271
+ 44
272
+ /Users/snl/code/sucker/spec/support/asins.rb
273
+ p
274
+ 1
275
+ x
276
+ 4
277
+ asin
278
+ x
279
+ 4
280
+ each
281
+ p
282
+ 13
283
+ I
284
+ 0
285
+ I
286
+ 1
287
+ I
288
+ 0
289
+ I
290
+ 2
291
+ I
292
+ 40
293
+ I
294
+ 3
295
+ I
296
+ 43
297
+ I
298
+ 4
299
+ I
300
+ 4c
301
+ I
302
+ 3
303
+ I
304
+ 4e
305
+ I
306
+ 7
307
+ I
308
+ 51
309
+ x
310
+ 44
311
+ /Users/snl/code/sucker/spec/support/asins.rb
312
+ p
313
+ 1
314
+ x
315
+ 5
316
+ asins
317
+ x
318
+ 17
319
+ method_visibility
320
+ x
321
+ 15
322
+ add_defn_method
323
+ p
324
+ 3
325
+ I
326
+ 0
327
+ I
328
+ 1
329
+ I
330
+ 10
331
+ x
332
+ 44
333
+ /Users/snl/code/sucker/spec/support/asins.rb
334
+ p
335
+ 0