Theatre_Explorer 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/Theatre_Explorer/cli.rb +23 -9
- data/lib/Theatre_Explorer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 134109ee7200cac59cad155755d0781e43d65d9ff4c4e965ccb506d6b6388198
|
4
|
+
data.tar.gz: 964162f84098cb9aa2ec1b72e2bc5319821227a01b6f223fd4081a897c3c0907
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc887e32b46c533f1b974e71147646a5503e872c060c7552b0567364ebaad91247575a711643c3cc0e8453db3aa99d652a98d9026ca1c63dce2170c4a5c91410
|
7
|
+
data.tar.gz: 85b5323730e245a8dca4ed7f7d90e3bd8fa10abd2d6047e27f30ee6c79488c0eca12d8c70cb63e0d1c2d55c55a591c6a8c148cf594c8dbf65ea30b96fbbb156b
|
data/lib/Theatre_Explorer/cli.rb
CHANGED
@@ -84,21 +84,36 @@ class CLI
|
|
84
84
|
else
|
85
85
|
#Creates hash with query results as keys and urls as values
|
86
86
|
options = Scraper.new.show_search(input)
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
87
|
+
if options.keys.size == 0
|
88
|
+
begin
|
89
|
+
raise SearchError
|
90
|
+
rescue SearchError => error
|
91
|
+
puts error.message
|
92
|
+
end
|
93
|
+
else
|
94
|
+
#Displays query results
|
95
|
+
options.keys.each.with_index(1) {|option, index| puts "#{index}) \t #{option}"}
|
96
|
+
puts "Which result would you like to explore?"
|
97
|
+
input = gets.strip.to_i
|
98
|
+
selection = options[options.keys[input - 1]]
|
99
|
+
#Scrapes and instantiates production object based on selection.
|
100
|
+
show = Scraper.new.production("https://www.broadwayworld.com#{selection}")
|
101
|
+
show.print
|
102
|
+
end
|
95
103
|
continue_prompt
|
96
104
|
end
|
97
105
|
end
|
98
106
|
|
107
|
+
class SearchError < StandardError
|
108
|
+
def message
|
109
|
+
"Search yielded no results."
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
99
113
|
#Sequence for repeated searches
|
100
114
|
def continue_prompt
|
101
115
|
puts "\nWould you like to explore more?"
|
116
|
+
puts "Yes/No"
|
102
117
|
input = gets.strip.downcase
|
103
118
|
if input == "n" || input == "no" || input == "exit"
|
104
119
|
goodbye
|
@@ -127,7 +142,6 @@ class CLI
|
|
127
142
|
puts "---------------------------"
|
128
143
|
puts "|| Goodbye! ||"
|
129
144
|
puts "==========================="
|
130
|
-
binding.pry
|
131
145
|
exit
|
132
146
|
end
|
133
147
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Theatre_Explorer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Drew Keat
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|