tmdb-movies 0.0.03
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +16 -0
- data/.rspec +2 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +74 -0
- data/Rakefile +2 -0
- data/lib/tmdb.rb +9 -0
- data/lib/tmdb/connection.rb +69 -0
- data/lib/tmdb/connection/genre_methods.rb +16 -0
- data/lib/tmdb/connection/movie_methods.rb +54 -0
- data/lib/tmdb/connection/people_methods.rb +45 -0
- data/lib/tmdb/connection/search_methods.rb +24 -0
- data/lib/tmdb/movie.rb +53 -0
- data/lib/tmdb/person.rb +25 -0
- data/lib/tmdb/tmdb_base.rb +17 -0
- data/lib/tmdb/version.rb +3 -0
- data/spec/spec_helper.rb +91 -0
- data/tmdb-movies.gemspec +25 -0
- metadata +119 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1c8aa27e851a3911fc24f7087eaf85bb71010fcc
|
4
|
+
data.tar.gz: 018f27ad2a2ed12151ecee724db26865ddf11daf
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 33ef90c7efac7c7e58c9704b0616c8976ed51bd7dbacc0ebe2f2332816f0332044192e512d6ea35a45e2462014e2cc384f4713df8bc596797df2a6831aa8a882
|
7
|
+
data.tar.gz: 226abf137b7b174a43a141584da1b658e2689a9fd7d9d0698b4fb5923d865f185149cea3c28b9434ae9a55d04d03136b80d99f57a829ca63d8fbefd377ffe3fa
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Kelly Mahan
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Tmdb::Movies
|
2
|
+
|
3
|
+
A gem for easy access to themoviedb.org's api.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'tmdb-movies'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install tmdb-movies
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
TODO: Write usage instructions here
|
24
|
+
|
25
|
+
## Rate Limiter
|
26
|
+
|
27
|
+
TMDB api has a hard rate limit of 40 requests every 10 seconds, going over that limit very quickly gets you you a bunch of errors about exceeding the limit. The rate limit method is so you don't have to worry about your own code exceeding that limit as long as you only have a single thread running. I set a conservative rate limit of 2.5 requests a second as a default for when i would occasionally have more than 1 thread going at a time.
|
28
|
+
|
29
|
+
The rate_limit method can be overridden to better match your own application. When I started using multiple resque workers the default limiter wasn't enough. Below is my override for a multi thread limiter in rails using resque with many workers. Some jobs are completed very fast some are a little slower.
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
#config/initializers/tmdb_rate_limit.rb
|
33
|
+
|
34
|
+
|
35
|
+
require "remote_lock" # the remote lock gem is not a requiremnt of tmdb-movies. Add it to your gem file to make use of this code
|
36
|
+
|
37
|
+
RemoteLock.class_eval do
|
38
|
+
def acquire_lock(key, options = {})
|
39
|
+
options = RemoteLock::DEFAULT_OPTIONS.merge(options)
|
40
|
+
1.upto(options[:retries]) do |attempt|
|
41
|
+
success = @adapter.store(key_for(key), options[:expiry])
|
42
|
+
return if success
|
43
|
+
break if attempt == options[:retries]
|
44
|
+
Kernel.sleep(options[:initial_wait])
|
45
|
+
end
|
46
|
+
raise RemoteLock::Error, "Couldn't acquire lock for: #{key}"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
#this is to rate limit for multiple processes, this will be slower than the built in rate limiter for 1 process
|
51
|
+
Tmdb::Connection.class_eval do
|
52
|
+
def rate_limit
|
53
|
+
$lock.synchronize("tmdb-movies-rate-limiter", retries: 999) do
|
54
|
+
last_time = Resque.redis.get("tmdb-movies-rate-limiter-last-update").to_f
|
55
|
+
if Time.now.to_f<last_time+Tmdb::Connection::CONNECTION_SPACING
|
56
|
+
sleep [last_time+Tmdb::Connection::CONNECTION_SPACING-Time.now.to_f,0].max #in case time passsed while processing
|
57
|
+
end
|
58
|
+
Resque.redis.set("tmdb-movies-rate-limiter-last-update", Time.now.to_f)
|
59
|
+
end
|
60
|
+
sleep 0.1 #if we don't sleep here the other proccesses don't get a chance to ask for a lock.
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
$lock = RemoteLock.new(RemoteLock::Adapters::Redis.new(Resque.redis))
|
65
|
+
```
|
66
|
+
|
67
|
+
|
68
|
+
## Contributing
|
69
|
+
|
70
|
+
1. Fork it ( https://github.com/[my-github-username]/tmdb-movies/fork )
|
71
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
72
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
73
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
74
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/lib/tmdb.rb
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
require 'tmdb/connection/movie_methods'
|
3
|
+
require 'tmdb/connection/people_methods'
|
4
|
+
require 'tmdb/connection/genre_methods'
|
5
|
+
require 'tmdb/connection/search_methods'
|
6
|
+
|
7
|
+
module Tmdb
|
8
|
+
|
9
|
+
@@connection = nil
|
10
|
+
|
11
|
+
def self.connection
|
12
|
+
@@connection
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.connection=(c)
|
16
|
+
@@connection = c
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.connect
|
20
|
+
@@connection ||= Tmdb::Connection.new
|
21
|
+
end
|
22
|
+
|
23
|
+
class Connection
|
24
|
+
include HTTParty
|
25
|
+
include MovieMethods
|
26
|
+
include PeopleMethods
|
27
|
+
include GenreMethods
|
28
|
+
include SearchMethods
|
29
|
+
# debug_output $stdout
|
30
|
+
|
31
|
+
attr_accessor :api_key, :response, :request, :rate_limit_time
|
32
|
+
|
33
|
+
CONNECTIONS_PER_MINUTE = 150.0
|
34
|
+
CONNECTION_SPACING = 60.0/CONNECTIONS_PER_MINUTE
|
35
|
+
TMDB_URL = "http://api.themoviedb.org/3"
|
36
|
+
|
37
|
+
def initialize(api_key = ENV["TMDB_API_KEY"])
|
38
|
+
@api_key = api_key
|
39
|
+
Tmdb.connection = self
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
def rate_limit
|
44
|
+
while(Time.now.to_f<@rate_limit_time.to_f+CONNECTION_SPACING)
|
45
|
+
sleep 0.1
|
46
|
+
end
|
47
|
+
@rate_limit_time = Time.now
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
def get(url, params={})
|
53
|
+
params.merge!({api_key: @api_key, language: params[:language]||"en"})
|
54
|
+
rate_limit
|
55
|
+
@response = self.class.get(TMDB_URL + url, query: params)
|
56
|
+
@request = @response.request
|
57
|
+
return @response
|
58
|
+
end
|
59
|
+
|
60
|
+
def post(url, params={})
|
61
|
+
params.merge!({api_key: @api_key, language: params[:language]||"en"})
|
62
|
+
rate_limit
|
63
|
+
@response = self.class.post(TMDB_URL + url, query: params)
|
64
|
+
@request = @response.request
|
65
|
+
return @response
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Tmdb
|
2
|
+
module GenreMethods
|
3
|
+
|
4
|
+
def genre_movie_list
|
5
|
+
OpenStruct.new(get("/genre/movie/list"))
|
6
|
+
end
|
7
|
+
|
8
|
+
def genre_tv_list
|
9
|
+
OpenStruct.new(get("/genre/tv/list"))
|
10
|
+
end
|
11
|
+
|
12
|
+
def genre_movies(id, options={})
|
13
|
+
OpenStruct.new(get("/genre/#{id}/movies", options))
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
module Tmdb
|
2
|
+
module MovieMethods
|
3
|
+
|
4
|
+
|
5
|
+
def movie(id, options={})
|
6
|
+
OpenStruct.new(get("/movie/#{id}", options))
|
7
|
+
end
|
8
|
+
|
9
|
+
def movie_all_changes(options={})
|
10
|
+
OpenStruct.new(get("/movie/changes", options))
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
movie_api_methods = %w(
|
15
|
+
latest
|
16
|
+
now_playing
|
17
|
+
upcoming
|
18
|
+
top_rated
|
19
|
+
popular
|
20
|
+
|
21
|
+
)
|
22
|
+
|
23
|
+
movie_api_methods.each do |m|
|
24
|
+
eval <<-EOF
|
25
|
+
def movie_#{m}(options={})
|
26
|
+
OpenStruct.new(get("/movie/#{m}", options))
|
27
|
+
end
|
28
|
+
EOF
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
movie_api_methods_id = %w(
|
33
|
+
alternative_titles
|
34
|
+
credits
|
35
|
+
images
|
36
|
+
keywords
|
37
|
+
releases
|
38
|
+
videos
|
39
|
+
translations
|
40
|
+
similar
|
41
|
+
reviews
|
42
|
+
lists
|
43
|
+
changes
|
44
|
+
)
|
45
|
+
|
46
|
+
movie_api_methods_id.each do |m|
|
47
|
+
eval <<-EOF
|
48
|
+
def movie_#{m}(id, options={})
|
49
|
+
OpenStruct.new(get("/movie/\#{id}/#{m}", options))
|
50
|
+
end
|
51
|
+
EOF
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Tmdb
|
2
|
+
module PeopleMethods
|
3
|
+
|
4
|
+
|
5
|
+
def person(id, options={})
|
6
|
+
OpenStruct.new(get("/person/#{id}", options))
|
7
|
+
end
|
8
|
+
|
9
|
+
|
10
|
+
def person_all_changes(options={})
|
11
|
+
OpenStruct.new(get("/person/changes", options))
|
12
|
+
end
|
13
|
+
|
14
|
+
people_api_methods = %w(
|
15
|
+
popular
|
16
|
+
latest
|
17
|
+
)
|
18
|
+
|
19
|
+
people_api_methods.each do |m|
|
20
|
+
eval <<-EOF
|
21
|
+
def person_#{m}(options={})
|
22
|
+
OpenStruct.new(get("/person/#{m}", options))
|
23
|
+
end
|
24
|
+
EOF
|
25
|
+
end
|
26
|
+
|
27
|
+
people_api_methods_id = %w(
|
28
|
+
movie_credits
|
29
|
+
tv_credits
|
30
|
+
combined_credits
|
31
|
+
external_ids
|
32
|
+
images
|
33
|
+
tagged_images
|
34
|
+
changes
|
35
|
+
)
|
36
|
+
|
37
|
+
people_api_methods_id.each do |m|
|
38
|
+
eval <<-EOF
|
39
|
+
def person_#{m}(id, options={})
|
40
|
+
OpenStruct.new(get("/person/\#{id}/#{m}", options))
|
41
|
+
end
|
42
|
+
EOF
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Tmdb
|
2
|
+
module SearchMethods
|
3
|
+
|
4
|
+
search_api_methods = %w(
|
5
|
+
company
|
6
|
+
collection
|
7
|
+
keyword
|
8
|
+
list
|
9
|
+
movie
|
10
|
+
multi
|
11
|
+
person
|
12
|
+
tv
|
13
|
+
)
|
14
|
+
|
15
|
+
search_api_methods.each do |m|
|
16
|
+
eval <<-EOF
|
17
|
+
def search_#{m}(query, options={})
|
18
|
+
options.merge!(query: query)
|
19
|
+
OpenStruct.new(get("/search/#{m}", options))
|
20
|
+
end
|
21
|
+
EOF
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/tmdb/movie.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
module Tmdb
|
2
|
+
class Movie < TmdbBase
|
3
|
+
|
4
|
+
def initialize(id)
|
5
|
+
@id = id
|
6
|
+
@info = api.movie(id)
|
7
|
+
end
|
8
|
+
|
9
|
+
def images
|
10
|
+
api.movie_images(id)
|
11
|
+
end
|
12
|
+
|
13
|
+
def posters
|
14
|
+
_images = images.posters.map{|p| OpenStruct.new(p)}
|
15
|
+
unless _images.map{|i| i.file_path}.include?(poster_path)
|
16
|
+
_images << OpenStruct.new({file_path: poster_path})
|
17
|
+
end
|
18
|
+
return _images
|
19
|
+
end
|
20
|
+
|
21
|
+
def backdrops
|
22
|
+
_images = images.backdrops.map{|p| OpenStruct.new(p)}
|
23
|
+
unless _images.map{|i| i.file_path}.include?(backdrop_path)
|
24
|
+
_images << OpenStruct.new({file_path: backdrop_path})
|
25
|
+
end
|
26
|
+
return _images
|
27
|
+
end
|
28
|
+
|
29
|
+
def cast
|
30
|
+
api.movie_credits(id).cast.map{|c| OpenStruct.new(c)}
|
31
|
+
end
|
32
|
+
|
33
|
+
def crew
|
34
|
+
api.movie_credits(id).crew.map{|c| OpenStruct.new(c)}
|
35
|
+
end
|
36
|
+
|
37
|
+
def videos
|
38
|
+
api.movie_videos(id).results.map{|t| OpenStruct.new(t)}
|
39
|
+
end
|
40
|
+
|
41
|
+
def release_date
|
42
|
+
Date.parse(@info.release_date) rescue nil
|
43
|
+
end
|
44
|
+
|
45
|
+
def method_missing(method, *args, &block)
|
46
|
+
if @info.respond_to?(method)
|
47
|
+
@info.send(method, *args, &block)
|
48
|
+
else
|
49
|
+
super
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
data/lib/tmdb/person.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
module Tmdb
|
2
|
+
class Person < TmdbBase
|
3
|
+
|
4
|
+
def initialize(id)
|
5
|
+
@id = id
|
6
|
+
@info = api.person(id)
|
7
|
+
end
|
8
|
+
|
9
|
+
def images
|
10
|
+
api.person_images(id).profiles.map{|i| OpenStruct.new(i)}
|
11
|
+
end
|
12
|
+
|
13
|
+
def movies
|
14
|
+
api.person_movie_credits(id).cast.map{|c| OpenStruct.new(c)}
|
15
|
+
end
|
16
|
+
|
17
|
+
def method_missing(method, *args, &block)
|
18
|
+
if @info.respond_to?(method)
|
19
|
+
@info.send(method, *args, &block)
|
20
|
+
else
|
21
|
+
super
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Tmdb
|
2
|
+
class TmdbBase
|
3
|
+
attr_accessor :id, :info
|
4
|
+
|
5
|
+
def api
|
6
|
+
Tmdb.connection
|
7
|
+
end
|
8
|
+
|
9
|
+
def status_message
|
10
|
+
@info.status_message
|
11
|
+
end
|
12
|
+
|
13
|
+
def changes(options={})
|
14
|
+
api.send("#{self.class.name.split('::').last.underscore}_changes", self.id, options)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/tmdb/version.rb
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
4
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
5
|
+
# files.
|
6
|
+
#
|
7
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
8
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
9
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
10
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
11
|
+
# a separate helper file that requires the additional dependencies and performs
|
12
|
+
# the additional setup, and require it from the spec files that actually need
|
13
|
+
# it.
|
14
|
+
#
|
15
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
16
|
+
# users commonly want.
|
17
|
+
#
|
18
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
19
|
+
RSpec.configure do |config|
|
20
|
+
# rspec-expectations config goes here. You can use an alternate
|
21
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
22
|
+
# assertions if you prefer.
|
23
|
+
config.expect_with :rspec do |expectations|
|
24
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
25
|
+
# and `failure_message` of custom matchers include text for helper methods
|
26
|
+
# defined using `chain`, e.g.:
|
27
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
28
|
+
# # => "be bigger than 2 and smaller than 4"
|
29
|
+
# ...rather than:
|
30
|
+
# # => "be bigger than 2"
|
31
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
32
|
+
end
|
33
|
+
|
34
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
35
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
36
|
+
config.mock_with :rspec do |mocks|
|
37
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
38
|
+
# a real object. This is generally recommended, and will default to
|
39
|
+
# `true` in RSpec 4.
|
40
|
+
mocks.verify_partial_doubles = true
|
41
|
+
end
|
42
|
+
|
43
|
+
# The settings below are suggested to provide a good initial experience
|
44
|
+
# with RSpec, but feel free to customize to your heart's content.
|
45
|
+
=begin
|
46
|
+
# These two settings work together to allow you to limit a spec run
|
47
|
+
# to individual examples or groups you care about by tagging them with
|
48
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
49
|
+
# get run.
|
50
|
+
config.filter_run :focus
|
51
|
+
config.run_all_when_everything_filtered = true
|
52
|
+
|
53
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
54
|
+
# recommended. For more details, see:
|
55
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
56
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
57
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
58
|
+
config.disable_monkey_patching!
|
59
|
+
|
60
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
61
|
+
# be too noisy due to issues in dependencies.
|
62
|
+
config.warnings = true
|
63
|
+
|
64
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
65
|
+
# file, and it's useful to allow more verbose output when running an
|
66
|
+
# individual spec file.
|
67
|
+
if config.files_to_run.one?
|
68
|
+
# Use the documentation formatter for detailed output,
|
69
|
+
# unless a formatter has already been configured
|
70
|
+
# (e.g. via a command-line flag).
|
71
|
+
config.default_formatter = 'doc'
|
72
|
+
end
|
73
|
+
|
74
|
+
# Print the 10 slowest examples and example groups at the
|
75
|
+
# end of the spec run, to help surface which specs are running
|
76
|
+
# particularly slow.
|
77
|
+
config.profile_examples = 10
|
78
|
+
|
79
|
+
# Run specs in random order to surface order dependencies. If you find an
|
80
|
+
# order dependency and want to debug it, you can fix the order by providing
|
81
|
+
# the seed, which is printed after each run.
|
82
|
+
# --seed 1234
|
83
|
+
config.order = :random
|
84
|
+
|
85
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
86
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
87
|
+
# test failures related to randomization by passing the same `--seed` value
|
88
|
+
# as the one that triggered the failure.
|
89
|
+
Kernel.srand config.seed
|
90
|
+
=end
|
91
|
+
end
|
data/tmdb-movies.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'tmdb/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "tmdb-movies"
|
8
|
+
spec.version = Tmdb::VERSION
|
9
|
+
spec.authors = ["Kelly Mahan"]
|
10
|
+
spec.email = ["kmahan@kmahan.com"]
|
11
|
+
spec.summary = %q{A gem for easy access to themoviedb.org's api.}
|
12
|
+
spec.description = %q{A gem for easy access to themoviedb.org's api.}
|
13
|
+
spec.homepage = "http://github.com/kellymahan/tmdb-movies"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
spec.add_development_dependency "rspec"
|
24
|
+
spec.add_dependency "httparty"
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tmdb-movies
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.03
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kelly Mahan
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-06-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: httparty
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: A gem for easy access to themoviedb.org's api.
|
70
|
+
email:
|
71
|
+
- kmahan@kmahan.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- ".rspec"
|
78
|
+
- Gemfile
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- lib/tmdb.rb
|
83
|
+
- lib/tmdb/connection.rb
|
84
|
+
- lib/tmdb/connection/genre_methods.rb
|
85
|
+
- lib/tmdb/connection/movie_methods.rb
|
86
|
+
- lib/tmdb/connection/people_methods.rb
|
87
|
+
- lib/tmdb/connection/search_methods.rb
|
88
|
+
- lib/tmdb/movie.rb
|
89
|
+
- lib/tmdb/person.rb
|
90
|
+
- lib/tmdb/tmdb_base.rb
|
91
|
+
- lib/tmdb/version.rb
|
92
|
+
- spec/spec_helper.rb
|
93
|
+
- tmdb-movies.gemspec
|
94
|
+
homepage: http://github.com/kellymahan/tmdb-movies
|
95
|
+
licenses:
|
96
|
+
- MIT
|
97
|
+
metadata: {}
|
98
|
+
post_install_message:
|
99
|
+
rdoc_options: []
|
100
|
+
require_paths:
|
101
|
+
- lib
|
102
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
requirements: []
|
113
|
+
rubyforge_project:
|
114
|
+
rubygems_version: 2.2.2
|
115
|
+
signing_key:
|
116
|
+
specification_version: 4
|
117
|
+
summary: A gem for easy access to themoviedb.org's api.
|
118
|
+
test_files:
|
119
|
+
- spec/spec_helper.rb
|