thetvdb_api 0.2.1 → 0.2.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.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/README.md +36 -81
  4. data/lib/thetvdb_api/actor.rb +15 -1
  5. data/lib/thetvdb_api/banner.rb +15 -1
  6. data/lib/thetvdb_api/base.rb +4 -4
  7. data/lib/thetvdb_api/episode.rb +50 -5
  8. data/lib/thetvdb_api/response/actors.rb +7 -0
  9. data/lib/thetvdb_api/response/banners.rb +7 -0
  10. data/lib/thetvdb_api/response/collection.rb +9 -0
  11. data/lib/thetvdb_api/response/episode.rb +5 -0
  12. data/lib/thetvdb_api/response/full_series.rb +21 -0
  13. data/lib/thetvdb_api/response/search_multiple_episode.rb +7 -0
  14. data/lib/thetvdb_api/response/search_multiple_series.rb +7 -0
  15. data/lib/thetvdb_api/response/search_series.rb +5 -0
  16. data/lib/thetvdb_api/response/series.rb +5 -0
  17. data/lib/thetvdb_api/response/update.rb +31 -0
  18. data/lib/thetvdb_api/response.rb +30 -8
  19. data/lib/thetvdb_api/search.rb +50 -4
  20. data/lib/thetvdb_api/series.rb +28 -2
  21. data/lib/thetvdb_api/update.rb +24 -8
  22. data/lib/thetvdb_api/version.rb +1 -1
  23. data/lib/thetvdb_api.rb +11 -1
  24. data/spec/integrations/actor_spec.rb +1 -1
  25. data/spec/integrations/banner_spec.rb +1 -1
  26. data/spec/integrations/client_spec.rb +15 -15
  27. data/spec/integrations/episode_spec.rb +4 -4
  28. data/spec/integrations/search_spec.rb +4 -4
  29. data/spec/integrations/series_spec.rb +2 -2
  30. data/spec/integrations/update_spec.rb +4 -4
  31. data/spec/spec_helper.rb +0 -21
  32. data/spec/units/actor_spec.rb +49 -0
  33. data/spec/units/banner_spec.rb +49 -0
  34. data/spec/units/episode_spec.rb +167 -0
  35. data/spec/units/response/actors_spec.rb +15 -0
  36. data/spec/units/response/banners_spec.rb +15 -0
  37. data/spec/units/response/collection_spec.rb +38 -0
  38. data/spec/units/response/episode_spec.rb +15 -0
  39. data/spec/units/response/full_series_spec.rb +51 -0
  40. data/spec/units/response/search_multiple_episode_spec.rb +15 -0
  41. data/spec/units/response/search_multiple_series_spec.rb +15 -0
  42. data/spec/units/response/search_series_spec.rb +15 -0
  43. data/spec/units/response/series_spec.rb +15 -0
  44. data/spec/units/response/update_spec.rb +79 -0
  45. data/spec/units/response_spec.rb +100 -0
  46. data/spec/units/search_spec.rb +178 -0
  47. data/spec/units/series_spec.rb +92 -0
  48. data/spec/units/update_spec.rb +178 -0
  49. data/thetvdb_api.gemspec +1 -1
  50. metadata +53 -49
  51. data/lib/thetvdb_api/mappers/actor.rb +0 -17
  52. data/lib/thetvdb_api/mappers/actors.rb +0 -10
  53. data/lib/thetvdb_api/mappers/banner.rb +0 -32
  54. data/lib/thetvdb_api/mappers/banners.rb +0 -10
  55. data/lib/thetvdb_api/mappers/base_mapper.rb +0 -13
  56. data/lib/thetvdb_api/mappers/episode.rb +0 -35
  57. data/lib/thetvdb_api/mappers/full_series.rb +0 -12
  58. data/lib/thetvdb_api/mappers/search_episode.rb +0 -10
  59. data/lib/thetvdb_api/mappers/search_series/series.rb +0 -25
  60. data/lib/thetvdb_api/mappers/search_series.rb +0 -10
  61. data/lib/thetvdb_api/mappers/series.rb +0 -40
  62. data/lib/thetvdb_api/mappers/update/banner.rb +0 -19
  63. data/lib/thetvdb_api/mappers/update/element.rb +0 -10
  64. data/lib/thetvdb_api/mappers/update/episode.rb +0 -8
  65. data/lib/thetvdb_api/mappers/update/series.rb +0 -8
  66. data/lib/thetvdb_api/mappers/update.rb +0 -14
  67. data/spec/thetvdb_api/actor_spec.rb +0 -21
  68. data/spec/thetvdb_api/banner_spec.rb +0 -21
  69. data/spec/thetvdb_api/episode_spec.rb +0 -63
  70. data/spec/thetvdb_api/mappers/actor_spec.rb +0 -15
  71. data/spec/thetvdb_api/mappers/banner_spec.rb +0 -31
  72. data/spec/thetvdb_api/mappers/search_series/series_spec.rb +0 -15
  73. data/spec/thetvdb_api/mappers/series_spec.rb +0 -31
  74. data/spec/thetvdb_api/mappers/update/banner_spec.rb +0 -15
  75. data/spec/thetvdb_api/response_spec.rb +0 -60
  76. data/spec/thetvdb_api/search_spec.rb +0 -63
  77. data/spec/thetvdb_api/series_spec.rb +0 -35
  78. data/spec/thetvdb_api/update_spec.rb +0 -63
  79. /data/spec/{thetvdb_api → units}/base_spec.rb +0 -0
  80. /data/spec/{thetvdb_api → units}/client_spec.rb +0 -0
