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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '07796add8d36511f373a1ed6268fa95cc164577d9fb19726e592f6f4b33ecb2c'
4
- data.tar.gz: eee233d00944280fd37ae88c06f78f7be419225e102d135107ad9ecae4aee355
3
+ metadata.gz: 8668b8285c3111972349d7c38b95be0dd3cc0e801485f96c0d3b6f225b09f0f3
4
+ data.tar.gz: 70822cf4c46cee7358df27cd6cd30c928a714304b0e10ca2f3a74e6dcb3868aa
5
5
  SHA512:
6
- metadata.gz: 0e9f6750488e1a05e7c9ff620497c7c7e4376412c6da31acf6d6afce8d559b0b0de032eeae6d1f1b72e156a7de57581186e42fa1b769c0b0acd4e0eba78e5802
7
- data.tar.gz: 5c0408ad61b9c7bf48c664aa301be11c7bd998be2ea82ba303371cb8ef09325e672b73b866144ef1d00147d4e1ea167c168a169dc1a87335785884b74cede305
6
+ metadata.gz: 5376e2689957f74daa8e5801cf7aadbbb4ea0d9e1c349061874282c573ac91f8b5e152a6e7dc7d087384940c5c38921c02e71648caf720b9af8852194039f7a3
7
+ data.tar.gz: 9dfcbded2200f24163080712ed5a3c6cc6534c4f67350180393ee5a92253e376ef0f0c7348477bb61196a50558c3175d43f4f0ba2dad72803e2d4a8eff769ed1
@@ -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
@@ -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 [`[e99c9ec]`](https://github.com/WolfAtheneum/covid19/commit/e99c9ec9a37d38b05ec1b632f0cb07e68788a19a) [`[TGWolf]`](https://github.com/TGWolf)
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
 
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -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).round(2).to_s + ' %'
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).round(2)
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'].to_s + ' %']
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
@@ -1,3 +1,3 @@
1
1
  class Covid19
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
@@ -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).round(2).to_s + ' %'
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).round(2)
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'].to_s + ' %']
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.2
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-23 00:00:00.000000000 Z
11
+ date: 2020-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler