boba_finder_CLI 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2f0613f963d01c4c468a120a2914244cb43fd5aa6d0aac222923151a62ffb43
4
- data.tar.gz: 469878b419a98e2bcda47a6a1d0d340925dd005d51c0a30af4dfa619f089c91b
3
+ metadata.gz: 0acdb6229656d5fd79ad56d598a720118c7a28678dea13aabd997a10ae913afe
4
+ data.tar.gz: c24ac12369c64a34712cef5fe2b586a8c1e158d773d51002b0f247d157295d72
5
5
  SHA512:
6
- metadata.gz: 8fb20212a1098e1595f8961782f463743cb60b433da71bc6c61e2a27a6751b714e921bdbef11d68d793705b6146afc7a6c6102a25364b74f325b938b4cea790b
7
- data.tar.gz: 9d5908af230fd4aea6e74ea9c550dc05f8e1bb703f5bf33cd041bc4fe60a2932b2437289803f1696145f51b60d7ca04903f12f7dfd37a9461fbf2f4526da0fa4
6
+ metadata.gz: 8053259842accaa89e7630e4e383fa0d88d16c3c661963cadce5f883d7ed7a1ab47c3e843b1f4b94a2718795144473b7d97f0618f6193f6ae40d109d6cc961c6
7
+ data.tar.gz: d5c5cc9296b8d3c961331832ceda6e27801b1b23ae0fa803e87b87421256be35230eb085b315373369a827b0908a278566752aa13ac1ac1841721b1fa8ec98ab
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boba_finder_CLI
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Clarence Sadsad
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-27 00:00:00.000000000 Z
11
+ date: 2018-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -56,14 +56,14 @@ dependencies:
56
56
  name: nokogiri
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
- type: :runtime
62
+ type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
@@ -86,28 +86,7 @@ email:
86
86
  executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
- files:
90
- - ".DS_Store"
91
- - ".bash_profile.save"
92
- - ".gitignore"
93
- - ".rspec"
94
- - ".travis.yml"
95
- - CODE_OF_CONDUCT.md
96
- - Gemfile
97
- - Gemfile.lock
98
- - LICENSE.txt
99
- - NOTES.md
100
- - README.md
101
- - Rakefile
102
- - bin/boba-finder
103
- - bin/console
104
- - bin/setup
105
- - boba_finder_CLI.gemspec
106
- - lib/boba_finder_CLI.rb
107
- - lib/boba_finder_CLI/boba.rb
108
- - lib/boba_finder_CLI/cli.rb
109
- - lib/boba_finder_CLI/finder.rb
110
- - lib/boba_finder_CLI/version.rb
89
+ files: []
111
90
  homepage:
112
91
  licenses:
113
92
  - MIT
