kovid 0.2.8 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cd1f1e19abebe1dae49edae09eadff72fce4bda44b00947d6503aa5981dcafd7
4
- data.tar.gz: 2cdd6e795a5181450306300ce1af34c9387097938f31d2527d8110973029f2e6
3
+ metadata.gz: fa7abbc0a4d9eca2bbc865fd6740fdf7ae611ec5290cf96e6ce28248982f2f00
4
+ data.tar.gz: 51ad886114e16c076fca34b96e4bd92c30022eb0a5fcff2e4a20eb067f688e8b
5
5
  SHA512:
6
- metadata.gz: 201bdd6bdcf678f08ac3d700755f40e754befe0cc056d363990642d106242c298fa5944813acfe9c0b398460caf021d9d8415c142959337c19676e63e8892fd6
7
- data.tar.gz: 3a658b84af3b3071fd63c2d68581c4b657073d83987477ebed7d688d67cec4b8400004c294064c0a2a374950c39d1c288d730a0a8c4ea02bb5986beae16dc272
6
+ metadata.gz: 93ac6304f8fcbf01b071e0be5dbf39d8a717d2fb9449f5851abe60f2ece6b17d541828817cbe42ede1cec787018c32f000a410287ee5ed3987d74a41ddcf43f3
7
+ data.tar.gz: 5cbe6f55009cb9a8af32a16a98739cf6df669218e903684232e86a58372c29fdd70c5d3ae2102228449c4e85157e58f02c31971a9f158375e17ee06cd389864f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kovid (0.2.6)
4
+ kovid (0.3.0)
5
5
  rainbow (~> 3.0)
6
6
  terminal-table (~> 1.8)
7
7
  thor (~> 1.0)
data/lib/kovid/cli.rb CHANGED
@@ -21,8 +21,16 @@ module Kovid
21
21
  puts Kovid.country(name)
22
22
  end
23
23
  end
24
+
24
25
  desc 'country COUNTRY or country "COUNTRY NAME"', 'Returns reported data on provided country. eg: "kovid country "hong kong".'
25
- alias country check
26
+ method_option :full, aliases: '-f'
27
+ def country(name)
28
+ if options[:full]
29
+ puts Kovid.country_full(name)
30
+ else
31
+ puts Kovid.country(name)
32
+ end
33
+ end
26
34
 
27
35
  desc 'state STATE', 'Return reported data on provided state.'
28
36
  def state(state)
@@ -96,7 +96,7 @@ module Kovid
96
96
  rows = []
97
97
 
98
98
  data.each do |country|
99
- rows << [country['country'].upcase, country['cases'], country['deaths'], country['recovered']]
99
+ rows << [country['country'].upcase, comma_delimit(country['cases']), comma_delimit(country['deaths']), comma_delimit(country['recovered'])]
100
100
  end
101
101
 
102
102
  Terminal::Table.new(headings: headings, rows: rows)
@@ -119,13 +119,13 @@ module Kovid
119
119
  data.each do |country|
120
120
  rows << [
121
121
  country['country'],
122
- country['cases'],
123
- country['deaths'],
124
- country['recovered'],
122
+ comma_delimit(country['cases']),
123
+ comma_delimit(country['deaths']),
124
+ comma_delimit(country['recovered']),
125
125
  check_if_positve(country['todayCases']),
126
126
  check_if_positve(country['todayDeaths']),
127
- country['critical'],
128
- country['casesPerOneMillion']
127
+ comma_delimit(country['critical']),
128
+ comma_delimit(country['casesPerOneMillion'])
129
129
  ]
130
130
  end
131
131
 
@@ -134,7 +134,13 @@ module Kovid
134
134
 
135
135
  def cases(cases)
136
136
  headings = CASES_DEATHS_RECOVERED
137
- rows = [[cases['cases'], cases['deaths'], cases['recovered']]]
137
+ rows = [
138
+ [
139
+ comma_delimit(cases['cases']),
140
+ comma_delimit(cases['deaths']),
141
+ comma_delimit(cases['recovered'])
142
+ ]
143
+ ]
138
144
 
139
145
  Terminal::Table.new(title: 'Total Number of Incidents Worldwide'.upcase, headings: headings, rows: rows)
140
146
  end
@@ -180,7 +186,7 @@ module Kovid
180
186
  end
181
187
 
182
188
  def check_if_positve(num)
183
- num.to_i.positive? ? "+#{num}" : num.to_s
189
+ num.to_i.positive? ? "+#{comma_delimit(num)}" : comma_delimit(num).to_s
184
190
  end
185
191
 
186
192
  def country_emoji(iso)
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.8'
4
+ VERSION = '0.3.0'
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.8
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emmanuel Hayford