@@ -0,0 +1,178 @@
1
+ require 'spec_helper'
2
+
3
+ describe ThetvdbApi::Update do
4
+ let(:klass) { ThetvdbApi::Update }
5
+ let(:model) { klass.new(ThetvdbApi::Client.new(api_key: '123456789')) }
6
+
7
+ describe '.day' do
8
+ it 'should call find_get_with_params with specific arguments' do
9
+ model.should_receive(:day_get_with_params).with({}).and_return(double(response: true))
10
+
11
+ model.day
12
+ end
13
+
14
+ it 'should call response with specific arguments' do
15
+ model.should_receive(:response).with(ThetvdbApi::Response::Update)
16
+
17
+ model.day
18
+ end
19
+ end
20
+
21
+ describe '.day_url' do
22
+ it 'should call find_get_with_params with specific arguments' do
23
+ model.should_receive(:day_get_with_params).and_return(double(url: true))
24
+
25
+ model.day_url
26
+ end
27
+
28
+ it 'should call url' do
29
+ model.should_receive(:url)
30
+
31
+ model.day_url
32
+ end
33
+ end
34
+
35
+ describe '.day_get_with_params' do
36
+ it 'should call get with specific arguments' do
37
+ model.stub(:day_path).and_return('PATH')
38
+ model.should_receive(:get).with('PATH').and_return(double(params: true))
39
+
40
+ model.day_get_with_params
41
+ end
42
+
43
+ it 'should call params with specific arguments' do
44
+ model.should_receive(:params).with({})
45
+
46
+ model.day_get_with_params
47
+ end
48
+ end
49
+
50
+ describe '.week' do
51
+ it 'should call find_get_with_params with specific arguments' do
52
+ model.should_receive(:week_get_with_params).with({}).and_return(double(response: true))
53
+
54
+ model.week
55
+ end
56
+
57
+ it 'should call response with specific arguments' do
58
+ model.should_receive(:response).with(ThetvdbApi::Response::Update)
59
+
60
+ model.week
61
+ end
62
+ end
63
+
64
+ describe '.week_url' do
65
+ it 'should call find_get_with_params with specific arguments' do
66
+ model.should_receive(:week_get_with_params).and_return(double(url: true))
67
+
68
+ model.week_url
69
+ end
70
+
71
+ it 'should call url' do
72
+ model.should_receive(:url)
73
+
74
+ model.week_url
75
+ end
76
+ end
77
+
78
+ describe '.week_get_with_params' do
79
+ it 'should call get with specific arguments' do
80
+ model.stub(:week_path).and_return('PATH')
81
+ model.should_receive(:get).with('PATH').and_return(double(params: true))
82
+
83
+ model.week_get_with_params
84
+ end
85
+
86
+ it 'should call params with specific arguments' do
87
+ model.should_receive(:params).with({})
88
+
89
+ model.week_get_with_params
90
+ end
91
+ end
92
+
93
+ describe '.month' do
94
+ it 'should call find_get_with_params with specific arguments' do
95
+ model.should_receive(:month_get_with_params).with({}).and_return(double(response: true))
96
+
97
+ model.month
98
+ end
99
+
100
+ it 'should call response with specific arguments' do
101
+ model.should_receive(:response).with(ThetvdbApi::Response::Update)
102
+
103
+ model.month
104
+ end
105
+ end
106
+
107
+ describe '.month_url' do
108
+ it 'should call find_get_with_params with specific arguments' do
109
+ model.should_receive(:month_get_with_params).and_return(double(url: true))
110
+
111
+ model.month_url
112
+ end
113
+
114
+ it 'should call url' do
115
+ model.should_receive(:url)
116
+
117
+ model.month_url
118
+ end
119
+ end
120
+
121
+ describe '.month_get_with_params' do
122
+ it 'should call get with specific arguments' do
123
+ model.stub(:month_path).and_return('PATH')
124
+ model.should_receive(:get).with('PATH').and_return(double(params: true))
125
+
126
+ model.month_get_with_params
127
+ end
128
+
129
+ it 'should call params with specific arguments' do
130
+ model.should_receive(:params).with({})
131
+
132
+ model.month_get_with_params
133
+ end
134
+ end
135
+
136
+ describe '.all' do
137
+ it 'should call find_get_with_params with specific arguments' do
138
+ model.should_receive(:all_get_with_params).with({}).and_return(double(response: true))
139
+
140
+ model.all
141
+ end
142
+
143
+ it 'should call response with specific arguments' do
144
+ model.should_receive(:response).with(ThetvdbApi::Response::Update)
145
+
146
+ model.all
147
+ end
148
+ end
149
+
150
+ describe '.all_url' do
151
+ it 'should call find_get_with_params with specific arguments' do
152
+ model.should_receive(:all_get_with_params).and_return(double(url: true))
153
+
154
+ model.all_url
155
+ end
156
+
157
+ it 'should call url' do
158
+ model.should_receive(:url)
159
+
160
+ model.all_url
161
+ end
162
+ end
163
+
164
+ describe '.all_get_with_params' do
165
+ it 'should call get with specific arguments' do
166
+ model.stub(:all_path).and_return('PATH')
167
+ model.should_receive(:get).with('PATH').and_return(double(params: true))
168
+
169
+ model.all_get_with_params
170
+ end
171
+
172
+ it 'should call params with specific arguments' do
173
+ model.should_receive(:params).with({})
174
+
175
+ model.all_get_with_params
176
+ end
177
+ end
178
+ end
data/thetvdb_api.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.add_runtime_dependency 'confiture', '~> 0.1.4'
22
22
  spec.add_runtime_dependency 'faraday', '~> 0.8.8'
