kovid 0.1.5 → 0.1.6
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 +20 -5
- data/{exe → bin}/kovid +0 -0
- data/kovid.gemspec +2 -2
- data/lib/kovid/request.rb +19 -4
- data/lib/kovid/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29a085cad77bc261e7c65efbddbff9af592c328e2e980ce785a868ce1f7dd88d
|
4
|
+
data.tar.gz: 310c0a2f5139cc26fa0a20159d8fb5ad3b141722f4e28360e67ad89afd9a6763
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4225dbced44ac4a1c6cde1c5aea535a626f9df380e06cc2960c8c9c2be104508ca5b8818b44470f0b1af605714a168e2ef3ad73cbd5524fe80bc455558b85c75
|
7
|
+
data.tar.gz: b890a173fca7a3c34f103954d6f3f97c43e286d4b99dc57dffadbb772dd4dd487743bf81db32e36b938534698465a7fe51d6995d480407b8a7edecd22c081f4b
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# 🦠 Kovid
|
2
2
|
|
3
|
-
Kovid is a small CLI app to fetch data surrounding the coronavirus pandemic of 2019. I found myself checking [Wikipedia](https://en.wikipedia.org/wiki/2019%E2%80%9320_coronavirus_pandemic) constantly for information and since I work mostly in the terminal, like most of you, I thought I'd build this to
|
3
|
+
Kovid is a small CLI app to fetch data surrounding the coronavirus pandemic of 2019. I found myself checking [Wikipedia](https://en.wikipedia.org/wiki/2019%E2%80%9320_coronavirus_pandemic) constantly for information and since I work mostly in the terminal, like most of you, I thought I'd build this to put the data right at our fingertips.
|
4
4
|
|
5
5
|
|
6
6
|
|
@@ -19,21 +19,36 @@ After installing:
|
|
19
19
|
|
20
20
|
☝️ Avoid touching your eyes, nose and mouth with unwashed hands later.
|
21
21
|
|
22
|
-
✌️ Disinfect your phones, keys,
|
22
|
+
✌️ Disinfect your phones, keys, doorknobs and anything you touch often than you should.
|
23
23
|
|
24
24
|
|
25
25
|
|
26
26
|
## ⚒️ Usage
|
27
27
|
|
28
|
+
#### Commands Overview
|
29
|
+
**Fetching**
|
30
|
+
* `kovid check ghana`.
|
31
|
+
* `kovid check ghana -f` OR `kovid check ghana --full`
|
32
|
+
|
33
|
+
**Comparing**
|
34
|
+
* `kovid compare ghana poland`
|
35
|
+
* `kovid compare ghana poland -f` OR `kovid compare ghana poland --full`
|
36
|
+
|
37
|
+
**Total figures**
|
38
|
+
* `kovid cases`
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
#### Commands Details
|
28
43
|
To fetch basic data on a country run:
|
29
44
|
|
30
|
-
`kovid check ghana
|
45
|
+
`kovid check ghana`
|
31
46
|
|
32
47
|
If the location contains spaces: `kovid check "Diamond Princess"`
|
33
48
|
|
34
49
|

|
35
50
|
|
36
|
-
For
|
51
|
+
For full table info on a country:
|
37
52
|
|
38
53
|
`kovid check ghana -f` OR `kovid check ghana --full`
|
39
54
|
|
@@ -70,7 +85,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/siaw23
|
|
70
85
|
|
71
86
|
## 🔖 License
|
72
87
|
|
73
|
-
The gem is available as open
|
88
|
+
The gem is available as open-source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
74
89
|
|
75
90
|
## ❤️ Code of Conduct
|
76
91
|
|
data/{exe → bin}/kovid
RENAMED
File without changes
|
data/kovid.gemspec
CHANGED
@@ -23,8 +23,8 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
24
24
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
25
|
end
|
26
|
-
spec.bindir = "
|
27
|
-
spec.executables = spec.files.grep(%r{^
|
26
|
+
spec.bindir = "bin"
|
27
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
|
30
30
|
spec.add_dependency "thor"
|
data/lib/kovid/request.rb
CHANGED
@@ -11,11 +11,26 @@ module Kovid
|
|
11
11
|
class << self
|
12
12
|
require 'pry'
|
13
13
|
def by_country(name)
|
14
|
-
path = "/countries/#{name}"
|
15
|
-
fetch_url = BASE_URL + path
|
14
|
+
# path = "/countries/#{name}"
|
15
|
+
# fetch_url = BASE_URL + path
|
16
16
|
|
17
|
-
|
18
|
-
|
17
|
+
# binding.pry
|
18
|
+
# response ||= JSON.parse(Typhoeus.get(fetch_url.to_s, cache_ttl: 3600).response_body)
|
19
|
+
# Kovid::Tablelize.country_table(response)
|
20
|
+
|
21
|
+
begin
|
22
|
+
path = "/countries/#{name}"
|
23
|
+
fetch_url = BASE_URL + path
|
24
|
+
|
25
|
+
response ||= JSON.parse(Typhoeus.get(fetch_url.to_s, cache_ttl: 3600).response_body)
|
26
|
+
Kovid::Tablelize.country_table(response)
|
27
|
+
|
28
|
+
rescue JSON::ParserError
|
29
|
+
rows = []
|
30
|
+
rows << ["Thankfully there are no reported cases in #{name.capitalize}!"]
|
31
|
+
table = Terminal::Table.new :headings => ["#{name}",], :rows => rows
|
32
|
+
puts table
|
33
|
+
end
|
19
34
|
end
|
20
35
|
|
21
36
|
def by_country_full(name)
|
data/lib/kovid/version.rb
CHANGED
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kovid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emmanuel Hayford
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2020-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
@@ -98,7 +98,9 @@ description: A CLI tool to fetch and compare the 2019 coronavirus pandemic numbe
|
|
98
98
|
email:
|
99
99
|
- siawmensah@gmail.com
|
100
100
|
executables:
|
101
|
+
- console
|
101
102
|
- kovid
|
103
|
+
- setup
|
102
104
|
extensions: []
|
103
105
|
extra_rdoc_files: []
|
104
106
|
files:
|
@@ -112,8 +114,8 @@ files:
|
|
112
114
|
- README.md
|
113
115
|
- Rakefile
|
114
116
|
- bin/console
|
117
|
+
- bin/kovid
|
115
118
|
- bin/setup
|
116
|
-
- exe/kovid
|
117
119
|
- kovid.gemspec
|
118
120
|
- lib/kovid.rb
|
119
121
|
- lib/kovid/cli.rb
|