showtimes 0.2.0 → 0.2.1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/showtimes/app.rb +26 -18
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7feec09b179b7b0495d17cff34ab37fa8f1bc18f
4
- data.tar.gz: f2f7f172f450881eb3c69ce9ed28ef9fadff7ab2
3
+ metadata.gz: 36c500f12c0eb9391ce423871d8b6c059a786c39
4
+ data.tar.gz: 5d1f450cdcd0ed2d6b7b3d1573c5e6b9b2940204
5
5
  SHA512:
6
- metadata.gz: 87be228abeb955117100d3ce2cbdaf80459985b42ee1eda50093ea784a92d2ab9de64b15488797b297f35bf3399639259151abbc55966211cd0aef0cdd7cfd7d
7
- data.tar.gz: 3e6aa1447f04b76bb1153d396050c27d34856becf87e3c8917eb4f721eae8f8e8302eb1a4f7f2d9000c863acf8d3e3f4355ed6eeb3415333371582d5954cfc74
6
+ metadata.gz: 300e509e5ecab257fa41acdd960eaca2c20ad9df871fbafebac83e73987674d8080cf36b3191abfe28c8795843e1407fdf61b31631a34c568c158389bec79c17
7
+ data.tar.gz: 242efa81263ce6be3621c19b717ad22e08c23524001aca451a52caef4c0b31534745d25b21bf0adfc6a948f8339209248193a0e587178e2da7304d7ca3d1b511
data/lib/showtimes/app.rb CHANGED
@@ -24,28 +24,27 @@ class Showtimes::App
24
24
  retry
25
25
  end
26
26
  Showtimes::Scraper.new.scrape_showtimes(zipcode)
27
- display_theaters
28
-
29
- puts "\n"
30
- puts "For which theater do you wish to see the showtimes? (enter the number)"
31
- theater_choice = gets.strip.to_i
32
- display_showtimes(theater_choice)
33
-
34
- what_next
27
+
28
+ theater_selection
35
29
  end
36
30
 
37
31
  def what_next
38
32
  puts "\n"
39
33
  puts "That's it! What do you want to do next?"
40
- puts "1: try another zipcode"
41
- puts "2: exit"
34
+ puts "1: try a new zipcode"
35
+ puts "2: back to theaters"
36
+ puts "3: exit"
42
37
  next_up = gets.strip
43
38
  if next_up == "1"
44
39
  start
40
+ elsif next_up == "2"
41
+ theater_selection
45
42
  else
46
- puts "***************************************"
47
- puts " BYEEEEEEEEEEE. See you soon! ♥ "
48
- puts "***************************************"
43
+ system('clear')
44
+ puts "\n"
45
+ puts "****************************************************"
46
+ puts "********** BYEEEEEEEEEEE. See you soon! ♥ **********"
47
+ puts "****************************************************"
49
48
  puts "\n"
50
49
  exit
51
50
  end
@@ -60,13 +59,24 @@ class Showtimes::App
60
59
  end
61
60
  end
62
61
 
62
+ def theater_selection
63
+ display_theaters
64
+ puts "\n"
65
+ puts "For which theater do you wish to see the showtimes? (enter the number)"
66
+ theater_choice = gets.strip.to_i
67
+ display_showtimes(theater_choice)
68
+
69
+ what_next
70
+ end
71
+
63
72
  def display_showtimes(index)
64
73
  selection = Showtimes::Theater.all[index-1]
74
+ stars = "*" * selection.name.length
65
75
 
66
76
  puts "\n"
67
- puts "**********************************************"
68
- puts "Movies playing today at #{selection.name}:"
69
- puts "**********************************************"
77
+ puts "*************************************#{stars}"
78
+ puts "***** Movies playing today at #{selection.name}: *****"
79
+ puts "*************************************#{stars}"
70
80
  puts "\n"
71
81
 
72
82
  selection.movies.each_with_index do |showtimes, index|
@@ -80,6 +90,4 @@ class Showtimes::App
80
90
  end
81
91
  end
82
92
 
83
-
84
-
85
93
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: showtimes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marine Boudeau