simple_themoviedb 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98860e2569b1ea431fce980cd4766628e6220e8688640b684f7560781cb9aa54
4
- data.tar.gz: f8245f485f4a2cd72daedbc36a9bfc7cd79766a81a96482347cb812a08ce90a0
3
+ metadata.gz: cf12e1f85c9a12ccf3ee97f8975890ac44b309fc495a423522768202f8f4e8df
4
+ data.tar.gz: 868c4ec54420f6023552b982ca0380644b5d498009b35250160e78ac5fc9633d
5
5
  SHA512:
6
- metadata.gz: bcc36fa94e4ce640ebc46779abb1ab5a616bc17d9134038a5a225edae4bd33f434de9180c7453764044af24959fdc04c9c4b2dbe42e1798af4456303a9ab96c0
7
- data.tar.gz: 1076a5eef965f94b9a7faf7da87e80ef8aaa6226776fc60115c5c76e153cbb1f1b1e3e7ff4577c992c3fa96e0c80b305d7f10c70b6eaa021df5258394f8b1fd1
6
+ metadata.gz: 5603ee05feb92153dd39272f1a17f72b6475ceb0f3723075f6148c1eaf38ac45298e3b57bcc14956d7acde64a916b92795fb2ac3471a98687775637b2f7520df
7
+ data.tar.gz: aa773e43b2973646049b8f6abc52ab6860c5b5614d447d450412f403770d77662f865a1ad63161244eb20efee56c7ad3798b660ae5109a19c90bece3078a5ddf
data/.gitignore CHANGED
@@ -9,3 +9,6 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+
13
+ # Ignore built gems
14
+ *.gem
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_themoviedb (0.1.0)
4
+ simple_themoviedb (0.1.1)
5
5
  httparty
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # SimpleThemoviedb
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).
@@ -34,45 +34,51 @@ module SimpleTheMovieDB
34
34
 
35
35
  def get_configuration
36
36
  url = "/configuration?"
37
- options = { :api_key => @api_key }
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
- self.class.get(url + options.to_query).parsed_response
44
+ get_and_parse(url, options)
46
45
  end
47
46
 
48
47
  def get_images(id)
49
48
  url = "/movie/#{id}/images?"
50
- options = { :api_key => @api_key }
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
- options = { :api_key => @api_key }
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
- options = { :api_key => @api_key }
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
- options = { :api_key => @api_key }
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
- options = { :api_key => @api_key }
75
- self.class.get(url + options.to_query).parsed_response
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
@@ -1,3 +1,3 @@
1
1
  module SimpleTheMovieDB
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  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.0
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-07 00:00:00.000000000 Z
11
+ date: 2018-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty