rottentom 0.2.0 → 0.3.0

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
  SHA1:
3
- metadata.gz: 98e71137eb8b60f3c6b75ed2c2038c5faa0fe2f7
4
- data.tar.gz: f316e3df1368a80a2eda2a3101e66e760832594d
3
+ metadata.gz: 1075c595c3e9572f2197db14cfbbe55e07778229
4
+ data.tar.gz: 4c40a75eabf197e60195d813942825ceddac220e
5
5
  SHA512:
6
- metadata.gz: 88532334a57b77f28fbc2b9d6a82367289b96c3846960ed43c83e2e7a0a93e74bfc98b6f64320bebfb7204487ebdd532644133dc93ad98bf331bd39f44de37f3
7
- data.tar.gz: 02e8af72d6550c397cfe369f5bde73c4f4b01ae7c74785a741e9199bd98db54b1dc8a5d9894ed2bf8ca1c3c5268ea47b4c8de429710c18521102e5122bcd428d
6
+ metadata.gz: 94052d07aeb6804ed82170349975b38e4ed47363b3fd2efdbd99c43f47bdd4f5a990c366c529edc20d5fc52925b5c9aa2f199eb730b2b80c25f3c2ba41c4bade
7
+ data.tar.gz: 3e7323da20660b0b50d4e5eafc937ec7c42b731989c50b4256ac3364a43c2c364edccbd1e204b699fd0f2f22d0caf25620587f8aac802c6c8eda47f4257fb191
data/README.md CHANGED
@@ -14,8 +14,12 @@ gem install rottentom
14
14
  require 'rottentom'
15
15
 
16
16
  RT::API.api_key = "#{your_api_key}"
17
+
17
18
  upcoming_dvds = RT::DVD.upcoming
18
19
  # => results
