movieDB 0.2.7 → 0.3.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
  SHA1:
3
- metadata.gz: 124312db314fc9ba1cffc82ab4a756954cf499dc
4
- data.tar.gz: ab27ef56e493ec17a98d40e21b7ef93abc5410ef
3
+ metadata.gz: 51a99dff4a1714a2f82cc884b17effb622d26475
4
+ data.tar.gz: f969ce9fb07fe4378caf8e2febeaf2d3b63fb9b7
5
5
  SHA512:
6
- metadata.gz: d566633537eaec4e45bc7dbe89a12fe003bf028e125b6e3774d19f02124212966b978b9fbb34cd9210125e898449b2e265698484bb689adec4016fae596072e2
7
- data.tar.gz: a7a50173eeb6e75cd94051ca85e67399ddda31f25335e45788aa668cce525b6f97780e5102447beb0a982d12f35597c5bf8c0efe89a1508c2e1abbf8ed0da5e0
6
+ metadata.gz: 993bba8490037ab19e8c31e3815b241e8c60ff0a83b54495480a950c143b96081245e3492e0b7419a509249dea819891c236ea1937a858544156af6cca212d4e
7
+ data.tar.gz: 14cca2572f8dc38aa67f7f75d45deb181fb3898635cd9c2ac164f7ce2554be01013b106e7a45f8cc85be0e51bad0269854d275c66a212fbc271af18e0b67eecb
data/.gitignore CHANGED
@@ -16,3 +16,5 @@ test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
18
  reports
19
+ .coveralls.yml
20
+ setup_readme.txt
@@ -7,12 +7,12 @@ env:
7
7
  #- GEM DB=mysql
8
8
  #- GEM DB=postgres
9
9
  before_install:
10
- - cd $GEM; export BUNDLE_GEMFILE="`pwd`/Gemfile"
10
+ - cd $GEM; export BUNDLE_GEMFILE="`pwd`/Gemfile"
11
11
  script: bundle exec rspec spec
12
12
 
13
13
  matrix:
14
14
  allow_failures:
15
- - rvm: 1.9.7
15
+ - rvm: 2.2.2
16
16
  #- rvm: jruby
17
17
  #- rvm: rbx
18
18
  #- rvm: ree
@@ -24,7 +24,7 @@ notifications:
24
24
  on_failure: always
25
25
 
26
26
  rvm:
27
- # 1.9.3
28
- - 1.9.7
29
- #- 2.0.0
30
- #- 2.1.0
27
+ - 2.2.2
28
+ # - 1.9.7
29
+ # - 2.2.2
30
+ # - 2.1.0
data/Gemfile CHANGED
@@ -1,4 +1,8 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in movieDB.gemspec
4
3
  gemspec
