thetvdb_api 0.3.0 → 0.3.1
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 +4 -4
- data/.rspec +2 -0
- data/CHANGELOG.md +5 -1
- data/README.md +15 -4
- data/lib/thetvdb_api/actor.rb +29 -12
- data/lib/thetvdb_api/attributes_mapping/search/get_episode.rb +6 -0
- data/lib/thetvdb_api/attributes_mapping/search/get_series.rb +6 -0
- data/lib/thetvdb_api/attributes_mapping/search/get_series_by_remote_id.rb +7 -0
- data/lib/thetvdb_api/banner.rb +29 -12
- data/lib/thetvdb_api/base.rb +0 -24
- data/lib/thetvdb_api/client.rb +4 -0
- data/lib/thetvdb_api/episode.rb +205 -53
- data/lib/thetvdb_api/search.rb +166 -44
- data/lib/thetvdb_api/series.rb +105 -31
- data/lib/thetvdb_api/server.rb +15 -0
- data/lib/thetvdb_api/version.rb +1 -1
- data/lib/thetvdb_api.rb +9 -1
- data/spec/fixtures/server_time.xml +4 -0
- data/spec/functionals/episode_spec.rb +3 -3
- data/spec/functionals/search_spec.rb +9 -9
- data/spec/functionals/series_spec.rb +6 -6
- data/spec/functionals/server_spec.rb +36 -0
- data/spec/integrations/actor_spec.rb +3 -1
- data/spec/integrations/banner_spec.rb +3 -1
- data/spec/integrations/client_spec.rb +54 -11
- data/spec/integrations/episode_spec.rb +11 -3
- data/spec/integrations/search_spec.rb +13 -5
- data/spec/integrations/series_spec.rb +6 -2
- data/spec/integrations/server_spec.rb +16 -0
- data/spec/integrations/update_spec.rb +6 -0
- data/spec/spec_helper.rb +1 -0
- data/thetvdb_api.gemspec +6 -3
- metadata +63 -12
- data/spec/functionals/base_spec.rb +0 -79
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ThetvdbApi::Server do
|
4
|
+
let(:client) { ThetvdbApi::Client.new(api_key: '123456789', adapter: :test, adapter_options: faraday_stubs) }
|
5
|
+
let(:model) { client.server }
|
6
|
+
|
7
|
+
let(:faraday_stubs) do
|
8
|
+
Faraday::Adapter::Test::Stubs.new do |stub|
|
9
|
+
stub.get('/api/Updates.php?type=none') do
|
10
|
+
[200, { content_type: 'xml' }, File.read('spec/fixtures/server_time.xml')]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe '.time' do
|
16
|
+
context 'hash attributes' do
|
17
|
+
it 'should return Faraday::Response class' do
|
18
|
+
expect(model.time).to be_a(Faraday::Response)
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should return Hash class for body reponse' do
|
22
|
+
expect(model.time.body).to be_a(Hash)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context 'normal attributes' do
|
27
|
+
it 'should return Faraday::Response class' do
|
28
|
+
expect(model.time).to be_a(Faraday::Response)
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'should return Hash class for body reponse' do
|
32
|
+
expect(model.time.body).to be_a(Hash)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -5,7 +5,9 @@ describe ThetvdbApi::Actor do
|
|
5
5
|
|
6
6
|
describe '.find' do
|
7
7
|
it 'should return response class' do
|
8
|
-
response = model.find(series_id: '
|
8
|
+
response = model.find(series_id: '72449')
|
9
|
+
ap response.body
|
10
|
+
|
9
11
|
expect(response).to be_a(Faraday::Response)
|
10
12
|
expect(response.status).to eq(200)
|
11
13
|
expect(response.body).to be_a(Hash)
|
@@ -5,7 +5,9 @@ describe ThetvdbApi::Banner do
|
|
5
5
|
|
6
6
|
describe '.find' do
|
7
7
|
it 'should return response class' do
|
8
|
-
response = model.find(series_id: '
|
8
|
+
response = model.find(series_id: '72449')
|
9
|
+
ap response.body
|
10
|
+
|
9
11
|
expect(response).to be_a(Faraday::Response)
|
10
12
|
expect(response.status).to eq(200)
|
11
13
|
expect(response.body).to be_a(Hash)
|
@@ -6,7 +6,9 @@ describe ThetvdbApi::Client do
|
|
6
6
|
describe '.search' do
|
7
7
|
describe '.get_series' do
|
8
8
|
it 'should return response class' do
|
9
|
-
response = client.search.get_series(seriesname: '
|
9
|
+
response = client.search.get_series(seriesname: 'stargate')
|
10
|
+
ap response.body
|
11
|
+
|
10
12
|
expect(response).to be_a(Faraday::Response)
|
11
13
|
expect(response.status).to eq(200)
|
12
14
|
expect(response.body).to be_a(Hash)
|
@@ -15,14 +17,18 @@ describe ThetvdbApi::Client do
|
|
15
17
|
|
16
18
|
describe '.get_series_by_remote_id' do
|
17
19
|
it 'should return response class with imdbid' do
|
18
|
-
response = client.search.get_series_by_remote_id(imdbid: '
|
20
|
+
response = client.search.get_series_by_remote_id(imdbid: 'tt0118480')
|
21
|
+
ap response.body
|
22
|
+
|
19
23
|
expect(response).to be_a(Faraday::Response)
|
20
24
|
expect(response.status).to eq(200)
|
21
25
|
expect(response.body).to be_a(Hash)
|
22
26
|
end
|
23
27
|
|
24
28
|
it 'should return response class with zap2itid' do
|
25
|
-
response = client.search.get_series_by_remote_id(zap2itid: '
|
29
|
+
response = client.search.get_series_by_remote_id(zap2itid: 'EP00225421')
|
30
|
+
ap response.body
|
31
|
+
|
26
32
|
expect(response).to be_a(Faraday::Response)
|
27
33
|
expect(response.status).to eq(200)
|
28
34
|
expect(response.body).to be_a(Hash)
|
@@ -31,7 +37,9 @@ describe ThetvdbApi::Client do
|
|
31
37
|
|
32
38
|
describe '.get_episode' do
|
33
39
|
it 'should return response class' do
|
34
|
-
response = client.search.get_episode(seriesid: '
|
40
|
+
response = client.search.get_episode(seriesid: '72449', airdate: '1997-07-27')
|
41
|
+
ap response.body
|
42
|
+
|
35
43
|
expect(response).to be_a(Faraday::Response)
|
36
44
|
expect(response.status).to eq(200)
|
37
45
|
expect(response.body).to be_a(Hash)
|
@@ -42,7 +50,9 @@ describe ThetvdbApi::Client do
|
|
42
50
|
describe '.series' do
|
43
51
|
describe '.find' do
|
44
52
|
it 'should return response class' do
|
45
|
-
response = client.series.find(series_id: '
|
53
|
+
response = client.series.find(series_id: '72449')
|
54
|
+
ap response.body
|
55
|
+
|
46
56
|
expect(response).to be_a(Faraday::Response)
|
47
57
|
expect(response.status).to eq(200)
|
48
58
|
expect(response.body).to be_a(Hash)
|
@@ -51,7 +61,9 @@ describe ThetvdbApi::Client do
|
|
51
61
|
|
52
62
|
describe '.find_full' do
|
53
63
|
it 'should return response class' do
|
54
|
-
response = client.series.find_full(series_id: '
|
64
|
+
response = client.series.find_full(series_id: '72449')
|
65
|
+
ap response.body
|
66
|
+
|
55
67
|
expect(response).to be_a(Faraday::Response)
|
56
68
|
expect(response.status).to eq(200)
|
57
69
|
expect(response.body).to be_a(Hash)
|
@@ -62,7 +74,22 @@ describe ThetvdbApi::Client do
|
|
62
74
|
describe '.actor' do
|
63
75
|
describe '.find' do
|
64
76
|
it 'should return response class' do
|
65
|
-
response = client.actor.find(series_id: '
|
77
|
+
response = client.actor.find(series_id: '72449')
|
78
|
+
ap response.body
|
79
|
+
|
80
|
+
expect(response).to be_a(Faraday::Response)
|
81
|
+
expect(response.status).to eq(200)
|
82
|
+
expect(response.body).to be_a(Hash)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
describe '.server' do
|
88
|
+
describe '.time' do
|
89
|
+
it 'should return response class' do
|
90
|
+
response = client.server.time
|
91
|
+
ap response.body
|
92
|
+
|
66
93
|
expect(response).to be_a(Faraday::Response)
|
67
94
|
expect(response.status).to eq(200)
|
68
95
|
expect(response.body).to be_a(Hash)
|
@@ -73,7 +100,9 @@ describe ThetvdbApi::Client do
|
|
73
100
|
describe '.banner' do
|
74
101
|
describe '.find' do
|
75
102
|
it 'should return response class' do
|
76
|
-
response = client.banner.find(series_id: '
|
103
|
+
response = client.banner.find(series_id: '72449')
|
104
|
+
ap response.body
|
105
|
+
|
77
106
|
expect(response).to be_a(Faraday::Response)
|
78
107
|
expect(response.status).to eq(200)
|
79
108
|
expect(response.body).to be_a(Hash)
|
@@ -84,7 +113,9 @@ describe ThetvdbApi::Client do
|
|
84
113
|
describe '.episode' do
|
85
114
|
describe '.find_by_default_order' do
|
86
115
|
it 'should return response class' do
|
87
|
-
response = client.episode.find_by_default_order(series_id: '
|
116
|
+
response = client.episode.find_by_default_order(series_id: '72449', season: '1', episode: '1')
|
117
|
+
ap response.body
|
118
|
+
|
88
119
|
expect(response).to be_a(Faraday::Response)
|
89
120
|
expect(response.status).to eq(200)
|
90
121
|
expect(response.body).to be_a(Hash)
|
@@ -93,7 +124,9 @@ describe ThetvdbApi::Client do
|
|
93
124
|
|
94
125
|
describe '.find_by_dvd_order' do
|
95
126
|
it 'should return response class' do
|
96
|
-
response = client.episode.find_by_dvd_order(series_id: '
|
127
|
+
response = client.episode.find_by_dvd_order(series_id: '72449', season: '1', episode: '1')
|
128
|
+
ap response.body
|
129
|
+
|
97
130
|
expect(response).to be_a(Faraday::Response)
|
98
131
|
expect(response.status).to eq(200)
|
99
132
|
expect(response.body).to be_a(Hash)
|
@@ -103,6 +136,8 @@ describe ThetvdbApi::Client do
|
|
103
136
|
describe '.find_by_absolute_order' do
|
104
137
|
it 'should return response class' do
|
105
138
|
response = client.episode.find_by_absolute_order(series_id: '70327', absolute: '1')
|
139
|
+
ap response.body
|
140
|
+
|
106
141
|
expect(response).to be_a(Faraday::Response)
|
107
142
|
expect(response.status).to eq(200)
|
108
143
|
expect(response.body).to be_a(Hash)
|
@@ -111,7 +146,9 @@ describe ThetvdbApi::Client do
|
|
111
146
|
|
112
147
|
describe '.find' do
|
113
148
|
it 'should return response class' do
|
114
|
-
response = client.episode.find(episode_id: '
|
149
|
+
response = client.episode.find(episode_id: '295696')
|
150
|
+
ap response.body
|
151
|
+
|
115
152
|
expect(response).to be_a(Faraday::Response)
|
116
153
|
expect(response.status).to eq(200)
|
117
154
|
expect(response.body).to be_a(Hash)
|
@@ -123,6 +160,8 @@ describe ThetvdbApi::Client do
|
|
123
160
|
describe '.day' do
|
124
161
|
it 'should return response class' do
|
125
162
|
response = client.update.day
|
163
|
+
ap response.body
|
164
|
+
|
126
165
|
expect(response).to be_a(Faraday::Response)
|
127
166
|
expect(response.status).to eq(200)
|
128
167
|
expect(response.body).to be_a(Hash)
|
@@ -132,6 +171,8 @@ describe ThetvdbApi::Client do
|
|
132
171
|
describe '.week' do
|
133
172
|
it 'should return response class' do
|
134
173
|
response = client.update.week
|
174
|
+
ap response.body
|
175
|
+
|
135
176
|
expect(response).to be_a(Faraday::Response)
|
136
177
|
expect(response.status).to eq(200)
|
137
178
|
expect(response.body).to be_a(Hash)
|
@@ -141,6 +182,8 @@ describe ThetvdbApi::Client do
|
|
141
182
|
describe '.month' do
|
142
183
|
it 'should return response class' do
|
143
184
|
response = client.update.month
|
185
|
+
ap response.body
|
186
|
+
|
144
187
|
expect(response).to be_a(Faraday::Response)
|
145
188
|
expect(response.status).to eq(200)
|
146
189
|
expect(response.body).to be_a(Hash)
|
@@ -6,7 +6,9 @@ describe ThetvdbApi::Episode do
|
|
6
6
|
describe 'real request' do
|
7
7
|
describe '.find_by_default_order' do
|
8
8
|
it 'should return response class' do
|
9
|
-
response = model.find_by_default_order(series_id: '
|
9
|
+
response = model.find_by_default_order(series_id: '72449', season: '1', episode: '2')
|
10
|
+
ap response.body
|
11
|
+
|
10
12
|
expect(response).to be_a(Faraday::Response)
|
11
13
|
expect(response.status).to eq(200)
|
12
14
|
expect(response.body).to be_a(Hash)
|
@@ -15,7 +17,9 @@ describe ThetvdbApi::Episode do
|
|
15
17
|
|
16
18
|
describe '.find_by_dvd_order' do
|
17
19
|
it 'should return response class' do
|
18
|
-
response = model.find_by_dvd_order(series_id: '
|
20
|
+
response = model.find_by_dvd_order(series_id: '72449', season: '1', episode: '1')
|
21
|
+
ap response.body
|
22
|
+
|
19
23
|
expect(response).to be_a(Faraday::Response)
|
20
24
|
expect(response.status).to eq(200)
|
21
25
|
expect(response.body).to be_a(Hash)
|
@@ -25,6 +29,8 @@ describe ThetvdbApi::Episode do
|
|
25
29
|
describe '.find_by_absolute_order' do
|
26
30
|
it 'should return response class' do
|
27
31
|
response = model.find_by_absolute_order(series_id: '70327', absolute: '1')
|
32
|
+
ap response.body
|
33
|
+
|
28
34
|
expect(response).to be_a(Faraday::Response)
|
29
35
|
expect(response.status).to eq(200)
|
30
36
|
expect(response.body).to be_a(Hash)
|
@@ -33,7 +39,9 @@ describe ThetvdbApi::Episode do
|
|
33
39
|
|
34
40
|
describe '.find' do
|
35
41
|
it 'should return response class' do
|
36
|
-
response = model.find(
|
42
|
+
response = model.find(id: '295696')
|
43
|
+
ap response.body
|
44
|
+
|
37
45
|
expect(response).to be_a(Faraday::Response)
|
38
46
|
expect(response.status).to eq(200)
|
39
47
|
expect(response.body).to be_a(Hash)
|
@@ -6,7 +6,9 @@ describe ThetvdbApi::Search do
|
|
6
6
|
describe 'real request' do
|
7
7
|
describe '.get_series' do
|
8
8
|
it 'should return response class' do
|
9
|
-
response = model.get_series(
|
9
|
+
response = model.get_series(name: 'stargate')
|
10
|
+
ap response.body
|
11
|
+
|
10
12
|
expect(response).to be_a(Faraday::Response)
|
11
13
|
expect(response.status).to eq(200)
|
12
14
|
expect(response.body).to be_a(Hash)
|
@@ -15,14 +17,18 @@ describe ThetvdbApi::Search do
|
|
15
17
|
|
16
18
|
describe '.get_series_by_remote_id' do
|
17
19
|
it 'should return response class with imdbid' do
|
18
|
-
response = model.get_series_by_remote_id(
|
20
|
+
response = model.get_series_by_remote_id(imdb_id: 'tt0118480')
|
21
|
+
ap response.body
|
22
|
+
|
19
23
|
expect(response).to be_a(Faraday::Response)
|
20
24
|
expect(response.status).to eq(200)
|
21
25
|
expect(response.body).to be_a(Hash)
|
22
26
|
end
|
23
27
|
|
24
|
-
it 'should return response class with
|
25
|
-
response = model.get_series_by_remote_id(
|
28
|
+
it 'should return response class with zap2it' do
|
29
|
+
response = model.get_series_by_remote_id(zap2it_id: 'EP00225421')
|
30
|
+
ap response.body
|
31
|
+
|
26
32
|
expect(response).to be_a(Faraday::Response)
|
27
33
|
expect(response.status).to eq(200)
|
28
34
|
expect(response.body).to be_a(Hash)
|
@@ -31,7 +37,9 @@ describe ThetvdbApi::Search do
|
|
31
37
|
|
32
38
|
describe '.get_episode' do
|
33
39
|
it 'should return response class' do
|
34
|
-
response = model.get_episode(
|
40
|
+
response = model.get_episode(series_id: '72449', air_date: '1997-07-27')
|
41
|
+
ap response.body
|
42
|
+
|
35
43
|
expect(response).to be_a(Faraday::Response)
|
36
44
|
expect(response.status).to eq(200)
|
37
45
|
expect(response.body).to be_a(Hash)
|
@@ -5,7 +5,9 @@ describe ThetvdbApi::Series do
|
|
5
5
|
|
6
6
|
describe '.find' do
|
7
7
|
it 'should return response class' do
|
8
|
-
response = model.find(
|
8
|
+
response = model.find(id: '72449')
|
9
|
+
ap response.body
|
10
|
+
|
9
11
|
expect(response).to be_a(Faraday::Response)
|
10
12
|
expect(response.status).to eq(200)
|
11
13
|
expect(response.body).to be_a(Hash)
|
@@ -14,7 +16,9 @@ describe ThetvdbApi::Series do
|
|
14
16
|
|
15
17
|
describe '.find_full' do
|
16
18
|
it 'should return response class' do
|
17
|
-
response = model.find_full(
|
19
|
+
response = model.find_full(id: '72449')
|
20
|
+
ap response.body
|
21
|
+
|
18
22
|
expect(response).to be_a(Faraday::Response)
|
19
23
|
expect(response.status).to eq(200)
|
20
24
|
expect(response.body).to be_a(Hash)
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ThetvdbApi::Server do
|
4
|
+
let(:model) { ThetvdbApi::Server.new(api_key: API_KEY) }
|
5
|
+
|
6
|
+
describe '.time' do
|
7
|
+
it 'should return response class' do
|
8
|
+
response = model.time
|
9
|
+
ap response.body
|
10
|
+
|
11
|
+
expect(response).to be_a(Faraday::Response)
|
12
|
+
expect(response.status).to eq(200)
|
13
|
+
expect(response.body).to be_a(Hash)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -6,6 +6,8 @@ describe ThetvdbApi::Update do
|
|
6
6
|
describe '.day' do
|
7
7
|
it 'should return response class' do
|
8
8
|
response = model.day
|
9
|
+
ap response.body
|
10
|
+
|
9
11
|
expect(response).to be_a(Faraday::Response)
|
10
12
|
expect(response.status).to eq(200)
|
11
13
|
expect(response.body).to be_a(Hash)
|
@@ -15,6 +17,8 @@ describe ThetvdbApi::Update do
|
|
15
17
|
describe '.week' do
|
16
18
|
it 'should return response class' do
|
17
19
|
response = model.week
|
20
|
+
ap response.body
|
21
|
+
|
18
22
|
expect(response).to be_a(Faraday::Response)
|
19
23
|
expect(response.status).to eq(200)
|
20
24
|
expect(response.body).to be_a(Hash)
|
@@ -24,6 +28,8 @@ describe ThetvdbApi::Update do
|
|
24
28
|
describe '.month' do
|
25
29
|
it 'should return response class' do
|
26
30
|
response = model.month
|
31
|
+
ap response.body
|
32
|
+
|
27
33
|
expect(response).to be_a(Faraday::Response)
|
28
34
|
expect(response.status).to eq(200)
|
29
35
|
expect(response.body).to be_a(Hash)
|
data/spec/spec_helper.rb
CHANGED
data/thetvdb_api.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ['krzysztof.wawer@gmail.com']
|
11
11
|
spec.description = %q{Ruby client for accessing TV shows information from the thetvdb.com API}
|
12
12
|
spec.summary = %q{Ruby client for thetvdb.com API}
|
13
|
-
spec.homepage = %q{http://github.com/
|
13
|
+
spec.homepage = %q{http://github.com/tvapi/thetvdb_api}
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
@@ -18,10 +18,13 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_runtime_dependency 'service_api', '0.0
|
21
|
+
spec.add_runtime_dependency 'service_api', '~> 0.1.0'
|
22
|
+
spec.add_runtime_dependency 'ov', '~> 0.1.0'
|
23
|
+
spec.add_runtime_dependency 'hashie', '>= 1.1.0'
|
22
24
|
|
23
25
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
24
26
|
spec.add_development_dependency 'rake'
|
25
|
-
spec.add_development_dependency 'rspec', '~> 3.
|
27
|
+
spec.add_development_dependency 'rspec', '~> 3.1.0'
|
26
28
|
spec.add_development_dependency 'coveralls', '~> 0.7'
|
29
|
+
spec.add_development_dependency 'awesome_print', '~> 1.6.0'
|
27
30
|
end
|
metadata
CHANGED
@@ -1,29 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thetvdb_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Krzysztof Wawer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: service_api
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.1.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.1.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: ov
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
18
32
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.0
|
33
|
+
version: 0.1.0
|
20
34
|
type: :runtime
|
21
35
|
prerelease: false
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
23
37
|
requirements:
|
24
|
-
- -
|
38
|
+
- - ~>
|
25
39
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.0
|
40
|
+
version: 0.1.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: hashie
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.1.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.1.0
|
27
55
|
- !ruby/object:Gem::Dependency
|
28
56
|
name: bundler
|
29
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +86,14 @@ dependencies:
|
|
58
86
|
requirements:
|
59
87
|
- - ~>
|
60
88
|
- !ruby/object:Gem::Version
|
61
|
-
version: 3.
|
89
|
+
version: 3.1.0
|
62
90
|
type: :development
|
63
91
|
prerelease: false
|
64
92
|
version_requirements: !ruby/object:Gem::Requirement
|
65
93
|
requirements:
|
66
94
|
- - ~>
|
67
95
|
- !ruby/object:Gem::Version
|
68
|
-
version: 3.
|
96
|
+
version: 3.1.0
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
98
|
name: coveralls
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,6 +108,20 @@ dependencies:
|
|
80
108
|
- - ~>
|
81
109
|
- !ruby/object:Gem::Version
|
82
110
|
version: '0.7'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: awesome_print
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 1.6.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ~>
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 1.6.0
|
83
125
|
description: Ruby client for accessing TV shows information from the thetvdb.com API
|
84
126
|
email:
|
85
127
|
- krzysztof.wawer@gmail.com
|
@@ -88,6 +130,7 @@ extensions: []
|
|
88
130
|
extra_rdoc_files: []
|
89
131
|
files:
|
90
132
|
- .gitignore
|
133
|
+
- .rspec
|
91
134
|
- .travis.yml
|
92
135
|
- CHANGELOG.md
|
93
136
|
- Gemfile
|
@@ -96,12 +139,16 @@ files:
|
|
96
139
|
- Rakefile
|
97
140
|
- lib/thetvdb_api.rb
|
98
141
|
- lib/thetvdb_api/actor.rb
|
142
|
+
- lib/thetvdb_api/attributes_mapping/search/get_episode.rb
|
143
|
+
- lib/thetvdb_api/attributes_mapping/search/get_series.rb
|
144
|
+
- lib/thetvdb_api/attributes_mapping/search/get_series_by_remote_id.rb
|
99
145
|
- lib/thetvdb_api/banner.rb
|
100
146
|
- lib/thetvdb_api/base.rb
|
101
147
|
- lib/thetvdb_api/client.rb
|
102
148
|
- lib/thetvdb_api/episode.rb
|
103
149
|
- lib/thetvdb_api/search.rb
|
104
150
|
- lib/thetvdb_api/series.rb
|
151
|
+
- lib/thetvdb_api/server.rb
|
105
152
|
- lib/thetvdb_api/update.rb
|
106
153
|
- lib/thetvdb_api/version.rb
|
107
154
|
- spec/fixtures/actors.xml
|
@@ -112,13 +159,14 @@ files:
|
|
112
159
|
- spec/fixtures/get_series.xml
|
113
160
|
- spec/fixtures/get_series_by_remote.xml
|
114
161
|
- spec/fixtures/series.xml
|
162
|
+
- spec/fixtures/server_time.xml
|
115
163
|
- spec/fixtures/updates.xml
|
116
164
|
- spec/functionals/actor_spec.rb
|
117
165
|
- spec/functionals/banner_spec.rb
|
118
|
-
- spec/functionals/base_spec.rb
|
119
166
|
- spec/functionals/episode_spec.rb
|
120
167
|
- spec/functionals/search_spec.rb
|
121
168
|
- spec/functionals/series_spec.rb
|
169
|
+
- spec/functionals/server_spec.rb
|
122
170
|
- spec/functionals/update_spec.rb
|
123
171
|
- spec/integrations/actor_spec.rb
|
124
172
|
- spec/integrations/banner_spec.rb
|
@@ -126,12 +174,13 @@ files:
|
|
126
174
|
- spec/integrations/episode_spec.rb
|
127
175
|
- spec/integrations/search_spec.rb
|
128
176
|
- spec/integrations/series_spec.rb
|
177
|
+
- spec/integrations/server_spec.rb
|
129
178
|
- spec/integrations/update_spec.rb
|
130
179
|
- spec/spec_helper.rb
|
131
180
|
- spec/support/.keep
|
132
181
|
- spec/support/api_key.rb.example
|
133
182
|
- thetvdb_api.gemspec
|
134
|
-
homepage: http://github.com/
|
183
|
+
homepage: http://github.com/tvapi/thetvdb_api
|
135
184
|
licenses:
|
136
185
|
- MIT
|
137
186
|
metadata: {}
|
@@ -151,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
200
|
version: '0'
|
152
201
|
requirements: []
|
153
202
|
rubyforge_project:
|
154
|
-
rubygems_version: 2.
|
203
|
+
rubygems_version: 2.4.5
|
155
204
|
signing_key:
|
156
205
|
specification_version: 4
|
157
206
|
summary: Ruby client for thetvdb.com API
|
@@ -164,13 +213,14 @@ test_files:
|
|
164
213
|
- spec/fixtures/get_series.xml
|
165
214
|
- spec/fixtures/get_series_by_remote.xml
|
166
215
|
- spec/fixtures/series.xml
|
216
|
+
- spec/fixtures/server_time.xml
|
167
217
|
- spec/fixtures/updates.xml
|
168
218
|
- spec/functionals/actor_spec.rb
|
169
219
|
- spec/functionals/banner_spec.rb
|
170
|
-
- spec/functionals/base_spec.rb
|
171
220
|
- spec/functionals/episode_spec.rb
|
172
221
|
- spec/functionals/search_spec.rb
|
173
222
|
- spec/functionals/series_spec.rb
|
223
|
+
- spec/functionals/server_spec.rb
|
174
224
|
- spec/functionals/update_spec.rb
|
175
225
|
- spec/integrations/actor_spec.rb
|
176
226
|
- spec/integrations/banner_spec.rb
|
@@ -178,6 +228,7 @@ test_files:
|
|
178
228
|
- spec/integrations/episode_spec.rb
|
179
229
|
- spec/integrations/search_spec.rb
|
180
230
|
- spec/integrations/series_spec.rb
|
231
|
+
- spec/integrations/server_spec.rb
|
181
232
|
- spec/integrations/update_spec.rb
|
182
233
|
- spec/spec_helper.rb
|
183
234
|
- spec/support/.keep
|
@@ -1,79 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
class SampleClass < ThetvdbApi::Base; end
|
4
|
-
|
5
|
-
describe ThetvdbApi::Base do
|
6
|
-
let(:model) { SampleClass.new({}) }
|
7
|
-
|
8
|
-
describe '.normalize_series_id_options' do
|
9
|
-
it 'return correct hash with normal attributes' do
|
10
|
-
expect(model.normalize_series_id_options(1234)).
|
11
|
-
to eq({ series_id: 1234 })
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'return correct hash with hash attributes' do
|
15
|
-
expect(model.normalize_series_id_options(series_id: 1234)).
|
16
|
-
to eq({ series_id: 1234 })
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
describe '.normalize_series_id_absolute_options' do
|
21
|
-
it 'return correct hash with normal attributes' do
|
22
|
-
expect(model.normalize_series_id_absolute_options(1234, 1)).
|
23
|
-
to eq({ series_id: 1234, absolute: 1 })
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'return correct hash with hash attributes' do
|
27
|
-
expect(model.normalize_series_id_absolute_options(series_id: 1234, absolute: 1)).
|
28
|
-
to eq({ series_id: 1234, absolute: 1 })
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
describe '.normalize_series_id_episode_options' do
|
33
|
-
it 'normalize_series_id_episode_options' do
|
34
|
-
expect(model.normalize_series_id_episode_options(1234, 1, 2)).
|
35
|
-
to eq({ series_id: 1234, season: 1, episode: 2 })
|
36
|
-
end
|
37
|
-
|
38
|
-
it 'return correct hash with hash attributes' do
|
39
|
-
expect(model.normalize_series_id_episode_options(series_id: 1234, season: 1, episode: 2)).
|
40
|
-
to eq({ series_id: 1234, season: 1, episode: 2 })
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
describe '.normalize_episode_id_options' do
|
45
|
-
it 'return correct hash with normal attributes' do
|
46
|
-
expect(model.normalize_episode_id_options(1234)).
|
47
|
-
to eq({ episode_id: 1234 })
|
48
|
-
end
|
49
|
-
|
50
|
-
it 'return correct hash with hash attributes' do
|
51
|
-
expect(model.normalize_episode_id_options(episode_id: 1234)).
|
52
|
-
to eq({ episode_id: 1234 })
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
describe '.normalize_series_name_options' do
|
57
|
-
it 'return correct hash with normal attributes' do
|
58
|
-
expect(model.normalize_series_name_options('Buffy')).
|
59
|
-
to eq({ seriesname: 'Buffy' })
|
60
|
-
end
|
61
|
-
|
62
|
-
it 'return correct hash with hash attributes' do
|
63
|
-
expect(model.normalize_series_name_options(name: 'Buffy')).
|
64
|
-
to eq({ seriesname: 'Buffy' })
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
describe '.normalize_series_id_air_date_options' do
|
69
|
-
it 'return correct hash with normal attributes' do
|
70
|
-
expect(model.normalize_series_id_air_date_options('1234', '2000-01-01')).
|
71
|
-
to eq({ seriesid: '1234', airdate: '2000-01-01' })
|
72
|
-
end
|
73
|
-
|
74
|
-
it 'return correct hash with hash attributes' do
|
75
|
-
expect(model.normalize_series_id_air_date_options(series_id: '1234', air_date: '2000-01-01')).
|
76
|
-
to eq({ seriesid: '1234', airdate: '2000-01-01' })
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|