movieDB 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +5 -1
- data/lib/movieDB.rb +131 -46
- data/lib/movieDB/data_analysis.rb +29 -19
- data/lib/movieDB/version.rb +1 -1
- data/movieDB.gemspec +3 -2
- data/spec/data_analysis_spec.rb +112 -0
- data/spec/movieDB_spec.rb +41 -43
- metadata +62 -27
- checksums.yaml +0 -7
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
MovieDB - Movie Data Analysis Tool
|
2
2
|
|
3
3
|
## Description
|
4
4
|
|
@@ -10,6 +10,10 @@ Basic functions and Data Analysis:
|
|
10
10
|
* Exploratory Data Analysis
|
11
11
|
* Confirmatory Data Analysis
|
12
12
|
|
13
|
+
## Requirements
|
14
|
+
|
15
|
+
ruby 1.9.x
|
16
|
+
|
13
17
|
## Installation
|
14
18
|
|
15
19
|
Add this line to your application's Gemfile:
|
data/lib/movieDB.rb
CHANGED
@@ -2,6 +2,7 @@ require "rubygems"
|
|
2
2
|
require "time"
|
3
3
|
require "open-uri"
|
4
4
|
require "nokogiri"
|
5
|
+
require "zimdb"
|
5
6
|
require "imdb"
|
6
7
|
require "spreadsheet"
|
7
8
|
require "MovieDB/base"
|
@@ -28,31 +29,78 @@ unless defined? MovieDB::Movie
|
|
28
29
|
|
29
30
|
const_set("MovieError", Class.new(StandardError))
|
30
31
|
|
31
|
-
attr_accessor :title,
|
32
|
-
:
|
33
|
-
:
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
32
|
+
attr_accessor :title,
|
33
|
+
:cast_members,
|
34
|
+
:cast_characters,
|
35
|
+
:cast_member_ids,
|
36
|
+
:cast_members_characters,
|
37
|
+
:trailer_url,
|
38
|
+
:director,
|
39
|
+
:writer,
|
40
|
+
:filming_locations,
|
41
|
+
:company,
|
42
|
+
:genres,
|
43
|
+
:languages,
|
44
|
+
:countries,
|
45
|
+
:length,
|
46
|
+
:plot,
|
47
|
+
:poster,
|
48
|
+
:rating,
|
49
|
+
:votes,
|
50
|
+
:mpaa_rating,
|
51
|
+
:tagline,
|
52
|
+
:year,
|
53
|
+
:release_date,
|
54
|
+
:released,
|
55
|
+
:unique_id,
|
56
|
+
:academy_award_nomination,
|
57
|
+
:academy_award_wins,
|
58
|
+
:golden_globe_nominations,
|
59
|
+
:golden_globe_wins,
|
60
|
+
:bafta_nomination,
|
61
|
+
:bafta_wins,
|
62
|
+
:worldwide_gross,
|
63
|
+
:film_release
|
64
|
+
|
65
|
+
DEFAULT_TITLE = "Method Missing 2: Rails Roars!"
|
66
|
+
DEFAULT_CAST_MEMBERS = ["David Black", "Paola Perotta", "Obie Fernandez", "David Chelimsky"]
|
67
|
+
DEFAULT_CAST_CHARACTERS = ["Developer", "Police Officer", "Hunter", "Hostage"]
|
68
|
+
DEFAULT_CAST_MEMBERS_CHARACTERS = ["David Black => Developer", "Paola Perotta => Police Officer",
|
69
|
+
"Obie Fernandez =>Hunter", "David Chelimsky =>Hostage"]
|
70
|
+
DEFAULT_CAST_MEMBER_IDS = ["nm3901234", "nm4901244", "nm5901235", "nm3601266"]
|
71
|
+
DEFAULT_TRAILER_URL = "http://imdb.com/video/screenplay/vi581042457/"
|
38
72
|
DEFAULT_DIRECTOR = "Yukihiro 'Matz' Matsumoto"
|
39
|
-
DEFAULT_RELEASED_DATE = "2005-12-13"
|
40
|
-
DEFAULT_FILM_RELEASE = ['theatrical', 'video', 'television', 'internet', 'print']
|
41
73
|
DEFAULT_WRITER = 'David Heinemeier Hansson'
|
74
|
+
DEFAULT_FILMING_LOCATIONS = ["Manhattan, New York, USA"]
|
75
|
+
DEFAULT_COMPANY = "Open Source Community Film Corporation"
|
76
|
+
DEFAULT_GENRES = ["Bromantic", "Syfy"]
|
77
|
+
DEFAULT_LANGUAGES = ["English", "German", "Italian"]
|
78
|
+
DEFAULT_COUNTRIES = ["USA", "Germany", "Italy"]
|
79
|
+
DEFAULT_LENGTH = 146
|
80
|
+
DEFAULT_PLOT = ["David Black, a developer, tries to write his flagship ruby book 'The Well-Grounded Rubyist vol. 186' only to find out that Ruby 9.0.2 and Rails 16.0.3 release dates have been postponed"]
|
81
|
+
DEFAULT_POSTER = "http://ia.media-imdb.com/images/M/MV5BMTY@@.jpg"
|
82
|
+
DEFAULT_RATING = 9.9
|
83
|
+
DEFAULT_VOTES = 110636
|
84
|
+
DEFAULT_MPAA_RATING = "Rated R for dynamic OOD language usage and private methods access (certificate 33087)"
|
85
|
+
DEFAULT_TAGLINE = 'Only One MVC Will rule Them All.'
|
86
|
+
DEFAULT_YEAR = 2013
|
87
|
+
DEFAULT_RELEASE_DATE = "11 October 2013 (USA)"
|
42
88
|
DEFAULT_UNIQUE_ID = @unique_id
|
43
|
-
DEFAULT_GENRE = ["Bromantic", "Syfy"]
|
44
89
|
DEFAULT_ACADEMY_AWARD_NOMINATION = 4
|
45
90
|
DEFAULT_ACADEMY_AWARD_WINS = 3
|
46
91
|
DEFAULT_GOLDEN_GLOBE_NOMINATIONS = 4
|
47
92
|
DEFAULT_GOLDEN_GLOBE_WINS = 2
|
48
93
|
DEFAULT_BAFTA_NOMINATION = 3
|
49
94
|
DEFAULT_BAFTA_WINS = 1
|
50
|
-
|
95
|
+
DEFAULT_FILM_RELEASE = ['theatrical', 'video', 'television', 'internet', 'print']
|
96
|
+
DEFAULT_WORLDWIDE_GROSS = "$124.6M" # Not provided by imdb api.
|
51
97
|
|
52
98
|
def initialize(attributes = {})
|
53
|
-
movie_attr = %w(title
|
54
|
-
|
55
|
-
|
99
|
+
movie_attr = %w(title cast_members cast_characters cast_member_ids cast_members_characters
|
100
|
+
trailer_url director writer filming_locations company genres languages countries
|
101
|
+
length plot poster rating votes mpaa_rating tagline year release_date unique_id
|
102
|
+
academy_award_nomination academy_award_wins golden_globe_nominations golden_globe_wins
|
103
|
+
bafta_nomination bafta_wins film_release worldwide_gross)
|
56
104
|
movie_attr.each do |attr|
|
57
105
|
self.send "#{attr}=", (attributes.has_key?(attr.to_sym) ? attributes[attr.to_sym] : self.class.const_get("DEFAULT_#{attr.upcase}"))
|
58
106
|
end
|
@@ -73,35 +121,73 @@ unless defined? MovieDB::Movie
|
|
73
121
|
@unique_id ||= "#{Date.today}#{Array.new(9){rand(9)}.join}".gsub('-','')
|
74
122
|
end
|
75
123
|
|
124
|
+
|
76
125
|
class << self
|
77
|
-
def create_movie_info(title, cast, director, released_date, film_release, writer, unique_id,
|
78
|
-
genre, academy_award_nomination, academy_award_wins, golden_globe_nominations,
|
79
|
-
golden_globe_wins, bafta_nomination, bafta_wins, worldwide_gross)
|
80
126
|
|
127
|
+
##
|
128
|
+
# Get the data from imdb
|
129
|
+
|
130
|
+
def get_imdb_movie_data(value)
|
131
|
+
puts zimdb_value = "tt" << value.to_s
|
132
|
+
@movie_data = Imdb::Movie.new(value.to_s)
|
133
|
+
@zimdb_data = Zimdb::Movie.new( :id => zimdb_value)
|
134
|
+
return @movie_data
|
135
|
+
return @zimdb_data
|
136
|
+
end
|
137
|
+
|
138
|
+
def imdb_movie_search(name)
|
139
|
+
@movie_search = Imdb::Movie.search(name.to_s)
|
140
|
+
end
|
141
|
+
|
142
|
+
def create_movie_info(value)
|
143
|
+
get_imdb_movie_data(value)
|
81
144
|
@movie_DS ||=[]
|
82
145
|
movie_info = Movie.new
|
83
|
-
movie_info.title = title
|
84
|
-
movie_info.
|
85
|
-
movie_info.
|
86
|
-
movie_info.
|
87
|
-
movie_info.
|
88
|
-
movie_info.
|
89
|
-
movie_info.
|
90
|
-
movie_info.
|
91
|
-
movie_info.
|
92
|
-
movie_info.
|
93
|
-
movie_info.
|
94
|
-
movie_info.
|
95
|
-
movie_info.
|
96
|
-
movie_info.
|
97
|
-
movie_info.
|
146
|
+
movie_info.title = @movie_data.title
|
147
|
+
movie_info.cast_members = @movie_data.cast_members
|
148
|
+
movie_info.cast_member_ids = @movie_data.cast_member_ids
|
149
|
+
movie_info.cast_characters = @movie_data.cast_characters
|
150
|
+
movie_info.cast_members_characters = @movie_data.cast_members_characters
|
151
|
+
movie_info.trailer_url = @movie_data.trailer_url
|
152
|
+
movie_info.director = @movie_data.director
|
153
|
+
movie_info.writer = Array.new << @zimdb_data.writer
|
154
|
+
movie_info.filming_locations = @movie_data.filming_locations
|
155
|
+
movie_info.company = Array.new << @movie_data.company
|
156
|
+
movie_info.genres =@movie_data.genres
|
157
|
+
movie_info.languages = @movie_data.languages
|
158
|
+
movie_info.countries = @movie_data.countries
|
159
|
+
movie_info.length = Array.new << @movie_data
|
160
|
+
movie_info.plot = Array.new << @movie_data.plot
|
161
|
+
movie_info.poster = Array.new << @movie_data.poster
|
162
|
+
movie_info.rating = Array.new << @movie_data.rating
|
163
|
+
movie_info.votes = @movie_data.votes
|
164
|
+
movie_info.mpaa_rating = Array.new << @movie_data.mpaa_rating
|
165
|
+
movie_info.tagline = Array.new << @movie_data.tagline
|
166
|
+
movie_info.year = Array.new << @movie_data.year
|
167
|
+
movie_info.release_date = Array.new << @movie_data.release_date
|
168
|
+
movie_info.unique_id = @unique_id
|
169
|
+
|
170
|
+
##
|
171
|
+
# TODO: Write API for the AMPAS.
|
172
|
+
|
173
|
+
#movie_info.academy_award_nomination = academy_award_nomination
|
174
|
+
#movie_info.academy_award_wins = academy_award_wins
|
175
|
+
#movie_info.golden_globe_nominations = golden_globe_nominations
|
176
|
+
#movie_info.golden_globe_wins = golden_globe_wins
|
177
|
+
#movie_info.bafta_nomination = bafta_nomination
|
178
|
+
#movie_info.bafta_wins = bafta_wins
|
179
|
+
#movie_info.worldwide_gross = worldwide_gross
|
98
180
|
@movie_DS << movie_info
|
181
|
+
return @movieDS
|
182
|
+
|
183
|
+
##
|
184
|
+
#TODO: Include this for later data analysis computation
|
99
185
|
|
100
|
-
if Movie.title_present?
|
101
|
-
raise ArgumentError, "The title #{@title_exist} has already been taking"
|
102
|
-
else
|
103
|
-
return @movie_DS
|
104
|
-
end
|
186
|
+
#if Movie.title_present?
|
187
|
+
#raise ArgumentError, "The title #{@title_exist} has already been taking"
|
188
|
+
#else
|
189
|
+
#return @movie_DS
|
190
|
+
#end
|
105
191
|
|
106
192
|
end
|
107
193
|
|
@@ -109,13 +195,13 @@ unless defined? MovieDB::Movie
|
|
109
195
|
# Filter the data store for the movie attributes. Return an array of the attributes.
|
110
196
|
#
|
111
197
|
# Example.
|
112
|
-
# Movie.filter_movie_attr('
|
198
|
+
# Movie.filter_movie_attr('cast_members') #=> ["Chris_Hemsworth", "Natalie_Portman"]
|
113
199
|
|
114
200
|
def filter_movie_attr(attr)
|
115
201
|
attr_raw = attr
|
116
202
|
attr_sym = attr.to_sym
|
117
203
|
|
118
|
-
raise ArgumentError, "#{attr_sym} is not a valid attribute." if !attr_sym == :director && :
|
204
|
+
raise ArgumentError, "#{attr_sym} is not a valid attribute." if !attr_sym == :director && :cast_members
|
119
205
|
filtered = @movie_DS.select{|ds| ds.attr_title?}.map(&attr_sym).flatten
|
120
206
|
attr_raw == 'title' ? filtered : filtered.uniq
|
121
207
|
end
|
@@ -134,14 +220,13 @@ unless defined? MovieDB::Movie
|
|
134
220
|
#
|
135
221
|
# capture(synopsis: "Last Vegas - Four geriatric friends vow to set Las Vegas Ablaze.")
|
136
222
|
|
137
|
-
def capture(**opts)
|
138
|
-
|
139
|
-
end
|
223
|
+
#def capture(**opts)
|
224
|
+
#@synopsis = opts
|
225
|
+
#end
|
140
226
|
|
141
|
-
def wrap(synopsis, before: "(", after: ")")
|
142
|
-
"#{before}#{synopsis}#{after}"
|
143
|
-
end
|
227
|
+
#def wrap(synopsis, before: "(", after: ")")
|
228
|
+
#"#{before}#{synopsis}#{after}"
|
229
|
+
#end
|
144
230
|
end
|
145
231
|
end
|
146
232
|
end
|
147
|
-
|
@@ -28,7 +28,7 @@ module MovieDB
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
module
|
31
|
+
module EstimationOfDensity
|
32
32
|
module Cluster_Weighted_Modeling; end
|
33
33
|
module Density_Estimation; end
|
34
34
|
module Discretization_Of_Continuous_Features; end
|
@@ -97,31 +97,41 @@ module MovieDB
|
|
97
97
|
end
|
98
98
|
|
99
99
|
##
|
100
|
-
#TODO:
|
100
|
+
#TODO: All Mathetical Calculations go here.
|
101
|
+
|
101
102
|
class ExportData
|
102
|
-
def
|
103
|
+
def write_spreadsheet (data, data_analysis_name)
|
103
104
|
|
104
105
|
begin data_analysis.is_a? String
|
105
|
-
data_analysis_name = data_analysis_name.split.join.gsub('_', ' ').downcase.to_s
|
106
|
-
|
106
|
+
@data_analysis_name = data_analysis_name.split.join.gsub('_', ' ').downcase.to_s
|
107
107
|
case data_analysis_name
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
data.each_with_index do |value, index|
|
117
|
-
sheet1[1, index] = "#{value}"
|
118
|
-
end
|
119
|
-
when "discrete least squares meshless method"
|
120
|
-
else
|
121
|
-
end
|
108
|
+
when "coefficient of determination"
|
109
|
+
write_coefficient_of_determination
|
110
|
+
when "discrete least squares meshless method"
|
111
|
+
write_discrete_least_squares_meshless_method
|
112
|
+
when "discrete least squares meshless method"
|
113
|
+
write_discrete_least_squares_meshless_method
|
114
|
+
else
|
115
|
+
end
|
122
116
|
rescue
|
123
117
|
raise ArgumentError, 'invalid attribute'
|
124
118
|
end
|
125
119
|
end
|
120
|
+
|
121
|
+
def write_coefficient_of_determination
|
122
|
+
book = Spreadsheet::Workbook.new
|
123
|
+
sheet1 = book.create_worksheet name: "Data Analysis: #{@data_analysis_name}"
|
124
|
+
sheet1.row(0).concat %w{title released_date worldwide_gross}
|
125
|
+
|
126
|
+
# Loop through the data to collect all values.
|
127
|
+
# Then values into array
|
128
|
+
|
129
|
+
data.each_with_index do |value, index|
|
130
|
+
sheet1[1, index] = "#{value}"
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
def write_discrete_least_squares_meshless_method; end
|
135
|
+
def write_discrete_least_squares_meshless_method; end
|
126
136
|
end
|
127
137
|
end
|
data/lib/movieDB/version.rb
CHANGED
data/movieDB.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = MovieDB::VERSION
|
9
9
|
spec.authors = ["Albert_McKeever"]
|
10
10
|
spec.email = ["kotn_ep1@hotmail.com"]
|
11
|
-
spec.description = %q{
|
12
|
-
spec.summary = %q{Movie Statistic and Data Analysis}
|
11
|
+
spec.description = %q{Perform Data Analysis on IMDB Movies}
|
12
|
+
spec.summary = %q{Movie/Film Statistic and Data Analysis}
|
13
13
|
spec.homepage = "https://github.com/keeperofthenecklace/movieDB"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency "rake"
|
23
23
|
spec.add_development_dependency "rspec"
|
24
24
|
spec.add_development_dependency 'imdb'
|
25
|
+
spec.add_development_dependency 'zimdb'
|
25
26
|
spec.add_development_dependency 'highline'
|
26
27
|
spec.add_development_dependency 'fakeweb'
|
27
28
|
spec.add_dependency "activesupport", ">= 4.0.0"
|
@@ -0,0 +1,112 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe MovieDB::DataAnalysis do
|
4
|
+
|
5
|
+
describe "#AnalysisOfVariance" do
|
6
|
+
describe "#LeastSquares" do
|
7
|
+
describe "#Coefficient_Of_Determination" do
|
8
|
+
pending
|
9
|
+
end
|
10
|
+
|
11
|
+
describe "#Discrete_Least_Squares_Meshless_Method" do
|
12
|
+
pending
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "#Explained_Sum_Of_Squares" do
|
16
|
+
pending
|
17
|
+
end
|
18
|
+
|
19
|
+
describe "#Fraction_Of_Variance_Unexplained" do
|
20
|
+
pending
|
21
|
+
end
|
22
|
+
|
23
|
+
describe "#Gauss_Newton_Algorithm" do
|
24
|
+
pending
|
25
|
+
end
|
26
|
+
|
27
|
+
describe "#Iteratively_Reweighted_Least_Squares" do
|
28
|
+
pending
|
29
|
+
end
|
30
|
+
|
31
|
+
describe "#Lack_Of_Fit_Sum_Of_Squares" do
|
32
|
+
pending
|
33
|
+
end
|
34
|
+
|
35
|
+
describe "#Least_Squares_Support_Vector_Machine" do
|
36
|
+
pending
|
37
|
+
end
|
38
|
+
|
39
|
+
describe "#Mean_Squared_Error" do
|
40
|
+
pending
|
41
|
+
end
|
42
|
+
|
43
|
+
describe "#Moving_Least_Squares" do
|
44
|
+
pending
|
45
|
+
end
|
46
|
+
|
47
|
+
describe "#Non_Linear_Iterative_Partial_Least_Squares" do
|
48
|
+
pending
|
49
|
+
end
|
50
|
+
|
51
|
+
describe "#Non_Linear_Least_Squares" do
|
52
|
+
pending
|
53
|
+
end
|
54
|
+
|
55
|
+
describe "#Ordinary_Least_Squares" do
|
56
|
+
pending
|
57
|
+
end
|
58
|
+
|
59
|
+
describe "#Partial_Least_Squares_Regression" do
|
60
|
+
pending
|
61
|
+
end
|
62
|
+
|
63
|
+
describe "#Partition_Of_Sums_Of_Squares" do
|
64
|
+
pending
|
65
|
+
end
|
66
|
+
|
67
|
+
describe "#Proofs_Involving_Ordinary_Least_Squares" do
|
68
|
+
pending
|
69
|
+
end
|
70
|
+
|
71
|
+
describe "#Residual_Sum_Of_Squares" do
|
72
|
+
pending
|
73
|
+
end
|
74
|
+
|
75
|
+
describe "#Total_Least_Squares" do
|
76
|
+
pending
|
77
|
+
end
|
78
|
+
|
79
|
+
describe "#Total_Sum_Of_Squares" do
|
80
|
+
pending
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
describe "#EstimationOfDensity" do
|
86
|
+
|
87
|
+
end
|
88
|
+
|
89
|
+
describe "#ExploratoryDataAnalysis" do
|
90
|
+
pending
|
91
|
+
end
|
92
|
+
|
93
|
+
describe "#DataMining" do
|
94
|
+
pending
|
95
|
+
end
|
96
|
+
|
97
|
+
describe "RegressionAnalysis" do
|
98
|
+
pending
|
99
|
+
end
|
100
|
+
|
101
|
+
describe "#Resampling" do
|
102
|
+
pending
|
103
|
+
end
|
104
|
+
|
105
|
+
describe "#Sensitivity_Analysis" do
|
106
|
+
pending
|
107
|
+
end
|
108
|
+
|
109
|
+
describe "#Time_series_Analysis" do
|
110
|
+
pending
|
111
|
+
end
|
112
|
+
end
|
data/spec/movieDB_spec.rb
CHANGED
@@ -1,64 +1,62 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'imdb'
|
3
|
+
require "zimdb"
|
4
|
+
|
2
5
|
|
3
6
|
describe MovieDB do
|
4
|
-
let(:defaultMovie){ MovieDB::Movie.new() }
|
5
7
|
|
6
|
-
describe "
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
8
|
+
describe "#get_imdb_movie_data" do
|
9
|
+
let(:movie_info){ MovieDB::Movie.send(:get_imdb_movie_data, "1951264") }
|
10
|
+
|
11
|
+
context "query imdb" do
|
12
|
+
it "returns movie data from imdb" do
|
13
|
+
movie_info.title.should == "The Hunger Games: Catching Fire"
|
14
|
+
movie_info.cast_members[0, 4].should == ["Jennifer Lawrence", "Liam Hemsworth", "Jack Quaid", "Taylor St. Clair"]
|
15
|
+
movie_info.cast_member_ids[0, 4].should == ["nm2225369", "nm2955013", "nm4425051", "nm1193262"]
|
16
|
+
movie_info.cast_characters[0, 4].should == ["Katniss Everdeen", "Gale Hawthorne", "Marvel", "Ripper"]
|
17
|
+
movie_info.cast_members_characters[0, 4].should == ["Jennifer Lawrence => Katniss Everdeen", "Liam Hemsworth => Gale Hawthorne", "Jack Quaid => Marvel", "Taylor St. Clair => Ripper"]
|
18
|
+
movie_info.trailer_url.should == "http://imdb.com/video/screenplay/vi365471769/"
|
19
|
+
movie_info.director.should == ["Francis Lawrence"]
|
20
|
+
#movie_info.writer.should == "Simon Beaufoy, Michael Arndt"
|
21
|
+
movie_info.filming_locations[0, 2].should == ["Oakland, New Jersey, USA", "O'ahu, Hawaii, USA"]
|
22
|
+
movie_info.company.should == "Color Force"
|
23
|
+
movie_info.genres.should == ["Action", "Adventure", "Sci-Fi", "Thriller"]
|
24
|
+
movie_info.languages.should == ["English"]
|
25
|
+
movie_info.countries.should == ["USA"]
|
26
|
+
movie_info.length.should == 146
|
27
|
+
movie_info.plot.should == "Katniss Everdeen and Peeta Mellark become targets of the Capitol after their victory in the 74th Hunger Games sparks a rebellion in the Districts of Panem."
|
28
|
+
movie_info.poster.should == "http://ia.media-imdb.com/images/M/MV5BMTAyMjQ3OTAxMzNeQTJeQWpwZ15BbWU4MDU0NzA1MzAx.jpg"
|
29
|
+
movie_info.rating.should == 8.2
|
30
|
+
movie_info.votes.should == 110636
|
31
|
+
movie_info.mpaa_rating.should == "Rated PG-13 for intense sequences of violence and action, some frightening images, thematic elements, a suggestive situation and language"
|
32
|
+
movie_info.tagline.should == "Every revolution begins with a spark. »"
|
33
|
+
movie_info.year.should == 2013
|
34
|
+
movie_info.release_date.should == "22 November 2013 (USA)"
|
35
|
+
end
|
22
36
|
end
|
23
37
|
|
24
|
-
it "
|
25
|
-
|
26
|
-
|
38
|
+
it "allows you to update attributes" do
|
39
|
+
movie_info.title = "Rails 4 Games: Turbolinks Reloaded!"
|
40
|
+
movie_info.title.should == "Rails 4 Games: Turbolinks Reloaded!"
|
27
41
|
end
|
28
42
|
end
|
29
43
|
|
30
|
-
describe "Adding movies to data store" do
|
44
|
+
describe "Adding multiple movies to data store" do
|
31
45
|
before :each do
|
32
|
-
movie_DS = MovieDB::Movie.instance_eval{create_movie_info(
|
33
|
-
|
34
|
-
"", "", "", "", "", "", '$86.1 Million')}
|
35
|
-
movie_DS = MovieDB::Movie.instance_eval{create_movie_info('Last Vegas', %w(Morgan Freeman', 'Robert De Niro', 'Michael Douglas', 'Kevin Kline', 'Mary Steenburgen'), 'Alan Taylor',
|
36
|
-
'2013-10-30', ['theatrical', 'print'], ["Dan Fogelman"], ['Comedy'], "",
|
37
|
-
"", "", "", "", "", "", '$11.2 Million')}
|
38
|
-
|
46
|
+
movie_DS = MovieDB::Movie.instance_eval{create_movie_info("2024544")}
|
47
|
+
movie_DS = MovieDB::Movie.instance_eval{create_movie_info("1800241")}
|
39
48
|
end
|
40
49
|
|
41
50
|
it "Should return names of all titles" do
|
42
|
-
MovieDB::Movie.instance_eval{filter_movie_attr("title")}.should == ["
|
51
|
+
MovieDB::Movie.instance_eval{filter_movie_attr("title")}.should == ["12 Years a Slave", "American Hustle"]
|
43
52
|
end
|
44
53
|
|
45
54
|
it "Should return names of all directors" do
|
46
|
-
MovieDB::Movie.instance_eval{filter_movie_attr("director")}.should == ["
|
55
|
+
MovieDB::Movie.instance_eval{filter_movie_attr("director")}.should == ["Steve McQueen", "David O. Russell"]
|
47
56
|
end
|
48
|
-
end
|
49
57
|
|
50
|
-
|
51
|
-
|
52
|
-
expect { movie_DS }.to raise_error
|
58
|
+
it "Should return names of all writers" do
|
59
|
+
MovieDB::Movie.instance_eval{filter_movie_attr("writer")}.should == ["John Ridley, Solomon Northup", "Eric Singer, David O. Russell"]
|
53
60
|
end
|
54
61
|
end
|
55
|
-
|
56
|
-
context "#capture" do
|
57
|
-
let!(:newCap){ MovieDB::Movie.new()}
|
58
|
-
|
59
|
-
it "should accept new synopsis argument" do
|
60
|
-
newCap.capture( synopsis: "Last Vegas - Four geriatric friends vow to set Las Vegas Ablaze.").should === {:synopsis=>"Last Vegas - Four geriatric friends vow to set Las Vegas Ablaze."}
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
62
|
end
|
metadata
CHANGED
@@ -1,136 +1,168 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: movieDB
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Albert_McKeever
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
12
|
+
date: 2013-12-12 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: bundler
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
|
-
- -
|
19
|
+
- - ~>
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: '1.3'
|
20
22
|
type: :development
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - ~>
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '1.3'
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: rake
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
|
-
- -
|
35
|
+
- - ! '>='
|
32
36
|
- !ruby/object:Gem::Version
|
33
37
|
version: '0'
|
34
38
|
type: :development
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
|
-
- -
|
43
|
+
- - ! '>='
|
39
44
|
- !ruby/object:Gem::Version
|
40
45
|
version: '0'
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: rspec
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
|
-
- -
|
51
|
+
- - ! '>='
|
46
52
|
- !ruby/object:Gem::Version
|
47
53
|
version: '0'
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
|
-
- -
|
59
|
+
- - ! '>='
|
53
60
|
- !ruby/object:Gem::Version
|
54
61
|
version: '0'
|
55
62
|
- !ruby/object:Gem::Dependency
|
56
63
|
name: imdb
|
57
64
|
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
58
66
|
requirements:
|
59
|
-
- -
|
67
|
+
- - ! '>='
|
60
68
|
- !ruby/object:Gem::Version
|
61
69
|
version: '0'
|
62
70
|
type: :development
|
63
71
|
prerelease: false
|
64
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
65
74
|
requirements:
|
66
|
-
- -
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: zimdb
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
67
92
|
- !ruby/object:Gem::Version
|
68
93
|
version: '0'
|
69
94
|
- !ruby/object:Gem::Dependency
|
70
95
|
name: highline
|
71
96
|
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
72
98
|
requirements:
|
73
|
-
- -
|
99
|
+
- - ! '>='
|
74
100
|
- !ruby/object:Gem::Version
|
75
101
|
version: '0'
|
76
102
|
type: :development
|
77
103
|
prerelease: false
|
78
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
79
106
|
requirements:
|
80
|
-
- -
|
107
|
+
- - ! '>='
|
81
108
|
- !ruby/object:Gem::Version
|
82
109
|
version: '0'
|
83
110
|
- !ruby/object:Gem::Dependency
|
84
111
|
name: fakeweb
|
85
112
|
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
86
114
|
requirements:
|
87
|
-
- -
|
115
|
+
- - ! '>='
|
88
116
|
- !ruby/object:Gem::Version
|
89
117
|
version: '0'
|
90
118
|
type: :development
|
91
119
|
prerelease: false
|
92
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
93
122
|
requirements:
|
94
|
-
- -
|
123
|
+
- - ! '>='
|
95
124
|
- !ruby/object:Gem::Version
|
96
125
|
version: '0'
|
97
126
|
- !ruby/object:Gem::Dependency
|
98
127
|
name: activesupport
|
99
128
|
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
100
130
|
requirements:
|
101
|
-
- -
|
131
|
+
- - ! '>='
|
102
132
|
- !ruby/object:Gem::Version
|
103
133
|
version: 4.0.0
|
104
134
|
type: :runtime
|
105
135
|
prerelease: false
|
106
136
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
107
138
|
requirements:
|
108
|
-
- -
|
139
|
+
- - ! '>='
|
109
140
|
- !ruby/object:Gem::Version
|
110
141
|
version: 4.0.0
|
111
142
|
- !ruby/object:Gem::Dependency
|
112
143
|
name: spreadsheet
|
113
144
|
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
114
146
|
requirements:
|
115
|
-
- -
|
147
|
+
- - ! '>='
|
116
148
|
- !ruby/object:Gem::Version
|
117
149
|
version: '0'
|
118
150
|
type: :runtime
|
119
151
|
prerelease: false
|
120
152
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
121
154
|
requirements:
|
122
|
-
- -
|
155
|
+
- - ! '>='
|
123
156
|
- !ruby/object:Gem::Version
|
124
157
|
version: '0'
|
125
|
-
description:
|
126
|
-
Analysis
|
158
|
+
description: Perform Data Analysis on IMDB Movies
|
127
159
|
email:
|
128
160
|
- kotn_ep1@hotmail.com
|
129
161
|
executables: []
|
130
162
|
extensions: []
|
131
163
|
extra_rdoc_files: []
|
132
164
|
files:
|
133
|
-
-
|
165
|
+
- .gitignore
|
134
166
|
- Gemfile
|
135
167
|
- LICENSE.txt
|
136
168
|
- README.md
|
@@ -146,35 +178,38 @@ files:
|
|
146
178
|
- lib/movieDB/version.rb
|
147
179
|
- movieDB.gemspec
|
148
180
|
- spec/.DS_Store
|
181
|
+
- spec/data_analysis_spec.rb
|
149
182
|
- spec/movieDB_spec.rb
|
150
183
|
- spec/person_spec.rb
|
151
184
|
- spec/spec_helper.rb
|
152
185
|
homepage: https://github.com/keeperofthenecklace/movieDB
|
153
186
|
licenses:
|
154
187
|
- MIT
|
155
|
-
metadata: {}
|
156
188
|
post_install_message:
|
157
189
|
rdoc_options: []
|
158
190
|
require_paths:
|
159
191
|
- lib
|
160
192
|
required_ruby_version: !ruby/object:Gem::Requirement
|
193
|
+
none: false
|
161
194
|
requirements:
|
162
|
-
- -
|
195
|
+
- - ! '>='
|
163
196
|
- !ruby/object:Gem::Version
|
164
197
|
version: '0'
|
165
198
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
199
|
+
none: false
|
166
200
|
requirements:
|
167
|
-
- -
|
201
|
+
- - ! '>='
|
168
202
|
- !ruby/object:Gem::Version
|
169
203
|
version: '0'
|
170
204
|
requirements: []
|
171
205
|
rubyforge_project:
|
172
|
-
rubygems_version:
|
206
|
+
rubygems_version: 1.8.25
|
173
207
|
signing_key:
|
174
|
-
specification_version:
|
175
|
-
summary: Movie Statistic and Data Analysis
|
208
|
+
specification_version: 3
|
209
|
+
summary: Movie/Film Statistic and Data Analysis
|
176
210
|
test_files:
|
177
211
|
- spec/.DS_Store
|
212
|
+
- spec/data_analysis_spec.rb
|
178
213
|
- spec/movieDB_spec.rb
|
179
214
|
- spec/person_spec.rb
|
180
215
|
- spec/spec_helper.rb
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 47a6b5c9b4e330fe911c6e9e1374767c5dc26208
|
4
|
-
data.tar.gz: aba7b9074ec6759e349e4bf49379725903107c9e
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: c44775435f1b8eda891c8b9a484cd49fc9ca0d7423acc3fa3a1018251d785e2c2d8f771006595e659602ebd2cc867fe4a385c5f969f2c26807f6f5d7245c7961
|
7
|
-
data.tar.gz: f36907d783dbd939bf01171b2b797cb9196d8d5d44eafeafba2209838e9d4d33cdb6d18783dfcf1cda673c963156afa7077e6cabc78326615a3c0dc683dffa4b
|