tmdb_party 0.4.0 → 0.4.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.
- data/README.rdoc +3 -0
- data/VERSION.yml +1 -1
- data/lib/tmdb_party.rb +2 -2
- data/test/fixtures/shitty_shit_result.json +1 -0
- data/test/tmdb_party/test_tmdb_party.rb +9 -0
- data/tmdb_party.gemspec +3 -2
- metadata +3 -2
data/README.rdoc
CHANGED
@@ -35,6 +35,9 @@ Simple ruby wrapper to themoviedb.org (http://api.themoviedb.org/2.0/docs/) usin
|
|
35
35
|
= what is themoviedb.org?
|
36
36
|
It's a movie database, kind of like IMDB except it's more of a community wiki. They also have an api that they're cool with people using. More on the api here: http://api.themoviedb.org/2.0/docs/
|
37
37
|
|
38
|
+
== Contributors
|
39
|
+
Jon Maddox (http://github.com/maddox)
|
40
|
+
|
38
41
|
== Copyright
|
39
42
|
|
40
43
|
Copyright (c) 2009 John Duff. See LICENSE for details.
|
data/VERSION.yml
CHANGED
data/lib/tmdb_party.rb
CHANGED
@@ -30,7 +30,7 @@ module TMDBParty
|
|
30
30
|
|
31
31
|
def search(query)
|
32
32
|
data = self.class.get("/Movie.search/" + default_path_items.join('/') + '/' + URI.escape(query))
|
33
|
-
if data.first == "Nothing found."
|
33
|
+
if data.class != Array || data.first == "Nothing found."
|
34
34
|
[]
|
35
35
|
else
|
36
36
|
data.collect { |movie| Movie.new(movie, self) }
|
@@ -39,7 +39,7 @@ module TMDBParty
|
|
39
39
|
|
40
40
|
def imdb_lookup(imdb_id)
|
41
41
|
data = self.class.get("/Movie.imdbLookup/" + default_path_items.join('/') + '/' + imdb_id)
|
42
|
-
if data.first == "Nothing found."
|
42
|
+
if data.class != Array || data.first == "Nothing found."
|
43
43
|
nil
|
44
44
|
else
|
45
45
|
Movie.new(data.first, self)
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -136,4 +136,13 @@ class TestTmdbParty < Test::Unit::TestCase
|
|
136
136
|
assert result.backdrops.first.has_key? 'original'
|
137
137
|
end
|
138
138
|
|
139
|
+
test "blank result" do
|
140
|
+
stub_get('/Movie.search/en/json/key/Closing%20the%20Ring', 'shitty_shit_result.json')
|
141
|
+
|
142
|
+
results = @tmdb.search('Closing the Ring')
|
143
|
+
assert_equal 0, results.size
|
144
|
+
end
|
145
|
+
|
146
|
+
|
147
|
+
|
139
148
|
end
|
data/tmdb_party.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{tmdb_party}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["John Duff", "Jon Maddox"]
|
12
|
-
s.date = %q{2009-
|
12
|
+
s.date = %q{2009-11-03}
|
13
13
|
s.email = %q{duff.john@gmail.com}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"LICENSE",
|
@@ -37,6 +37,7 @@ Gem::Specification.new do |s|
|
|
37
37
|
"test/fixtures/no_groups.json",
|
38
38
|
"test/fixtures/rad.json",
|
39
39
|
"test/fixtures/search.json",
|
40
|
+
"test/fixtures/shitty_shit_result.json",
|
40
41
|
"test/fixtures/single_result.json",
|
41
42
|
"test/fixtures/transformers.json",
|
42
43
|
"test/test_helper.rb",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tmdb_party
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Duff
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-
|
13
|
+
date: 2009-11-03 00:00:00 -05:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -74,6 +74,7 @@ files:
|
|
74
74
|
- test/fixtures/no_groups.json
|
75
75
|
- test/fixtures/rad.json
|
76
76
|
- test/fixtures/search.json
|
77
|
+
- test/fixtures/shitty_shit_result.json
|
77
78
|
- test/fixtures/single_result.json
|
78
79
|
- test/fixtures/transformers.json
|
79
80
|
- test/test_helper.rb
|