top_10_box_office 0.1.1 → 0.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cf44828db608df4835d83c7386c10b8447a1dba9
4
- data.tar.gz: 789164bed1b9603c5e303132f51022177dfcc835
3
+ metadata.gz: 45bc67de1c394c622509c6cec9995df4d52be52a
4
+ data.tar.gz: 23c06eb7ec7e1dec12318bd77281a2823c60c786
5
5
  SHA512:
6
- metadata.gz: 2e55ef97659046727a1d1462826fb6c057be6377d3de4f6255cc229b7719a032750cb1e649ee01fc29381f43526e83daf70532bb36a2ce55336ba22dfab3c3a9
7
- data.tar.gz: 65bf7abf7087f8f37fe03a03684f20bb0964d50f9c58fc5706316fe88bc3fd446d3217115c072f98ac94d15a131f5f626051aa1823080f37244150b383a70f88
6
+ metadata.gz: f560fb741540301f5c81611e3ca63e0d995c99291c6cc69df011b938e4562f5fd3723cfe6da5460830347e9ae9fda03ab412355c996f0af99d95d00614690c1e
7
+ data.tar.gz: b930f7fff34531fd5d771c8267c3b2cfdb1a6d63ba470eb80a4e96fbf9452804b7dfce23aa51bad77f2737f937790b71bcafe3c5299cb642c08694d975ae5fec
data/README.md CHANGED
@@ -26,7 +26,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
26
26
 
27
27
  ## Contributing
28
28
 
29
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/top_10_box_office. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
29
+ Bug reports and pull requests are welcome on GitHub at https://github.com/xyn12/top-10-box-office-cli-app. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
30
30
 
31
31
 
32
32
  ## License
data/bin/console CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "bundler/setup"
4
4
  require "top_10_box_office"
5
+ require_relative '../config/environment'
5
6
 
6
7
  require "irb"
7
8
  IRB.start(__FILE__)
@@ -6,6 +6,7 @@ class Top10BoxOffice::CLI
6
6
  puts " #{Top10BoxOffice::Movie.date} ".light_green
7
7
  puts "----------------------------------------------------------------------------"
8
8
  puts
9
+
9
10
  start
10
11
  end
11
12
 
@@ -16,6 +17,7 @@ class Top10BoxOffice::CLI
16
17
  print "\n['L'ist / 'Q'uit] $ ".light_red
17
18
  input = gets.chomp.downcase
18
19
  puts
20
+
19
21
  if input == "l" || input == "list"
20
22
  print_list
21
23
  movie_information
@@ -32,12 +34,14 @@ class Top10BoxOffice::CLI
32
34
  puts "\nEnter movie number for more details:".light_green
33
35
  print "[1 - 10] $ ".light_red
34
36
  input = gets.chomp.to_i
37
+
35
38
  input.between?(1, 10) ? print_movie_details(input) : movie_information
36
39
  end
37
40
 
38
41
  def print_list
39
42
  puts " Title Weekend Gross Weeks".light_green
40
43
  puts
44
+
41
45
  Top10BoxOffice::Movie.all.each.with_index do |movie, idx|
42
46
  print " " if idx < 9
43
47
  puts "#{idx + 1}. #{movie.title.ljust(35)} #{movie.weekend_total.ljust(15)} #{movie.gross.ljust(15)} #{movie.weeks}"
@@ -45,16 +49,19 @@ class Top10BoxOffice::CLI
45
49
  end
46
50
 
47
51
  def print_movie_details(input)
52
+ system("clear")
48
53
  movie_details = Top10BoxOffice::Movie.find_or_get_details(input - 1)
49
- puts "\nTitle:".light_blue + " #{movie_details.movie.title}"
50
- puts "IMDB Rating:".light_blue + " #{movie_details.imdb_rating}"
51
- puts "Stars:".light_blue + " #{movie_details.actors}"
52
- puts "Director:".light_blue + " #{movie_details.director}"
53
- puts "Genre:".light_blue + " #{movie_details.genre}"
54
- puts "Content Rating:".light_blue + " #{movie_details.content_rating}"
55
- puts "Runtime:".light_blue + " #{movie_details.runtime}"
56
- puts "Summary:".light_blue + " #{movie_details.summary}"
54
+
55
+ puts movie_details.movie.title.bold.light_green
56
+ puts "\nIMDB Rating:".light_blue + " #{movie_details.imdb_rating}"
57
+ puts "\nStars:".light_blue + " #{movie_details.actors}"
58
+ puts "\nDirector:".light_blue + " #{movie_details.director}"
59
+ puts "\nGenre:".light_blue + " #{movie_details.genre}"
60
+ puts "\nContent Rating:".light_blue + " #{movie_details.content_rating}"
61
+ puts "\nRuntime:".light_blue + " #{movie_details.runtime}"
62
+ puts "\nSummary:".light_blue + " #{movie_details.summary}"
57
63
  puts "\n"
64
+
58
65
  start
59
66
  end
60
67
  end
@@ -1,3 +1,3 @@
1
1
  module Top10BoxOffice
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'top_10_box_office/version'
4
+ require './config/environment'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "top_10_box_office"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: top_10_box_office
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - xyn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-17 00:00:00.000000000 Z
11
+ date: 2017-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler