covid19 0.1.2 → 0.1.3
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/.rubocop.yml +9 -0
- data/CHANGELOG.md +7 -1
- data/VERSION.txt +1 -1
- data/exe/covid19 +6 -5
- data/lib/covid19/version.rb +1 -1
- data/testing/covid19 +6 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8668b8285c3111972349d7c38b95be0dd3cc0e801485f96c0d3b6f225b09f0f3
|
4
|
+
data.tar.gz: 70822cf4c46cee7358df27cd6cd30c928a714304b0e10ca2f3a74e6dcb3868aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5376e2689957f74daa8e5801cf7aadbbb4ea0d9e1c349061874282c573ac91f8b5e152a6e7dc7d087384940c5c38921c02e71648caf720b9af8852194039f7a3
|
7
|
+
data.tar.gz: 9dfcbded2200f24163080712ed5a3c6cc6534c4f67350180393ee5a92253e376ef0f0c7348477bb61196a50558c3175d43f4f0ba2dad72803e2d4a8eff769ed1
|
data/.rubocop.yml
CHANGED
@@ -28,6 +28,12 @@ Metrics/MethodLength:
|
|
28
28
|
Metrics/PerceivedComplexity:
|
29
29
|
Enabled: false
|
30
30
|
|
31
|
+
Style/FormatString:
|
32
|
+
Enabled: false
|
33
|
+
|
34
|
+
Style/FormatStringToken:
|
35
|
+
Enabled: false
|
36
|
+
|
31
37
|
Style/FrozenStringLiteralComment:
|
32
38
|
Enabled: false
|
33
39
|
|
@@ -58,5 +64,8 @@ Style/RedundantReturn:
|
|
58
64
|
Style/SpecialGlobalVars:
|
59
65
|
Enabled: false
|
60
66
|
|
67
|
+
Style/StringLiterals:
|
68
|
+
Enabled: false
|
69
|
+
|
61
70
|
Style/WordArray:
|
62
71
|
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -5,11 +5,17 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
|
6
6
|
This changelog was automatically generated using [Caretaker](https://github.com/WolfAtheneum/covid19) by [Wolf Software](https://github.com/WolfSoftware)
|
7
7
|
|
8
|
+
### [v0.1.3](https://github.com/WolfAtheneum/covid19/compare/v0.1.2...v0.1.3)
|
9
|
+
|
10
|
+
> Released on March, 26th 2020
|
11
|
+
|
12
|
+
- Minor tweak to the output death rate percentage [`[b2181fa]`](https://github.com/WolfAtheneum/covid19/commit/b2181fa254c9d049cbde07d03b2646b4646c4782) [`[TGWolf]`](https://github.com/TGWolf)
|
13
|
+
|
8
14
|
### [v0.1.2](https://github.com/WolfAtheneum/covid19/compare/v0.1.0...v0.1.2)
|
9
15
|
|
10
16
|
> Released on March, 23rd 2020
|
11
17
|
|
12
|
-
- Add the new code to the binary as it was only added to the testing binary [`[
|
18
|
+
- Add the new code to the binary as it was only added to the testing binary [`[dc3cce4]`](https://github.com/WolfAtheneum/covid19/commit/dc3cce4d8e0d61efea2a49271bba43b17ca42103) [`[TGWolf]`](https://github.com/TGWolf)
|
13
19
|
|
14
20
|
- Add a death rate as a percentage of confirmed cases [`[348efbf]`](https://github.com/WolfAtheneum/covid19/commit/348efbf2c1ca5bdffbd369595c670acc7cadeaf8) [`[TGWolf]`](https://github.com/TGWolf)
|
15
21
|
|
data/VERSION.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/exe/covid19
CHANGED
@@ -21,9 +21,9 @@ def format_latest_stats(results)
|
|
21
21
|
confirmed = results['latest']['confirmed']
|
22
22
|
deaths = results['latest']['deaths']
|
23
23
|
|
24
|
-
percentage = ((deaths.to_f / confirmed) * 100)
|
24
|
+
percentage = ((deaths.to_f / confirmed) * 100)
|
25
25
|
|
26
|
-
formatted << ['death rate', percentage]
|
26
|
+
formatted << ['death rate', "%.2f%%" % percentage]
|
27
27
|
|
28
28
|
puts Terminal::Table.new :title => 'Latest Global Statistics', :rows => formatted, :style => { :width => 80 }
|
29
29
|
end
|
@@ -48,7 +48,7 @@ def format_latest_country_stats(results, options = {})
|
|
48
48
|
deaths = item['latest']['deaths']
|
49
49
|
recovered = item['latest']['recovered']
|
50
50
|
end
|
51
|
-
percentage = ((deaths.to_f / confirmed) * 100)
|
51
|
+
percentage = ((deaths.to_f / confirmed) * 100)
|
52
52
|
|
53
53
|
percentage = 0 if percentage.nil?
|
54
54
|
|
@@ -68,15 +68,16 @@ def format_latest_country_stats(results, options = {})
|
|
68
68
|
|
69
69
|
formatted = []
|
70
70
|
sorted.each do |item|
|
71
|
-
formatted << [item['country'], item['country_code'], item['id'], item['confirmed'], item['deaths'], item['recovered'], item['death_rate']
|
71
|
+
formatted << [item['country'], item['country_code'], item['id'], item['confirmed'], item['deaths'], item['recovered'], "%.2f" % item['death_rate']]
|
72
72
|
end
|
73
73
|
|
74
|
-
table = Terminal::Table.new :title => 'Latest Statistics by Country', :headings => ['Country', 'Code', 'ID', 'Confirmed', 'Deaths', 'Recovered', 'Death Rate'], :rows => formatted, :style => { :padding_left => 2, :padding_right => 2 }
|
74
|
+
table = Terminal::Table.new :title => 'Latest Statistics by Country', :headings => ['Country', 'Code', 'ID', 'Confirmed', 'Deaths', 'Recovered', 'Death Rate (%)'], :rows => formatted, :style => { :padding_left => 2, :padding_right => 2 }
|
75
75
|
table.align_column(1, :center)
|
76
76
|
table.align_column(2, :right)
|
77
77
|
table.align_column(3, :right)
|
78
78
|
table.align_column(4, :right)
|
79
79
|
table.align_column(5, :right)
|
80
|
+
table.align_column(6, :right)
|
80
81
|
|
81
82
|
puts table
|
82
83
|
end
|
data/lib/covid19/version.rb
CHANGED
data/testing/covid19
CHANGED
@@ -22,9 +22,9 @@ def format_latest_stats(results)
|
|
22
22
|
confirmed = results['latest']['confirmed']
|
23
23
|
deaths = results['latest']['deaths']
|
24
24
|
|
25
|
-
percentage = ((deaths.to_f / confirmed) * 100)
|
25
|
+
percentage = ((deaths.to_f / confirmed) * 100)
|
26
26
|
|
27
|
-
formatted << ['death rate', percentage]
|
27
|
+
formatted << ['death rate', "%.2f%%" % percentage]
|
28
28
|
|
29
29
|
puts Terminal::Table.new :title => 'Latest Global Statistics', :rows => formatted, :style => { :width => 80 }
|
30
30
|
end
|
@@ -49,7 +49,7 @@ def format_latest_country_stats(results, options = {})
|
|
49
49
|
deaths = item['latest']['deaths']
|
50
50
|
recovered = item['latest']['recovered']
|
51
51
|
end
|
52
|
-
percentage = ((deaths.to_f / confirmed) * 100)
|
52
|
+
percentage = ((deaths.to_f / confirmed) * 100)
|
53
53
|
|
54
54
|
percentage = 0 if percentage.nil?
|
55
55
|
|
@@ -69,15 +69,16 @@ def format_latest_country_stats(results, options = {})
|
|
69
69
|
|
70
70
|
formatted = []
|
71
71
|
sorted.each do |item|
|
72
|
-
formatted << [item['country'], item['country_code'], item['id'], item['confirmed'], item['deaths'], item['recovered'], item['death_rate']
|
72
|
+
formatted << [item['country'], item['country_code'], item['id'], item['confirmed'], item['deaths'], item['recovered'], "%.2f" % item['death_rate']]
|
73
73
|
end
|
74
74
|
|
75
|
-
table = Terminal::Table.new :title => 'Latest Statistics by Country', :headings => ['Country', 'Code', 'ID', 'Confirmed', 'Deaths', 'Recovered', 'Death Rate'], :rows => formatted, :style => { :padding_left => 2, :padding_right => 2 }
|
75
|
+
table = Terminal::Table.new :title => 'Latest Statistics by Country', :headings => ['Country', 'Code', 'ID', 'Confirmed', 'Deaths', 'Recovered', 'Death Rate (%)'], :rows => formatted, :style => { :padding_left => 2, :padding_right => 2 }
|
76
76
|
table.align_column(1, :center)
|
77
77
|
table.align_column(2, :right)
|
78
78
|
table.align_column(3, :right)
|
79
79
|
table.align_column(4, :right)
|
80
80
|
table.align_column(5, :right)
|
81
|
+
table.align_column(6, :right)
|
81
82
|
|
82
83
|
puts table
|
83
84
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: covid19
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Gurney aka Wolf
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|