data/.DS_Store DELETED
Binary file
data/.bash_profile.save DELETED
@@ -1,4 +0,0 @@
1
- export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
2
- export CLICOLOR=1
3
- export LSCOLORS=ExFxBxDxCxegedabagacad
4
- alias ls='ls -GFh'
data/.gitignore DELETED
@@ -1,11 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.3.1
5
- before_install: gem install bundler -v 1.16.2
data/CODE_OF_CONDUCT.md DELETED
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at joshsad2@gmail.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/jsadsad/boba-finder-cli-gem" }
4
-
5
- # Specify your gem's dependencies in boba_finder_CLI.gemspec
6
- gemspec
data/Gemfile.lock DELETED
@@ -1,47 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- boba_finder_CLI (0.1.0)
5
- colorize
6
- nokogiri
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- coderay (1.1.2)
12
- colorize (0.8.1)
13
- diff-lcs (1.3)
14
- method_source (0.9.0)
15
- mini_portile2 (2.3.0)
16
- nokogiri (1.8.5)
17
- mini_portile2 (~> 2.3.0)
18
- pry (0.11.3)
19
- coderay (~> 1.1.0)
20
- method_source (~> 0.9.0)
21
- rake (10.5.0)
22
- rspec (3.8.0)
23
- rspec-core (~> 3.8.0)
24
- rspec-expectations (~> 3.8.0)
25
- rspec-mocks (~> 3.8.0)
26
- rspec-core (3.8.0)
27
- rspec-support (~> 3.8.0)
28
- rspec-expectations (3.8.2)
29
- diff-lcs (>= 1.2.0, < 2.0)
30
- rspec-support (~> 3.8.0)
31
- rspec-mocks (3.8.0)
32
- diff-lcs (>= 1.2.0, < 2.0)
33
- rspec-support (~> 3.8.0)
34
- rspec-support (3.8.0)
35
-
36
- PLATFORMS
37
- ruby
38
-
39
- DEPENDENCIES
40
- boba_finder_CLI!
41
- bundler (~> 1.16)
42
- pry
43
- rake (~> 10.0)
44
- rspec
45
-
46
- BUNDLED WITH
47
- 1.16.2
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2018 Joshua Clarence Sadsad
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
data/NOTES.md DELETED
@@ -1,21 +0,0 @@
1
- How to build a CLI Gem
2
-
3
- 1. Plan your gem, imagine the interface.
4
- 2. Start with project structure.
5
- 3. Start with entry point - the file run.
6
- 4. Force that built the CLI interface.
7
- 5. Stub out the interface.
8
- 6. Start making things real.
9
- 7. Discover Objects.
10
- 8. Program
11
-
12
- ---
13
-
14
- 1. A CLI for finding Boba spots, via YELP and ZIP codes.
15
- - user types ZIP
16
- - displays top 5 - 10 spots, star rating, and City
17
- 1. iTea
18
- 2. Quickly
19
- 3. Tapioca Express
20
-
21
- .xpath("//script").remove = removes ad elements
data/README.md DELETED
@@ -1,42 +0,0 @@
1
- # BobaFinderCLI
2
-
3
- This Ruby gem provides a Command Line Interface(CLI) to view 10 Boba spots around a given ZIP code via Yelp.
4
-
5
- ## Installation
6
-
7
- Add this line to your application's Gemfile:
8
-
9
- ```ruby
10
- gem 'boba_finder_CLI'
11
- ```
12
-
13
- And then execute:
14
-
15
- $ bundle
16
-
17
- Or install it yourself as:
18
-
19
- $ gem install boba_finder_CLI
20
-
21
- ## Usage
22
-
23
-
24
-
25
- ## Development
26
-
27
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
28
-
29
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
30
-
31
- ## Contributing
32
-
33
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/boba_finder_CLI. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
34
-
35
- ## License
36
-
37
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
38
-
39
- ## Code of Conduct
40
-
41
- Everyone interacting in the BobaFinderCLI project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/boba_finder_CLI/blob/master/CODE_OF_CONDUCT.md).
42
- # boba-finder-cli-gem
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
data/bin/boba-finder DELETED
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # require_relative '../lib/boba_finder_CLI'
4
- require "bundler/setup"
5
- require "boba_finder_CLI"
6
-
7
- BobaFinder::CLI.new.call
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "boba_finder_CLI"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,39 +0,0 @@
1
-
2
- lib = File.expand_path("../lib", __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "boba_finder_CLI/version"
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "boba_finder_CLI"
8
- spec.version = BobaFinder::VERSION
9
- spec.authors = ["Joshua Clarence Sadsad"]
10
- spec.email = ["joshsad2@gmail.com"]
11
-
12
- spec.summary = "Boba Finder CLI Project for Flatiron School"
13
- spec.license = "MIT"
14
-
15
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
16
- # to allow pushing to a single host or delete this section to allow pushing to any host.
17
- # if spec.respond_to?(:metadata)
18
- # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
19
- # else
20
- # raise "RubyGems 2.0 or newer is required to protect against " \
21
- # "public gem pushes."
22
- # end
23
-
24
- # Specify which files should be added to the gem when it is released.
25
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
26
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
27
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
28
- end
29
- spec.bindir = "exe"
30
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
- spec.require_paths = ["lib"]
32
-
33
- spec.add_development_dependency "bundler", "~> 1.16"
34
- spec.add_development_dependency "rake", "~> 10.0"
35
-
36
- spec.add_development_dependency 'pry', '~> 0'
37
- spec.add_runtime_dependency 'nokogiri', '~> 0'
38
- spec.add_runtime_dependency'colorize', '~> 0'
39
- end
@@ -1,11 +0,0 @@
1
- #Environment File
2
-
3
- require 'nokogiri'
4
- require 'colorize'
5
- require 'open-uri'
6
- require 'pry'
7
-
8
- require_relative "./boba_finder_CLI/version"
9
- require_relative "./boba_finder_CLI/cli"
10
- require_relative "./boba_finder_CLI/finder"
11
- require_relative "./boba_finder_CLI/boba"
@@ -1,28 +0,0 @@
1
- class BobaFinder::Boba
2
-
3
- attr_accessor :name, :stars, :city, :neighborhood, :address, :telephone
4
-
5
- @@all = []
6
-
7
- def self.boba
8
- @@all
9
- end
10
-
11
- def initialize(
12
- name= nil, stars= nil,
13
- city= nil, neighborhood= nil,
14
- address= nil, telephone= nil)
15
- @name = name
16
- @stars = stars
17
- @city = city
18
- @neighborhood = neighborhood
19
- @address = address
20
- @telephone = telephone
21
- @@all << self
22
- end
23
-
24
- def self.reset_boba
25
- @@all = []
26
- end
27
-
28
- end
@@ -1,64 +0,0 @@
1
- class BobaFinder::CLI #The CLI controller
2
-
3
- def call
4
- list
5
- menu
6
- end
7
-
8
- def list
9
- input = ""
10
- puts "Welcome to Boba Finder!".colorize(:light_blue)
11
- sleep 1
12
- BobaFinder::Finder.scrape_yelp
13
- BobaFinder::Boba.boba.each_with_index{|drink, i| puts "#{i + 1}. #{drink.name}"}
14
- puts "----------------------".colorize(:green)
15
- end
16
-
17
- def menu
18
- puts "Based on numbered order, what place would you like to get information about?".colorize(:light_blue)
19
- input = gets.strip.to_i
20
- if input > 10
21
- puts "Invalid number! Please put 1 - 10.".colorize(:red)
22
- sleep 1
23
- puts "----------------------".colorize(:green)
24
- self.menu
25
- else
26
- result(input)
27
- end
28
- end
29
-
30
- def result(input)
31
- spot = BobaFinder::Boba.boba[input - 1]
32
- puts "#{spot.name}"
33
- puts "This place has a #{spot.stars}."
34
- sleep 1
35
- if spot.city == ""
36
- location = spot.neighborhood
37
- else
38
- location = spot.city
39
- end
40
- puts "It is located at #{spot.address}, #{location}."
41
- sleep 1
42
- if spot.telephone == ""
43
- puts "This location does not have a phone number."
44
- else
45
- puts "Their telephone is #{spot.telephone}."
46
- end
47
- puts "----------------------".colorize(:green)
48
- puts "Do you want to look at another location? [yes/no]"
49
- new_input = gets.strip.downcase
50
- if new_input == "yes" || new_input == "y"
51
- BobaFinder::Boba.reset_boba
52
- self.call
53
- elsif new_input == "no" || new_input == "n"
54
- bye
55
- else
56
- puts "Not an input. [yes/no]"
57
- end
58
- end
59
-
60
- def bye
61
- puts "Goodbye"
62
- end
63
-
64
- end
@@ -1,35 +0,0 @@
1
- class BobaFinder::Finder
2
-
3
- def self.user_zip
4
- puts "What is your ZIP code?"
5
- input = gets.strip
6
- if input.size != 5
7
- puts "Invalid number! Please put a proper ZIP code.".colorize(:red)
8
- sleep 1
9
- puts "----------------------".colorize(:green)
10
- self.user_zip
11
- else
12
- @link = "https://www.yelp.com/search?find_desc=boba&find_loc=#{input}"
13
- sleep 1
14
- puts "Here's a list of places near you:"
15
- puts "\n"
16
- sleep 2
17
- end
18
- end
19
-
20
- def self.scrape_yelp
21
- self.user_zip
22
- doc = Nokogiri::HTML(open(@link, "User-Agent" => "JCS", "From" => "joshsad2@gmail.com"))
23
- doc.xpath("//script").remove
24
-
25
- doc.search("li.regular-search-result").map do |spot|
26
- name = spot.css("a.biz-name span").text
27
- stars = spot.css("div.i-stars").attr("title").value
28
- city = spot.css("span.biz-city").children.text if spot.css("span.biz-city")
29
- neighborhood = spot.css("span.neighborhood-str-list").children.text.strip if spot.css("span.neighborhood-str-list")
30
- address = spot.css("address").children.text.strip
31
- telephone = spot.css("span.biz-phone").children.text.strip
32
- BobaFinder::Boba.new(name, stars, city, neighborhood, address, telephone)
33
- end
34
- end
35
- end
@@ -1,3 +0,0 @@
1
- module BobaFinder
2
- VERSION = "0.1.0"
3
- end