rottentom 0.2.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 98e71137eb8b60f3c6b75ed2c2038c5faa0fe2f7
4
+ data.tar.gz: f316e3df1368a80a2eda2a3101e66e760832594d
5
+ SHA512:
6
+ metadata.gz: 88532334a57b77f28fbc2b9d6a82367289b96c3846960ed43c83e2e7a0a93e74bfc98b6f64320bebfb7204487ebdd532644133dc93ad98bf331bd39f44de37f3
7
+ data.tar.gz: 02e8af72d6550c397cfe369f5bde73c4f4b01ae7c74785a741e9199bd98db54b1dc8a5d9894ed2bf8ca1c3c5268ea47b4c8de429710c18521102e5122bcd428d
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem 'httparty'
4
+ gem 'hashie'
5
+ gem 'json'
6
+
7
+ # Add dependencies to develop your gem here.
8
+ # Include everything needed to run rake, tests, features, etc.
9
+ group :development do
10
+ gem "shoulda", ">= 0"
11
+ gem "rdoc", "~> 3.12"
12
+ gem "bundler", "~> 1.0"
13
+ gem "jeweler", "~> 2.0.1"
14
+ gem "simplecov", ">= 0"
15
+ end
@@ -0,0 +1,86 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ activesupport (4.1.4)
5
+ i18n (~> 0.6, >= 0.6.9)
6
+ json (~> 1.7, >= 1.7.7)
7
+ minitest (~> 5.1)
8
+ thread_safe (~> 0.1)
9
+ tzinfo (~> 1.1)
10
+ addressable (2.3.6)
11
+ builder (3.2.2)
12
+ descendants_tracker (0.0.4)
13
+ thread_safe (~> 0.3, >= 0.3.1)
14
+ docile (1.1.3)
15
+ faraday (0.9.0)
16
+ multipart-post (>= 1.2, < 3)
17
+ git (1.2.6)
18
+ github_api (0.11.3)
19
+ addressable (~> 2.3)
20
+ descendants_tracker (~> 0.0.1)
21
+ faraday (~> 0.8, < 0.10)
22
+ hashie (>= 1.2)
23
+ multi_json (>= 1.7.5, < 2.0)
24
+ nokogiri (~> 1.6.0)
25
+ oauth2
26
+ hashie (2.1.2)
27
+ highline (1.6.21)
28
+ httparty (0.13.1)
29
+ json (~> 1.8)
30
+ multi_xml (>= 0.5.2)
31
+ i18n (0.6.11)
32
+ jeweler (2.0.1)
33
+ builder
34
+ bundler (>= 1.0)
35
+ git (>= 1.2.5)
36
+ github_api
37
+ highline (>= 1.6.15)
38
+ nokogiri (>= 1.5.10)
39
+ rake
40
+ rdoc
41
+ json (1.8.1)
42
+ jwt (1.0.0)
43
+ mini_portile (0.6.0)
44
+ minitest (5.4.0)
45
+ multi_json (1.10.1)
46
+ multi_xml (0.5.5)
47
+ multipart-post (2.0.0)
48
+ nokogiri (1.6.2.1)
49
+ mini_portile (= 0.6.0)
50
+ oauth2 (0.9.4)
51
+ faraday (>= 0.8, < 0.10)
52
+ jwt (~> 1.0)
53
+ multi_json (~> 1.3)
54
+ multi_xml (~> 0.5)
55
+ rack (~> 1.2)
56
+ rack (1.5.2)
57
+ rake (10.3.2)
58
+ rdoc (3.12.2)
59
+ json (~> 1.4)
60
+ shoulda (3.5.0)
61
+ shoulda-context (~> 1.0, >= 1.0.1)
62
+ shoulda-matchers (>= 1.4.1, < 3.0)
63
+ shoulda-context (1.2.1)
64
+ shoulda-matchers (2.6.1)
65
+ activesupport (>= 3.0.0)
66
+ simplecov (0.8.2)
67
+ docile (~> 1.1.0)
68
+ multi_json
69
+ simplecov-html (~> 0.8.0)
70
+ simplecov-html (0.8.0)
71
+ thread_safe (0.3.4)
72
+ tzinfo (1.2.1)
73
+ thread_safe (~> 0.1)
74
+
75
+ PLATFORMS
76
+ ruby
77
+
78
+ DEPENDENCIES
79
+ bundler (~> 1.0)
80
+ hashie
81
+ httparty
82
+ jeweler (~> 2.0.1)
83
+ json
84
+ rdoc (~> 3.12)
85
+ shoulda
86
+ simplecov
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2014 Cody Barr
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,24 @@
1
+ # rottentom
2
+
3
+ rottentom is a simple ruby wrapper for the Rotten Tomatoes API based on HTTParty using Hashie::Mash
4
+
5
+ ## Install
6
+
7
+ ```ruby
8
+ gem install rottentom
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```ruby
14
+ require 'rottentom'
15
+
16
+ RT::API.api_key = "#{your_api_key}"
17
+ upcoming_dvds = RT::DVD.upcoming
18
+ # => results
19
+ ```
20
+
21
+ ## Copyright
22
+
23
+ Copyright (c) 2014 Cody Barr. See LICENSE.txt for
24
+ further details.
@@ -0,0 +1,51 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
17
+ gem.name = "rottentom"
18
+ gem.homepage = "http://github.com/codybarr/rottentom"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{ Ruby wrapper for the Rotten Tomatoes API }
21
+ gem.description = %Q{ Ruby wrapper for the Rotten Tomatoes API }
22
+ gem.email = "cody.barr@gmail.com"
23
+ gem.authors = ["Cody Barr"]
24
+ # dependencies defined in Gemfile
25
+ end
26
+ Jeweler::RubygemsDotOrgTasks.new
27
+
28
+ require 'rake/testtask'
29
+ Rake::TestTask.new(:test) do |test|
30
+ test.libs << 'lib' << 'test'
31
+ test.pattern = 'test/**/test_*.rb'
32
+ test.verbose = true
33
+ end
34
+
35
+ desc "Code coverage detail"
36
+ task :simplecov do
37
+ ENV['COVERAGE'] = "true"
38
+ Rake::Task['test'].execute
39
+ end
40
+
41
+ task :default => :test
42
+
43
+ require 'rdoc/task'
44
+ Rake::RDocTask.new do |rdoc|
45
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
46
+
47
+ rdoc.rdoc_dir = 'rdoc'
48
+ rdoc.title = "rottentom #{version}"
49
+ rdoc.rdoc_files.include('README*')
50
+ rdoc.rdoc_files.include('lib/**/*.rb')
51
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.2.0
@@ -0,0 +1,7 @@
1
+ require 'httparty'
2
+ require 'hashie'
3
+ require 'json'
4
+
5
+ Dir[File.dirname(__FILE__) + '/rottentom/*.rb'].each do |file|
6
+ require file
7
+ end
@@ -0,0 +1,17 @@
1
+ module RT
2
+ class API
3
+ include HTTParty
4
+
5
+ @@api_key = ''
6
+
7
+ base_uri 'http://api.rottentomatoes.com/api/public'
8
+
9
+ def self.api_key
10
+ @@api_key
11
+ end
12
+
13
+ def self.api_key=(key)
14
+ @@api_key = key
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,14 @@
1
+ module RT
2
+ class DVD
3
+ def self.upcoming
4
+ # Accepted parameters:
5
+ # :page, :include_adult (true / false), :year
6
+ options = { apikey: RT::API.api_key }
7
+
8
+ results = RT::API.get("/v1.0/lists/dvds/upcoming.json", query: options)
9
+ results = JSON.parse(results)['movies']
10
+ results.collect! { |movie| Hashie::Mash.new(movie) }
11
+
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ # test/test_helper.rb
2
+
3
+ # Library
4
+ require_relative '../lib/rottentom'
5
+
6
+ # Dependencies
7
+ require 'minitest/autorun'
8
+ require 'pp'
9
+
10
+ describe "Test Constants" do
11
+ API_KEY = File.open('test/api_key').read
12
+ end
@@ -0,0 +1,17 @@
1
+ require 'helper'
2
+
3
+ describe RT::DVD do
4
+
5
+ RT::API.api_key = API_KEY
6
+
7
+ describe ".upcoming" do
8
+
9
+ it "should return upcoming DVDs" do
10
+ skip("Worked as of 8/5/14 - check http://www.rottentomatoes.com/dvd/upcoming/ for latest upcoming releases")
11
+ upcoming = RT::DVD.upcoming
12
+ upcoming.first.title.must_equal "Divergent"
13
+ end
14
+
15
+ end
16
+
17
+ end
metadata ADDED
@@ -0,0 +1,169 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rottentom
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Cody Barr
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-08-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: httparty
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: hashie
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: json
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
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: shoulda
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rdoc
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.12'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.12'
83
+ - !ruby/object:Gem::Dependency
84
+ name: bundler
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: jeweler
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 2.0.1
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 2.0.1
111
+ - !ruby/object:Gem::Dependency
112
+ name: simplecov
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description: " Ruby wrapper for the Rotten Tomatoes API "
126
+ email: cody.barr@gmail.com
127
+ executables: []
128
+ extensions: []
129
+ extra_rdoc_files:
130
+ - LICENSE.txt
131
+ - README.md
132
+ files:
133
+ - ".document"
134
+ - Gemfile
135
+ - Gemfile.lock
136
+ - LICENSE.txt
137
+ - README.md
138
+ - Rakefile
139
+ - VERSION
140
+ - lib/rottentom.rb
141
+ - lib/rottentom/api.rb
142
+ - lib/rottentom/dvd.rb
143
+ - test/helper.rb
144
+ - test/test_rottentom.rb
145
+ homepage: http://github.com/codybarr/rottentom
146
+ licenses:
147
+ - MIT
148
+ metadata: {}
149
+ post_install_message:
150
+ rdoc_options: []
151
+ require_paths:
152
+ - lib
153
+ required_ruby_version: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - ">="
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ required_rubygems_version: !ruby/object:Gem::Requirement
159
+ requirements:
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ version: '0'
163
+ requirements: []
164
+ rubyforge_project:
165
+ rubygems_version: 2.4.1
166
+ signing_key:
167
+ specification_version: 4
168
+ summary: Ruby wrapper for the Rotten Tomatoes API
169
+ test_files: []