imdb 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +4 -8
  3. data/README.md +2 -2
  4. data/lib/imdb/base.rb +14 -0
  5. data/lib/imdb/season.rb +5 -3
  6. data/lib/imdb/string_extensions.rb +1 -6
  7. data/lib/imdb/version.rb +1 -1
  8. data/spec/fixtures/locations +109 -155
  9. data/spec/fixtures/plotsummary +101 -147
  10. data/spec/fixtures/releaseinfo +1413 -0
  11. data/spec/fixtures/search_kannethirey_thondrinal +62 -115
  12. data/spec/fixtures/search_killed_wife +82 -115
  13. data/spec/fixtures/search_star_trek +82 -115
  14. data/spec/fixtures/synopsis +154 -146
  15. data/spec/fixtures/tbbt-s1 +2027 -0
  16. data/spec/fixtures/thewalkingdead-s1 +137 -165
  17. data/spec/fixtures/thewalkingdead-s1e2 +214 -184
  18. data/spec/fixtures/top_250 +2905 -2953
  19. data/spec/fixtures/tt0036855 +253 -240
  20. data/spec/fixtures/tt0083987 +268 -242
  21. data/spec/fixtures/tt0095016 +299 -197
  22. data/spec/fixtures/tt0110912 +282 -247
  23. data/spec/fixtures/tt0111161 +229 -236
  24. data/spec/fixtures/tt0117731 +232 -217
  25. data/spec/fixtures/tt0166222 +166 -189
  26. data/spec/fixtures/tt0242653 +271 -210
  27. data/spec/fixtures/tt0330508 +123 -153
  28. data/spec/fixtures/tt0468569 +231 -206
  29. data/spec/fixtures/tt0898266 +1505 -0
  30. data/spec/fixtures/tt1401252 +153 -146
  31. data/spec/fixtures/tt1520211 +252 -225
  32. data/spec/fixtures/wall_e_search +742 -0
  33. data/spec/imdb/episode_spec.rb +1 -1
  34. data/spec/imdb/movie_spec.rb +24 -1
  35. data/spec/imdb/search_spec.rb +2 -20
  36. data/spec/imdb/season_spec.rb +22 -0
  37. data/spec/imdb/series_spec.rb +1 -1
  38. data/spec/spec_helper.rb +5 -1
  39. metadata +28 -21
  40. data/History.txt +0 -78
@@ -28,7 +28,7 @@ describe "Imdb::Episode" do
28
28
  end
29
29
 
30
30
  it "has a plot" do
31
- @episode.plot.should =~ /Rick finds himself trapped, with other survivors, inside a department store, surrounded by zombies/
31
+ @episode.plot.should =~ /Rick finds himself trapped with other survivors inside a department store, surrounded by walkers/
32
32
  end
33
33
 
34
34
  it "has a original air data" do
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  # This test uses "Die hard (1988)" as a testing sample:
@@ -142,7 +144,7 @@ describe "Imdb::Movie" do
142
144
  end
143
145
 
144
146
  it "should find number of votes" do
145
- @movie.votes.should be_within(10000).of(397054)
147
+ @movie.votes.should be_within(10000).of(420900)
146
148
  end
147
149
 
148
150
  it "should find the title" do
@@ -175,7 +177,17 @@ describe "Imdb::Movie" do
175
177
  filming_locations.should be_an(Array)
176
178
  filming_locations.size.should eql(4)
177
179
  filming_locations[0].should match(/.*, USA$/i)
180
+ end
178
181
 
182
+ it "should find multiple 'also known as' versions" do
183
+ also_known_as = @movie.also_known_as
184
+ also_known_as.should be_an(Array)
185
+ also_known_as.size.should eql(40)
186
+ end
187
+
188
+ it "should find a specific 'also known as' version" do
189
+ also_known_as = @movie.also_known_as
190
+ also_known_as.should include({ version: "Russia", title: "Крепкий орешек"})
179
191
  end
180
192
 
181
193
  it "should provide a convenience method to search" do
@@ -250,4 +262,15 @@ describe "Imdb::Movie" do
250
262
  @movie.poster.should eql("http://ia.media-imdb.com/images/M/MV5BMjE0ODk2NjczOV5BMl5BanBnXkFtZTYwNDQ0NDg4.jpg")
251
263
  end
252
264
  end
265
+
266
+ describe 'with title that has utf-8 characters' do
267
+ # WALL-E
268
+ before(:each) do
269
+ @movie = Imdb::Movie.search("Wall-E").first
270
+ end
271
+
272
+ it 'should give the proper title' do
273
+ @movie.title.should == 'WALL·E (2008)'
274
+ end
275
+ end
253
276
  end
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe "Imdb::Search with multiple search results" do
4
-
5
4
  before(:each) do
