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.
- checksums.yaml +4 -4
- data/lib/showtimes/app.rb +26 -18
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36c500f12c0eb9391ce423871d8b6c059a786c39
|
4
|
+
data.tar.gz: 5d1f450cdcd0ed2d6b7b3d1573c5e6b9b2940204
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
41
|
-
puts "2:
|
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
|
-
|
47
|
-
puts "
|
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
|