23
23
  spec.add_runtime_dependency 'uri_template', '~> 0.6.0'
24
- spec.add_runtime_dependency 'happymapper', '~> 0.4.1'
24
+ spec.add_runtime_dependency 'multi_xml', '~> 0.5.5'
25
25
 
26
26
  spec.add_development_dependency 'bundler', '~> 1.3'
27
27
  spec.add_development_dependency 'rake'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thetvdb_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krzysztof Wawer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-21 00:00:00.000000000 Z
11
+ date: 2013-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: confiture
@@ -53,19 +53,19 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.6.0
55
55
  - !ruby/object:Gem::Dependency
56
- name: happymapper
56
+ name: multi_xml
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 0.4.1
61
+ version: 0.5.5
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ~>
67
67
  - !ruby/object:Gem::Version
68
- version: 0.4.1
68
+ version: 0.5.5
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -144,23 +144,17 @@ files:
144
144
  - lib/thetvdb_api/client.rb
145
145
  - lib/thetvdb_api/configuration.rb
146
146
  - lib/thetvdb_api/episode.rb
147
- - lib/thetvdb_api/mappers/actor.rb
148
- - lib/thetvdb_api/mappers/actors.rb
149
- - lib/thetvdb_api/mappers/banner.rb
150
- - lib/thetvdb_api/mappers/banners.rb
151
- - lib/thetvdb_api/mappers/base_mapper.rb
152
- - lib/thetvdb_api/mappers/episode.rb
153
- - lib/thetvdb_api/mappers/full_series.rb
154
- - lib/thetvdb_api/mappers/search_episode.rb
155
- - lib/thetvdb_api/mappers/search_series.rb
156
- - lib/thetvdb_api/mappers/search_series/series.rb
157
- - lib/thetvdb_api/mappers/series.rb
158
- - lib/thetvdb_api/mappers/update.rb
159
- - lib/thetvdb_api/mappers/update/banner.rb
160
- - lib/thetvdb_api/mappers/update/element.rb
161
- - lib/thetvdb_api/mappers/update/episode.rb
162
- - lib/thetvdb_api/mappers/update/series.rb
163
147
  - lib/thetvdb_api/response.rb
