UrgentcareCLI 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +49 -0
- data/LICENSE.txt +21 -0
- data/Notes +41 -0
- data/README.md +41 -0
- data/Rakefile +6 -0
- data/UrgentCare.gemspec +39 -0
- data/bin/Urgentcare +8 -0
- data/bin/console +22 -0
- data/bin/setup +8 -0
- data/data.txt +4 -0
- data/lib/UrgentCare.rb +13 -0
- data/lib/UrgentCare/CLI.rb +57 -0
- data/lib/UrgentCare/Office.rb +23 -0
- data/lib/UrgentCare/version.rb +3 -0
- data/lib/Urgentcare/Scraper.rb +36 -0
- data/spec.md +6 -0
- data/test.data +2110 -0
- metadata +136 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 81add6e9dc74720ae8da85002dfd13eaaa9fa68a7e9f377c66f1e1704f6c0702
|
4
|
+
data.tar.gz: 40eec143b8cc9275e28e0228325a7d1760ebb1b59156ac75ea23af64ab93171f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 832d3f1947b47f0c3774f8838f5fb9472e6ced50b1f2b66618d087872f1dacf080331cd4b538ec7ff5c3e5f4927a8b5484b48465c986e37458a6bc863ddb7312
|
7
|
+
data.tar.gz: de6668874de46c92aed884cd5ff063a6c7dc00ee9f591bdb499fb3c360fecd3877f89f04207f0f7d95bbb59868f6f6eeb17a3fca3347ff97a62af9c2b0119190
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
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 TODO: Write your email address. 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
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
UrgentcareCLI (0.1.0)
|
5
|
+
nokogiri (~> 1.8.2)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
coderay (1.1.2)
|
11
|
+
diff-lcs (1.3)
|
12
|
+
method_source (0.9.0)
|
13
|
+
mini_portile2 (2.3.0)
|
14
|
+
nokogiri (1.8.2)
|
15
|
+
mini_portile2 (~> 2.3.0)
|
16
|
+
project (1.3.0)
|
17
|
+
rspec (>= 1.2.9)
|
18
|
+
pry (0.11.3)
|
19
|
+
coderay (~> 1.1.0)
|
20
|
+
method_source (~> 0.9.0)
|
21
|
+
rake (12.3.1)
|
22
|
+
rspec (3.7.0)
|
23
|
+
rspec-core (~> 3.7.0)
|
24
|
+
rspec-expectations (~> 3.7.0)
|
25
|
+
rspec-mocks (~> 3.7.0)
|
26
|
+
rspec-core (3.7.1)
|
27
|
+
rspec-support (~> 3.7.0)
|
28
|
+
rspec-expectations (3.7.0)
|
29
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
+
rspec-support (~> 3.7.0)
|
31
|
+
rspec-mocks (3.7.0)
|
32
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
33
|
+
rspec-support (~> 3.7.0)
|
34
|
+
rspec-support (3.7.1)
|
35
|
+
|
36
|
+
PLATFORMS
|
37
|
+
ruby
|
38
|
+
|
39
|
+
DEPENDENCIES
|
40
|
+
UrgentcareCLI!
|
41
|
+
bundler (~> 1.16)
|
42
|
+
nokogiri
|
43
|
+
project
|
44
|
+
pry
|
45
|
+
rake
|
46
|
+
rspec (~> 3.0)
|
47
|
+
|
48
|
+
BUNDLED WITH
|
49
|
+
1.16.1
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018: Pamela Torres-Rocca
|
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
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
Find Urgent Care with shortest wait time
|
2
|
+
Local Massachusetts facilities
|
3
|
+
|
4
|
+
What are the next two things that you need to do?
|
5
|
+
|
6
|
+
CLI Interaction
|
7
|
+
- Welcome
|
8
|
+
- Please provide your Massachusetts location
|
9
|
+
- Wait times for closest Urgent Care centers are as follows:
|
10
|
+
- Please enter another location, ask to display list, or exit
|
11
|
+
|
12
|
+
Medford Physician One
|
13
|
+
https://physicianoneurgentcare.com/find-us/locations/ma/medford-urgent-care
|
14
|
+
Cape Cod Health
|
15
|
+
https://www.capecodhealth.org/patients-visitors/wait-time/
|
16
|
+
Dedham
|
17
|
+
https://www.afcurgentcare.com/dedham/patient-resources/check-in-online/
|
18
|
+
Southeast MA
|
19
|
+
https://www.southcoast.org/services/urgent-care/
|
20
|
+
Boston Area CareWell - next available appts.
|
21
|
+
https://www.carewellurgentcare.com/locations/
|
22
|
+
Boston Area AFC Urgent Care- wait times
|
23
|
+
https://www.clockwisemd.com/groups/53
|
24
|
+
|
25
|
+
Create one dependency that loads all others. Loads all files
|
26
|
+
into memory.
|
27
|
+
|
28
|
+
Rake is another way to run files. Like a bin file.
|
29
|
+
Require bundler, the mother of all gems. Then tell it to require
|
30
|
+
which requires all gems. This makes sure that the files are
|
31
|
+
loaded in the correct order.
|
32
|
+
|
33
|
+
:: is a unary operator that allows: constants, instance methods and class
|
34
|
+
methods defined within a class or module, to be accessed from anywhere outside
|
35
|
+
the class or module.
|
36
|
+
|
37
|
+
|
38
|
+
Class CLI
|
39
|
+
Class Scraper
|
40
|
+
Class location list
|
41
|
+
Class location
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# UrgentCare
|
2
|
+
|
3
|
+
CLI Urgent Care returns current wait times at urgent care centers based on location.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'project'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install project
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
TODO: Write usage instructions here
|
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/Pamela454/Pamela-cli-app. 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 Project project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/project/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/UrgentCare.gemspec
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", )
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "./lib/Urgentcare/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "UrgentcareCLI"
|
8
|
+
spec.version = Urgentcare::VERSION
|
9
|
+
spec.authors = ["PamelaTorres-Rocca"]
|
10
|
+
spec.email = ["pfrieze@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Current Urgent Care wait times in Massachusetts based on location.}
|
13
|
+
spec.homepage = "https://github.com/Pamela454/Pamela-cli-app.git"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
17
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
18
|
+
#if spec.respond_to?(:metadata)
|
19
|
+
# spec.metadata["allowed_push_host"] = ''
|
20
|
+
#else
|
21
|
+
# raise "RubyGems 2.0 or newer is required to protect against " \
|
22
|
+
# "public gem pushes."
|
23
|
+
#end
|
24
|
+
|
25
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
26
|
+
f.match(%r{^(test|spec|features)/})
|
27
|
+
end
|
28
|
+
spec.bindir = "exe"
|
29
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
30
|
+
spec.require_paths = ["lib"]
|
31
|
+
|
32
|
+
spec.add_development_dependency "bundler", "~> 1.16" #locks gems to current versions
|
33
|
+
spec.add_development_dependency "rake", "~> 10.0" #bundle update to update
|
34
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
35
|
+
spec.add_development_dependency "pry", "~> 0.11.3"
|
36
|
+
#spec.add_development_dependency "open-uri"
|
37
|
+
|
38
|
+
spec.add_dependency "nokogiri", "~> 1.8.2"
|
39
|
+
end
|
data/bin/Urgentcare
ADDED
data/bin/console
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "Urgentcare"
|
5
|
+
|
6
|
+
puts("starting")
|
7
|
+
require "bundler/setup"
|
8
|
+
puts("after bundler")
|
9
|
+
|
10
|
+
require "Urgentcare"
|
11
|
+
puts("after proj")
|
12
|
+
|
13
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
14
|
+
# with your gem easier. You can also use a different console, if you like.
|
15
|
+
|
16
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
17
|
+
require "pry"
|
18
|
+
Pry.start
|
19
|
+
|
20
|
+
require "irb"
|
21
|
+
puts("after irb")
|
22
|
+
IRB.start
|
data/bin/setup
ADDED
data/data.txt
ADDED
data/lib/UrgentCare.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'pry'
|
2
|
+
require 'nokogiri'
|
3
|
+
require 'open-uri'
|
4
|
+
|
5
|
+
require_relative "./Urgentcare/CLI"
|
6
|
+
require_relative "./Urgentcare/version" #why was this not a relative path?
|
7
|
+
require_relative "./Urgentcare/Office"
|
8
|
+
require_relative "./Urgentcare/Scraper"
|
9
|
+
|
10
|
+
#required by bundler
|
11
|
+
module Urgentcare
|
12
|
+
# Your code goes here...
|
13
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
class Urgentcare::CLI
|
2
|
+
|
3
|
+
def call
|
4
|
+
welcome
|
5
|
+
end
|
6
|
+
|
7
|
+
def welcome
|
8
|
+
|
9
|
+
puts "Welcome to the Urgent Care CLI"
|
10
|
+
puts " "
|
11
|
+
puts " "
|
12
|
+
puts "Please choose a number from the following list for details on
|
13
|
+
an Urgent Care location."
|
14
|
+
puts " "
|
15
|
+
|
16
|
+
Urgentcare::Scraper.new.get_clinics
|
17
|
+
@clinics = Urgentcare::Office.all
|
18
|
+
@clinics.each_with_index do |office, i|
|
19
|
+
puts "#{i + 1}. #{office.name}"
|
20
|
+
end
|
21
|
+
list
|
22
|
+
end
|
23
|
+
|
24
|
+
def list
|
25
|
+
puts " "
|
26
|
+
location = gets.chomp
|
27
|
+
if location == "Exit" ||location == "exit"
|
28
|
+
puts "Thank you and Goodbye!"
|
29
|
+
else
|
30
|
+
@index = location.to_i - 1
|
31
|
+
office_details
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def office_details
|
36
|
+
the_office = Urgentcare::Office.all
|
37
|
+
if @index != "Exit" ||@index != "exit"
|
38
|
+
puts " "
|
39
|
+
puts "Office Name: #{the_office[@index].name}"
|
40
|
+
puts "Office Number: #{the_office[@index].phone_number}"
|
41
|
+
puts "Office URL: https://www.www.carewellurgentcare.com#{the_office[@index].url}"
|
42
|
+
puts "Next Available Time: #{the_office[@index].next_available}"
|
43
|
+
puts " "
|
44
|
+
else
|
45
|
+
puts "No results found. Please try again."
|
46
|
+
end
|
47
|
+
puts "Would you like to select another office from the list?"
|
48
|
+
puts " "
|
49
|
+
@clinics.each_with_index do |office, i|
|
50
|
+
puts "#{i + 1}. #{office.name}"
|
51
|
+
end
|
52
|
+
puts " "
|
53
|
+
puts "If not, please type exit."
|
54
|
+
puts " "
|
55
|
+
list
|
56
|
+
end
|
57
|
+
end
|