Knox_Restaurants 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +3 -1
- data/Knox_Restaurants.gemspec +1 -1
- data/README.md +4 -0
- data/lib/Knox_Restaurants/api.rb +2 -1
- data/lib/Knox_Restaurants/version.rb +1 -1
- data/lib/environment.rb +1 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 651a9d7f8ed99b9891ae4297eae8b6cdaa2c2e15fd3c9d12b18dc4cceb2241a3
|
4
|
+
data.tar.gz: 727a48a464c9769e3b310ae547c458f8f13328101b8e327182c782e52723872b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21b15ba708396e4575b23fe8213df04483818ed8bddf871e07916f0977d9c0c1ec8a35036cdde022196036d235eb29fc354ffc65bf4677f356283e5bf4d0bd1d
|
7
|
+
data.tar.gz: a3031cdb7ae67bb28078bf47eb1e4cea7abee382f94a4eb0f5c0ff9563d68803bbcb9beeb3cf7bee8c4f891ec019372bc14f9b2b046d71432688f378b66d4e8a
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
Knox_Restaurants (0.
|
4
|
+
Knox_Restaurants (0.4.0)
|
5
|
+
dotenv
|
5
6
|
httparty
|
6
7
|
nokogiri
|
7
8
|
|
@@ -10,6 +11,7 @@ GEM
|
|
10
11
|
specs:
|
11
12
|
coderay (1.1.2)
|
12
13
|
diff-lcs (1.3)
|
14
|
+
dotenv (2.7.5)
|
13
15
|
httparty (0.17.1)
|
14
16
|
mime-types (~> 3.0)
|
15
17
|
multi_xml (>= 0.5.2)
|
data/Knox_Restaurants.gemspec
CHANGED
data/README.md
CHANGED
@@ -20,6 +20,10 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
+
Before starting the program, you would need to acquire Yelp's API key. Go to https://www.yelp.com/developers/v3/manage_app to create an account or use your existing Yelp login information to create an app. The information about the app isn't important because we just need an API key to access the API for this gem.
|
24
|
+
|
25
|
+
Once you created an app, you should see your API key. Go back to your terminal and inside the Knox_Restaurants directory, type 'touch .env'. This creates an environment file that will story your personal API key. Go to the '.env' file and type in 'export API_KEY=<your API Key>. Once that's done, you should be able to start your program.
|
26
|
+
|
23
27
|
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
28
|
|
25
29
|
## Development
|
data/lib/Knox_Restaurants/api.rb
CHANGED
@@ -3,7 +3,8 @@ class KnoxRestaurants::API
|
|
3
3
|
attr_accessor :cuisine
|
4
4
|
|
5
5
|
def self.fetch
|
6
|
-
key = ENV["KEY"]
|
6
|
+
# key = ENV["KEY"]
|
7
|
+
key = ENV["API_KEY"]
|
7
8
|
url = "https://api.yelp.com/v3/businesses/search?term=restaurant&location=knoxville&limit=50"
|
8
9
|
response = HTTParty.get(url, headers: {'Authorization' => "Bearer #{key}"})
|
9
10
|
response.parsed_response
|
data/lib/environment.rb
CHANGED
@@ -4,9 +4,8 @@ require_relative "./knox_restaurants/cli"
|
|
4
4
|
require_relative "./knox_restaurants/restaurant"
|
5
5
|
require_relative "./knox_restaurants/api"
|
6
6
|
require "pry"
|
7
|
-
require "nokogiri"
|
8
|
-
require "open-uri"
|
9
7
|
require "httparty"
|
8
|
+
require "dotenv/load"
|
10
9
|
|
11
10
|
|
12
11
|
module KnoxRestaurants
|
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.
|
4
|
+
version: 0.5.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-
|
11
|
+
date: 2019-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: dotenv
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|