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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b453d783796a94766fee3d796a41070ae4a1708c8a306a8b77ae60a912293a78
4
- data.tar.gz: 85ff2d518cd223ab521f6c1221151745a75269605288fcd5882f569871bbc0eb
3
+ metadata.gz: fdb8dfafa7894028f398f20f933b498c405d56bfc3ef4a5d7a339a83276a7d6d
4
+ data.tar.gz: 30eb0c8ce98ee989185cf81f8bba72f5c993bdc6a44a229b7ba2a9131e31b1ae
5
5
  SHA512:
6
- metadata.gz: 9d4d98b52a3eea164950abbb4639c97aacd95f3a3cce00f8d211c558ec5fc3f97bbb26bf2b97aab69ad95bbc897c77c9a65bd66a97e5f3021bb48adc23e007af
7
- data.tar.gz: 19f9ce8011ecf1383c71787fd9bc853d4fef3d3df2bbb6d63010e0a4bffa6708d895ed05547c4db6629f9fe84028dc614e0b9de5951b603f8fd2e162b7de6473
6
+ metadata.gz: bdf67215185377506876eb06937b1e9592c4e29d984b1f8458296acc3d23f1ff6162f64864ebb430906a1e70e3005d80ff226fc51c7eb8ecb9a07164dd9019f1
7
+ data.tar.gz: d7d350545f13bd7ebee3987e0af9a3d23968f229ef7c87d70da5536bdcb5064525093988ab1f5ee16b7bf3b07d25c164368e742b5bcc075b71768d2a98b08b47
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kovid (0.2.4)
4
+ kovid (0.2.5)
5
5
  colorize (~> 0.8)
6
6
  terminal-table (~> 1.8)
7
7
  thor (~> 1.0)
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
- Please feel free to contribute or suggest ideas!
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` (Full history)
41
- * `kovid history COUNTRY N` (History in the last N days)
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 check your spelling!']]
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
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kovid
4
- VERSION = '0.2.5'
4
+ VERSION = '0.2.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kovid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emmanuel Hayford