uatu-marvel 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +4 -1
  5. data/Gemfile +2 -1
  6. data/README.md +5 -3
  7. data/bin/console +7 -0
  8. data/lib/uatu.rb +13 -2
  9. data/lib/uatu/base.rb +10 -55
  10. data/lib/uatu/configuration.rb +3 -5
  11. data/lib/uatu/connection.rb +48 -41
  12. data/lib/uatu/endpoints/collection.rb +16 -0
  13. data/lib/uatu/endpoints/nested.rb +23 -0
  14. data/lib/uatu/endpoints/single.rb +17 -0
  15. data/lib/uatu/resource.rb +21 -19
  16. data/lib/uatu/resources.rb +3 -0
  17. data/lib/uatu/response.rb +1 -4
  18. data/lib/uatu/version.rb +1 -1
  19. data/spec/integration/characters_spec.rb +25 -0
  20. data/spec/integration/comics_spec.rb +17 -0
  21. data/spec/integration/creators_spec.rb +19 -0
  22. data/spec/integration/events_spec.rb +19 -0
  23. data/spec/integration/series_spec.rb +19 -0
  24. data/spec/integration/stories_spec.rb +19 -0
  25. data/spec/spec_helper.rb +18 -0
  26. data/spec/support/fake_marvel_api.rb +24 -0
  27. data/spec/support/fake_marvel_api/characters/list.json +381 -0
  28. data/spec/support/fake_marvel_api/characters/show.json +381 -0
  29. data/spec/support/fake_marvel_api/comics/list.json +1479 -0
  30. data/spec/support/fake_marvel_api/comics/show.json +134 -0
  31. data/spec/support/fake_marvel_api/creators/list.json +180 -0
  32. data/spec/support/fake_marvel_api/creators/show.json +323 -0
  33. data/spec/support/fake_marvel_api/events/list.json +2224 -0
  34. data/spec/support/fake_marvel_api/events/show.json +474 -0
  35. data/spec/support/fake_marvel_api/series/list.json +739 -0
  36. data/spec/support/fake_marvel_api/series/show.json +101 -0
  37. data/spec/support/fake_marvel_api/stories/list.json +523 -0
  38. data/spec/support/fake_marvel_api/stories/show.json +69 -0
  39. data/spec/uatu/configuration_spec.rb +26 -0
  40. data/spec/uatu/connection_spec.rb +54 -0
  41. data/spec/uatu/resource_spec.rb +40 -0
  42. data/spec/uatu_spec.rb +9 -0
  43. data/uatu.gemspec +6 -4
  44. metadata +123 -34
  45. data/test/helper.rb +0 -9
  46. data/test/uatu/base_test.rb +0 -51
  47. data/test/uatu/configuration_test.rb +0 -19
  48. data/test/uatu/connection_test.rb +0 -31
  49. data/test/uatu/resource_test.rb +0 -33
  50. data/test/uatu/uatu_test.rb +0 -9
