red5 0.0.1 → 0.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1bb49b333c808a9768fb5b486439fceeea835de9
4
- data.tar.gz: 857af910f7b74427072ce7e42f724b603a53a02f
3
+ metadata.gz: 1cc0bb9c1ac63bfe093999941d97cc3c23669dde
4
+ data.tar.gz: e637e3d181140613b101c1f3cad14380fc5c0e04
5
5
  SHA512:
6
- metadata.gz: 1efb5bcd4c275a23cafb8024993d32a91ce1bbcd0d66e7c31d97b0a82fe602db811ffa60bbd03be529acdfb119bb5700c4f74c24c52d634aca1645d900888b1c
7
- data.tar.gz: 4121c9b5f99c01bea377039b48e7205d4bfcc3f84037b20d62ed18957a08841e50cad1e29f5839e81473bf5692e9670a0dd34dcae4d9a14b001a471d05d7e92a
6
+ metadata.gz: ec3efe49f6f54dfe101d859670c9fce2d55d0a73b2f7378a5e3461fc34ffe8092070746edaaf17955d2d83b4cdfe6ef56d9531c413ba71b305379e42aa68e305
7
+ data.tar.gz: faee78ecede73f6f88cfaf3fbda81c92eb322da9cb0b665dfd13b254333ff519d13497f2867ccdcaffa0a077961c9ce11b915d78718d46aa1506abb38392d17d
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.5
data/README.md CHANGED
@@ -1,3 +1,10 @@
1
+ [![Build Status](https://travis-ci.org/pikesley/red5.svg)](https://travis-ci.org/pikesley/red5)
2
+ [![Dependency Status](http://img.shields.io/gemnasium/pikesley/red5.svg)](https://gemnasium.com/pikesley/red5)
3
+ [![Code Climate](http://img.shields.io/codeclimate/github/pikesley/red5.svg)](https://codeclimate.com/github/pikesley/red5)
4
+ [![Gem Version](http://img.shields.io/gem/v/red5.svg)](https://rubygems.org/gems/red5)
5
+ [![License](http://img.shields.io/:license-mit-blue.svg)](http://pikesley.mit-license.org)
6
+ [![Badges](http://img.shields.io/:badges-6/6-ff6799.svg)](https://github.com/badges/badgerbadgerbadger)
7
+
1
8
  # Red5
2
9
 
3
10
  Ruby bindings for the [Star Wars API](http://swapi.co)
@@ -2,4 +2,13 @@ require 'rest_client'
2
2
  require 'json'
3
3
 
4
4
  require 'red5/version'
5
+
6
+ require 'red5/root'
7
+ require 'red5/entities'
8
+
9
+ require 'red5/films'
10
+ require 'red5/people'
5
11
  require 'red5/planets'
12
+ require 'red5/species'
13
+ require 'red5/starships'
14
+ require 'red5/vehicles'
@@ -0,0 +1,9 @@
1
+ module Red_5
2
+ class Entities
3
+ def self.find id
4
+ slug = self.name.split('::').last.downcase
5
+ resource = RestClient::Resource.new "http://swapi.co/api/#{slug}/#{id}"
6
+ JSON.parse resource.get.body
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,4 @@
1
+ module Red_5
2
+ class Films < Entities
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Red_5
2
+ class People < Entities
3
+ end
4
+ end
@@ -1,8 +1,4 @@
1
1
  module Red_5
2
- class Planets
3
- def self.find id
4
- resource = RestClient::Resource.new "http://swapi.co/api/planets/#{id}"
5
- JSON.parse resource.get.body
6
- end
2
+ class Planets < Entities
7
3
  end
8
4
  end
@@ -0,0 +1,8 @@
1
+ module Red_5
2
+ class Root
3
+ def self.all
4
+ resource = RestClient::Resource.new "http://swapi.co/api/"
5
+ JSON.parse resource.get.body
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,4 @@
1
+ module Red_5
2
+ class Species < Entities
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Red_5
2
+ class Starships < Entities
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Red_5
2
+ class Vehicles < Entities
3
+ end
4
+ end
@@ -1,3 +1,3 @@
1
1
  module Red5
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -0,0 +1,111 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://swapi.co/api/films/1
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 21:18:40 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=d267891c2bc3dff31486725148b7b39a11419283120; expires=Tue, 22-Dec-15
31
+ 21:18:40 GMT; path=/; domain=.swapi.co; HttpOnly
32
+ X-Frame-Options:
33
+ - SAMEORIGIN
34
+ Location:
35
+ - http://swapi.co/api/films/1/
36
+ Via:
37
+ - 1.1 vegur
38
+ Server:
39
+ - cloudflare-nginx
40
+ Cf-Ray:
41
+ - 19cf5a6c00750a72-LHR
42
+ body:
43
+ encoding: UTF-8
44
+ string: ''
45
+ http_version:
46
+ recorded_at: Mon, 22 Dec 2014 21:18:40 GMT
47
+ - request:
48
+ method: get
49
+ uri: http://swapi.co/api/films/1/
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=d267891c2bc3dff31486725148b7b39a11419283120; 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 21:18:40 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
+ - 19cf5a6cdc1c0a72-LHR
87
+ Content-Encoding:
88
+ - gzip
89
+ body:
90
+ encoding: ASCII-8BIT
91
+ string: !binary |-
92
+ H4sIAAAAAAAAA4STUW/TQAzHv4qVF16ilsCA0beKTRtioGnsjaHJvXMba8nd
93
+ yXdpKHx5fEnZC+quUlQpP9t/+2/nT5U4dVStqjV8oxGufaCqrihw9JYe2Var
94
+ s7rSl47d7tEIjp3Gfk7AERACCXsLfguG99zBiLJ4kAd3RxvqIAY0FFsOsYaY
95
+ hJ+0RKZb8b0mt2wtOdhgpBpa3BOM3mWeWmKBLUtMsGeTvBwAd8gupiMGympX
96
+ 2KFJbOCyDyw0KefnYhBVghy3waTT1TA1lFkMTBF6dLgjC8lrY4TaKhmhqXro
97
+ 0MUMcvpc+FXMYOgS95i0S8LgXT0FXFyu768z/X6/vqsBHaD0XrT0NPykmDCx
98
+ dzByaoGcH3YtBD+STLN4sKTe+EPOJZdUDnILlJ7HuR0kDlpxc/ivp8iOdQBR
99
+ ezRXbb7VydXzCd4QI0heAbS+J8CNR7HQzsraluTd1GCGmLxl1dc9qsJMfae7
100
+ OZrRYgKjPOYlHfMD+dBpUWdBdAKdOb/dCpHV7R792+mGfh0W+tObstp2Xqbe
101
+ zxV52RHcDAajkiDeDoYmgrrsL4Ok37o0Nk/w1XzCrht6DTMt6jg6bqxWP6o2
102
+ pbBaLuOIgRfGL/VvOTe1bJYa/QJ/U+BvC/yswN8V+PsC/1Dg5wX+scCb16WA
103
+ kkNNyaKm5FFTMqkpudSUbGhKPpzrofzU85u+t9NHNeMXruYYcNqTY8As9+/L
104
+ Oyn4HDBL/gUAAP//jJbPCoMwDMbfZXelie3o+hyednWVFRRk4G57d6PrHwW/
105
+ sdJbfrTJl6TpbwReWhCodEGgUgXBRbNjYOftmD+CWstLlHr7Z+gGD4VKdtyQ
106
+ mYDFlAnYdJmw3/RNvgvYp2jGb1ACsAwRwJmNAIw6AWZzWCabjC0Z5BdWpCvi
107
+ ilRL2nHjGqqtVbLucpJ/hCPGgt2clm1qNteIza/1B3B2bR+GcQv8swAAAP//
108
+ AwAhKm2rVggAAA==
109
+ http_version:
110
+ recorded_at: Mon, 22 Dec 2014 21:18:40 GMT
111
+ 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/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
+ - Mon, 22 Dec 2014 21:14:46 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=da29c9ee58cbf13639c69c257133f29461419282886; expires=Tue, 22-Dec-15
31
+ 21:14:46 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
+ - 19cf54b9543e0a72-LHR
42
+ body:
43
+ encoding: UTF-8
44
+ string: ''
45
+ http_version:
46
+ recorded_at: Mon, 22 Dec 2014 21:14:46 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=da29c9ee58cbf13639c69c257133f29461419282886; 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 21:14:47 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
+ - 19cf54baa7c70a72-LHR
87
+ Content-Encoding:
88
+ - gzip
89
+ body:
90
+ encoding: ASCII-8BIT
91
+ string: !binary |-
92
+ H4sIAAAAAAAAA3yQ0U7DIBSGX2Xheiucrl0jl32GJUaNWVh3NogUCFCbxfju
93
+ HubUmDiv4P/+jwDnjTk1IpOsxzgt7rXJmCa3sComtmQazUlnamHTUhxVShS6
94
+ stfKxN3grY9E9tHPjmB6Me4b2svZJcMz/oh2QkJ7E7PenVEV1nR9/0DwhO6A
95
+ BRxxVLZo2o84+2gPBHXOQXKeZhVMNXhOCw9WOcyJAyf5aOxIr3v607yUn97t
96
+ uv2/3nD2TF8MOBgsF1F4RW0G+5VSpqlpE65xiKgylrfXApoV1CsQW2hlu5YN
97
+ VFCDEOKxzOdgfmu12NYgoZOtqNZwd9WmaG+NAX2wyDvO3j8AAAD//wMAbdOz
98
+ O88BAAA=
99
+ http_version:
100
+ recorded_at: Mon, 22 Dec 2014 21:14:47 GMT
101
+ 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/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
+ - Mon, 22 Dec 2014 21:09:39 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=d49e65f1001ab55df6be2525775bfdee11419282578; expires=Tue, 22-Dec-15
31
+ 21:09:38 GMT; path=/; domain=.swapi.co; HttpOnly
32
+ X-Frame-Options:
33
+ - SAMEORIGIN
34
+ Location:
35
+ - http://swapi.co/api/people/7/
36
+ Via:
37
+ - 1.1 vegur
38
+ Server:
39
+ - cloudflare-nginx
40
+ Cf-Ray:
41
+ - 19cf4d35bbdd0a72-LHR
42
+ body:
43
+ encoding: UTF-8
44
+ string: ''
45
+ http_version:
46
+ recorded_at: Mon, 22 Dec 2014 21:09:39 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=d49e65f1001ab55df6be2525775bfdee11419282578; 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 21:09:39 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
+ - 19cf4d37141e0a72-LHR
87
+ Content-Encoding:
88
+ - gzip
89
+ body:
90
+ encoding: ASCII-8BIT
91
+ string: !binary |-
92
+ H4sIAAAAAAAAA3yQ0U7DIBSGX2Xheiucrl0jl32GJUaNWVh3NogUCFCbxfju
93
+ HubUmDiv4P/+jwDnjTk1IpOsxzgt7rXJmCa3sComtmQazUlnamHTUhxVShS6
94
+ stfKxN3grY9E9tHPjmB6Me4b2svZJcMz/oh2QkJ7E7PenVEV1nR9/0DwhO6A
95
+ BRxxVLZo2o84+2gPBHXOQXKeZhVMNXhOCw9WOcyJAyf5aOxIr3v607yUn97t
96
+ uv2/3nD2TF8MOBgsF1F4RW0G+5VSpqlpE65xiKgylrfXApoV1CsQW2hlu5YN
97
+ VFCDEOKxzOdgfmu12NYgoZOtqNZwd9WmaG+NAX2wyDvO3j8AAAD//wMAbdOz
98
+ O88BAAA=
99
+ http_version:
100
+ recorded_at: Mon, 22 Dec 2014 21:09:39 GMT
101
+ 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/planets/2
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 21:14:44 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=dd8e20390e5e100280d1b4d6b431fceaa1419282884; expires=Tue, 22-Dec-15
31
+ 21:14:44 GMT; path=/; domain=.swapi.co; HttpOnly
32
+ X-Frame-Options:
33
+ - SAMEORIGIN
34
+ Location:
35
+ - http://swapi.co/api/planets/2/
36
+ Via:
37
+ - 1.1 vegur
38
+ Server:
39
+ - cloudflare-nginx
40
+ Cf-Ray:
41
+ - 19cf54ab1e100a78-LHR
42
+ body:
43
+ encoding: UTF-8
44
+ string: ''
45
+ http_version:
46
+ recorded_at: Mon, 22 Dec 2014 21:14:44 GMT
47
+ - request:
48
+ method: get
49
+ uri: http://swapi.co/api/planets/2/
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=dd8e20390e5e100280d1b4d6b431fceaa1419282884; 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 21:14:45 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
+ - 19cf54ace3280a72-LHR
87
+ Content-Encoding:
88
+ - gzip
89
+ body:
90
+ encoding: ASCII-8BIT
91
+ string: !binary |-
92
+ H4sIAAAAAAAAA4SQ3U7EIBCFX2XDdXeBblsrd77DXmnMZiyzSkKBwNSNMb67
93
+ QzfGmLjKDeScjzM/7yLAjMKIO28xAwTRiBwJyMVwTJhdtGy2HcsxPzkC/63u
94
+ hypbxwGEmQXd9kqxNHk3A9VUwpnx+m7Ec4ZXR2+V2xSCYCFblvlrBhdYZqAU
95
+ z0ZpNnNcArFcmChLPsGExzNcynS1Ropp8WubtT/1dWr7WJzFQEWYB/FClIyU
96
+ 5QzJ7aYo+ZIJY/Ioe8nwH/4w/gOMWorHRpycn6/WWk2pryVd7GHNmTLygOu6
97
+ le62ut1qddDa7HvTjbvu5pbHu+cctO4n1qpDq0w/Gs3YuoqKLdkz81vRxDtG
98
+ KrKV4uMTAAD//wMAMgUgfwACAAA=
99
+ http_version:
100
+ recorded_at: Mon, 22 Dec 2014 21:14:45 GMT
101
+ recorded_with: VCR 2.9.3
@@ -19,7 +19,7 @@ http_interactions:
19
19
  message: MOVED PERMANENTLY
20
20
  headers:
21
21
  Date:
22
- - Mon, 22 Dec 2014 15:49:11 GMT
22
+ - Mon, 22 Dec 2014 21:09:39 GMT
23
23
  Content-Type:
24
24
  - text/html; charset=utf-8
25
25
  Transfer-Encoding:
@@ -27,23 +27,23 @@ http_interactions:
27
27
  Connection:
28
28
  - keep-alive
29
29
  Set-Cookie:
30
- - __cfduid=d41800bf071d219779ee46187fc0064111419263350; expires=Tue, 22-Dec-15
31
- 15:49:10 GMT; path=/; domain=.swapi.co; HttpOnly
32
- Location:
33
- - http://swapi.co/api/planets/2/
30
+ - __cfduid=d73e3416ef3f615b9dfed72bab729b9f01419282579; expires=Tue, 22-Dec-15
31
+ 21:09:39 GMT; path=/; domain=.swapi.co; HttpOnly
34
32
  X-Frame-Options:
35
33
  - SAMEORIGIN
34
+ Location:
35
+ - http://swapi.co/api/planets/2/
36
36
  Via:
37
37
  - 1.1 vegur
38
38
  Server:
39
39
  - cloudflare-nginx
40
40
  Cf-Ray:
41
- - 19cd77c6f87a0a78-LHR
41
+ - 19cf4d39cb350a72-LHR
42
42
  body:
43
43
  encoding: UTF-8
44
44
  string: ''
45
45
  http_version:
46
- recorded_at: Mon, 22 Dec 2014 15:49:11 GMT
46
+ recorded_at: Mon, 22 Dec 2014 21:09:39 GMT
47
47
  - request:
48
48
  method: get
49
49
  uri: http://swapi.co/api/planets/2/
@@ -56,7 +56,7 @@ http_interactions:
56
56
  Accept-Encoding:
57
57
  - gzip, deflate
58
58
  Cookie:
59
- - __cfduid=d41800bf071d219779ee46187fc0064111419263350; domain=.swapi.co
59
+ - __cfduid=d73e3416ef3f615b9dfed72bab729b9f01419282579; domain=.swapi.co
60
60
  User-Agent:
61
61
  - Ruby
62
62
  response:
@@ -65,25 +65,25 @@ http_interactions:
65
65
  message: OK
66
66
  headers:
67
67
  Date:
68
- - Mon, 22 Dec 2014 15:49:11 GMT
68
+ - Mon, 22 Dec 2014 21:09:40 GMT
69
69
  Content-Type:
70
70
  - application/json
71
71
  Transfer-Encoding:
72
72
  - chunked
73
73
  Connection:
74
74
  - keep-alive
75
- Vary:
76
- - Accept, Cookie
77
75
  X-Frame-Options:
78
76
  - SAMEORIGIN
79
77
  Allow:
80
78
  - GET, HEAD, OPTIONS
79
+ Vary:
80
+ - Accept, Cookie
81
81
  Via:
82
82
  - 1.1 vegur
83
83
  Server:
84
84
  - cloudflare-nginx
85
85
  Cf-Ray:
86
- - 19cd77c928c90a78-LHR
86
+ - 19cf4d3b5b750a72-LHR
87
87
  Content-Encoding:
88
88
  - gzip
89
89
  body:
@@ -97,5 +97,5 @@ http_interactions:
97
97
  MvKA67qV7ra63Wp10Nrse9ONu+7mlse75xy07ifWqkOrTD8azdi6ioot2TPz
98
98
  W9HEO0YqspXi4xMAAP//AwAyBSB/AAIAAA==
99
99
  http_version:
100
- recorded_at: Mon, 22 Dec 2014 15:49:11 GMT
100
+ recorded_at: Mon, 22 Dec 2014 21:09:40 GMT
101
101
  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/species/8
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 21:18:40 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=d267891c2bc3dff31486725148b7b39a11419283120; expires=Tue, 22-Dec-15
31
+ 21:18:40 GMT; path=/; domain=.swapi.co; HttpOnly
32
+ Location:
33
+ - http://swapi.co/api/species/8/
34
+ X-Frame-Options:
35
+ - SAMEORIGIN
36
+ Via:
37
+ - 1.1 vegur
38
+ Server:
39
+ - cloudflare-nginx
40
+ Cf-Ray:
41
+ - 19cf5a708b940a72-LHR
42
+ body:
43
+ encoding: UTF-8
44
+ string: ''
45
+ http_version:
46
+ recorded_at: Mon, 22 Dec 2014 21:18:40 GMT
47
+ - request:
48
+ method: get
49
+ uri: http://swapi.co/api/species/8/
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=d267891c2bc3dff31486725148b7b39a11419283120; 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 21:18:41 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
+ - 19cf5a71674b0a72-LHR
87
+ Content-Encoding:
88
+ - gzip
89
+ body:
90
+ encoding: ASCII-8BIT
91
+ string: !binary |-
92
+ H4sIAAAAAAAAA3SQzW7CMBCEXwX5HPBPgEKuPffGqVWFlmRJVji2ZTuNUNV3
93
+ 7yYSoq3KwbY83+x415/CQY+iEi/eLZ7BQg+RRCFqCynRmWrI5B1z6ENHJwLH
94
+ sMFErbuRhC4TLwbwgRFaPHZIbZeZ6a1iOV3IHWtvfUysRWyKxckOyHv0oysW
95
+ Pde4DOzsgOLd6bxDFvGKd+2K1vrxx1uWzpgCTJ0M7uI4cMrxPY4+2obVLudQ
96
+ SZlGCLSqveRDBgsOc5KlluzmSztw1p9vmGcN6INl8vZ/zkyleZLivRBnsn16
97
+ ZJ2hLGdjHREyTs0ZpddLbZZ6d9C6UvtqY1ZmWyqlXqfJG/ptM+pgdFVuq7VZ
98
+ 6c3NNkT7YM4UsCZMcifF1zcAAAD//wMAwE8ZcesBAAA=
99
+ http_version:
100
+ recorded_at: Mon, 22 Dec 2014 21:18:41 GMT
101
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,102 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://swapi.co/api/starships/12
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 21:22:29 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=d0aa3854a097b3893ef12b039fced5bcf1419283349; expires=Tue, 22-Dec-15
31
+ 21:22:29 GMT; path=/; domain=.swapi.co; HttpOnly
32
+ Location:
33
+ - http://swapi.co/api/starships/12/
34
+ X-Frame-Options:
35
+ - SAMEORIGIN
36
+ Via:
37
+ - 1.1 vegur
38
+ Server:
39
+ - cloudflare-nginx
40
+ Cf-Ray:
41
+ - 19cf60083bff0a78-LHR
42
+ body:
43
+ encoding: UTF-8
44
+ string: ''
45
+ http_version:
46
+ recorded_at: Mon, 22 Dec 2014 21:22:30 GMT
47
+ - request:
48
+ method: get
49
+ uri: http://swapi.co/api/starships/12/
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=d0aa3854a097b3893ef12b039fced5bcf1419283349; 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 21:22:30 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
+ - 19cf6009bcf50a78-LHR
87
+ Content-Encoding:
88
+ - gzip
89
+ body:
90
+ encoding: ASCII-8BIT
91
+ string: !binary |-
92
+ H4sIAAAAAAAAAwAAAP//hFJNS8QwFPwrS867bdMPtb16EEFP7kEUCTF92wbT
93
+ JCSpdRH/uy8REcG6odBmZvJmXl/eieYTkI7c7xapB7Ilk+lBIbDfnTWbH5Tr
94
+ +cBFmB04JK+1MNPm0jhrHA/SaJQI4wOTmgkHvQweVbRucSGlQA9hjEiZNana
95
+ G+NhMt6O4NCAeQvQR75oiljKwRJ3+Gm593gaXCyYOO4GwwS3XMhwjCqaYKP9
96
+ PPFnBcl5swC8IDweLbjeyVdgMSj2gmQWD9xe3eyTY9z4wJ0fpWVCoR/Cdwgc
97
+ 5DAGbBdDSGViR49kDMF2ee4XbmUmTI6v3IKxCnKaR791vj3B04tTAqzwtCUH
98
+ qabVLIlcj/JFl//TVbLBGfCQhlIWtN7REp89pR1tu6LJqrrA9YB14rB/yUqU
99
+ nXdV09V1Vre0rKoom128VH+Zfv97jI3BPj4BAAD//wMA83+UI5ICAAA=
100
+ http_version:
101
+ recorded_at: Mon, 22 Dec 2014 21:22:30 GMT
102
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,102 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://swapi.co/api/vehicles/18
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 21:26:43 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=d873a608e6ad141f01b364fd1edb30b6d1419283603; expires=Tue, 22-Dec-15
31
+ 21:26:43 GMT; path=/; domain=.swapi.co; HttpOnly
32
+ X-Frame-Options:
33
+ - SAMEORIGIN
34
+ Location:
35
+ - http://swapi.co/api/vehicles/18/
36
+ Via:
37
+ - 1.1 vegur
38
+ Server:
39
+ - cloudflare-nginx
40
+ Cf-Ray:
41
+ - 19cf663885340a78-LHR
42
+ body:
43
+ encoding: UTF-8
44
+ string: ''
45
+ http_version:
46
+ recorded_at: Mon, 22 Dec 2014 21:26:43 GMT
47
+ - request:
48
+ method: get
49
+ uri: http://swapi.co/api/vehicles/18/
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=d873a608e6ad141f01b364fd1edb30b6d1419283603; 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 21:26:43 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
+ - 19cf663a67a80a78-LHR
87
+ Content-Encoding:
88
+ - gzip
89
+ body:
90
+ encoding: ASCII-8BIT
91
+ string: !binary |-
92
+ H4sIAAAAAAAAAwAAAP//dFHBbgIhEP0VwllFVq12byZemqaXZi9t02ymOLpE
93
+ FsjAak3Tf++w6cWkvcAw7817PPiSHnqUtdw2020jJ7IPe3Tl7JxokAisF1vq
94
+ A+FeNAQ+xUC58MAPBzB5ICSmPw6QxY7sGcUL0D5NxEMfkSw4scMIlHv0WYSD
95
+ eLLOZqCreMaEQKZjLRNSbq1vDZvYnFhu8CcfLp4xh/6YO25V89H1s4XchxQ7
96
+ FvfHNkXEPaN3BeX5C9crLiOkxJNIRW05gkDH0BqIYGy+clfP52M/+DT08OHw
97
+ 1viMnTUOW+NYihFeYXBZXMCdODJbWBfKZd/eJ/JgXV9K2eUca6XSBaKdmaB4
98
+ UyOoKsUz/8MLJd/HBJDHQNVcL6e6mupVo6t6samr1ex+seY7v7JOeacbWlU1
99
+ mjm61qvZWi/v1otCG6h85V+mv+mS0hslv38AAAD//wMAG2D2DQYCAAA=
100
+ http_version:
101
+ recorded_at: Mon, 22 Dec 2014 21:26:43 GMT
102
+ recorded_with: VCR 2.9.3
@@ -1,10 +1,53 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  module Red_5
4
+ describe Root do
5
+ it 'has vehicles' do
6
+ root = Root.all
7
+ expect(root.keys).to include 'films'
8
+ end
9
+ end
10
+
11
+ describe Films do
12
+ it 'finds a film', :vcr do
13
+ film = Films.find 1
14
+ expect(film['title']).to eq 'A New Hope'
15
+ expect(film['episode_id']).to eq 4
16
+ end
17
+ end
18
+
19
+ describe People do
20
+ it 'finds a person', :vcr do
21
+ person = People.find 7 # Aunt Beru
22
+ expect(person['eye_color']).to eq 'blue'
23
+ end
24
+ end
25
+
4
26
  describe Planets do
5
- it 'should find a planet', :vcr do
27
+ it 'finds a planet', :vcr do
6
28
  planet = Planets.find 2
7
29
  expect(planet['name']).to eq 'Alderaan'
8
30
  end
9
31
  end
32
+
33
+ describe Species do
34
+ it 'finds a species', :vcr do
35
+ species = Species.find 8 # Mon Calamari
36
+ expect(species['classification']).to eq 'amphibian'
37
+ end
38
+ end
39
+
40
+ describe Starships do
41
+ it 'finds a starship', :vcr do
42
+ starship = Starships.find 12
43
+ expect(starship['model']).to eq 'T-65 X-wing'
44
+ end
45
+ end
46
+
47
+ describe Vehicles do
48
+ it 'finds a vehicle', :vcr do
49
+ vehicle = Vehicles.find 18 # AT-AT
50
+ expect(vehicle['manufacturer']).to match /Kuat Drive Yards/
51
+ end
52
+ end
10
53
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: red5
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - pikesley
@@ -131,16 +131,31 @@ extra_rdoc_files: []
131
131
  files:
132
132
  - ".gitignore"
133
133
  - ".rspec"
134
+ - ".travis.yml"
134
135
  - Gemfile
135
136
  - Guardfile
136
137
  - LICENSE.md
137
138
  - README.md
138
139
  - Rakefile
139
140
  - lib/red5.rb
141
+ - lib/red5/entities.rb
142
+ - lib/red5/films.rb
143
+ - lib/red5/people.rb
140
144
  - lib/red5/planets.rb
145
+ - lib/red5/root.rb
146
+ - lib/red5/species.rb
147
+ - lib/red5/starships.rb
148
+ - lib/red5/vehicles.rb
141
149
  - lib/red5/version.rb
142
150
  - red5.gemspec
151
+ - spec/cassettes/Red_5_Films/finds_a_film.yml
152
+ - spec/cassettes/Red_5_People/finds_a_person.yml
153
+ - spec/cassettes/Red_5_People/should_find_a_person.yml
154
+ - spec/cassettes/Red_5_Planets/finds_a_planet.yml
143
155
  - spec/cassettes/Red_5_Planets/should_find_a_planet.yml
156
+ - spec/cassettes/Red_5_Species/finds_a_species.yml
157
+ - spec/cassettes/Red_5_Starships/finds_a_starship.yml
158
+ - spec/cassettes/Red_5_Vehicles/finds_a_vehicle.yml
144
159
  - spec/red5_spec.rb
145
160
  - spec/spec_helper.rb
146
161
  - spec/support/vcr_setup.rb
@@ -169,7 +184,14 @@ signing_key:
169
184
  specification_version: 4
170
185
  summary: SWAPI bindings
171
186
  test_files:
187
+ - spec/cassettes/Red_5_Films/finds_a_film.yml
188
+ - spec/cassettes/Red_5_People/finds_a_person.yml
189
+ - spec/cassettes/Red_5_People/should_find_a_person.yml
190
+ - spec/cassettes/Red_5_Planets/finds_a_planet.yml
172
191
  - spec/cassettes/Red_5_Planets/should_find_a_planet.yml
192
+ - spec/cassettes/Red_5_Species/finds_a_species.yml
193
+ - spec/cassettes/Red_5_Starships/finds_a_starship.yml
194
+ - spec/cassettes/Red_5_Vehicles/finds_a_vehicle.yml
173
195
  - spec/red5_spec.rb
174
196
  - spec/spec_helper.rb
175
197
  - spec/support/vcr_setup.rb