spotlite 0.7.2 → 0.8.0

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 (53) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +8 -41
  4. data/Rakefile +23 -3
  5. data/lib/spotlite.rb +1 -8
  6. data/lib/spotlite/movie.rb +169 -80
  7. data/lib/spotlite/person.rb +90 -14
  8. data/lib/spotlite/string_extensions.rb +9 -9
  9. data/lib/spotlite/version.rb +1 -1
  10. data/spec/fixtures/movie_find_conan +722 -0
  11. data/spec/fixtures/{search_no_results → movie_find_no_results} +95 -149
  12. data/spec/fixtures/nm0000233/index +6118 -0
  13. data/spec/fixtures/nm0005132/index +817 -740
  14. data/spec/fixtures/nm0864666/index +199 -221
  15. data/spec/fixtures/nm1659547/index +748 -719
  16. data/spec/fixtures/person_find_conan +722 -0
  17. data/spec/fixtures/{search_the_core → person_find_no_results} +112 -219
  18. data/spec/fixtures/tt0002186/index +212 -242
  19. data/spec/fixtures/tt0047396/releaseinfo +217 -292
  20. data/spec/fixtures/tt0112873/index +556 -539
  21. data/spec/fixtures/tt0133093/criticreviews +169 -250
  22. data/spec/fixtures/tt0133093/fullcredits +212 -299
  23. data/spec/fixtures/tt0133093/index +444 -491
  24. data/spec/fixtures/tt0133093/keywords +416 -492
  25. data/spec/fixtures/tt0133093/mediaindex_still_frame +114 -158
  26. data/spec/fixtures/tt0133093/releaseinfo +282 -344
  27. data/spec/fixtures/tt0133093/technical +1144 -0
  28. data/spec/fixtures/tt0133093/trivia +1350 -1230
  29. data/spec/fixtures/tt0169547/index +629 -644
  30. data/spec/fixtures/tt0317248/index +579 -608
  31. data/spec/fixtures/tt1134629/fullcredits +257 -340
  32. data/spec/spec_helper.rb +24 -23
  33. data/spec/spotlite/find_spec.rb +38 -0
  34. data/spec/spotlite/movie_spec.rb +73 -57
  35. data/spec/spotlite/person_spec.rb +60 -1
  36. data/spotlite.gemspec +9 -9
  37. metadata +34 -56
  38. data/lib/spotlite/box_office_top.rb +0 -11
  39. data/lib/spotlite/coming_soon.rb +0 -24
  40. data/lib/spotlite/in_theaters.rb +0 -25
  41. data/lib/spotlite/list.rb +0 -18
  42. data/lib/spotlite/opening_this_week.rb +0 -11
  43. data/lib/spotlite/search.rb +0 -45
  44. data/lib/spotlite/top.rb +0 -23
  45. data/spec/fixtures/movies_coming_soon +0 -2103
  46. data/spec/fixtures/movies_in_theaters +0 -2708
  47. data/spec/fixtures/top +0 -10823
  48. data/spec/spotlite/box_office_top_spec.rb +0 -29
  49. data/spec/spotlite/coming_soon_spec.rb +0 -29
  50. data/spec/spotlite/opening_this_week_spec.rb +0 -29
  51. data/spec/spotlite/search_spec.rb +0 -34
  52. data/spec/spotlite/top_spec.rb +0 -21
  53. data/tasks/fixtures.rake +0 -15
