red5 0.0.2 → 0.0.3

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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +1 -0
  3. data/README.md +55 -1
  4. data/Rakefile +3 -1
  5. data/lib/red_5.rb +19 -0
  6. data/lib/red_5/exceptions/red_5_exception.rb +9 -0
  7. data/lib/red_5/helpers.rb +8 -0
  8. data/lib/red_5/models/entities.rb +54 -0
  9. data/lib/{red5 → red_5/models}/films.rb +1 -1
  10. data/lib/{red5 → red_5/models}/people.rb +1 -1
  11. data/lib/{red5 → red_5/models}/planets.rb +1 -1
  12. data/lib/{red5 → red_5/models}/species.rb +1 -1
  13. data/lib/{red5 → red_5/models}/starships.rb +1 -1
  14. data/lib/{red5 → red_5/models}/vehicles.rb +1 -1
  15. data/lib/{red5 → red_5}/root.rb +1 -1
  16. data/lib/red_5/version.rb +3 -0
  17. data/red5.gemspec +4 -1
  18. data/spec/cassettes/Failure/404s/raises_an_exception_on_a_ludicrous_request.yml +96 -0
  19. data/spec/cassettes/Failure/404s/raises_an_exception_on_a_non-existent_thing.yml +96 -0
  20. data/spec/cassettes/Failure/Non-existent_attributes/raises_an_exception_on_a_bogus_lookup.yml +101 -0
  21. data/spec/cassettes/Red5_Films/finds_a_particular_film.yml +111 -0
  22. data/spec/cassettes/Red5_Films/has_OpenStruct-type_lookups.yml +111 -0
  23. data/spec/cassettes/Red5_Films/returns_a_film.yml +111 -0
  24. data/spec/cassettes/Red5_People/fetches_the_species_for_a_person.yml +155 -0
  25. data/spec/cassettes/{Red_5_People/should_find_a_person.yml → Red5_People/finds_a_particular_person.yml} +13 -13
  26. data/spec/cassettes/Red5_People/has_an_id.yml +101 -0
  27. data/spec/cassettes/Red5_People/returns_a_person.yml +101 -0
  28. data/spec/cassettes/{Red_5_Planets/should_find_a_planet.yml → Red5_Planets/finds_a_planet.yml} +18 -18
  29. data/spec/cassettes/Red5_Species/fetches_the_homeworld_for_a_species.yml +157 -0
  30. data/spec/cassettes/Red5_Species/finds_a_homeworld_for_a_species.yml +101 -0
  31. data/spec/cassettes/Red5_Species/finds_a_species.yml +101 -0
  32. data/spec/cassettes/Red5_Starships/Failure/raises_an_exception_on_a_ludicrous_request.yml +96 -0
  33. data/spec/cassettes/Red5_Starships/Failure/raises_an_exception_on_a_non-existent_thing.yml +96 -0
  34. data/spec/cassettes/Red5_Starships/finds_a_starship.yml +102 -0
  35. data/spec/cassettes/Red5_Vehicles/finds_a_vehicle.yml +102 -0
  36. data/spec/cassettes/Red_5_Films/finds_a_particular_film.yml +111 -0
  37. data/spec/cassettes/Red_5_Films/returns_a_film.yml +111 -0
  38. data/spec/cassettes/Red_5_People/fetches_the_species_for_a_person.yml +155 -0
  39. data/spec/cassettes/Red_5_People/finds_a_particular_person.yml +101 -0
  40. data/spec/cassettes/Red_5_People/gets_the_species_for_a_person.yml +252 -0
  41. data/spec/cassettes/Red_5_People/has_an_id.yml +101 -0
  42. data/spec/cassettes/Red_5_People/returns_a_person.yml +101 -0
  43. data/spec/cassettes/Red_5_Species/fetches_the_homeworld_for_a_species.yml +157 -0
  44. data/spec/cassettes/Red_5_Species/finds_a_homeworld_for_a_species.yml +101 -0
  45. data/spec/cassettes/Red_5_Species/gets_the_homeworld_for_a_species.yml +157 -0
  46. data/spec/cassettes/Red_5_Starships/Failure/raises_an_exception_on_a_non-existent_thing.yml +96 -0
  47. data/spec/failure_spec.rb +31 -0
  48. data/spec/models/films_spec.rb +15 -0
  49. data/spec/models/people_spec.rb +25 -0
  50. data/spec/models/planets_spec.rb +10 -0
  51. data/spec/models/species_spec.rb +20 -0
  52. data/spec/models/starships_spec.rb +10 -0
  53. data/spec/models/vehicles_spec.rb +10 -0
  54. data/spec/red5_spec.rb +2 -45
  55. data/spec/spec_helper.rb +1 -1
  56. metadata +129 -17
  57. data/lib/red5.rb +0 -14
  58. data/lib/red5/entities.rb +0 -9
  59. data/lib/red5/version.rb +0 -3
