ma_breweries 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/ma_breweries/brewery.rb +3 -3
- data/lib/ma_breweries/cli.rb +21 -15
- data/lib/ma_breweries/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: 1134c924b6dc7e2ca7d30a9243ae07345f4252bf81fea2a6cfdea771c60f6487
|
4
|
+
data.tar.gz: a42b4d4ef06ff9b89a41536973a586ce57edef10bbf6fc7ceeca10e3668ceac2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bec02233311a6d6163ba4910425b452979e7e96aff442d6133090d9235a606b85e6a7fb8124c4a85cc5576fb376aa173a404e054f6e233aacfd671b0a20ff59
|
7
|
+
data.tar.gz: 6e58370a1e3cc66eb50bbe5334f61ccbf95bc3d77cf0868d6fe35171ed8f166f25b52d5ffb61832b2b90817f41ec9a536ef7c89be77be9a935de6004ea3df1ba
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# MaBreweries
|
2
2
|
|
3
|
-
Brewery search that allows you to find all of the local Massachusetts breweries. You are able to list all of the breweries by name in a numbered list. Also you can search all of the breweries by Name, Brewery type,
|
3
|
+
Brewery search that allows you to find all of the local Massachusetts breweries. You are able to list all of the breweries by name in a numbered list. Also you can search all of the breweries by Name, Brewery type, and City. This CLI project is based on the Open Brewery DB API.
|
4
4
|
## Installation
|
5
5
|
|
6
6
|
Add this line to your application's Gemfile:
|
data/lib/ma_breweries/brewery.rb
CHANGED
@@ -31,9 +31,9 @@ class MaBreweries::BREWERY
|
|
31
31
|
self.all.select {|brewery| brewery.brewery_type.downcase == brewery_type.downcase}
|
32
32
|
end
|
33
33
|
|
34
|
-
def self.find_by_street(street)
|
35
|
-
|
36
|
-
end
|
34
|
+
# def self.find_by_street(street)
|
35
|
+
# self.all.select {|brewery| brewery.street.downcase == street.downcase}
|
36
|
+
# end
|
37
37
|
|
38
38
|
def self.find_by_city(city)
|
39
39
|
self.all.select {|brewery| brewery.city.downcase == city.downcase}
|
data/lib/ma_breweries/cli.rb
CHANGED
@@ -30,14 +30,15 @@ class MaBreweries::CLI
|
|
30
30
|
puts "\n"
|
31
31
|
|
32
32
|
menu
|
33
|
+
puts "\n"
|
33
34
|
brewery_input = gets.chomp.downcase
|
34
35
|
while (brewery_input != "exit")
|
35
36
|
if brewery_input == "name"
|
36
37
|
search_breweries_by_name
|
37
38
|
elsif brewery_input == "type"
|
38
39
|
search_breweries_by_type
|
39
|
-
elsif brewery_input == "street"
|
40
|
-
|
40
|
+
# elsif brewery_input == "street"
|
41
|
+
# search_breweries_by_street
|
41
42
|
elsif brewery_input == "city"
|
42
43
|
search_breweries_by_city
|
43
44
|
elsif brewery_input == "all"
|
@@ -45,9 +46,11 @@ class MaBreweries::CLI
|
|
45
46
|
else
|
46
47
|
puts " ** I am sorry you won't find any brews that way! ** "
|
47
48
|
end
|
49
|
+
puts "\n"
|
48
50
|
menu
|
49
51
|
brewery_input = gets.chomp.downcase
|
50
52
|
end
|
53
|
+
puts "\n"
|
51
54
|
puts " ** Peace out! Have fun and drive carefully! ** "
|
52
55
|
end
|
53
56
|
|
@@ -56,15 +59,16 @@ class MaBreweries::CLI
|
|
56
59
|
puts "\n"
|
57
60
|
puts " * To search by brewery name please enter - Name"
|
58
61
|
puts " * To search by brewery type please enter - Type"
|
59
|
-
|
62
|
+
# puts " * To search by street name please enter - Street"
|
60
63
|
puts " * To search by city please enter - City"
|
61
64
|
puts " * To list all the breweries by name please enter - All"
|
62
|
-
puts "\n"
|
63
65
|
puts " * To exit please enter - exit"
|
66
|
+
|
64
67
|
end
|
65
68
|
|
66
69
|
def search_breweries_by_name
|
67
70
|
puts "Please enter the brewery name: "
|
71
|
+
puts "\n"
|
68
72
|
input = gets.chomp
|
69
73
|
brewery = MaBreweries::BREWERY.find_by_name(input)
|
70
74
|
if brewery
|
@@ -74,6 +78,7 @@ class MaBreweries::CLI
|
|
74
78
|
|
75
79
|
def search_breweries_by_type
|
76
80
|
puts "Please enter the brewery type: "
|
81
|
+
puts "\n"
|
77
82
|
input = gets.chomp
|
78
83
|
breweries = MaBreweries::BREWERY.find_by_brewery_type(input)
|
79
84
|
if breweries
|
@@ -84,21 +89,22 @@ class MaBreweries::CLI
|
|
84
89
|
end
|
85
90
|
end
|
86
91
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
92
|
+
# def search_breweries_by_street
|
93
|
+
# puts "Pease enter the street you think the brews are on:"
|
94
|
+
# input = gets.chomp
|
95
|
+
# breweries = MaBreweries::BREWERY.find_by_street(input)
|
96
|
+
# if breweries
|
97
|
+
# breweries.each do |brewery|
|
98
|
+
# brewery.brew_info
|
99
|
+
# puts "\n"
|
100
|
+
# end
|
101
|
+
# end
|
102
|
+
# end
|
98
103
|
|
99
104
|
|
100
105
|
def search_breweries_by_city
|
101
106
|
puts "Please enter the city you would like to search in:"
|
107
|
+
puts"\n"
|
102
108
|
input = gets.chomp
|
103
109
|
breweries = MaBreweries::BREWERY.find_by_city(input)
|
104
110
|
if breweries
|
data/lib/ma_breweries/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ma_breweries
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "'Justin Beaulieu'"
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|