@@ -0,0 +1,474 @@
1
+ {
2
+ "code": 200,
3
+ "status": "Ok",
4
+ "copyright": "© 2017 MARVEL",
5
+ "attributionText": "Data provided by Marvel. © 2017 MARVEL",
6
+ "attributionHTML": "<a href=\"http://marvel.com\">Data provided by Marvel. © 2017 MARVEL</a>",
7
+ "etag": "48ffcebf4d3fdbad1feb474e98009de922c535d7",
8
+ "data": {
9
+ "offset": 0,
10
+ "limit": 20,
11
+ "total": 1,
12
+ "count": 1,
13
+ "results": [
14
+ {
15
+ "id": 233,
16
+ "title": "Atlantis Attacks",
17
+ "description": "Ghaur returns to complete his quest to resurrect the evil god Set, but his plan is opposed by Earth's heroes.",
18
+ "resourceURI": "http://gateway.marvel.com/v1/public/events/233",
19
+ "urls": [
20
+ {
21
+ "type": "detail",
22
+ "url": "http://marvel.com/comics/events/233/atlantis_attacks?utm_campaign=apiRef&utm_source=dcc0afa448458533d901bf0ff81da74c"
23
+ },
24
+ {
25
+ "type": "wiki",
26
+ "url": "http://marvel.com/universe/Atlantis_Attacks?utm_campaign=apiRef&utm_source=dcc0afa448458533d901bf0ff81da74c"
27
+ }
28
+ ],
29
+ "modified": "2013-06-25T13:49:06-0400",
30
+ "start": "1989-01-01 00:00:00",
31
+ "end": "2011-02-16 00:00:00",
32
+ "thumbnail": {
33
+ "path": "http://i.annihil.us/u/prod/marvel/i/mg/9/60/51c9d7f42a0c8",
34
+ "extension": "jpg"
35
+ },
36
+ "creators": {
37
+ "available": 103,
38
+ "collectionURI": "http://gateway.marvel.com/v1/public/events/233/creators",
39
+ "items": [
40
+ {
41
+ "resourceURI": "http://gateway.marvel.com/v1/public/creators/11401",
42
+ "name": "various",
43
+ "role": "penciller"
44
+ },
45
+ {
46
+ "resourceURI": "http://gateway.marvel.com/v1/public/creators/1279",
47
+ "name": "Jon Bogdanove",
48
+ "role": "penciller"
49
+ },
50
+ {
51
+ "resourceURI": "http://gateway.marvel.com/v1/public/creators/211",
52
+ "name": "Mark Bright",
53
+ "role": "penciller"
54
+ },
55
+ {
56
+ "resourceURI": "http://gateway.marvel.com/v1/public/creators/1216",
57
+ "name": "Rich Buckler",
58
+ "role": "penciller"
59
+ },
60
+ {
61
+ "resourceURI": "http://gateway.marvel.com/v1/public/creators/6675",
62
+ "name": "Don Ald",
63
+ "role": "inker"
64
+ },
65
+ {
66
+ "resourceURI": "http://gateway.marvel.com/v1/public/creators/1836",
67
+ "name": "Terry Austin",
68
+ "role": "inker"
69
+ },
70
+ {
71
+ "resourceURI": "http://gateway.marvel.com/v1/public/creators/2077",
72
+ "name": "Hilary Barta",
73
+ "role": "inker"
74
+ },
75
+ {
76
+ "resourceURI": "http://gateway.marvel.com/v1/public/creators/5823",
77
+ "name": "Danny Bulanadi",
78
+ "role": "inker"
79
+ },
80
+ {
81
+ "resourceURI": "http://gateway.marvel.com/v1/public/creators/3074",
82
+ "name": "Ralph Cabrera",
83
+ "role": "inker"
84
+ },
85
+ {
86
+ "resourceURI": "http://gateway.marvel.com/v1/public/creators/1898",
87
+ "name": "Mike DeCarlo",
88
+ "role": "inker"
89
+ },
90
+ {
91
+ "resourceURI": "http://gateway.marvel.com/v1/public/creators/2047",
92
+ "name": "Craig Anderson",
93
+ "role": "editor"
94
+ },
95
+ {
96
+ "resourceURI": "http://gateway.marvel.com/v1/public/creators/87",
97
+ "name": "Mark Bagley",
98
+ "role": "penciler"
99
+ },
100
+ {
101
+ "resourceURI": "http://gateway.marvel.com/v1/public/creators/1827",
102
+ "name": "John Byrne",
103
+ "role": "penciler"
104
+ },
105
+ {
106
+ "resourceURI": "http://gateway.marvel.com/v1/public/creators/270",
107
+ "name": "Gene Colan",
108
+ "role": "penciler"
109
+ },
110
+ {
111
+ "resourceURI": "http://gateway.marvel.com/v1/public/creators/8018",
112
+ "name": "Amanda Conner",
113
+ "role": "penciler"
114
+ },
115
+ {
116
+ "resourceURI": "http://gateway.marvel.com/v1/public/creators/3456",
117
+ "name": "Gavin Curtis",
118
+ "role": "penciler"
119
+ },
120
+ {
121
+ "resourceURI": "http://gateway.marvel.com/v1/public/creators/3459",
122
+ "name": "Judy Bogdanove",
123
+ "role": "writer"
124
+ },
125
+ {
126
+ "resourceURI": "http://gateway.marvel.com/v1/public/creators/954",
127
+ "name": "Gerry Conway",
128
+ "role": "writer"
129
+ },
130
+ {
131
+ "resourceURI": "http://gateway.marvel.com/v1/public/creators/1909",
132
+ "name": "Steve Buccellato",
133
+ "role": "colorist"
134
+ },
135
+ {
136
+ "resourceURI": "http://gateway.marvel.com/v1/public/creators/1887",
137
+ "name": "Janice Chiang",
138
+ "role": "letterer"
139
+ }
140
+ ],
141
+ "returned": 20
142
+ },
143
+ "characters": {
144
+ "available": 47,
145
+ "collectionURI": "http://gateway.marvel.com/v1/public/events/233/characters",
146
+ "items": [
147
+ {
148
+ "resourceURI": "http://gateway.marvel.com/v1/public/characters/1010354",
149
+ "name": "Adam Warlock"
150
+ },
151
+ {
152
+ "resourceURI": "http://gateway.marvel.com/v1/public/characters/1009159",
153
+ "name": "Archangel"
154
+ },
155
+ {
156
+ "resourceURI": "http://gateway.marvel.com/v1/public/characters/1009165",
157
+ "name": "Avengers"
158
+ },
159
+ {
160
+ "resourceURI": "http://gateway.marvel.com/v1/public/characters/1009175",
161
+ "name": "Beast"
162
+ },
163
+ {
164
+ "resourceURI": "http://gateway.marvel.com/v1/public/characters/1010366",
165
+ "name": "Boom Boom"
166
+ },
167
+ {
168
+ "resourceURI": "http://gateway.marvel.com/v1/public/characters/1009219",
169
+ "name": "Cannonball"
170
+ },
171
+ {
172
+ "resourceURI": "http://gateway.marvel.com/v1/public/characters/1010813",
173
+ "name": "Celestials"
174
+ },
175
+ {
176
+ "resourceURI": "http://gateway.marvel.com/v1/public/characters/1009243",
177
+ "name": "Colossus"
178
+ },
179
+ {
180
+ "resourceURI": "http://gateway.marvel.com/v1/public/characters/1009257",
181
+ "name": "Cyclops"
182
+ },
183
+ {
184
+ "resourceURI": "http://gateway.marvel.com/v1/public/characters/1009267",
185
+ "name": "Dazzler"
186
+ },
187
+ {
188
+ "resourceURI": "http://gateway.marvel.com/v1/public/characters/1009281",
189
+ "name": "Doctor Doom"
190
+ },
191
+ {
192
+ "resourceURI": "http://gateway.marvel.com/v1/public/characters/1010807",
193
+ "name": "Eternals"
194
+ },
195
+ {
196
+ "resourceURI": "http://gateway.marvel.com/v1/public/characters/1009299",
197
+ "name": "Fantastic Four"
198
+ },
199
+ {
200
+ "resourceURI": "http://gateway.marvel.com/v1/public/characters/1010868",
201
+ "name": "Firebird"
202
+ },
203
+ {
204
+ "resourceURI": "http://gateway.marvel.com/v1/public/characters/1009315",
205
+ "name": "Gateway"
206
+ },
207
+ {
208
+ "resourceURI": "http://gateway.marvel.com/v1/public/characters/1009337",
209
+ "name": "Havok"
210
+ },
211
+ {
212
+ "resourceURI": "http://gateway.marvel.com/v1/public/characters/1009356",
213
+ "name": "Human Torch"
214
+ },
215
+ {
216
+ "resourceURI": "http://gateway.marvel.com/v1/public/characters/1009362",
217
+ "name": "Iceman"
218
+ },
219
+ {
220
+ "resourceURI": "http://gateway.marvel.com/v1/public/characters/1009366",
221
+ "name": "Invisible Woman"
222
+ },
223
+ {
224
+ "resourceURI": "http://gateway.marvel.com/v1/public/characters/1009368",
225
+ "name": "Iron Man"
226
+ }
227
+ ],
228
+ "returned": 20
229
+ },
230
+ "stories": {
231
+ "available": 75,
232
+ "collectionURI": "http://gateway.marvel.com/v1/public/events/233/stories",
233
+ "items": [
234
+ {
235
+ "resourceURI": "http://gateway.marvel.com/v1/public/stories/15311",
236
+ "name": "",
237
+ "type": ""
238
+ },
239
+ {
240
+ "resourceURI": "http://gateway.marvel.com/v1/public/stories/15312",
241
+ "name": "For Crown and Conquest",
242
+ "type": ""
243
+ },
244
+ {
245
+ "resourceURI": "http://gateway.marvel.com/v1/public/stories/15313",
246
+ "name": "Savior of the Lost Artifacts",
247
+ "type": ""
248
+ },
249
+ {
250
+ "resourceURI": "http://gateway.marvel.com/v1/public/stories/15314",
251
+ "name": "Mission: Impossible Man",
252
+ "type": ""
253
+ },
254
+ {
255
+ "resourceURI": "http://gateway.marvel.com/v1/public/stories/15315",
256
+ "name": "Doctor Doom's Strength Comparison Page",
257
+ "type": ""
258
+ },
259
+ {
260
+ "resourceURI": "http://gateway.marvel.com/v1/public/stories/15316",
261
+ "name": "Game, Set, and Match: Ch. 14",
262
+ "type": ""
263
+ },
264
+ {
265
+ "resourceURI": "http://gateway.marvel.com/v1/public/stories/17393",
266
+ "name": "Avengers Annual (1967) #18",
267
+ "type": "cover"
268
+ },
269
+ {
270
+ "resourceURI": "http://gateway.marvel.com/v1/public/stories/17394",
271
+ "name": "Avengers Assembled",
272
+ "type": "interiorStory"
273
+ },
274
+ {
275
+ "resourceURI": "http://gateway.marvel.com/v1/public/stories/17395",
276
+ "name": "The Initiation of Quasar",
277
+ "type": "interiorStory"
278
+ },
279
+ {
280
+ "resourceURI": "http://gateway.marvel.com/v1/public/stories/17396",
281
+ "name": "Cap's Avengerability Analysis",
282
+ "type": "interiorStory"
283
+ },
284
+ {
285
+ "resourceURI": "http://gateway.marvel.com/v1/public/stories/17397",
286
+ "name": "The Saga of the Serpent Crown Chapter 8: Manifest Destiny",
287
+ "type": "interiorStory"
288
+ },
289
+ {
290
+ "resourceURI": "http://gateway.marvel.com/v1/public/stories/19855",
291
+ "name": "Atlantis Attacks Part 3",
292
+ "type": "cover"
293
+ },
294
+ {
295
+ "resourceURI": "http://gateway.marvel.com/v1/public/stories/19856",
296
+ "name": "Double Cross",
297
+ "type": "interiorStory"
298
+ },
299
+ {
300
+ "resourceURI": "http://gateway.marvel.com/v1/public/stories/19857",
301
+ "name": "Jubilation Day",
302
+ "type": "interiorStory"
303
+ },
304
+ {
305
+ "resourceURI": "http://gateway.marvel.com/v1/public/stories/19858",
306
+ "name": "The Saga of the Serpent Crown Part 3: Serpent In the Garden",
307
+ "type": "interiorStory"
308
+ },
309
+ {
310
+ "resourceURI": "http://gateway.marvel.com/v1/public/stories/21535",
311
+ "name": "Cover #21535",
312
+ "type": "cover"
313
+ },
314
+ {
315
+ "resourceURI": "http://gateway.marvel.com/v1/public/stories/21536",
316
+ "name": "Splash!",
317
+ "type": "interiorStory"
318
+ },
319
+ {
320
+ "resourceURI": "http://gateway.marvel.com/v1/public/stories/21622",
321
+ "name": "Cover #21622",
322
+ "type": "cover"
323
+ },
324
+ {
325
+ "resourceURI": "http://gateway.marvel.com/v1/public/stories/21623",
326
+ "name": "",
327
+ "type": "table of contents"
328
+ },
329
+ {
330
+ "resourceURI": "http://gateway.marvel.com/v1/public/stories/21624",
331
+ "name": "Here Be Monsters!",
332
+ "type": "interiorStory"
333
+ }
334
+ ],
335
+ "returned": 20
336
+ },
337
+ "comics": {
338
+ "available": 14,
339
+ "collectionURI": "http://gateway.marvel.com/v1/public/events/233/comics",
340
+ "items": [
341
+ {
342
+ "resourceURI": "http://gateway.marvel.com/v1/public/comics/16898",
343
+ "name": "Amazing Spider-Man Annual (1964) #23"
344
+ },
345
+ {
346
+ "resourceURI": "http://gateway.marvel.com/v1/public/comics/29321",
347
+ "name": "Atlantis Attacks (2011) #1"
348
+ },
349
+ {
350
+ "resourceURI": "http://gateway.marvel.com/v1/public/comics/29322",
351
+ "name": "Atlantis Attacks (DM Only) (2011)"
352
+ },
353
+ {
354
+ "resourceURI": "http://gateway.marvel.com/v1/public/comics/6932",
355
+ "name": "Avengers Annual (1967) #18"
356
+ },
357
+ {
358
+ "resourceURI": "http://gateway.marvel.com/v1/public/comics/17794",
359
+ "name": "Avengers West Coast (1985) #52"
360
+ },
361
+ {
362
+ "resourceURI": "http://gateway.marvel.com/v1/public/comics/17842",
363
+ "name": "Avengers West Coast Annual (1986) #4"
364
+ },
365
+ {
366
+ "resourceURI": "http://gateway.marvel.com/v1/public/comics/8701",
367
+ "name": "Fantastic Four Annual (1963) #22"
368
+ },
369
+ {
370
+ "resourceURI": "http://gateway.marvel.com/v1/public/comics/19861",
371
+ "name": "Iron Man Annual (1970) #10"
372
+ },
373
+ {
374
+ "resourceURI": "http://gateway.marvel.com/v1/public/comics/10417",
375
+ "name": "New Mutants (1983) #76"
376
+ },
377
+ {
378
+ "resourceURI": "http://gateway.marvel.com/v1/public/comics/10339",
379
+ "name": "New Mutants Annual (1984) #5"
380
+ },
381
+ {
382
+ "resourceURI": "http://gateway.marvel.com/v1/public/comics/16675",
383
+ "name": "Thor Annual (1966) #14"
384
+ },
385
+ {
386
+ "resourceURI": "http://gateway.marvel.com/v1/public/comics/18326",
387
+ "name": "What If? (1989) #25"
388
+ },
389
+ {
390
+ "resourceURI": "http://gateway.marvel.com/v1/public/comics/23512",
391
+ "name": "X-Factor Annual (1986) #4"
392
+ },
393
+ {
394
+ "resourceURI": "http://gateway.marvel.com/v1/public/comics/12359",
395
+ "name": "X-Men Annual (1970) #13"
396
+ }
397
+ ],
398
+ "returned": 14
399
+ },
400
+ "series": {
401
+ "available": 14,
402
+ "collectionURI": "http://gateway.marvel.com/v1/public/events/233/series",
403
+ "items": [
404
+ {
405
+ "resourceURI": "http://gateway.marvel.com/v1/public/series/2984",
406
+ "name": "Amazing Spider-Man Annual (1964 - 2009)"
407
+ },
408
+ {
409
+ "resourceURI": "http://gateway.marvel.com/v1/public/series/10030",
410
+ "name": "Atlantis Attacks (2011)"
411
+ },
412
+ {
413
+ "resourceURI": "http://gateway.marvel.com/v1/public/series/10031",
414
+ "name": "Atlantis Attacks (DM Only) (2011)"
415
+ },
416
+ {
417
+ "resourceURI": "http://gateway.marvel.com/v1/public/series/1988",
418
+ "name": "Avengers Annual (1967 - 1994)"
419
+ },
420
+ {
421
+ "resourceURI": "http://gateway.marvel.com/v1/public/series/3623",
422
+ "name": "Avengers West Coast (1985 - 1994)"
423
+ },
424
+ {
425
+ "resourceURI": "http://gateway.marvel.com/v1/public/series/3624",
426
+ "name": "Avengers West Coast Annual (1986 - 1993)"
427
+ },
428
+ {
429
+ "resourceURI": "http://gateway.marvel.com/v1/public/series/2012",
430
+ "name": "Fantastic Four Annual (1963 - 1994)"
431
+ },
432
+ {
433
+ "resourceURI": "http://gateway.marvel.com/v1/public/series/3723",
434
+ "name": "Iron Man Annual (1970 - 1994)"
435
+ },
436
+ {
437
+ "resourceURI": "http://gateway.marvel.com/v1/public/series/2055",
438
+ "name": "New Mutants (1983 - 1991)"
439
+ },
440
+ {
441
+ "resourceURI": "http://gateway.marvel.com/v1/public/series/2053",
442
+ "name": "New Mutants Annual (1984 - 1991)"
443
+ },
444
+ {
445
+ "resourceURI": "http://gateway.marvel.com/v1/public/series/2978",
446
+ "name": "Thor Annual (1966 - 2001)"
447
+ },
448
+ {
449
+ "resourceURI": "http://gateway.marvel.com/v1/public/series/3648",
450
+ "name": "What If? (1989 - 1998)"
451
+ },
452
+ {
453
+ "resourceURI": "http://gateway.marvel.com/v1/public/series/6689",
454
+ "name": "X-Factor Annual (1986 - 1994)"
455
+ },
456
+ {
457
+ "resourceURI": "http://gateway.marvel.com/v1/public/series/2100",
458
+ "name": "X-Men Annual (1970 - 1994)"
459
+ }
460
+ ],
461
+ "returned": 14
462
+ },
463
+ "next": {
464
+ "resourceURI": "http://gateway.marvel.com/v1/public/events/116",
465
+ "name": "Acts of Vengeance!"
466
+ },
467
+ "previous": {
468
+ "resourceURI": "http://gateway.marvel.com/v1/public/events/252",
469
+ "name": "Inferno"
470
+ }
471
+ }
472
+ ]
473
+ }
474
+ }