6
5
  @search = Imdb::Search.new("Star Trek: TOS")
7
6
  end
@@ -10,8 +9,8 @@ describe "Imdb::Search with multiple search results" do
10
9
  @search.query.should == "Star Trek: TOS"
11
10
  end
12
11
 
13
- it "should find 4 results" do
14
- @search.movies.size.should eql(4)
12
+ it "should find 14 results" do
13
+ @search.movies.size.should eql(14)
15
14
  end
16
15
 
17
16
  it "should return Imdb::Movie objects only" do
@@ -28,7 +27,6 @@ describe "Imdb::Search with multiple search results" do
28
27
  end
29
28
 
30
29
  describe "Imdb::Search with an exact match and no poster" do
31
-
32
30
  it "should not raise an exception" do
33
31
  expect {
34
32
  @search = Imdb::Search.new("Kannethirey Thondrinal").movies
@@ -39,20 +37,4 @@ describe "Imdb::Search with an exact match and no poster" do
39
37
  @search = Imdb::Search.new("Kannethirey Thondrinal")
40
38
  @search.movies.first.id.should eql("0330508")
41
39
  end
42
-
43
- end
44
-
45
- describe "Imdb::Search with an exact match" do
46
-
47
- before(:each) do
48
- @search = Imdb::Search.new("I killed my lesbian wife")
49
- end
50
-
51
- it "should find one result" do
52
- @search.movies.size.should eql(1)
53
- end
54
-
55
- it "should have the corrected title" do
56
- @search.movies.first.title.should =~ /I Killed My Lesbian Wife/i
57
- end
58
40
  end
@@ -17,3 +17,25 @@ describe "Imdb::Season" do
17
17
  end
18
18
  end
19
19
 
20
+ describe "Imdb::Season starting with episode 0" do
21
+ before(:each) do
22
+ @serie = Imdb::Serie.new("0898266")
23
+ @season = @serie.season(1)
24
+ @episodes = @serie.season(1).episodes
25
+ end
26
+
27
+ it "should index episode correctly" do
28
+ @episodes[0].episode.should eql(0)
29
+ @episodes[1].episode.should eql(1)
30
+ end
31
+
32
+ it "should return the correct title" do
33
+ @episodes[0].title.should eql("Unaired Pilot")
34
+ @episodes[1].title.should eql("Pilot")
35
+ end
36
+
37
+ it "should fetch the correct episode" do
38
+ @season.episode(0).episode.should eql(0)
39
+ @season.episode(1).episode.should eql(1)
40
+ end
41
+ end
@@ -11,7 +11,7 @@ describe "Imdb::Serie" do
11
11
  end
12
12
 
13
13
  it "reports the number of seasons" do
14
- @serie.seasons.size.should eql(4)
14
+ @serie.seasons.size.should eql(5)
15
15
  end
16
16
 
17
17
  it "can fetch a specific season" do
@@ -27,6 +27,7 @@ IMDB_SAMPLES = {
27
27
  "http://akas.imdb.com/title/tt0095016/synopsis" => "synopsis",
28
28
  "http://akas.imdb.com/title/tt0095016/plotsummary" => "plotsummary",
29
29
  "http://akas.imdb.com/title/tt0095016/locations" => "locations",
30
+ "http://akas.imdb.com/title/tt0095016/releaseinfo" => "releaseinfo",
30
31
  "http://akas.imdb.com:80/title/tt0242653/combined" => "tt0242653",
31
32
  "http://akas.imdb.com/title/tt0166222/?fr=c2M9MXxsbT01MDB8ZmI9dXx0dD0xfG14PTIwfGh0bWw9MXxjaD0xfGNvPTF8cG49MHxmdD0xfGt3PTF8cXM9SSBraWxsZWQgbXkgbGVzYmlhbiB3aWZlfHNpdGU9YWthfHE9SSBraWxsZWQgbXkgbGVzYmlhbiB3aWZlfG5tPTE_;fc=1;ft=7" => "tt0166222",
32
33
  "http://akas.imdb.com:80/chart/top" => "top_250",
@@ -38,7 +39,10 @@ IMDB_SAMPLES = {
38
39
  "http://akas.imdb.com/title/tt0468569/combined" => "tt0468569",
39
40
  "http://akas.imdb.com/title/tt1520211/combined" => "tt1520211",
40
41
  "http://akas.imdb.com/title/tt1520211/episodes?season=1" => "thewalkingdead-s1",
41
- "http://akas.imdb.com/title/tt1628064/combined" => "thewalkingdead-s1e2"
42
+ "http://akas.imdb.com/title/tt1628064/combined" => "thewalkingdead-s1e2",
43
+ "http://akas.imdb.com/title/tt0898266/episodes?season=1" => "tbbt-s1",
44
+ "http://akas.imdb.com/title/tt0898266/combined" => "tt0898266",
45
+ "http://akas.imdb.com/find?q=Wall-E;s=tt" => "wall_e_search"
42
46
  }
43
47
 
44
48
  unless ENV['LIVE_TEST']
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ariejan de Vroom
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-28 00:00:00.000000000 Z
11
+ date: 2014-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.6.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.6.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 10.0.3
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 10.0.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 2.13.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 2.13.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: gokdok
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rdoc
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '4.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '4.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: fakeweb
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: Easily use Ruby or the command line to find information on IMDB.com.
@@ -102,11 +102,10 @@ executables:
102
102
  extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
- - .gitignore
106
- - .rspec
107
- - .travis.yml
105
+ - ".gitignore"
106
+ - ".rspec"
107
+ - ".travis.yml"
108
108
  - Gemfile
109
- - History.txt
110
109
  - MIT-LICENSE
111
110
  - Manifest.txt
112
111
  - README.md
@@ -131,10 +130,12 @@ files:
131
130
  - script/generate
132
131
  - spec/fixtures/locations
133
132
  - spec/fixtures/plotsummary
133
+ - spec/fixtures/releaseinfo
134
134
  - spec/fixtures/search_kannethirey_thondrinal
135
135
  - spec/fixtures/search_killed_wife
136
136
  - spec/fixtures/search_star_trek
137
137
  - spec/fixtures/synopsis
138
+ - spec/fixtures/tbbt-s1
138
139
  - spec/fixtures/thewalkingdead-s1
139
140
  - spec/fixtures/thewalkingdead-s1e2
140
141
  - spec/fixtures/top_250
@@ -148,8 +149,10 @@ files:
148
149
  - spec/fixtures/tt0242653
149
150
  - spec/fixtures/tt0330508
150
151
  - spec/fixtures/tt0468569
152
+ - spec/fixtures/tt0898266
151
153
  - spec/fixtures/tt1401252
152
154
  - spec/fixtures/tt1520211
155
+ - spec/fixtures/wall_e_search
153
156
  - spec/imdb/cli_spec.rb
154
157
  - spec/imdb/episode_spec.rb
155
158
  - spec/imdb/movie_spec.rb
@@ -169,27 +172,29 @@ require_paths:
169
172
  - lib
170
173
  required_ruby_version: !ruby/object:Gem::Requirement
171
174
  requirements:
172
- - - '>='
175
+ - - ">="
173
176
  - !ruby/object:Gem::Version
174
177
  version: '0'
175
178
  required_rubygems_version: !ruby/object:Gem::Requirement
176
179
  requirements:
177
- - - '>='
180
+ - - ">="
178
181
  - !ruby/object:Gem::Version
179
182
  version: '0'
180
183
  requirements: []
181
184
  rubyforge_project: imdb
182
- rubygems_version: 2.0.3
185
+ rubygems_version: 2.2.1
183
186
  signing_key:
184
187
  specification_version: 4
185
188
  summary: Easily access the publicly available information on IMDB.
186
189
  test_files:
187
190
  - spec/fixtures/locations
188
191
  - spec/fixtures/plotsummary
192
+ - spec/fixtures/releaseinfo
189
193
  - spec/fixtures/search_kannethirey_thondrinal
190
194
  - spec/fixtures/search_killed_wife
191
195
  - spec/fixtures/search_star_trek
192
196
  - spec/fixtures/synopsis
197
+ - spec/fixtures/tbbt-s1
193
198
  - spec/fixtures/thewalkingdead-s1
194
199
  - spec/fixtures/thewalkingdead-s1e2
195
200
  - spec/fixtures/top_250
@@ -203,8 +208,10 @@ test_files:
203
208
  - spec/fixtures/tt0242653
204
209
  - spec/fixtures/tt0330508
205
210
  - spec/fixtures/tt0468569
211
+ - spec/fixtures/tt0898266
206
212
  - spec/fixtures/tt1401252
207
213
  - spec/fixtures/tt1520211
214
+ - spec/fixtures/wall_e_search
208
215
  - spec/imdb/cli_spec.rb
209
216
  - spec/imdb/episode_spec.rb
210
217
  - spec/imdb/movie_spec.rb
@@ -1,78 +0,0 @@
1
- == 0.6.7 2011-11-30
2
-
3
- * Added trailer page URL [HeeL]
4
-
5
- == 0.6.6 2011-09-14
6
-
7
- -> No history was kept, so here's a short changelog since 2010-02-14 based on git:
8
-
9
- ariejan - 2011-09-14 21:37:06 +0200 - Tested against latest IMDB site
10
- ariejan - 2011-09-14 21:30:51 +0200 - Ignore .rvmrc
11
- ariejan - 2011-09-14 12:27:16 -0700 - Merge pull request #21 from defeed/master
12
- Arjom - 2011-09-14 18:48:39 +0300 - Added method to get countries
13
- ariejan - 2011-09-05 22:49:27 -0700 - Merge pull request #20 from mguterl/use_bundler
14
- mguterl - 2011-09-05 09:31:23 -0400 - replace jeweler with bundler
15
- ariejan - 2011-06-16 03:32:45 -0700 - Merge pull request #18 from rbu/master
16
- rbu - 2011-06-15 22:25:11 +0200 - increase version to 0.6.5.1 and update gemspec
17
- rbu - 2011-06-15 22:16:01 +0200 - Add method to get the number of votes
18
- rbu - 2011-06-15 22:06:07 +0200 - automatic fixtures update, and add a note about a flaky test
19
- rbu - 2011-06-15 22:02:18 +0200 - Fix test, 'Die Hard' had some changes in imdb
20
- rbu - 2011-06-15 22:01:24 +0200 - Fix test, pick another movie for 'without poster' case
21
- rbu - 2011-06-15 21:49:25 +0200 - Fix test, Matrix Revolutions is not an exact match anymore
22
- rbu - 2011-06-15 21:16:43 +0200 - Use akas. subdomain to avoid localized titles
23
- tolosa - 2010-12-04 04:26:19 -0300 - Updated fixtures and sources
24
- tolosa - 2010-12-04 04:25:50 -0300 - Fixed search result for exact match
25
- tolosa - 2010-10-24 21:16:05 -0300 - Modified movie class to load data from new URL, in order to bypass the recent design changes in the IMDB website
26
- tolosa - 2010-10-24 20:53:43 -0300 - Changed movie URLs to load in fixture data
27
- tolosa - 2010-10-24 20:49:52 -0300 - Updated fixture data from new movie URLs
28
- ghedamat - 2010-10-08 06:16:58 -0700 - changed h5 to h4 due to Imdb site layout change
29
- ariejan - 2010-04-29 23:40:20 +0200 - Regenerated gemspec for version 0.6.5
30
- ariejan - 2010-04-29 23:40:11 +0200 - Version bump to 0.6.5
31
- rick - 2010-04-30 05:35:08 +0800 - Adding a means of returning cast member IMDB id's for further lookups.
32
- kenpratt - 2010-04-30 05:34:55 +0800 - Improved poster image parsing (increased success rate on top 250 from ~81% to 100%).
33
- hornairs - 2010-04-30 05:34:42 +0800 - Fixed parsing of plot and release date after IMDB added little arrows, all tests passing.
34
- sandeep kumar - 2010-02-15 15:47:35 +0800 - adding method for release_date for imdb movie and testcase for the same
35
-
36
- == 0.5.0 patch-1 2010-02-14
37
-
38
- * Added methods for fetching release date [if available] from IMDB
39
- * Added Testcase for the same as well.
40
-
41
- == 0.5.0 2009-06-17
42
-
43
- * Added Top 250 listing [mguterl]
44
- * Made general improvements to data retrieval [mguterl]
45
-
46
- == 0.4.2 2009-06-14
47
-
48
- * Updated manifest to include all spec fixtures. [ariejan]
49
-
50
- == 0.4.1 2009-06-14
51
-
52
- * Added support for FakeWeb so specs run faster. [mguterl]
53
- * Cache the search query i Imdb::Search.query. [mguterl]
54
- * Added a convenience method Imdb::Search.search. [mguterl]
55
-
56
- == 0.4.0 2009-06-14
57
-
58
- * Updates to the console 'imdb' utility [ariejan]
59
- * Show the IMDB ID
60
- * Show the full IMDB URL
61
-
62
- == 0.3.0 2009-06-07
63
-
64
- * Fixed typo in CLI field name 'Cast by' [ariejan]
65
- * Fixed retrieval of multiple directors. (#1) [ariejan]
66
-
67
- == 0.2.0 2009-06-04
68
-
69
- * Added console tool 'imdb' for searching and getting movie info. [ariejan]
70
- * Fixed issue #2 [ariejan]
71
-
72
- == 0.1.0 2009-06-03
73
-
74
- * Added Imdb::Search that allows search IMDB for a specific movie. [ariejan]
75
-
76
- == 0.0.1 2009-06-03
77
-
78
- * First release of the IMDB gem. [ariejan]