phl-covid-testing 0.1.9 → 0.2.0
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 +4 -4
- data/README.md +7 -8
- data/bin/console +1 -9
- data/bin/setup +0 -2
- data/lib/concerns/Displayable.rb +3 -1
- data/lib/concerns/Findable.rb +19 -12
- data/lib/concerns/Inputable.rb +8 -2
- data/lib/phl-covid-testing.rb +2 -13
- data/lib/phl_covid_testing/cli.rb +3 -1
- data/lib/phl_covid_testing/testing_location.rb +1 -0
- data/lib/phl_covid_testing/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e3564c1aeb3e879da656d32bae2358d1da71e17f4ac25f35c416de1a16ca6b5
|
4
|
+
data.tar.gz: e5c101a4c4788b938d148479873c02dbe18239044655766185bb6ae3435fcfe9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fc1a6cd34c3c649228c3c675862d800c96d41e7d255695c1b59d313f77db56ef7cb505f967318de9a641ae093ce82c5630bedadd8925cd654b319e4e6b8d456
|
7
|
+
data.tar.gz: 140ad762cf157d2fde9d5b2c2897a3b68e9f5ffa5a7e4b32b98eea276b816df2fe0eb885de39929589213b240eee582bf8c59849e22dc398dbb5a17a8b67a4f0
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@ Find and view details about COVID-19 testing locations located in Philadelphia,
|
|
11
11
|
Add this line to your application's Gemfile:
|
12
12
|
|
13
13
|
```ruby
|
14
|
-
gem '
|
14
|
+
gem 'phl-covid-testing'
|
15
15
|
```
|
16
16
|
|
17
17
|
And then execute:
|
@@ -20,7 +20,12 @@ And then execute:
|
|
20
20
|
|
21
21
|
Or install it yourself as:
|
22
22
|
|
23
|
-
$ gem install
|
23
|
+
$ gem install phl-covid-testing
|
24
|
+
|
25
|
+
You can then begin the application by executing:
|
26
|
+
|
27
|
+
$ phl-covid-testing
|
28
|
+
|
24
29
|
|
25
30
|
## Usage
|
26
31
|
|
@@ -46,12 +51,6 @@ Enter 'walk' to view all testing locations offering walk-up services, and 'drive
|
|
46
51
|
|
47
52
|
Enter 'all' to view a list of all testing locations.
|
48
53
|
|
49
|
-
## Development
|
50
|
-
|
51
|
-
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.
|
52
|
-
|
53
|
-
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).
|
54
|
-
|
55
54
|
## Contributing
|
56
55
|
|
57
56
|
Bug reports and pull requests are welcome on GitHub at https://github.com/bfirestone23/phl_covid_testing. 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.
|
data/bin/console
CHANGED
@@ -1,14 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require "
|
4
|
-
require "./lib/environment"
|
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
|
3
|
+
require "phl-covid-testing"
|
12
4
|
|
13
5
|
require "irb"
|
14
6
|
IRB.start(__FILE__)
|
data/bin/setup
CHANGED
data/lib/concerns/Displayable.rb
CHANGED
@@ -3,7 +3,9 @@ module Displayable
|
|
3
3
|
def display_all
|
4
4
|
PHLCovidTesting::TestingLocation.all.each.with_index(1) {|x, i| puts "\n#{i}. #{x.name}"}
|
5
5
|
all_sites = PHLCovidTesting::TestingLocation.all
|
6
|
-
puts "\nEnter a number to learn more about a testing location,
|
6
|
+
puts "\nEnter a number to learn more about a testing location,
|
7
|
+
'main' to return to the main menu,
|
8
|
+
or 'exit' to end the program.\n".colorize(:yellow)
|
7
9
|
get_input_all(all_sites)
|
8
10
|
end
|
9
11
|
|
data/lib/concerns/Findable.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
module Findable
|
2
2
|
module InstanceMethods
|
3
3
|
def search_by_zipcode(input)
|
4
|
-
results = PHLCovidTesting::TestingLocation.all.
|
5
|
-
|
6
|
-
end
|
4
|
+
results = PHLCovidTesting::TestingLocation.all.select do |location|
|
5
|
+
location.zipcode.to_s == input
|
6
|
+
end
|
7
7
|
|
8
8
|
if results.length == 0
|
9
9
|
puts "\nNo match found. Please try again.\n".colorize(:red)
|
@@ -14,15 +14,17 @@ module Findable
|
|
14
14
|
get_input_main_options
|
15
15
|
else
|
16
16
|
results.each.with_index(1) {|x, i| puts "\n#{i}. #{x.name}"}
|
17
|
-
puts "\nEnter another number to see location details,
|
17
|
+
puts "\nEnter another number to see location details,
|
18
|
+
'all' to see the full list of locations,
|
19
|
+
'main' to return to the main menu,
|
20
|
+
\nor 'exit' to end the program.\n".colorize(:yellow)
|
18
21
|
get_input_sub(results)
|
19
22
|
end
|
20
23
|
end
|
21
24
|
|
22
25
|
def search_by_name(input)
|
23
|
-
results =
|
24
|
-
|
25
|
-
results << x if x.name.downcase.include?(input)
|
26
|
+
results = PHLCovidTesting::TestingLocation.all.select do |location|
|
27
|
+
location.name.downcase[input.downcase]
|
26
28
|
end
|
27
29
|
|
28
30
|
if results.length == 0
|
@@ -34,7 +36,10 @@ module Findable
|
|
34
36
|
get_input_main_options
|
35
37
|
else
|
36
38
|
results.each.with_index(1) {|x, i| puts "\n#{i}. #{x.name}"}
|
37
|
-
puts "\nEnter another number to see location details,
|
39
|
+
puts "\nEnter another number to see location details,
|
40
|
+
'all' to see the full list of locations,
|
41
|
+
'main' to return to the main menu,
|
42
|
+
\nor 'exit' to end the program.\n".colorize(:yellow)
|
38
43
|
get_input_sub(results)
|
39
44
|
end
|
40
45
|
end
|
@@ -48,9 +53,8 @@ module Findable
|
|
48
53
|
end
|
49
54
|
|
50
55
|
def search_by_access(input)
|
51
|
-
results =
|
52
|
-
|
53
|
-
results << x if x.access_type.downcase.include?(input)
|
56
|
+
results = PHLCovidTesting::TestingLocation.all.select do |location|
|
57
|
+
location.access_type.downcase[input.downcase]
|
54
58
|
end
|
55
59
|
|
56
60
|
if results.length == 0
|
@@ -62,7 +66,10 @@ module Findable
|
|
62
66
|
get_input_main_options
|
63
67
|
else
|
64
68
|
results.each.with_index(1) {|x, i| puts "\n#{i}. #{x.name}"}
|
65
|
-
puts "\nEnter another number to see location details,
|
69
|
+
puts "\nEnter another number to see location details,
|
70
|
+
'all' to see the full list of locations,
|
71
|
+
'main' to return to the main menu,
|
72
|
+
\nor 'exit' to end the program.\n".colorize(:yellow)
|
66
73
|
get_input_sub(results)
|
67
74
|
end
|
68
75
|
end
|
data/lib/concerns/Inputable.rb
CHANGED
@@ -54,7 +54,10 @@ module Inputable
|
|
54
54
|
get_input_sub(result_array)
|
55
55
|
else
|
56
56
|
display_detail(result_array[input.to_i - 1])
|
57
|
-
puts "\nEnter another number to see location details,
|
57
|
+
puts "\nEnter another number to see location details,
|
58
|
+
'all' to see the full list,
|
59
|
+
'main' to return to the main menu,
|
60
|
+
\nor 'exit' to end the program.\n".colorize(:yellow)
|
58
61
|
get_input_sub(result_array)
|
59
62
|
end
|
60
63
|
end
|
@@ -75,7 +78,10 @@ module Inputable
|
|
75
78
|
display_all
|
76
79
|
else
|
77
80
|
display_detail(all_sites[input.to_i - 1])
|
78
|
-
puts "\nEnter another number to see location details,
|
81
|
+
puts "\nEnter another number to see location details,
|
82
|
+
'all' to see the full list again,
|
83
|
+
'main' to return to the main menu,
|
84
|
+
\nor 'exit' to end the program.\n".colorize(:yellow)
|
79
85
|
get_input_sub(all_sites)
|
80
86
|
end
|
81
87
|
end
|
data/lib/phl-covid-testing.rb
CHANGED
@@ -4,16 +4,5 @@ require 'open-uri'
|
|
4
4
|
require 'json'
|
5
5
|
require 'net/http'
|
6
6
|
|
7
|
-
require_relative "./concerns
|
8
|
-
require_relative "./
|
9
|
-
require_relative "./concerns/Inputable"
|
10
|
-
|
11
|
-
require_relative "./phl_covid_testing/version"
|
12
|
-
require_relative "./phl_covid_testing/cli"
|
13
|
-
require_relative "./phl_covid_testing/api"
|
14
|
-
require_relative "./phl_covid_testing/testing_location"
|
15
|
-
|
16
|
-
|
17
|
-
module PHLCovidTesting
|
18
|
-
class Error < StandardError; end
|
19
|
-
end
|
7
|
+
require_relative "./concerns"
|
8
|
+
require_relative "./phl_covid_testing"
|
@@ -5,7 +5,9 @@ class PHLCovidTesting::CLI
|
|
5
5
|
|
6
6
|
def call
|
7
7
|
create_sites
|
8
|
-
puts "\nWelcome to the Philadelphia COVID-19 Testing Finder
|
8
|
+
puts "\nWelcome to the Philadelphia COVID-19 Testing Finder!
|
9
|
+
\nAll data provided by OpenDataPhilly at:
|
10
|
+
https://www.opendataphilly.org/dataset/covid-19-test-sites".colorize(:yellow)
|
9
11
|
get_input_main_options
|
10
12
|
end
|
11
13
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phl-covid-testing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Firestone
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|