@@ -0,0 +1,101 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://swapi.co/api/people/7
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*; q=0.5, application/xml"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 301
19
+ message: MOVED PERMANENTLY
20
+ headers:
21
+ Date:
22
+ - Tue, 23 Dec 2014 11:02:19 GMT
23
+ Content-Type:
24
+ - text/html; charset=utf-8
25
+ Transfer-Encoding:
26
+ - chunked
27
+ Connection:
28
+ - keep-alive
29
+ Set-Cookie:
30
+ - __cfduid=dff7fb175434bd0c65d08691140f866321419332539; expires=Wed, 23-Dec-15
31
+ 11:02:19 GMT; path=/; domain=.swapi.co; HttpOnly
32
+ Location:
33
+ - http://swapi.co/api/people/7/
34
+ X-Frame-Options:
35
+ - SAMEORIGIN
36
+ Via:
37
+ - 1.1 vegur
38
+ Server:
39
+ - cloudflare-nginx
40
+ Cf-Ray:
41
+ - 19d410f296230a72-LHR
42
+ body:
43
+ encoding: UTF-8
44
+ string: ''
45
+ http_version:
46
+ recorded_at: Tue, 23 Dec 2014 11:02:19 GMT
47
+ - request:
48
+ method: get
49
+ uri: http://swapi.co/api/people/7/
50
+ body:
51
+ encoding: US-ASCII
52
+ string: ''
53
+ headers:
54
+ Accept:
55
+ - "*/*; q=0.5, application/xml"
56
+ Accept-Encoding:
57
+ - gzip, deflate
58
+ Cookie:
59
+ - __cfduid=dff7fb175434bd0c65d08691140f866321419332539; domain=.swapi.co
60
+ User-Agent:
61
+ - Ruby
62
+ response:
63
+ status:
64
+ code: 200
65
+ message: OK
66
+ headers:
67
+ Date:
68
+ - Tue, 23 Dec 2014 11:02:20 GMT
69
+ Content-Type:
70
+ - application/json
71
+ Transfer-Encoding:
72
+ - chunked
73
+ Connection:
74
+ - keep-alive
75
+ Allow:
76
+ - GET, HEAD, OPTIONS
77
+ X-Frame-Options:
78
+ - SAMEORIGIN
79
+ Vary:
80
+ - Accept, Cookie
81
+ Via:
82
+ - 1.1 vegur
83
+ Server:
84
+ - cloudflare-nginx
85
+ Cf-Ray:
86
+ - 19d410f40b880a78-LHR
87
+ Content-Encoding:
88
+ - gzip
89
+ body:
90
+ encoding: ASCII-8BIT
91
+ string: !binary |-
92
+ H4sIAAAAAAAAAwAAAP//fJDRTsMgFIZfZeF6K5yuXSOXfYYlRo1ZWHc2iBQI
93
+ UJvF+O4e5tSYOK/g//6PAOeNOTUik6zHOC3utcmYJrewKia2ZBrNSWdqYdNS
94
+ HFVKFLqy18rE3eCtj0T20c+OYHox7hvay9klwzP+iHZCQnsTs96dURXWdH3/
95
+ QPCE7oAFHHFUtmjajzj7aA8Edc5Bcp5mFUw1eE4LD1Y5zIkDJ/lo7Eive/rT
96
+ vJSf3u26/b/ecPZMXww4GCwXUXhFbQb7lVKmqWkTrnGIqDKWt9cCmhXUKxBb
97
+ aGW7lg1UUIMQ4rHM52B+a7XY1iChk62o1nB31aZob40BfbDIO87ePwAAAP//
98
+ AwBt07M7zwEAAA==
99
+ http_version:
100
+ recorded_at: Tue, 23 Dec 2014 11:02:20 GMT
101
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,252 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://swapi.co/api/people/15
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*; q=0.5, application/xml"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 301
19
+ message: MOVED PERMANENTLY
20
+ headers:
21
+ Date:
22
+ - Mon, 22 Dec 2014 22:17:30 GMT
23
+ Content-Type:
24
+ - text/html; charset=utf-8
25
+ Transfer-Encoding:
26
+ - chunked
27
+ Connection:
28
+ - keep-alive
29
+ Set-Cookie:
30
+ - __cfduid=d17cc3b87b9f79d81b5b569f7c6dfd9eb1419286649; expires=Tue, 22-Dec-15
31
+ 22:17:29 GMT; path=/; domain=.swapi.co; HttpOnly
32
+ X-Frame-Options:
33
+ - SAMEORIGIN
34
+ Location:
35
+ - http://swapi.co/api/people/15/
36
+ Via:
37
+ - 1.1 vegur
38
+ Server:
39
+ - cloudflare-nginx
40
+ Cf-Ray:
41
+ - 19cfb09942720a72-LHR
42
+ body:
43
+ encoding: UTF-8
44
+ string: ''
45
+ http_version:
46
+ recorded_at: Mon, 22 Dec 2014 22:17:30 GMT
47
+ - request:
48
+ method: get
49
+ uri: http://swapi.co/api/people/15/
50
+ body:
51
+ encoding: US-ASCII
52
+ string: ''
53
+ headers:
54
+ Accept:
55
+ - "*/*; q=0.5, application/xml"
56
+ Accept-Encoding:
57
+ - gzip, deflate
58
+ Cookie:
59
+ - __cfduid=d17cc3b87b9f79d81b5b569f7c6dfd9eb1419286649; domain=.swapi.co
60
+ User-Agent:
61
+ - Ruby
62
+ response:
63
+ status:
64
+ code: 200
65
+ message: OK
66
+ headers:
67
+ Date:
68
+ - Mon, 22 Dec 2014 22:17:30 GMT
69
+ Content-Type:
70
+ - application/json
71
+ Transfer-Encoding:
72
+ - chunked
73
+ Connection:
74
+ - keep-alive
75
+ X-Frame-Options:
76
+ - SAMEORIGIN
77
+ Allow:
78
+ - GET, HEAD, OPTIONS
79
+ Vary:
80
+ - Accept, Cookie
81
+ Via:
82
+ - 1.1 vegur
83
+ Server:
84
+ - cloudflare-nginx
85
+ Cf-Ray:
86
+ - 19cfb09abd5d0a72-LHR
87
+ Content-Encoding:
88
+ - gzip
89
+ body:
90
+ encoding: ASCII-8BIT
91
+ string: !binary |-
92
+ H4sIAAAAAAAAA3SQwWoDIRRF/8V1k6ej6cAss8kPZNOWEozzOkocFbUNofTf
93
+ +xyGQKFZyT3vqFe/WdAzsoEdMuIY2ROz6CZbiYheUpx1KRR61Uba5ZOJPmYi
94
+ ATShcnHhjiY6IxDEG97Z2WtzIXZ2udrTDXWDSu33LwQnDCM2MGuP7YI44zVm
95
+ PxKytaYBoFx1clsTgRZIXgesBToJZH84P1O3t3/VZQgC2DuVTGgcPlTXMahF
96
+ /kLrjF/strXqXKxLazQZdcVWr+NCbUS3Efwo+oHLQfKtlIpz/tp+YHR/tY4f
97
+ OzGQuWva86p9Zv/opRiTRxA7YD+/AAAA//8DAARbVvykAQAA
98
+ http_version:
99
+ recorded_at: Mon, 22 Dec 2014 22:17:30 GMT
100
+ - request:
101
+ method: get
102
+ uri: http://swapi.co/api/people/15
103
+ body:
104
+ encoding: US-ASCII
105
+ string: ''
106
+ headers:
107
+ Accept:
108
+ - "*/*; q=0.5, application/xml"
109
+ Accept-Encoding:
110
+ - gzip, deflate
111
+ User-Agent:
112
+ - Ruby
113
+ response:
114
+ status:
115
+ code: 301
116
+ message: MOVED PERMANENTLY
117
+ headers:
118
+ Date:
119
+ - Mon, 22 Dec 2014 22:17:30 GMT
120
+ Content-Type:
121
+ - text/html; charset=utf-8
122
+ Transfer-Encoding:
123
+ - chunked
124
+ Connection:
125
+ - keep-alive
126
+ Set-Cookie:
127
+ - __cfduid=ddad9a599d59bdf89caa54e37115d99cb1419286650; expires=Tue, 22-Dec-15
128
+ 22:17:30 GMT; path=/; domain=.swapi.co; HttpOnly
129
+ Location:
130
+ - http://swapi.co/api/people/15/
131
+ X-Frame-Options:
132
+ - SAMEORIGIN
133
+ Via:
134
+ - 1.1 vegur
135
+ Server:
136
+ - cloudflare-nginx
137
+ Cf-Ray:
138
+ - 19cfb09dd58f0a72-LHR
139
+ body:
140
+ encoding: UTF-8
141
+ string: ''
142
+ http_version:
143
+ recorded_at: Mon, 22 Dec 2014 22:17:30 GMT
144
+ - request:
145
+ method: get
146
+ uri: http://swapi.co/api/people/15/
147
+ body:
148
+ encoding: US-ASCII
149
+ string: ''
150
+ headers:
151
+ Accept:
152
+ - "*/*; q=0.5, application/xml"
153
+ Accept-Encoding:
154
+ - gzip, deflate
155
+ Cookie:
156
+ - __cfduid=ddad9a599d59bdf89caa54e37115d99cb1419286650; domain=.swapi.co
157
+ User-Agent:
158
+ - Ruby
159
+ response:
160
+ status:
161
+ code: 200
162
+ message: OK
163
+ headers:
164
+ Date:
165
+ - Mon, 22 Dec 2014 22:17:31 GMT
166
+ Content-Type:
167
+ - application/json
168
+ Transfer-Encoding:
169
+ - chunked
170
+ Connection:
171
+ - keep-alive
172
+ Allow:
173
+ - GET, HEAD, OPTIONS
174
+ X-Frame-Options:
175
+ - SAMEORIGIN
176
+ Vary:
177
+ - Accept, Cookie
178
+ Via:
179
+ - 1.1 vegur
180
+ Server:
181
+ - cloudflare-nginx
182
+ Cf-Ray:
183
+ - 19cfb09f437c0a72-LHR
184
+ Content-Encoding:
185
+ - gzip
186
+ body:
187
+ encoding: ASCII-8BIT
188
+ string: !binary |-
189
+ H4sIAAAAAAAAA3SQwWoDIRRF/8V1k6ej6cAss8kPZNOWEozzOkocFbUNofTf
190
+ +xyGQKFZyT3vqFe/WdAzsoEdMuIY2ROz6CZbiYheUpx1KRR61Uba5ZOJPmYi
191
+ ATShcnHhjiY6IxDEG97Z2WtzIXZ2udrTDXWDSu33LwQnDCM2MGuP7YI44zVm
192
+ PxKytaYBoFx1clsTgRZIXgesBToJZH84P1O3t3/VZQgC2DuVTGgcPlTXMahF
193
+ /kLrjF/strXqXKxLazQZdcVWr+NCbUS3Efwo+oHLQfKtlIpz/tp+YHR/tY4f
194
+ OzGQuWva86p9Zv/opRiTRxA7YD+/AAAA//8DAARbVvykAQAA
195
+ http_version:
196
+ recorded_at: Mon, 22 Dec 2014 22:17:31 GMT
197
+ - request:
198
+ method: get
199
+ uri: http://swapi.co/api/species/4/
200
+ body:
201
+ encoding: US-ASCII
202
+ string: ''
203
+ headers:
204
+ Accept:
205
+ - "*/*; q=0.5, application/xml"
206
+ Accept-Encoding:
207
+ - gzip, deflate
208
+ User-Agent:
209
+ - Ruby
210
+ response:
211
+ status:
212
+ code: 200
213
+ message: OK
214
+ headers:
215
+ Date:
216
+ - Mon, 22 Dec 2014 22:17:33 GMT
217
+ Content-Type:
218
+ - application/json
219
+ Transfer-Encoding:
220
+ - chunked
221
+ Connection:
222
+ - keep-alive
223
+ Set-Cookie:
224
+ - __cfduid=df869a8644d4469b4b10952a4dd5300161419286651; expires=Tue, 22-Dec-15
225
+ 22:17:31 GMT; path=/; domain=.swapi.co; HttpOnly
226
+ Allow:
227
+ - GET, HEAD, OPTIONS
228
+ X-Frame-Options:
229
+ - SAMEORIGIN
230
+ Vary:
231
+ - Accept, Cookie
232
+ Via:
233
+ - 1.1 vegur
234
+ Server:
235
+ - cloudflare-nginx
236
+ Cf-Ray:
237
+ - 19cfb0a1f2c40a72-LHR
238
+ Content-Encoding:
239
+ - gzip
240
+ body:
241
+ encoding: ASCII-8BIT
242
+ string: !binary |-
243
+ H4sIAAAAAAAAA3SPT0sDMRDFv4rk3DZ/um1hj168S0+KlGl2ujs0TUImaxHx
244
+ uztblSrYQwh5v5c3895VhBOqVj2mjiCqmfIBmOlAHiqlKIQxVpIjrEOmPv6A
245
+ grlS+PoFr1igx92A1A9VoN0YkflIcedTSIVF6wtinN3tw4jCBqByZVGDaPiG
246
+ V2kfwB9/ZQc6IGeYRo/xGNN5GjykE55TCZ2oQ6251ZrPkGnhk5ZL5wARK2u3
247
+ 1OKWRz9KlpgfIEgRf3cPTF5QxpSDgOf/Yy5U25VWLzN1oHDiW9YL1PZi9AWh
248
+ 4rSbM7aZWze3Zms3rVm1br1oNtYY8zT17uivzZmts+1y3TZuYZvm2zaWcKMm
249
+ Z/SErButPj4BAAD//wMAauZPrtQBAAA=
250
+ http_version:
251
+ recorded_at: Mon, 22 Dec 2014 22:17:33 GMT
252
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,101 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://swapi.co/api/people/13
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - "*/*; q=0.5, application/xml"
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 301
19
+ message: MOVED PERMANENTLY
20
+ headers:
21
+ Date:
22
+ - Tue, 23 Dec 2014 11:20:32 GMT
23
+ Content-Type:
24
+ - text/html; charset=utf-8
25
+ Transfer-Encoding:
26
+ - chunked
27
+ Connection:
28
+ - keep-alive
29
+ Set-Cookie:
30
+ - __cfduid=df965b2a0c9557140c6625ce3eea283a21419333632; expires=Wed, 23-Dec-15
31
+ 11:20:32 GMT; path=/; domain=.swapi.co; HttpOnly
32
+ Location:
33
+ - http://swapi.co/api/people/13/
34
+ X-Frame-Options:
35
+ - SAMEORIGIN
36
+ Via:
37
+ - 1.1 vegur
38
+ Server:
39
+ - cloudflare-nginx
40
+ Cf-Ray:
41
+ - 19d42ba15a670a78-LHR
42
+ body:
43
+ encoding: UTF-8
44
+ string: ''
45
+ http_version:
46
+ recorded_at: Tue, 23 Dec 2014 11:20:32 GMT
47
+ - request:
48
+ method: get
49
+ uri: http://swapi.co/api/people/13/
50
+ body:
51
+ encoding: US-ASCII
52
+ string: ''
53
+ headers:
54
+ Accept:
55
+ - "*/*; q=0.5, application/xml"
56
+ Accept-Encoding:
57
+ - gzip, deflate
58
+ Cookie:
59
+ - __cfduid=df965b2a0c9557140c6625ce3eea283a21419333632; domain=.swapi.co
60
+ User-Agent:
61
+ - Ruby
62
+ response:
63
+ status:
64
+ code: 200
65
+ message: OK
66
+ headers:
67
+ Date:
68
+ - Tue, 23 Dec 2014 11:20:33 GMT
69
+ Content-Type:
70
+ - application/json
71
+ Transfer-Encoding:
72
+ - chunked
73
+ Connection:
74
+ - keep-alive
75
+ Allow:
76
+ - GET, HEAD, OPTIONS
77
+ X-Frame-Options:
78
+ - SAMEORIGIN
79
+ Vary:
80
+ - Accept, Cookie
81
+ Via:
82
+ - 1.1 vegur
83
+ Server:
84
+ - cloudflare-nginx
85
+ Cf-Ray:
86
+ - 19d42ba29a980a78-LHR
87
+ Content-Encoding:
88
+ - gzip
89
+ body:
90
+ encoding: ASCII-8BIT
91
+ string: !binary |-
92
+ H4sIAAAAAAAAAwAAAP//fJHBbsIwDIbfpedBYlO6rUd4BS7bNKGQeiQiTao0
93
+ XYWmvfscYKBJK6fI3//FcpyvwquWirpYGxp3SmtVPBSG7N4khohPXLaq77kA
94
+ wJwpG7c6uBAZ7WIYPcP+YP0VDv7gz5iOdFPdQIx2NiazPZLKDKVcrV6Y7sk3
95
+ lEmrXLZMaGkM0TWMTEpdLUQ/qs7OdRB8iM4pT6kXUAq2P6xrecC3f9VTKCB7
96
+ 0zHejxf340oU77yDjrSlyTkuce7F8icZq920/ZsLeD43Tyr2xnaTF66CADk1
97
+ 7c1BPHXVkVSivGSUUM4AZyA3UNUl1uVyLqtKSvma/7GxfzWUG4QaHuulnC8W
98
+ eNGG6Kb+i0LnSAA//vsHAAD//wMAyyaXinICAAA=
99
+ http_version:
100
+ recorded_at: Tue, 23 Dec 2014 11:20:32 GMT
101
+ recorded_with: VCR 2.9.3