kovid 0.2.5 → 0.2.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/Gemfile.lock +1 -1
- data/README.md +5 -4
- data/lib/kovid/cli.rb +1 -1
- data/lib/kovid/request.rb +1 -1
- data/lib/kovid/tablelize.rb +1 -5
- data/lib/kovid/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdb8dfafa7894028f398f20f933b498c405d56bfc3ef4a5d7a339a83276a7d6d
|
4
|
+
data.tar.gz: 30eb0c8ce98ee989185cf81f8bba72f5c993bdc6a44a229b7ba2a9131e31b1ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdf67215185377506876eb06937b1e9592c4e29d984b1f8458296acc3d23f1ff6162f64864ebb430906a1e70e3005d80ff226fc51c7eb8ecb9a07164dd9019f1
|
7
|
+
data.tar.gz: d7d350545f13bd7ebee3987e0af9a3d23968f229ef7c87d70da5536bdcb5064525093988ab1f5ee16b7bf3b07d25c164368e742b5bcc075b71768d2a98b08b47
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,8 @@
|
|
4
4
|
|
5
5
|
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 some of you, I thought I'd build this to put the data right at our fingertips.
|
6
6
|
|
7
|
-
|
7
|
+
Code contribution and ideas welcome.
|
8
|
+
|
8
9
|
|
9
10
|
## ⚙️ Installation
|
10
11
|
|
@@ -24,7 +25,7 @@ You can run `kovid --help` to see the full list of available commands.
|
|
24
25
|
|
25
26
|
#### Commands Overview
|
26
27
|
😷 **Fetching**
|
27
|
-
* `kovid check COUNTRY`
|
28
|
+
* `kovid check COUNTRY` (`kovid country COUNTRY` works as well)
|
28
29
|
* `kovid check COUNTRY -f` OR `kovid check COUNTRY --full`
|
29
30
|
|
30
31
|
🇺🇸You can fetch US state-specific data 🇺🇸
|
@@ -37,8 +38,8 @@ You can run `kovid --help` to see the full list of available commands.
|
|
37
38
|
You can compare as many countries as you want.
|
38
39
|
|
39
40
|
😷 **History**
|
40
|
-
* `kovid history COUNTRY` (
|
41
|
-
* `kovid history COUNTRY N` (
|
41
|
+
* `kovid history COUNTRY` (full history)
|
42
|
+
* `kovid history COUNTRY N` (history in the last N days)
|
42
43
|
|
43
44
|
😷 **Total figures**
|
44
45
|
* `kovid cases`
|
data/lib/kovid/cli.rb
CHANGED
@@ -43,7 +43,7 @@ module Kovid
|
|
43
43
|
puts Kovid.cases
|
44
44
|
end
|
45
45
|
|
46
|
-
desc 'history COUNTRY', 'Return history of incidents of COUNTRY'
|
46
|
+
desc 'history COUNTRY or history COUNTRY N', 'Return history of incidents of COUNTRY (in the last N days)'
|
47
47
|
def history(*params)
|
48
48
|
if params.size == 2
|
49
49
|
puts Kovid.history(params.first, params.last)
|
data/lib/kovid/request.rb
CHANGED
@@ -58,7 +58,7 @@ module Kovid
|
|
58
58
|
private
|
59
59
|
|
60
60
|
def no_case_in(country)
|
61
|
-
rows = [['No reported cases OR
|
61
|
+
rows = [['No reported cases OR wrong spelling of country/state!']]
|
62
62
|
Terminal::Table.new headings: ["You checked: #{country.capitalize}"], rows: rows
|
63
63
|
end
|
64
64
|
|
data/lib/kovid/tablelize.rb
CHANGED
@@ -68,10 +68,6 @@ module Kovid
|
|
68
68
|
rows = []
|
69
69
|
rows << [state['cases'], state['todayCases'], state['deaths'], state['todayDeaths'], state['recovered'], state['active']]
|
70
70
|
|
71
|
-
puts
|
72
|
-
puts "‼️ Swap value of 'Recovered' for 'Active'. API scraper broke."
|
73
|
-
puts "‼️ So 'Active' is #{state['recovered']} and not #{state['active']}."
|
74
|
-
|
75
71
|
Terminal::Table.new(title: state['state'].upcase, headings: headings, rows: rows)
|
76
72
|
end
|
77
73
|
|
@@ -86,7 +82,7 @@ module Kovid
|
|
86
82
|
rows = []
|
87
83
|
|
88
84
|
data.each do |country|
|
89
|
-
rows << [country['country'], country['cases'], country['deaths'], country['recovered']]
|
85
|
+
rows << [country['country'].upcase, country['cases'], country['deaths'], country['recovered']]
|
90
86
|
end
|
91
87
|
|
92
88
|
Terminal::Table.new(headings: headings, rows: rows)
|
data/lib/kovid/version.rb
CHANGED