20
+
21
+ RT::DVD.current
22
+ RT::DVD.new_releases
19
23
  ```
20
24
 
21
25
  ## Copyright
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.3.0
@@ -1,6 +1,7 @@
1
1
  require 'httparty'
2
2
  require 'hashie'
3
3
  require 'json'
4
+ require 'active_support/time'
4
5
 
5
6
  Dir[File.dirname(__FILE__) + '/rottentom/*.rb'].each do |file|
6
7
  require file
@@ -1,5 +1,22 @@
1
1
  module RT
2
2
  class DVD
3
+
4
+ def self.current(options = {})
5
+ options.merge!(apikey: RT::API.api_key)
6
+
7
+ results = RT::API.get("/v1.0/lists/dvds/current_releases.json", query: options)
8
+ results = JSON.parse(results)['movies']
9
+ results.collect! { |movie| Hashie::Mash.new(movie) }
10
+ end
11
+
12
+ def self.current(options = {})
13
+ options.merge!(apikey: RT::API.api_key)
14
+
15
+ results = RT::API.get("/v1.0/lists/dvds/new_releases.json", query: options)
16
+ results = JSON.parse(results)['movies']
17
+ results.collect! { |movie| Hashie::Mash.new(movie) }
18
+ end
19
+
3
20
  def self.upcoming
4
21
  # Accepted parameters:
5
22
  # :page, :include_adult (true / false), :year
@@ -0,0 +1,74 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+ # stub: rottentom 0.3.0 ruby lib
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "rottentom"
9
+ s.version = "0.3.0"
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
13
+ s.authors = ["Cody Barr"]
14
+ s.date = "2014-08-08"
15
+ s.description = " Ruby wrapper for the Rotten Tomatoes API "
16
+ s.email = "cody.barr@gmail.com"
17
+ s.extra_rdoc_files = [
18
+ "LICENSE.txt",
19
+ "README.md"
20
+ ]
21
+ s.files = [
22
+ ".document",
23
+ "Gemfile",
24
+ "Gemfile.lock",
25
+ "LICENSE.txt",
26
+ "README.md",
27
+ "Rakefile",
28
+ "VERSION",
29
+ "lib/rottentom.rb",
30
+ "lib/rottentom/api.rb",
31
+ "lib/rottentom/dvd.rb",
32
+ "rottentom.gemspec",
33
+ "test/helper.rb",
34
+ "test/test_rottentom.rb"
35
+ ]
36
+ s.homepage = "http://github.com/codybarr/rottentom"
37
+ s.licenses = ["MIT"]
38
+ s.rubygems_version = "2.4.1"
39
+ s.summary = "Ruby wrapper for the Rotten Tomatoes API"
40
+
41
+ if s.respond_to? :specification_version then
42
+ s.specification_version = 4
43
+
44
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
45
+ s.add_runtime_dependency(%q<httparty>, [">= 0"])
46
+ s.add_runtime_dependency(%q<hashie>, [">= 0"])
47
+ s.add_runtime_dependency(%q<json>, [">= 0"])
48
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
49
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
50
+ s.add_development_dependency(%q<bundler>, ["~> 1.0"])
51
+ s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
52
+ s.add_development_dependency(%q<simplecov>, [">= 0"])
53
+ else
54
+ s.add_dependency(%q<httparty>, [">= 0"])
55
+ s.add_dependency(%q<hashie>, [">= 0"])
56
+ s.add_dependency(%q<json>, [">= 0"])
57
+ s.add_dependency(%q<shoulda>, [">= 0"])
58
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
59
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
60
+ s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
61
+ s.add_dependency(%q<simplecov>, [">= 0"])
62
+ end
63
+ else
64
+ s.add_dependency(%q<httparty>, [">= 0"])
65
+ s.add_dependency(%q<hashie>, [">= 0"])
66
+ s.add_dependency(%q<json>, [">= 0"])
67
+ s.add_dependency(%q<shoulda>, [">= 0"])
68
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
69
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
70
+ s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
71
+ s.add_dependency(%q<simplecov>, [">= 0"])
72
+ end
73
+ end
74
+
@@ -4,14 +4,36 @@ describe RT::DVD do
4
4
 
5
5
  RT::API.api_key = API_KEY
6
6
 
7
+ describe ".current" do
8
+ let (:current) { RT::DVD.current }
9
+
10
+ it "should return results" do
11
+ current.first.release_dates.dvd.wont_be_empty
12
+ end
13
+ end
14
+
15
+ describe ".new_releases" do
16
+ let (:new_dvds) { RT::DVD.current }
17
+
18
+ it "should return results" do
19
+ new_dvds.first.release_dates.dvd.wont_be_empty
20
+ end
21
+ end
22
+
23
+
24
+
7
25
  describe ".upcoming" do
26
+ let (:upcoming) { RT::DVD.upcoming }
8
27
 
9
28
  it "should return upcoming DVDs" do
10
29
  skip("Worked as of 8/5/14 - check http://www.rottentomatoes.com/dvd/upcoming/ for latest upcoming releases")
11
- upcoming = RT::DVD.upcoming
12
30
  upcoming.first.title.must_equal "Divergent"
13
31
  end
14
32
 
33
+ it "should allow us to find the imdb id of a given movie" do
34
+ skip("Worked as of 8/5/14 - check http://www.rottentomatoes.com/dvd/upcoming/ for latest upcoming releases")
35
+ upcoming.first.alternate_ids.imdb.must_equal "1840309"
36
+ end
15
37
  end
16
38
 
17
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rottentom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Barr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-06 00:00:00.000000000 Z
11
+ date: 2014-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -140,6 +140,7 @@ files:
140
140
  - lib/rottentom.rb
141
141
  - lib/rottentom/api.rb
142
142
  - lib/rottentom/dvd.rb
143
+ - rottentom.gemspec
143
144
  - test/helper.rb
144
145
  - test/test_rottentom.rb
145
146
  homepage: http://github.com/codybarr/rottentom