imdb_party 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ *.sw?
2
+ .DS_Store
3
+ coverage
4
+ rdoc
5
+ pkg
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.0
1
+ 0.6.1
@@ -1,47 +1,49 @@
1
1
  # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{imdb_party}
8
- s.version = "0.6.0"
8
+ s.version = "0.6.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jon Maddox"]
12
- s.date = %q{2011-05-02}
12
+ s.date = %q{2011-05-04}
13
13
  s.description = %q{IMDB client using the IMDB API that their iPhone app uses}
14
14
  s.email = %q{jon@mustacheinc.com}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
- "README.md"
17
+ "README.md"
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
- "LICENSE",
22
- "README.md",
23
- "Rakefile",
24
- "VERSION",
25
- "imdb_party.gemspec",
26
- "lib/imdb_party.rb",
27
- "lib/imdb_party/httparty_icebox.rb",
28
- "lib/imdb_party/imdb.rb",
29
- "lib/imdb_party/movie.rb",
30
- "lib/imdb_party/person.rb",
31
- "test/movie_test.rb",
32
- "test/person_test.rb",
33
- "test/search_test.rb",
34
- "test/test_helper.rb"
21
+ ".gitignore",
22
+ "LICENSE",
23
+ "README.md",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "imdb_party.gemspec",
27
+ "lib/imdb_party.rb",
28
+ "lib/imdb_party/httparty_icebox.rb",
29
+ "lib/imdb_party/imdb.rb",
30
+ "lib/imdb_party/movie.rb",
31
+ "lib/imdb_party/person.rb",
32
+ "test/movie_test.rb",
33
+ "test/person_test.rb",
34
+ "test/search_test.rb",
35
+ "test/test_helper.rb"
35
36
  ]
36
37
  s.homepage = %q{http://github.com/maddox/imdb_party}
38
+ s.rdoc_options = ["--charset=UTF-8"]
37
39
  s.require_paths = ["lib"]
38
40
  s.rubygems_version = %q{1.4.2}
39
41
  s.summary = %q{IMDB client using the IMDB API that their iPhone app uses}
40
42
  s.test_files = [
41
43
  "test/movie_test.rb",
42
- "test/person_test.rb",
43
- "test/search_test.rb",
44
- "test/test_helper.rb"
44
+ "test/person_test.rb",
45
+ "test/search_test.rb",
46
+ "test/test_helper.rb"
45
47
  ]
46
48
 
47
49
  if s.respond_to? :specification_version then
@@ -59,4 +61,3 @@ Gem::Specification.new do |s|
59
61
  s.add_dependency(%q<httparty>, [">= 0"])
60
62
  end
61
63
  end
62
-
@@ -16,14 +16,16 @@ module ImdbParty
16
16
  query_params = default_params.merge(params)
17
17
  query_param_array = []
18
18
 
19
- host = self.class.base_uri.gsub('http://', '').to_s
20
-
19
+ base_uri = URI.parse(self.class.base_uri)
20
+ base_host = base_uri.host
21
+ the_path = base_uri.path + path
22
+
21
23
  query_params.each_pair{|key, value| query_param_array << "#{key}=#{URI.escape(value.to_s)}" }
22
- uri = URI::HTTP.build(:scheme => 'https', :host => host, :path => path, :query => query_param_array.join("&"))
24
+ uri = URI::HTTP.build(:scheme => 'https', :host => base_host, :path => the_path, :query => query_param_array.join("&"))
23
25
 
24
26
  query_param_array << "sig=app1-#{OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new('sha1'), default_params["apiKey"], uri.to_s)}"
25
27
 
26
- uri = URI::HTTP.build(:scheme => 'https', :host => host, :path => path, :query => query_param_array.join("&"))
28
+ uri = URI::HTTP.build(:scheme => 'https', :host => base_host, :path => the_path, :query => query_param_array.join("&"))
27
29
  uri.to_s
28
30
  end
29
31
 
@@ -15,7 +15,7 @@ class SearchTest < Test::Unit::TestCase
15
15
  assert (@results.size >= 15)
16
16
  end
17
17
  end
18
-
18
+
19
19
  context "search for title with spaces in the name" do
20
20
  setup do
21
21
  @results = @imdb.find_by_title("the truman show")
@@ -35,7 +35,7 @@ class SearchTest < Test::Unit::TestCase
35
35
  assert_equal 0, @results.size
36
36
  end
37
37
  end
38
-
38
+
39
39
  context "find movie by id" do
40
40
  setup do
41
41
  @movie = @imdb.find_movie_by_id("tt0382932")
@@ -45,7 +45,7 @@ class SearchTest < Test::Unit::TestCase
45
45
  assert_equal ImdbParty::Movie, @movie.class
46
46
  end
47
47
  end
48
-
48
+
49
49
  context "find top 250 movies" do
50
50
  setup do
51
51
  @movies = @imdb.top_250
@@ -56,7 +56,25 @@ class SearchTest < Test::Unit::TestCase
56
56
  assert_equal Hash, @movies.first.class
57
57
  end
58
58
  end
59
+
60
+ context "find popular shows" do
61
+ setup do
62
+ @shows = @imdb.popular_shows
63
+ end
64
+
65
+ should "be an Array of Hashes" do
66
+ assert_equal Array, @shows.class
67
+ assert_equal Hash, @shows.first.class
68
+ end
69
+ end
70
+
71
+ end
59
72
 
73
+ context "anonymous imdb" do
74
+ setup do
75
+ @imdb = ImdbParty::Imdb.new(:anonymize => true)
76
+ end
77
+
60
78
  context "find popular shows" do
61
79
  setup do
62
80
  @shows = @imdb.popular_shows
@@ -69,4 +87,5 @@ class SearchTest < Test::Unit::TestCase
69
87
  end
70
88
 
71
89
  end
90
+
72
91
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imdb_party
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 0
10
- version: 0.6.0
9
+ - 1
10
+ version: 0.6.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jon Maddox
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-02 00:00:00 -04:00
18
+ date: 2011-05-04 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -57,6 +57,7 @@ extra_rdoc_files:
57
57
  - README.md
58
58
  files:
59
59
  - .document
60
+ - .gitignore
60
61
  - LICENSE
61
62
  - README.md
62
63
  - Rakefile
@@ -76,8 +77,8 @@ homepage: http://github.com/maddox/imdb_party
76
77
  licenses: []
77
78
 
78
79
  post_install_message:
79
- rdoc_options: []
80
-
80
+ rdoc_options:
81
+ - --charset=UTF-8
81
82
  require_paths:
82
83
  - lib
83
84
  required_ruby_version: !ruby/object:Gem::Requirement