4
+
5
+ group :documentation do
6
+ gem 'coveralls', :require => false
7
+ end
8
+
data/README.md CHANGED
@@ -1,12 +1,18 @@
1
- MovieDB - Movie Data Analysis Tool
1
+ ## MovieDB
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/movieDB.png)](http://badge.fury.io/rb/movieDB) [![Code Climate](https://codeclimate.com/github/keeperofthenecklace/movieDB.png)](https://codeclimate.com/github/keeperofthenecklace/movieDB) [![Build Status](https://secure.travis-ci.org/keeperofthenecklace/movieDB.png?branch=master)](http://travis-ci.org/keeperofthenecklace/movieDB)
4
- [![Join the chat at https://gitter.im/keeperofthenecklace/movieDB](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/keeperofthenecklace/movieDB?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5
- ## Description
3
+ MovieDB is a ruby wrapper for fetching raw Movie or TV Data from IMDb and performing a variety of statistical analysis and computation.
4
+ The objective and usage of this tool is to media producers make high level structured decision decisions based off realistic figures.
6
5
 
7
- Although the name suggests a datastore gem, MovieDB is actually a ruby wrapper that inspects, cleans, transform and model imdb data and provides useful data analysis information, suggesting conclusion. The objective and usage is to provide a tool that can aide movie/film producers make statistical decisions based off archival imdb data.
6
+ The fetched data is stored in memory using Redis. An expiration time of 1800 seconds has be set for every load.
7
+
8
+ - [![Join the chat at https://gitter.im/keeperofthenecklace/movieDB](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/keeperofthenecklace/movieDB?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
9
+ - [![Coverage Status](https://coveralls.io/repos/keeperofthenecklace/movieDB/badge.svg)](https://coveralls.io/r/keeperofthenecklace/movieDB)
10
+ - [![Code Climate](https://codeclimate.com/github/keeperofthenecklace/movieDB.png)](https://codeclimate.com/github/keeperofthenecklace/movieDB)
11
+ - [![Gem Version](https://badge.fury.io/rb/movieDB.png)](http://badge.fury.io/rb/movieDB)
12
+ - [![Build Status](https://secure.travis-ci.org/keeperofthenecklace/movieDB.png?branch=master)](http://travis-ci.org/keeperofthenecklace/movieDB)
13
+
14
+ ## Basic functions and Data Analysis:
8
15
 
9
- Basic functions and Data Analysis:
10
16
  * Data Analysis
11
17
  * Exploratory Data Analysis
12
18
  * Confirmatory Data Analysis
@@ -19,21 +25,23 @@ Add this line to your application's Gemfile:
19
25
 
20
26
  And then execute:
21
27
 
22
- $ bundle install
28
+ $> bundle install
23
29
 
24
30
  Or install it yourself as:
25
31
 
26
- $ gem install movieDB
32
+ $> gem install movieDB
27
33
 
28
34
  ## Require - loading the libraries
29
35
 
30
- $ irb
36
+ $> irb
31
37
 
32
- > require 'movieDB'
38
+ $> require 'movieDB'
33
39
 
34
40
  ## Usage - Fetch Raw Movie Data From IMDb
35
41
 
36
- > MovieDB::Movie.get_data("0369610", "3079380")
42
+ $> imdb_ids = ["0369610", "3079380"]
43
+
44
+ $> MovieDB::Movie.get_data(imdb_ids)
37
45
 
38
46
  /* YOU CAN ADD AS MANY IMDB IDs AS YOU LIKE. BUT DO NOT EXCEED THE MAXIMUM REQUEST RATE. */
39
47
 
@@ -59,13 +67,13 @@ For example, the fetched data used
59
67
 
60
68
  > require 'MovieDB/data_process'
61
69
 
62
- > MovieDB::DataProcess.send(:basic_statistic, 'mdb_JurassicWorld_Spy_20150611.xls')
70
+ > MovieDB::DataProcess.send(:basic_statistic, 'imdb_JurassicWorld_Spy_20150611.xls')
63
71
 
64
72
  ### Exported - Analyzed Data
65
73
 
66
74
  The exported analyzed data is stored in your reports directory.
67
75
 
68
- $ cd /reports/basic_statistic_20131216.xls
76
+ $ cd /reports/basic_statistic_20150611.xls
69
77
 
70
78
  ## What's Next
71
79
 
@@ -1,5 +1,4 @@
1
1
  require "rubygems"
2
- require "time" # Time is an abstraction of dates and times.
3
2
  require "open-uri" # is an easy-to-use wrapper for net/http, net/https and net/ftp.
4
3
  require "nokogiri" # is an HTML, XML, SAX, and Reader parser.
5
4
  require "themoviedb" # Provides a simple, easy to use interface for the Movie Database API.
@@ -9,6 +8,8 @@ require "MovieDB/base"
9
8
  require "MovieDB/data_analysis"
10
9
  require "MovieDB/secret"
11
10
  require "MovieDB/data_export"
11
+ require "redis"
12
+ require "json"
12
13
 
13
14
  unless defined? MovieDB::Movie
14
15
  module MovieDB #:nodoc:
@@ -40,7 +41,7 @@ unless defined? MovieDB::Movie
40
41
  :cast_members_characters,
41
42
  :trailer_url,
42
43
  :director,
43
- :writer,
44
+ :writers,
44
45
  :filming_locations,
45
46
  :company,
46
47
  :genres,
@@ -55,16 +56,7 @@ unless defined? MovieDB::Movie
55
56
  :tagline,
56
57
  :year,
57
58
  :release_date,
58
- :worldwide_gross,
59
- :released,
60
- :unique_id,
61
- :academy_award_nomination,
62
- :academy_award_wins,
63
- :golden_globe_nominations,
64
- :golden_globe_wins,
65
- :bafta_nomination,
66
- :bafta_wins,
67
- :film_release
59
+ :revenue
68
60
 
69
61
  DEFAULT_TITLE = "Method Missing 2: Rails Roars!"
70
62
  DEFAULT_CAST_MEMBERS = ["David Black", "Paola Perotta", "Obie Fernandez", "David Chelimsky"]
@@ -74,7 +66,7 @@ unless defined? MovieDB::Movie
74
66
  DEFAULT_CAST_MEMBER_IDS = ["nm3901234", "nm4901244", "nm5901235", "nm3601266"]
75
67
  DEFAULT_TRAILER_URL = "http://imdb.com/video/screenplay/vi581042457/"
76
68
  DEFAULT_DIRECTOR = "Yukihiro 'Matz' Matsumoto"
77
- DEFAULT_WRITER = 'David Heinemeier Hansson'
69
+ DEFAULT_WRITERS = 'David Heinemeier Hansson'
78
70
  DEFAULT_FILMING_LOCATIONS = ["Manhattan, New York, USA"]
79
71
  DEFAULT_COMPANY = "Open Source Community Film Corporation"
80
72
  DEFAULT_GENRES = ["Bromantic", "Syfy"]
@@ -89,29 +81,23 @@ unless defined? MovieDB::Movie
89
81
  DEFAULT_TAGLINE = 'Only One MVC Will Rule Them All.'
90
82
  DEFAULT_YEAR = 2013
91
83
  DEFAULT_RELEASE_DATE = "11 October 2013 (USA)"
92
- DEFAULT_WORLDWIDE_GROSS = "$124.6M" # Not provided by imdb api.
93
- DEFAULT_UNIQUE_ID = @unique_id
94
- DEFAULT_ACADEMY_AWARD_NOMINATION = 4
95
- DEFAULT_ACADEMY_AWARD_WINS = 3
96
- DEFAULT_GOLDEN_GLOBE_NOMINATIONS = 4
97
- DEFAULT_GOLDEN_GLOBE_WINS = 2
98
- DEFAULT_BAFTA_NOMINATION = 3
99
- DEFAULT_BAFTA_WINS = 1
100
- DEFAULT_FILM_RELEASE = ['theatrical', 'video', 'television', 'internet', 'print']
84
+ DEFAULT_REVENUE = 456790
101
85
 
102
86
  def initialize(attributes = {})
103
87
  $IMDB_ATTRIBUTES_HEADERS = movie_attr = %w(title cast_members cast_characters cast_member_ids cast_members_characters
104
- trailer_url director writer filming_locations company genres languages countries
105
- length plot poster rating votes mpaa_rating tagline year release_date worldwide_gross unique_id
106
- academy_award_nomination academy_award_wins golden_globe_nominations golden_globe_wins
107
- bafta_nomination bafta_wins film_release)
88
+ trailer_url director writers filming_locations company genres languages countries
89
+ length plot poster rating votes mpaa_rating tagline year release_date revenue)
108
90
 
109
91
  movie_attr.each do |attr|
110
92
  self.send("#{attr}=", (attributes.has_key?(attr.to_sym) ? attributes[attr.to_sym] : self.class.const_get("DEFAULT_#{attr.upcase}")))
111
93
  end
112
94
  end
113
95
 
114
- # This is empty the container #
96
+ # This is empty the container
97
+ #
98
+ # Futire release of this software will be using the boxofficemojoAPI
99
+ # https://github.com/skozilla/BoxOfficeMojo/tree/master/boxofficemojoAPI
100
+ #
115
101
  # def clear_data_store
116
102
  # return @movie_DS = []
117
103
  # end
@@ -124,47 +110,44 @@ unless defined? MovieDB::Movie
124
110
  #
125
111
  # MovieDB::Movie.instance_eval { filter_movie_attr("title") }
126
112
  def self.get_data(*args)
127
- @movie_DS = []
113
+ @db_redis ||= Redis.new
114
+
115
+ @db_redis.del "revenue"
116
+
117
+ @imdb_id = []
118
+
119
+ Tmdb::Api.key(Movie.key)
120
+
121
+ args.flatten.each do |value|
122
+ @imdb_id << value
128
123
 
129
- args.each do |value|
130
124
  movie_info = Movie.new
131
125
  @movie_data = Imdb::Movie.new(value)
132
126
 
133
- begin
134
- movie_info.title = Array.new << @movie_data.title
135
- movie_info.cast_members = @movie_data.cast_members.flatten
136
- movie_info.cast_characters = @movie_data.cast_characters
137
- movie_info.cast_member_ids = @movie_data.cast_member_ids
138
- movie_info.cast_members_characters = @movie_data.cast_members_characters
139
- movie_info.trailer_url = @movie_data.trailer_url.nil? ? 'No Trailer' : @movie_data.trailer_url
140
- movie_info.director = @movie_data.director.flatten
141
- movie_info.writer = @movie_data.writers.flatten
142
- movie_info.filming_locations = @movie_data.filming_locations.flatten.join(', ')
143
- movie_info.company = Array.new << @movie_data.company
144
- movie_info.genres = @movie_data.genres.flatten.join(' ').sub(' ' , ', ')
145
- movie_info.languages = Array.new << @movie_data.languages.flatten.join(' ').sub(' ' , ', ')
146
- movie_info.countries = Array.new << @movie_data.countries.flatten.join(' ').sub(' ' , ', ')
147
- movie_info.length = Array.new << @movie_data.length
148
- movie_info.plot = Array.new << @movie_data.plot
149
- movie_info.poster = Array.new << @movie_data.poster
150
- movie_info.rating = Array.new << @movie_data.rating
151
- movie_info.votes = Array.new << @movie_data.votes
152
- movie_info.mpaa_rating = Array.new << @movie_data.mpaa_rating == [nil] ? ["Not Rated"] : [@movie_data.mpaa_rating]
153
- movie_info.tagline = Array.new << @movie_data.tagline
154
- movie_info.year = Array.new << @movie_data.year
155
- movie_info.release_date = Array.new << @movie_data.release_date
156
- rescue
157
- raise ArgumentError, 'Invalid IMDb id entered.'
158
- end
127
+ movie_detail = Tmdb::Movie.detail("tt#{value}")
128
+
129
+ $IMDB_ATTRIBUTES_HEADERS.each do |attr_key|
130
+ begin @movie_data.send(attr_key)
131
+ attr_value = @movie_data.send(attr_key)
132
+ rescue => e
133
+ attr_value = movie_detail['revenue']
134
+ end
135
+
136
+ @db_redis.hset "movie:#{value}", "#{attr_key}", "#{attr_value}" # Adding a hash data type.
159
137
 
160
- @movie_DS << movie_info
138
+ @db_redis.lpush "#{attr_key}", "#{attr_value}" if attr_value.is_a? Numeric # Adding a list data type.
139
+
140
+ @db_redis.expire "#{attr_key}", 1800
141
+
142
+ @db_redis.expire "movie:#{value}", 1800
143
+ end
161
144
  end
162
145
 
163
146
  write_imdb_data_to_xls
164
147
  end
165
148
 
166
149
  def self.write_imdb_data_to_xls
167
- Movie.export_movie_data(@movie_DS)
150
+ Movie.export_movie_data(@db_redis, @imdb_id)
168
151
  end
169
152
  end
170
153
  end
@@ -1,18 +1,18 @@
1
1
  require "spreadsheet"
2
+ require "redis"
3
+ require "json"
2
4
 
3
- # JSON Data (movie_DS) fetched from IMDb by the movieDB.rb module is processed here.
4
- # Spreadsheet gem is used to writes the attributes in an xls format to the report folder,
5
- # where it is later used for data analysis.
6
- #
7
- # Usage / Example:
8
- #
9
- # MovieDB::Movie.export_movie_data(IMDB_JSON_FILE)
5
+ # Movie data fetched from IMDb is stored as a hash data type in redis.
6
+ # The key and values are written into a spreadsheet for later data analysis.
10
7
  module MovieDB
11
8
  module DataExport
12
- def export_movie_data(movie_DS)
13
- @movie_DS = movie_DS
9
+ def export_movie_data(db_redis, imdb_ids)
10
+ @db_redis = db_redis
11
+ @imdb_ids = imdb_ids
12
+
14
13
  create_spreadsheet_file
15
- create_spreadsheet_report(movie_DS)
14
+ create_spreadsheet_report
15
+
16
16
  write_xls_file
17
17
  end
18
18
 
@@ -24,7 +24,7 @@ module MovieDB
24
24
 
25
25
  @book = Spreadsheet::Workbook.new
26
26
  @sheet = @book.create_worksheet
27
- @sheet.name = report_name if @movie_DS
27
+ @sheet.name = report_name if @db_redis
28
28
  @sheet.name = "Data Analysis: #{$DATA_ANALYSIS_NAME}" if $DATA_ANALYSIS_NAME
29
29
  end
30
30
 
@@ -32,9 +32,9 @@ module MovieDB
32
32
  Dir.mkdir(directory_name) unless File.exists? directory_name
33
33
  end
34
34
 
35
- def create_spreadsheet_report(movie_DS)
35
+ def create_spreadsheet_report
36
36
  create_spreadsheet_header
37
- create_spreadsheet_body(movie_DS)
37
+ create_spreadsheet_body
38
38
  end
39
39
 
40
40
  def create_spreadsheet_header
@@ -49,29 +49,24 @@ module MovieDB
49
49
  @sheet.column(22).default_format = float_format
50
50
  end
51
51
 
52
- # The values from the header_attr is converted from a string to a method.
53
- # We accomplish this by using Object#send
54
- #
55
- # Example Usage:
56
- #
57
- # movie_attribute = movie_DS[i].send(header_attr)
58
- #
59
- # Starts the row insert on row 1 and not row 0.
60
- #
61
- # Example Usage:
62
- #
63
- # row = @sheet.row(i + 1)
64
- def create_spreadsheet_body(movie_DS)
65
- 0.upto(movie_DS.length - 1) do |i|
66
- row = @sheet.row(i + 1)
67
-
68
- $IMDB_ATTRIBUTES_HEADERS.each do |header_attr|
69
- string_values = ['title', 'language', 'length', 'rating', 'vote', 'release', 'mpaa_rating', 'year']
70
- movie_attribute = movie_DS[i].send(header_attr)
71
-
72
- row.push(movie_attribute.map { |t| t }.join(' ')) if ([].unshift header_attr).any? { |v| string_values.include?(v) }
73
- row.push movie_attribute.length if (movie_attribute.is_a? Array) && ([].unshift header_attr).any? { |v| !string_values.include?(v) }
74
- row.push(movie_attribute) if movie_attribute.is_a? String
52
+ # We write the all keys and values from our data set to the spreadsheet
53
+ def create_spreadsheet_body
54
+ @imdb_ids.each_with_index do |imdb_id, idx|
55
+ row = @sheet.row(idx + 1)
56
+
57
+ $IMDB_ATTRIBUTES_HEADERS.each do |attr_key|
58
+ string_values = ['title', 'language', 'length', 'rating', 'vote', 'release', 'mpaa_rating', 'year', 'revenue']
59
+
60
+ # Check to see if the fetch redis value is in a JSON
61
+ begin
62
+ movie_value = JSON.parse(@db_redis.hget "movie:#{imdb_id}", "#{attr_key}")
63
+ rescue => e
64
+ movie_value = [] << (@db_redis.hget "movie:#{imdb_id}", "#{attr_key}")
65
+ end
66
+
67
+ row.push(movie_value.map { |t| t }.join(' ')) if ([].unshift attr_key).any? { |v| string_values.include?(v) }
68
+ row.push movie_value.length if (movie_value.is_a? Array) && ([].unshift attr_key).any? { |v| !string_values.include?(v) }
69
+ row.push(movie_value) if movie_value.is_a? String
75
70
  end
76
71
  end
77
72
  end
@@ -79,12 +74,11 @@ module MovieDB
79
74
  def report_name
80
75
  name = "imdb_"
81
76
 
82
- 0.upto(@movie_DS.length - 1) do |i|
83
- name << @movie_DS[i].title.map { |m| m }.join().gsub(' ', '') + "_"
77
+ @imdb_ids.each do |imdb_id|
78
+ name << (@db_redis.hget "movie:#{imdb_id}", "title").gsub(' ', '')
79
+ name << '_' unless @imdb_ids.length == imdb_id
84
80
  end
85
81
 
86
- name << "#{Time.now.to_s.gsub(':', '').gsub('-', '').gsub(' ', '').split('')[0..7].join}"
87
-
88
82
  return name
89
83
  end
90
84
 
@@ -1,3 +1,3 @@
1
1
  module MovieDB
2
- VERSION = "0.2.7"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Albert McKeever"]
10
10
  spec.email = ["kotn_ep1@hotmail.com"]
11
11
  spec.description = %q{Perform Data Analysis on IMDB Movies}
12
- spec.summary = %q{Movie/Film Statistic and Data Analysis}
12
+ spec.summary = %q{Movie/Film/TV Statistic and Data Analysis}
13
13
  spec.homepage = "https://github.com/keeperofthenecklace/movieDB"
14
14
  spec.license = "MIT"
15
15
 
@@ -21,11 +21,12 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "bundler", "~> 1.3"
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency "rspec"
24
- spec.add_development_dependency 'imdb'
25
- spec.add_development_dependency 'zimdb'
26
24
  spec.add_development_dependency 'highline'
27
25
  spec.add_development_dependency 'fakeweb'
28
26
  spec.add_dependency "activesupport", ">= 4.0.0"
29
27
  spec.add_dependency "spreadsheet"
30
28
  spec.add_dependency "themoviedb"
29
+ spec.add_dependency "redis"
30
+ spec.add_dependency 'imdb'
31
+ spec.add_dependency 'json'
31
32
  end
@@ -1,16 +1,14 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe MovieDB::DataExport do
4
-
5
- describe "#export_movie_data" do
6
- MovieDB::Movie.send(:clear_data_store)
7
- MovieDB::Movie.send(:get_multiple_imdb_movie_data, "2024544", "1800241", "0791314")
8
- MovieDB::DataExport.export_movie_data
9
4
 
10
- let(:file_name) {MovieDB::DataExport.write_xls_file}
5
+ describe "#fetch_movie_data_from_imdb" do
6
+ MovieDB::Movie.get_data("2024544", "1800241", "0791314")
11
7
 
12
- it 'writes the exported data as an xls file to the reports directory' do
13
- File.exist?(File.join('reports', file_name)).should == true
8
+ let(:file_name) {MovieDB::Movie.write_imdb_data_to_xls}
9
+
10
+ it 'writes the fetched data as an xls file to the reports directory' do
11
+ expect(File.exist?(File.join('reports', file_name))).to eql(true)
14
12
  end
15
13
 
16
14
  end
@@ -8,113 +8,10 @@ describe MovieDB::DataProcess do
8
8
  let(:basic_stat) {MovieDB::DataProcess}
9
9
 
10
10
  it "should return the cof" do
11
- basic_stat.send(:basic_statistic, 'imdb_raw_data_2013122312.xls').should == 'Statistic_2013122417.xls'
12
- end
13
-
14
- it "raise error if file does not exist" do
15
-
11
+ # pending
12
+ basic_stat.send(:basic_statistic, 'imdb_12YearsaSlave_AmericanHustle_KeeperoftheNecklace.xls').should == 'Statistic_2015061319.xls'
16
13
  end
17
- end
18
-
19
- describe "#Discrete_Least_Squares_Meshless_Method" do
20
- pending
21
- end
22
-
23
- describe "#Explained_Sum_Of_Squares" do
24
- pending
25
- end
26
-
27
- describe "#Fraction_Of_Variance_Unexplained" do
28
- pending
29
- end
30
-
31
- describe "#Gauss_Newton_Algorithm" do
32
- pending
33
- end
34
-
35
- describe "#Iteratively_Reweighted_Least_Squares" do
36
- pending
37
- end
38
-
39
- describe "#Lack_Of_Fit_Sum_Of_Squares" do
40
- pending
41
- end
42
-
43
- describe "#Least_Squares_Support_Vector_Machine" do
44
- pending
45
- end
46
-
47
- describe "#Mean_Squared_Error" do
48
- pending
49
- end
50
-
51
- describe "#Moving_Least_Squares" do
52
- pending
53
- end
54
-
55
- describe "#Non_Linear_Iterative_Partial_Least_Squares" do
56
- pending
57
- end
58
-
59
- describe "#Non_Linear_Least_Squares" do
60
- pending
61
- end
62
-
63
- describe "#Ordinary_Least_Squares" do
64
- pending
65
- end
66
-
67
- describe "#Partial_Least_Squares_Regression" do
68
- pending
69
- end
70
-
71
- describe "#Partition_Of_Sums_Of_Squares" do
72
- pending
73
- end
74
-
75
- describe "#Proofs_Involving_Ordinary_Least_Squares" do
76
- pending
77
- end
78
-
79
- describe "#Residual_Sum_Of_Squares" do
80
- pending
81
- end
82
-
83
- describe "#Total_Least_Squares" do
84
- pending
85
- end
86
-
87
- describe "#Total_Sum_Of_Squares" do
88
- pending
89
- end
90
- end
91
- end
92
-
93
- describe "#EstimationOfDensity" do
94
-
95
- end
96
-
97
- describe "#ExploratoryDataAnalysis" do
98
- pending
99
- end
100
-
101
- describe "#DataMining" do
102
- pending
103
- end
104
-
105
- describe "RegressionAnalysis" do
106
- pending
14
+ end
15
+ end
107
16
  end
108
-
109
- describe "#Resampling" do
110
- pending
111
- end
112
-
113
- describe "#Sensitivity_Analysis" do
114
- pending
115
- end
116
-
117
- describe "#Time_series_Analysis" do
118
- pending
119
- end
120
17
  end
@@ -7,7 +7,7 @@ describe MovieDB::Person do
7
7
  MovieDB::Person.instance_eval{ create_with_info("Brittany Murphy", "F", "1977-11-10", "2009-12-20") }
8
8
  MovieDB::Person.instance_eval{ create_with_info("George Clooney", "M", "1961-05-06", "") }
9
9
 
10
- MovieDB::Person.instance_eval{ filter_person('name') }.should == ['Brittany Murphy', 'George Clooney']
10
+ expect(MovieDB::Person.instance_eval{ filter_person('name') }).to eq(['Brittany Murphy', 'George Clooney'])
11
11
  end
12
12
  end
13
13
 
@@ -16,7 +16,7 @@ describe MovieDB::Person do
16
16
  age = MovieDB::Person.instance_eval{ filter_person('age') }
17
17
  moviePerson = MovieDB::Person.instance_eval{ sample_attr('age') }
18
18
 
19
- #moviePerson.should be_in(age)
19
+ # moviePerson.should be_in(age)
20
20
  end
21
21
  end
22
22
 
@@ -1,5 +1,8 @@
1
1
  $:.unshift File.expand_path('..', __FILE__)
2
2
  $:.unshift File.expand_path('../../lib/', __FILE__)
3
+
4
+ require 'coveralls'
5
+ Coveralls.wear!
3
6
  require 'movieDB'
4
7
  require 'MovieDB/base'
5
8
  require "MovieDB/person"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: movieDB
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Albert McKeever
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-12 00:00:00.000000000 Z
11
+ date: 2015-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: imdb
56
+ name: highline
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: zimdb
70
+ name: fakeweb
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -81,13 +81,27 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: highline
84
+ name: activesupport
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 4.0.0
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: 4.0.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: spreadsheet
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
101
  - - ">="
88
102
  - !ruby/object:Gem::Version
89
103
  version: '0'
90
- type: :development
104
+ type: :runtime
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
@@ -95,13 +109,13 @@ dependencies:
95
109
  - !ruby/object:Gem::Version
96
110
  version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
- name: fakeweb
112
+ name: themoviedb
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
115
  - - ">="
102
116
  - !ruby/object:Gem::Version
103
117
  version: '0'
104
- type: :development
118
+ type: :runtime
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
@@ -109,21 +123,21 @@ dependencies:
109
123
  - !ruby/object:Gem::Version
110
124
  version: '0'
111
125
  - !ruby/object:Gem::Dependency
112
- name: activesupport
126
+ name: redis
113
127
  requirement: !ruby/object:Gem::Requirement
114
128
  requirements:
115
129
  - - ">="
116
130
  - !ruby/object:Gem::Version
117
- version: 4.0.0
131
+ version: '0'
118
132
  type: :runtime
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
135
  requirements:
122
136
  - - ">="
123
137
  - !ruby/object:Gem::Version
124
- version: 4.0.0
138
+ version: '0'
125
139
  - !ruby/object:Gem::Dependency
126
- name: spreadsheet
140
+ name: imdb
127
141
  requirement: !ruby/object:Gem::Requirement
128
142
  requirements:
129
143
  - - ">="
@@ -137,7 +151,7 @@ dependencies:
137
151
  - !ruby/object:Gem::Version
138
152
  version: '0'
139
153
  - !ruby/object:Gem::Dependency
140
- name: themoviedb
154
+ name: json
141
155
  requirement: !ruby/object:Gem::Requirement
142
156
  requirements:
143
157
  - - ">="
@@ -180,7 +194,6 @@ files:
180
194
  - spec/.DS_Store
181
195
  - spec/data_export_spec.rb
182
196
  - spec/data_process_spec.rb
183
- - spec/movieDB_spec.rb
184
197
  - spec/person_spec.rb
185
198
  - spec/spec_helper.rb
186
199
  homepage: https://github.com/keeperofthenecklace/movieDB
@@ -206,11 +219,10 @@ rubyforge_project:
206
219
  rubygems_version: 2.4.6
207
220
  signing_key:
208
221
  specification_version: 4
209
- summary: Movie/Film Statistic and Data Analysis
222
+ summary: Movie/Film/TV Statistic and Data Analysis
210
223
  test_files:
211
224
  - spec/.DS_Store
212
225
  - spec/data_export_spec.rb
213
226
  - spec/data_process_spec.rb
214
- - spec/movieDB_spec.rb
215
227
  - spec/person_spec.rb
216
228
  - spec/spec_helper.rb
@@ -1,36 +0,0 @@
1
- require 'spec_helper'
2
- require 'imdb'
3
- require "zimdb"
4
-
5
- describe MovieDB do
6
-
7
- describe "#get_imdb_movie_data" do
8
-
9
- context "Get multiple movie data from IMDb" do
10
- MovieDB::Movie.send(:clear_data_store)
11
- MovieDB::Movie.send(:get_multiple_imdb_movie_data, "0120338", "0120815", "0120915")
12
- #MovieDB::Movie.send(:get_multiple_imdb_movie_data, "0120338")
13
- MovieDB::DataExport.export_movie_data
14
- it "Should return titles" do
15
- MovieDB::Movie.instance_eval{filter_movie_attr("title")}.should == [["Titanic"], ["Saving Private Ryan"], ["Star Wars: Episode I - The Phantom Menace"]]
16
- end
17
-
18
- it "Should return directors" do
19
- MovieDB::Movie.instance_eval{filter_movie_attr("director")}.should == [["James Cameron"], ["Steven Spielberg"], ["George Lucas"]]
20
- end
21
-
22
- end
23
- end
24
-
25
- describe "validation" do
26
-
27
- context "invalid id number" do
28
-
29
- it "should raise an error" do
30
- # expect {MovieDB::Movie.send(:get_multiple_imdb_movie_data, "9024544")}.to raise_error('invalid imbd id')
31
- end
32
-
33
- end
34
- end
35
-
36
- end