kovid 0.6.1 → 0.6.2

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: b34798e9212d718e441ff0185598d028662b4e13994ebe7a7354cd0a22a7aef5
4
- data.tar.gz: 2e23bc917e77996ad1b848aed6340cdb25123ba5bfd976a8d5407c347f05ac25
3
+ metadata.gz: ba5ca0fe0f0b4f13d4ae3fa0796df0fdda1bd0029c8e1f908a4ac7b79766f928
4
+ data.tar.gz: 11328de6b6c9e1a4f4bad7bb42d65ed3575e0efc7677dc4aa916bfe1ba4b5000
5
5
  SHA512:
6
- metadata.gz: 0c2ce46118ef92380c1c5bd1b4faba1b1e8893225161c7e3c2fe684298db3d830eda22f13854f8a69e8aef6d0ad581cca9b1ee40db8f3ab79bc410db1fce29f7
7
- data.tar.gz: 9099b7a5e109c567ab7a0b707d991ad53be609ff918b02b6d56bcc45516c1489a9785e931c2814036a415edab69c0f24826bdd9f18ec6ccc6a438dae85c89e86
6
+ metadata.gz: d3ad984c1cef60884ec75512763f759eca655c09d69d7db0a237a015fc78b05e2a2059fd84441d60aa090a08452df388c51cd10de51cf2ce52c2cce8c71da1b6
7
+ data.tar.gz: 9277e293560db60a004a4f388789a790d5da74a3a650e39b21a6eca0f01e1431c54ad09a66cf467cf22a3f57c2dce94cba121185ab6e87096410d29a3e1586bf
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kovid (0.6.0)
4
+ kovid (0.6.1)
5
5
  ascii_charts (~> 0.9.1)
6
6
  rainbow (~> 3.0)
7
7
  terminal-table (~> 1.8)
data/README.md CHANGED
@@ -44,7 +44,7 @@ You can get continental information with the following commands:
44
44
 
45
45
  You can fetch US state-specific data:
46
46
  * `kovid state STATE` OR `kovid state "STATE NAME"`.
47
- * `kovid aus` for data on all US states.
47
+ * `kovid states --all` or `kovid states -a` for data on all US states.
48
48
 
49
49
  Provinces
50
50
 
@@ -63,12 +63,12 @@ module Kovid
63
63
  data_source
64
64
  end
65
65
 
66
- desc 'all_us_states', 'Returns full comparison table for all US states'
67
- def all_us_states
66
+ desc 'states -a', 'Returns full comparison table for all US states'
67
+ method_option :all, aliases: '-a'
68
+ def states
68
69
  puts Kovid.all_us_states
69
70
  data_source
70
71
  end
71
- map aus: :all_us_states
72
72
 
73
73
  desc 'world', 'Returns total number of cases, deaths and recoveries.'
74
74
  def world
@@ -18,4 +18,8 @@ class String
18
18
  def paint_yellow
19
19
  Rainbow(self).yellow.bg(:black).bold
20
20
  end
21
+
22
+ def paint_highlight
23
+ Rainbow(self).underline
24
+ end
21
25
  end
@@ -211,15 +211,26 @@ module Kovid
211
211
  end
212
212
 
213
213
  def compare_us_states(data)
214
- rows = data.map do |state|
215
- [
216
- state.fetch('state').upcase,
217
- comma_delimit(state.fetch('cases')),
218
- check_if_positve(state['todayCases']),
219
- comma_delimit(state['deaths']),
220
- check_if_positve(state['todayDeaths']),
221
- comma_delimit(state.fetch('active'))
222
- ]
214
+ rows = data.map.with_index do |state, index|
215
+ if index.odd?
216
+ [
217
+ state.fetch('state').upcase,
218
+ comma_delimit(state.fetch('cases')),
219
+ check_if_positve(state['todayCases']),
220
+ comma_delimit(state['deaths']),
221
+ check_if_positve(state['todayDeaths']),
222
+ comma_delimit(state.fetch('active'))
223
+ ]
224
+ else
225
+ [
226
+ state.fetch('state').upcase.paint_highlight,
227
+ comma_delimit(state.fetch('cases')).paint_highlight,
228
+ check_if_positve(state['todayCases']).paint_highlight,
229
+ comma_delimit(state['deaths']).paint_highlight,
230
+ check_if_positve(state['todayDeaths']).paint_highlight,
231
+ comma_delimit(state.fetch('active')).paint_highlight
232
+ ]
233
+ end
223
234
  end
224
235
 
225
236
  align_columns(:compare_us_states,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kovid
4
- VERSION = '0.6.1'
4
+ VERSION = '0.6.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kovid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emmanuel Hayford
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-05 00:00:00.000000000 Z
11
+ date: 2020-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ascii_charts