Knox_Restaurants 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 400c0379f201b366cd4c6ab7b1eb9095538d29041d7a4f75bf06b50f317a27d3
4
- data.tar.gz: 43e42bc302e2b1deaa775620eb0f6fe5469a90d98b10930aa70fc6ff36cde4e7
3
+ metadata.gz: 17898c7e15ca36dbbd5fa2935857ecda7b0ce59f97abd9eb27518a1826a77853
4
+ data.tar.gz: b8cfa7381d74905a01b3ef86e7f14013be7a2e15ed99ed1c8d72614ce81f51a1
5
5
  SHA512:
6
- metadata.gz: b8602b3d08f1287e9ebb00c3c4af335b4d00ebe5c220fdb4f68359a0fbbf8a02eb94ffabae8cd2b72921d6e6a6a2128fe16d97b5370d31421b897daefee81ca3
7
- data.tar.gz: 69a47f17433dfaa19574660cbfa782cdb09d52a5dee20471413acd015efaa39ab778e558e4a635beb5bb4b973f6df94f0672f1fa12212c73083f45a02d15581f
6
+ metadata.gz: 69899bb34a84472180fdec6faa83a52eca9945ddbe2fd69ee636552dd75cd4b4beccc6be43b03bc24a2721d6c5ecfd30f09c153a5a87cb1c30d4c084d54b183a
7
+ data.tar.gz: 9a5b0ff55fe9d29abdebc919326aa66ef77e957302fae6bbf1c102d3563f5b88f4b7f0358b8cfc384deea94c56ce9fb3cd0c5f727541615423b7aa9394e8d736
data/.gitignore CHANGED
@@ -6,6 +6,6 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
-
9
+ app_env
10
10
  # rspec failure tracking
11
11
  .rspec_status
data/Gemfile CHANGED
@@ -1,4 +1,5 @@
1
1
  source "https://rubygems.org"
2
2
 
3
+
3
4
  # Specify your gem's dependencies in Knox_Restaurants.gemspec
4
5
  gemspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- Knox_Restaurants (0.1.0)
4
+ Knox_Restaurants (0.5.0)
5
5
  httparty
6
6
  nokogiri
7
7
 
Binary file
Binary file
Binary file
data/README.md CHANGED
@@ -20,7 +20,7 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- To start the program, run 'bin/knox_restaurants' in terminal. There will be a numbered list of cuisines to choose from. There will be a prompt to enter in a number. It will return a list of restaurants corresponding to the user's input. From here, enter a valid number to get more information for that restaurant. Enter "end" to exit the program.
23
+ To start the program, run 'bin/Knox_Restaurants' in terminal. There will be a numbered list of cuisines to choose from. There will be a prompt to enter in a number. It will return a list of restaurants corresponding to the user's input. From here, enter a valid number to get more information for that restaurant. Enter "end" to exit the program.
24
24
 
25
25
  ## Development
26
26
 
@@ -3,7 +3,7 @@ class KnoxRestaurants::API
3
3
  attr_accessor :cuisine
4
4
 
5
5
  def self.fetch
6
- key = ENV["API_KEY"]
6
+ key = ENV["KEY"]
7
7
  url = "https://api.yelp.com/v3/businesses/search?term=restaurant&location=knoxville&limit=50"
8
8
  response = HTTParty.get(url, headers: {'Authorization' => "Bearer #{key}"})
9
9
  response.parsed_response
@@ -2,9 +2,13 @@ class KnoxRestaurants::CLI
2
2
  #outputs to user
3
3
 
4
4
  def call
5
- puts "Welcome to Knoxville!"
6
5
  KnoxRestaurants::API.fetch #fetches from API
7
- start
6
+ puts <<-REST
7
+ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-
8
+ | Welcome to Knoxville! |
9
+ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-
10
+ REST
11
+ start
8
12
  end
9
13
 
10
14
  def start
@@ -16,20 +20,43 @@ class KnoxRestaurants::CLI
16
20
 
17
21
  def display_cuisine_choices
18
22
  @cuisine = KnoxRestaurants::Restaurant.get_cuisines.each.with_index(1) do |cuisine, idx|
19
- puts "#{idx}. #{cuisine}"
23
+ puts <<-REST
24
+ #{idx}. #{cuisine}
25
+ REST
20
26
  end
21
27
  end
22
28
 
