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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17898c7e15ca36dbbd5fa2935857ecda7b0ce59f97abd9eb27518a1826a77853
4
- data.tar.gz: b8cfa7381d74905a01b3ef86e7f14013be7a2e15ed99ed1c8d72614ce81f51a1
3
+ metadata.gz: 651a9d7f8ed99b9891ae4297eae8b6cdaa2c2e15fd3c9d12b18dc4cceb2241a3
4
+ data.tar.gz: 727a48a464c9769e3b310ae547c458f8f13328101b8e327182c782e52723872b
5
5
  SHA512:
6
- metadata.gz: 69899bb34a84472180fdec6faa83a52eca9945ddbe2fd69ee636552dd75cd4b4beccc6be43b03bc24a2721d6c5ecfd30f09c153a5a87cb1c30d4c084d54b183a
7
- data.tar.gz: 9a5b0ff55fe9d29abdebc919326aa66ef77e957302fae6bbf1c102d3563f5b88f4b7f0358b8cfc384deea94c56ce9fb3cd0c5f727541615423b7aa9394e8d736
6
+ metadata.gz: 21b15ba708396e4575b23fe8213df04483818ed8bddf871e07916f0977d9c0c1ec8a35036cdde022196036d235eb29fc354ffc65bf4677f356283e5bf4d0bd1d
7
+ data.tar.gz: a3031cdb7ae67bb28078bf47eb1e4cea7abee382f94a4eb0f5c0ff9563d68803bbcb9beeb3cf7bee8c4f891ec019372bc14f9b2b046d71432688f378b66d4e8a
data/.gitignore CHANGED
@@ -7,5 +7,6 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
  app_env
10
+ .env
10
11
  # rspec failure tracking
11
12
  .rspec_status
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- Knox_Restaurants (0.5.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)
@@ -33,5 +33,5 @@ Gem::Specification.new do |spec|
33
33
  spec.add_development_dependency "rspec", "~> 3.0"
34
34
  spec.add_development_dependency "pry"
35
35
  spec.add_dependency "httparty"
36
- spec.add_dependency "nokogiri"
36
+ spec.add_dependency "dotenv"
37
37
  end
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module KnoxRestaurants
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -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.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-24 00:00:00.000000000 Z
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: nokogiri
84
+ name: dotenv
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="