148
+ - lib/thetvdb_api/response/actors.rb
149
+ - lib/thetvdb_api/response/banners.rb
150
+ - lib/thetvdb_api/response/collection.rb
151
+ - lib/thetvdb_api/response/episode.rb
152
+ - lib/thetvdb_api/response/full_series.rb
153
+ - lib/thetvdb_api/response/search_multiple_episode.rb
154
+ - lib/thetvdb_api/response/search_multiple_series.rb
155
+ - lib/thetvdb_api/response/search_series.rb
156
+ - lib/thetvdb_api/response/series.rb
157
+ - lib/thetvdb_api/response/update.rb
164
158
  - lib/thetvdb_api/search.rb
165
159
  - lib/thetvdb_api/series.rb
166
160
  - lib/thetvdb_api/update.rb
@@ -174,20 +168,25 @@ files:
174
168
  - spec/integrations/update_spec.rb
175
169
  - spec/spec_helper.rb
176
170
  - spec/support/thetvdb_api.rb
177
- - spec/thetvdb_api/actor_spec.rb
178
- - spec/thetvdb_api/banner_spec.rb
179
- - spec/thetvdb_api/base_spec.rb
180
- - spec/thetvdb_api/client_spec.rb
181
- - spec/thetvdb_api/episode_spec.rb
182
- - spec/thetvdb_api/mappers/actor_spec.rb
183
- - spec/thetvdb_api/mappers/banner_spec.rb
184
- - spec/thetvdb_api/mappers/search_series/series_spec.rb
185
- - spec/thetvdb_api/mappers/series_spec.rb
186
- - spec/thetvdb_api/mappers/update/banner_spec.rb
187
- - spec/thetvdb_api/response_spec.rb
188
- - spec/thetvdb_api/search_spec.rb
189
- - spec/thetvdb_api/series_spec.rb
190
- - spec/thetvdb_api/update_spec.rb
171
+ - spec/units/actor_spec.rb
172
+ - spec/units/banner_spec.rb
173
+ - spec/units/base_spec.rb
174
+ - spec/units/client_spec.rb
175
+ - spec/units/episode_spec.rb
176
+ - spec/units/response/actors_spec.rb
177
+ - spec/units/response/banners_spec.rb
178
+ - spec/units/response/collection_spec.rb
179
+ - spec/units/response/episode_spec.rb
180
+ - spec/units/response/full_series_spec.rb
181
+ - spec/units/response/search_multiple_episode_spec.rb
182
+ - spec/units/response/search_multiple_series_spec.rb
183
+ - spec/units/response/search_series_spec.rb
184
+ - spec/units/response/series_spec.rb
185
+ - spec/units/response/update_spec.rb
186
+ - spec/units/response_spec.rb
187
+ - spec/units/search_spec.rb
188
+ - spec/units/series_spec.rb
189
+ - spec/units/update_spec.rb
191
190
  - thetvdb_api.gemspec
192
191
  homepage: http://github.com/wafcio/thetvdb_api
193
192
  licenses:
@@ -223,17 +222,22 @@ test_files:
223
222
  - spec/integrations/update_spec.rb
224
223
  - spec/spec_helper.rb
225
224
  - spec/support/thetvdb_api.rb