@@ -1,29 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Spotlite::BoxOfficeTop" do
4
- before(:each) do
5
- @list = Spotlite::BoxOfficeTop.new.movies
6
- end
7
-
8
- it "should return 10 results" do
9
- @list.size.should eql(10)
10
- end
11
-
12
- it "should return Spotlite::Movie objects" do
13
- @list.each { |movie| movie.should be_a(Spotlite::Movie) }
14
- end
15
-
16
- describe "Movie" do
17
- it "should have IMDb ID" do
18
- @list.each { |movie| movie.imdb_id.should match(/\d{7}/) }
19
- end
20
-
21
- it "should have title" do
22
- @list.each { |movie| movie.title.should match(/\w+/) }
23
- end
24
-
25
- it "should have year" do
26
- @list.each { |movie| movie.year.to_s.should match(/\d{4}/) }
27
- end
28
- end
29
- end
@@ -1,29 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Spotlite::ComingSoon" do
4
- before(:each) do
5
- @list = Spotlite::ComingSoon.new.movies
6
- end
7
-
8
- it "should return a few results" do
9
- @list.size.should be_within(14).of(15)
10
- end
11
-
12
- it "should return Spotlite::Movie objects" do
13
- @list.each { |movie| movie.should be_a(Spotlite::Movie) }
14
- end
15
-
16
- describe "Movie" do
17
- it "should have IMDb ID" do
18
- @list.each { |movie| movie.imdb_id.should match(/\d{7}/) }
19
- end
20
-
21
- it "should have title" do
22
- @list.each { |movie| movie.title.should match(/\w+/) }
23
- end
24
-
25
- it "should have year" do
26
- @list.each { |movie| movie.year.to_s.should match(/\d{4}/) }
27
- end
28
- end
29
- end
@@ -1,29 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Spotlite::OpeningThisWeek" do
4
- before(:each) do
5
- @list = Spotlite::OpeningThisWeek.new.movies
6
- end
7
-
8
- it "should return a few results" do
9
- @list.size.should be_within(14).of(15)
10
- end
11
-
12
- it "should return Spotlite::Movie objects" do
13
- @list.each { |movie| movie.should be_a(Spotlite::Movie) }
14
- end
15
-
16
- describe "Movie" do
17
- it "should have IMDb ID" do
18
- @list.each { |movie| movie.imdb_id.should match(/\d{7}/) }
19
- end
20
-
21
- it "should have title" do
22
- @list.each { |movie| movie.title.should match(/\w+/) }
23
- end
24
-
25
- it "should have year" do
26
- @list.each { |movie| movie.year.to_s.should match(/\d{4}/) }
27
- end
28
- end
29
- end
@@ -1,34 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Spotlite::Search" do
4
- before(:each) do
5
- @search = Spotlite::Search.new("the core")
6
- end
7
-
8
- it "should return 6 results" do
9
- @search.movies.size.should be_within(5).of(10)
10
- end
11
-
12
- it "should return Spotlite::Movie objects" do
13
- @search.movies.each { |movie| movie.should be_a(Spotlite::Movie) }
14
- end
15
-
16
- it "should return IMDb ID, title, and year" do
17
- @search.movies.first.imdb_id.should eql("0298814")
18
- @search.movies.first.title.should eql("The Core")
19
- @search.movies.first.year.should eql(2003)
20
- end
21
-
22
- it "should not contain video games" do
23
- @search.movies.each { |movie| movie.imdb_id.should_not eql("0483593") }
24
- end
25
-
26
- it "should not contain TV series/episodes" do
27
- @search.movies.each { |movie| movie.imdb_id.should_not eql("1979599") }
28
- end
29
-
30
- it "should handle 'No results found'" do
31
- @search = Spotlite::Search.new("wappadoozle swambling")
32
- @search.movies.should be_empty
33
- end
34
- end
@@ -1,21 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Spotlite::Top" do
4
- before(:each) do
5
- @top = Spotlite::Top.new.movies
6
- end
7
-
8
- it "should return 250 results" do
9
- @top.size.should eql(250)
10
- end
11
-
12
- it "should return Spotlite::Movie objects" do
13
- @top.each { |movie| movie.should be_a(Spotlite::Movie) }
14
- end
15
-
16
- it "should return IMDb ID and title" do
17
- @top.first.imdb_id.should eql("0111161")
18
- @top.first.title.should eql("The Shawshank Redemption")
19
- @top.first.year.should eql(1994)
20
- end
21
- end
@@ -1,15 +0,0 @@
1
- namespace :fixtures do
2
- desc "Refresh spec fixtures with fresh data from IMDb.com"
3
- task :refresh do
4
- require File.expand_path(File.dirname(__FILE__) + "/../spec/spec_helper")
5
-
6
- IMDB_SAMPLES.each_pair do |url, fixture|
7
- page = `curl -isH "Accept-Language: en-us" #{url}`
8
-
9
- File.open(File.expand_path(File.dirname(__FILE__) + "/../spec/fixtures/#{fixture}"), 'w') do |f|
10
- f.write(page)
11
- end
12
-
13
- end
14
- end
15
- end