23
29
  def input_cuisine_choice
24
- puts "What are you in the mood for?"
25
- puts "Enter a valid number"
26
- puts "Enter 'end' to exit"
30
+ puts <<-REST
31
+ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-
32
+ | What are you in the mood for? |
33
+ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-
34
+ REST
35
+ puts <<-REST
36
+ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-
37
+ | Enter a valid number |
38
+ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-
39
+ REST
40
+ puts <<-REST
41
+ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-
42
+ | Enter 'end' to exit |
43
+ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-
44
+ REST
27
45
  input = gets.strip.downcase
28
46
  if valid?(input, @cuisine)
29
47
  display_restaurants(input.to_i)
30
- puts "To find out more, enter the number for which restaurant you want"
48
+ puts <<-REST
49
+ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-
50
+ | To find out more, enter the |
51
+ | number for the restaurant you want |
52
+ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-
53
+ REST
31
54
  else
32
- puts "I don't understand. Please pick another cuisine"
55
+ puts <<-REST
56
+ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-
57
+ | I don't understand. Please pick another cuisine |
58
+ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-
59
+ REST
33
60
  sleep(2)
34
61
  start
35
62
  end
@@ -37,12 +64,18 @@ class KnoxRestaurants::CLI
37
64
 
38
65
  def display_restaurants(input)
39
66
  @restaurant = KnoxRestaurants::Restaurant.get_cuisine_restaurants(input).each.with_index(1) do |r, idx|
40
- puts "#{idx}. #{r.name}"
67
+ puts <<-REST
68
+ #{idx}. #{r.name}
69
+ REST
41
70
  end
42
71
  end
43
72
 
44
73
  def return_details
45
- puts "Please enter a valid restaurant number"
74
+ puts <<-REST
75
+ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-
76
+ | Please enter a valid restaurant number |
77
+ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-
78
+ REST
46
79
  restaurant = gets.chomp
47
80
  if valid?(restaurant, @restaurant)
48
81
  display_details(restaurant.to_i)
@@ -54,15 +87,14 @@ class KnoxRestaurants::CLI
54
87
  def display_details(input)
55
88
  r = @restaurant[input-1]
56
89
 
57
- puts <<~RESTAURANT
58
- Address: #{r.address}
59
- Phone number: #{r.phone_number}
60
- Website: #{r.url}
61
- Rating: #{r.rating} of 5
62
- Price Range: #{r.price}
63
- Reviews: #{r.reviews}
64
- RESTAURANT
65
-
90
+ puts <<-REST
91
+ Address: #{r.address}
92
+ Phone number: #{r.phone_number}
93
+ Rating: #{r.rating} of 5
94
+ Price Range: #{r.price}
95
+ Reviews: #{r.reviews}
96
+ Website: #{r.url}
97
+ REST
66
98
  end
67
99
 
68
100
  def valid?(input,array)
@@ -73,7 +105,11 @@ class KnoxRestaurants::CLI
73
105
  end
74
106
 
75
107
  def last_hurrah
76
- puts "Would you like to pick another cuisine? Yes or No"
108
+ puts <<-REST
109
+ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-
110
+ | Would you like to pick another cuisine? Yes or No |
111
+ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-
112
+ REST
77
113
  if gets.chomp.downcase == "yes"
78
114
  start
79
115
  else
@@ -82,7 +118,11 @@ class KnoxRestaurants::CLI
82
118
  end
83
119
 
84
120
  def goodbye
85
- puts "Thanks for visiting Knoxville. Have a nice day."
121
+ puts <<-REST
122
+ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-
123
+ | Thanks for visiting Knoxville. Have a nice day! |
124
+ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-
125
+ REST
86
126
  exit
87
127
  end
88
128
  end
@@ -1,3 +1,3 @@
1
1
  module KnoxRestaurants
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Knox_Restaurants
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chaya Deaver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-23 00:00:00.000000000 Z
11
+ date: 2019-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -108,6 +108,9 @@ files:
108
108
  - CODE_OF_CONDUCT.md
109
109
  - Gemfile
110
110
  - Gemfile.lock
111
+ - Knox_Restaurants-0.1.0.gem
112
+ - Knox_Restaurants-0.2.0.gem
113
+ - Knox_Restaurants-0.3.0.gem
111
114
  - Knox_Restaurants.gemspec
112
115
  - LICENSE.txt
113
116
  - README.md