simple_themoviedb 0.1.0 → 0.1.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.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/Gemfile.lock +1 -1
- data/README.md +2 -6
- data/lib/simple_themoviedb.rb +19 -13
- data/lib/simple_themoviedb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf12e1f85c9a12ccf3ee97f8975890ac44b309fc495a423522768202f8f4e8df
|
4
|
+
data.tar.gz: 868c4ec54420f6023552b982ca0380644b5d498009b35250160e78ac5fc9633d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5603ee05feb92153dd39272f1a17f72b6475ceb0f3723075f6148c1eaf38ac45298e3b57bcc14956d7acde64a916b92795fb2ac3471a98687775637b2f7520df
|
7
|
+
data.tar.gz: aa773e43b2973646049b8f6abc52ab6860c5b5614d447d450412f403770d77662f865a1ad63161244eb20efee56c7ad3798b660ae5109a19c90bece3078a5ddf
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# SimpleTheMovieDB
|
2
2
|
|
3
|
-
A brutally simple wrapper on the themoviedb.com API.
|
3
|
+
A brutally simple wrapper on the themoviedb.com API. The library that powers [Love4Movies](http://love4movies.com).
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -33,7 +33,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
|
|
33
33
|
## License
|
34
34
|
|
35
35
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
36
|
-
|
37
|
-
## Code of Conduct
|
38
|
-
|
39
|
-
Everyone interacting in the SimpleThemoviedb project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/simple_themoviedb/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/simple_themoviedb.rb
CHANGED
@@ -34,45 +34,51 @@ module SimpleTheMovieDB
|
|
34
34
|
|
35
35
|
def get_configuration
|
36
36
|
url = "/configuration?"
|
37
|
-
|
38
|
-
self.class.get(url + options.to_query).parsed_response
|
37
|
+
get_and_parse(url)
|
39
38
|
end
|
40
39
|
|
41
40
|
def get_movie(id, lang = nil)
|
42
41
|
url = "/movie/#{id}?"
|
43
42
|
options = { :api_key => @api_key }
|
44
43
|
options = options.merge(:language => lang) if lang
|
45
|
-
|
44
|
+
get_and_parse(url, options)
|
46
45
|
end
|
47
46
|
|
48
47
|
def get_images(id)
|
49
48
|
url = "/movie/#{id}/images?"
|
50
|
-
|
51
|
-
self.class.get(url + options.to_query).parsed_response
|
49
|
+
get_and_parse(url)
|
52
50
|
end
|
53
51
|
|
54
52
|
def get_cast(id)
|
55
53
|
url = "/movie/#{id}/casts?"
|
56
|
-
|
57
|
-
self.class.get(url + options.to_query).parsed_response
|
54
|
+
get_and_parse(url)
|
58
55
|
end
|
59
56
|
|
60
57
|
def get_person(id)
|
61
58
|
url = "/person/#{id}?"
|
62
|
-
|
63
|
-
self.class.get(url + options.to_query).parsed_response
|
59
|
+
get_and_parse(url)
|
64
60
|
end
|
65
61
|
|
66
62
|
def get_person_images(id)
|
67
63
|
url = "/person/#{id}/images?"
|
68
|
-
|
69
|
-
self.class.get(url + options.to_query).parsed_response
|
64
|
+
get_and_parse(url)
|
70
65
|
end
|
71
66
|
|
72
67
|
def get_person_credits(id)
|
73
68
|
url = "/person/#{id}/credits?"
|
74
|
-
|
75
|
-
|
69
|
+
get_and_parse(url)
|
70
|
+
end
|
71
|
+
|
72
|
+
private
|
73
|
+
|
74
|
+
def get_and_parse(url, options = { api_key: @api_key })
|
75
|
+
self.class.get(url + to_query(options)).parsed_response
|
76
|
+
end
|
77
|
+
|
78
|
+
def to_query(options)
|
79
|
+
options.map do |key, value|
|
80
|
+
"#{key}=#{value}"
|
81
|
+
end.join("&")
|
76
82
|
end
|
77
83
|
end
|
78
84
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_themoviedb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gawyn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|