226
- - spec/thetvdb_api/actor_spec.rb
227
- - spec/thetvdb_api/banner_spec.rb
228
- - spec/thetvdb_api/base_spec.rb
229
- - spec/thetvdb_api/client_spec.rb
230
- - spec/thetvdb_api/episode_spec.rb
231
- - spec/thetvdb_api/mappers/actor_spec.rb
232
- - spec/thetvdb_api/mappers/banner_spec.rb
233
- - spec/thetvdb_api/mappers/search_series/series_spec.rb
234
- - spec/thetvdb_api/mappers/series_spec.rb
235
- - spec/thetvdb_api/mappers/update/banner_spec.rb
236
- - spec/thetvdb_api/response_spec.rb
237
- - spec/thetvdb_api/search_spec.rb
238
- - spec/thetvdb_api/series_spec.rb
239
- - spec/thetvdb_api/update_spec.rb
225
+ - spec/units/actor_spec.rb
226
+ - spec/units/banner_spec.rb
227
+ - spec/units/base_spec.rb
228
+ - spec/units/client_spec.rb
229
+ - spec/units/episode_spec.rb
230
+ - spec/units/response/actors_spec.rb
231
+ - spec/units/response/banners_spec.rb
232
+ - spec/units/response/collection_spec.rb
233
+ - spec/units/response/episode_spec.rb
234
+ - spec/units/response/full_series_spec.rb
235
+ - spec/units/response/search_multiple_episode_spec.rb
236
+ - spec/units/response/search_multiple_series_spec.rb
237
+ - spec/units/response/search_series_spec.rb
238
+ - spec/units/response/series_spec.rb
239
+ - spec/units/response/update_spec.rb
240
+ - spec/units/response_spec.rb
241
+ - spec/units/search_spec.rb
242
+ - spec/units/series_spec.rb
243
+ - spec/units/update_spec.rb
@@ -1,17 +0,0 @@
1
- require 'happymapper'
2
-
3
- class ThetvdbApi::Mappers::Actor
4
- include HappyMapper
5
-
6
- tag 'Actor'
7
-
8
- element :id, Integer
9
- element :image_path, String, tag: 'Image'
10
- element :name, String, tag: 'Name'
11
- element :role, String, tag: 'Role'
12
- element :sort_order, Integer, tag: 'SortOrder'
13
-
14
- def image_url
15
- image_path ? "http://thetvdb.com/banners/#{image_path}" : nil
16
- end
17
- end
@@ -1,10 +0,0 @@
1
- require 'happymapper'
2
- require 'thetvdb_api/mappers/actor'
3
-
4
- class ThetvdbApi::Mappers::Actors
5
- include HappyMapper
6
-
7
- tag 'Actors'
8
-
9
- has_many :actors, ThetvdbApi::Mappers::Actor, tag: 'Actor'
10
- end
@@ -1,32 +0,0 @@
1
- require 'happymapper'
2
-
3
- class ThetvdbApi::Mappers::Banner
4
- include HappyMapper
5
-
6
- tag 'Banner'
7
-
8
- element :id, Integer
9
- element :path, String, tag: 'BannerPath'
10
- element :thumbnail_path, String, tag: 'ThumbnailPath'
11
- element :vignette_path, String, tag: 'VignettePath'
12
- element :type, String, tag: 'BannerType'
13
- element :type2, String, tag: 'BannerType2'
14
- element :language, String, tag: 'Language'
15
- element :season, Integer, tag: 'Season'
16
- element :rating, Float, tag: 'Rating'
17
- element :rating_count, Integer, tag: 'RatingCount'
18
- element :series_name, String, tag: 'SeriesName'
19
- element :colors, String, tag: 'Colors'
20
-
21
- def url
22
- path ? "http://thetvdb.com/banners/#{path}" : nil
23
- end
24
-
25
- def thumbnail_url
26
- thumbnail_path ? "http://thetvdb.com/banners/#{thumbnail_path}" : nil
27
- end
28
-
29
- def vignette_url
30
- vignette_path ? "http://thetvdb.com/banners/#{vignette_path}" : nil
31
- end
32
- end
@@ -1,10 +0,0 @@
1
- require 'happymapper'
2
- require 'thetvdb_api/mappers/banner'
3
-
4
- class ThetvdbApi::Mappers::Banners
5
- include HappyMapper
6
-
7
- tag 'Banners'
8
-
9
- has_many :banners, ThetvdbApi::Mappers::Banner, tag: 'Banner'
10
- end
@@ -1,13 +0,0 @@
1
- require 'happymapper'
2
-
3
- module ThetvdbApi::Mappers::BaseMapper
4
- def self.included(base)
5
- base.send :element, :id, Integer
6
- base.send :element, :first_aired, Date, tag: 'FirstAired'
7
- base.send :element, :imdb_id, String, tag: 'IMDB_ID'
8
- base.send :element, :language, String, tag: 'Language'
9
- base.send :element, :overview, String, tag: 'Overview'
10
- base.send :element, :rating, Float, tag: 'Rating'
11
- base.send :element, :rating_count, Integer, tag: 'RatingCount'
12
- end
13
- end
@@ -1,35 +0,0 @@
1
- require 'happymapper'
2
- require 'thetvdb_api/mappers/base_mapper'
3
-
4
- class ThetvdbApi::Mappers::Episode
5
- include HappyMapper
6
- include ThetvdbApi::Mappers::BaseMapper
7
-
8
- tag 'Episode'
9
-
10
- element :combined_episode_number, Integer, tag: 'Combined_episodenumber'
11
- element :combined_season, Integer, tag: 'Combined_season'
12
- element :dvd_chapter, String, tag: 'DVD_chapter'
13
- element :dvd_discid, String, tag: 'DVD_discid'
14
- element :dvd_episodenumber, String, tag: 'DVD_episodenumber'
15
- element :dvd_season, String, tag: 'DVD_season'
16
- element :director, String, tag: 'Director'
17
- element :ep_img_flag, Integer, tag: 'EpImgFlag'
18
- element :name, String, tag: 'EpisodeName'
19
- element :number, String, tag: 'EpisodeNumber'
20
- element :guest_stars, String, tag: 'GuestStars'
21
- element :production_code, String, tag: 'ProductionCode'
22
- element :season_number, Integer, tag: 'SeasonNumber'
23
- element :writer, String, tag: 'Writer'
24
- element :absolute_number, Integer
25
- element :airs_after_season, Integer, tag: 'airsafter_season'
26
- element :airs_before_episode, Integer, tag: 'airsbefore_episode'
27
- element :airs_before_season, Integer, tag: 'airsbefore_season'
28
- element :filename, String
29
- element :last_updated_timestamp, Integer, tag: 'lastupdated'
30
- element :season_id, Integer, tag: 'seasonid'
31
- element :series_id, Integer, tag: 'seriesid'
32
- element :thumb_added_at, Time, tag: 'thumb_added'
33
- element :thumb_height, Integer
34
- element :thumb_width, Integer
35
- end
@@ -1,12 +0,0 @@
1
- require 'happymapper'
2
- require 'thetvdb_api/mappers/episode'
3
- require 'thetvdb_api/mappers/series'
4
-
5
- class ThetvdbApi::Mappers::FullSeries
6
- include HappyMapper
7
-
8
- tag 'Data'
9
-
10
- element :series, ThetvdbApi::Mappers::Series, tag: 'Series'
11
- has_many :episodes, ThetvdbApi::Mappers::Episode, tag: 'Episodes'
12
- end
@@ -1,10 +0,0 @@
1
- require 'happymapper'
2
- require 'episode'
3
-
4
- class ThetvdbApi::Mappers::SearchEpisode
5
- include HappyMapper
6
-
7
- tag 'Data'
8
-
9
- has_many :series, ThetvdbApi::Mappers::Episode, tag: 'Episode'
10
- end
@@ -1,25 +0,0 @@
1
- require 'happymapper'
2
-
3
- class ThetvdbApi::Mappers::SearchSeries
4
- class Series
5
- include HappyMapper
6
-
7
- tag 'Series'
8
-
9
- element :id, Integer
10
- element :series_id, Integer, tag: 'seriesid'
11
- element :language, String
12
- element :name, String, tag: 'SeriesName'
13
- element :aliases, String, tag: 'AliasNames'
14
- element :banner_path, String, tag: 'banner'
15
- element :overview, String, tag: 'Overview'
16
- element :first_aired, Date
17
- element :imdb_id, String, tag: 'IMDB_ID'
18
- element :zap2it_id, String
19
- element :network, String, tag: 'Network'
20
-
21
- def banner_url
22
- banner_path ? "http://thetvdb.com/banners/#{banner_path}" : nil
23
- end
24
- end
25
- end
@@ -1,10 +0,0 @@
1
- require 'happymapper'
2
- require 'search_series/series'
3
-
4
- class ThetvdbApi::Mappers::SearchSeries
5
- include HappyMapper
6
-
7
- tag 'Data'
8
-
9
- has_many :series, ThetvdbApi::Mappers::SearchSeries::Series, tag: 'Series'
10
- end
@@ -1,40 +0,0 @@
1
- require 'happymapper'
2
- require 'thetvdb_api/mappers/base_mapper'
3
-
4
- class ThetvdbApi::Mappers::Series
5
- include HappyMapper
6
- include ThetvdbApi::Mappers::BaseMapper
7
-
8
- tag 'Series'
9
-
10
- element :actors, String, tag: 'Actors'
11
- element :airs_day_of_week, String, tag: 'Airs_DayOfWeek'
12
- element :airs_time, String, tag: 'Airs_Time'
13
- element :content_rating, String, tag: 'ContentRating'
14
- element :genres, String, tag: 'Genre'
15
- element :network, String, targ: 'Network'
16
- element :network_id, Integer, targ: 'NetworkID'
17
- element :runtime, Integer, tag: 'Runtime'
18
- element :series_id, Integer, tag: 'SeriesID'
19
- element :name, String, tag: 'SeriesName'
20
- element :status, String, tag: 'Status'
21
- element :added_at, Time, tag: 'added'
22
- element :added_by, Integer, tag: 'adddedBy'
23
- element :banner_path, String, tag: 'banner'
24
- element :fanart_path, String, tag: 'fanart'
25
- element :last_updated_timestamp, Integer, tag: 'lastupdated'
26
- element :poster_path, String, tag: 'posters'
27
- element :zap2it_id, String
28
-
29
- def banner_url
30
- banner_path ? "http://thetvdb.com/banners/#{banner_path}" : nil
31
- end
32
-
33
- def fanart_url
34
- fanart_path ? "http://thetvdb.com/banners/#{fanart_path}" : nil
35
- end
36
-
37
- def poster_url
38
- poster_path ? "http://thetvdb.com/banners/#{poster_path}" : nil
39
- end
40
- end
@@ -1,19 +0,0 @@
1
- require 'happymapper'
2
-
3
- class ThetvdbApi::Mappers::Update
4
- class Banner
5
- include HappyMapper
6
-
7
- tag 'Banner'
8
- element :type, String
9
- element :format, String
10
- element :series_id, String, tag: 'Series'
11
- element :season_num, String, tag: 'SeasonNum'
12
- element :language, String
13
- element :path, String
14
-
15
- def url
16
- path ? "http://thetvdb.com/banners/#{path}" : nil
17
- end
18
- end
19
- end
@@ -1,10 +0,0 @@
1
- require 'happymapper'
2
-
3
- class ThetvdbApi::Mappers::Update
4
- class Element
5
- include HappyMapper
6
-
7
- element :id, Integer
8
- element :timestamp, Integer, tag: 'time'
9
- end
10
- end
@@ -1,8 +0,0 @@
1
- require 'happymapper'
2
- require 'thetvdb_api/mappers/update/element'
3
-
4
- class ThetvdbApi::Mappers::Update
5
- class Episode < ThetvdbApi::Mappers::Update::Element
6
- tag 'Episode'
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- require 'happymapper'
2
- require 'thetvdb_api/mappers/update/element'
3
-
4
- class ThetvdbApi::Mappers::Update
5
- class Series < ThetvdbApi::Mappers::Update::Element
6
- tag 'Series'
7
- end
8
- end
@@ -1,14 +0,0 @@
1
- require 'happymapper'
2
- require 'update/banner'
3
- require 'update/episode'
4
- require 'update/series'
5
-
6
- class ThetvdbApi::Mappers::Update
7
- include HappyMapper
8
-
9
- tag 'Data'
10
-
11
- has_many :series, ThetvdbApi::Mappers::Update::Series, tag: 'Series'
12
- has_many :episodes, ThetvdbApi::Mappers::Update::Episode, tag: 'Episode'
13
- has_many :banners, ThetvdbApi::Mappers::Update::Banner, tag: 'Banner'
14
- end
@@ -1,21 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe ThetvdbApi::Actor do
4
- let(:klass) { ThetvdbApi::Actor }
5
- let(:model) { klass.new(ThetvdbApi::Client.new(api_key: '123456789')) }
6
- let(:mock_model) { SampleModel.new }
7
-
8
- describe '.find' do
9
- it 'should call get with specific params' do
10
- model.should_receive(:get).with('{api_key}/series/{series_id}/actors.xml').and_return(mock_model)
11
-
12
- model.find('1234')
13
- end
14
-
15
- it 'should call params with specific params' do
16
- model.should_receive(:params).with(series_id: '1234').and_return(mock_model)
17
-
18
- model.find('1234')
19
- end
20
- end
21
- end