kovid 0.3.1 β†’ 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ced083e926d055a20281a468cc923214709badda8fa4a489bcbaa2a0a30aecfa
4
- data.tar.gz: 88f862b715a3ba136683511700f68edfa2c25716e373152b4151ebaaf717e184
3
+ metadata.gz: d4205df6f2e487214f535dda994a132264a9966b6c7527dec22f908f7aad76ed
4
+ data.tar.gz: 24b98f27cddcff29ed2a75d02be4af8d81fb2078d138890d75c9fb3541207bdf
5
5
  SHA512:
6
- metadata.gz: a265dcf1170bed905c522ae4aa038b2368561f9aed9c56c1f3e8dd8db89464a4c8ed576b215f94c1a2a4f9687e4e754f3c12ad1dd24a1a30c316c700e04eb93f
7
- data.tar.gz: 58780c213b132e4b5047386d8c03f3127a09ab51512d09892eaa1ea4ddeb08d507daaa335658746fd6579b85758a1d2eba2cc28906217ecbac6d4c41c37e3282
6
+ metadata.gz: 2c5e2f6b14c57dc707d81f5711ea6d2004300d253f8ba7afb0d453d14bd2f73210de62d73d2457caf7ed221ad8d27b192db2e511e749903bb25cd31bbfe3be02
7
+ data.tar.gz: 7fc35f3888744cbadcfe131e080ef56a3d9b0055f8437316f5286f364ab71391a6322df951c86c707ab43d3669b839aaed58fa3108913c36d6d252ce3759dca5
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kovid (0.3.0)
4
+ kovid (0.3.1)
5
5
  rainbow (~> 3.0)
6
6
  terminal-table (~> 1.8)
7
7
  thor (~> 1.0)
data/README.md CHANGED
@@ -1,59 +1,55 @@
1
1
  # 🦠 Kovid
2
2
 
3
- [gem]: https://rubygems.org/gems/kovid
4
-
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.
3
+ 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 so I thought I'd build this to provide info directly in the terminal. It's where some of us spend time more.
6
4
 
7
5
  Code contribution and ideas welcome.
8
6
 
9
7
 
10
8
  ## βš™οΈ Installation
11
9
 
12
- Before installing:
13
-
14
- ☝️ Wash your hands with soap and water for at least 20 seconds.
15
-
16
- ✌️ Run `gem install kovid`
10
+ To install:
17
11
 
18
- UPDATE often with `gem update kovid`
12
+ * ️ Wash your hands with soap and water for at least 20 seconds.
19
13
 
14
+ * Run `gem install kovid`.
20
15
 
16
+ It's recommended you update often with `gem update kovid`.
21
17
 
22
18
  ## βš’οΈ Usage
23
19
 
24
20
  You can run `kovid --help` to see the full list of available commands.
25
21
 
26
- **NOTE:** If you find it irritating to have to type `kovid state STATE`, `covid state STATE` works as well.
27
-
28
22
  #### Commands Overview
29
23
  😷 **Fetching**
30
- * `kovid check COUNTRY` (`kovid country COUNTRY` works as well)
31
- * `kovid check COUNTRY -f` OR `kovid check COUNTRY --full`
24
+ * `kovid check COUNTRY` OR `kovid country COUNTRY`.
25
+ * `kovid check COUNTRY -f` OR `kovid check COUNTRY --full`.
32
26
 
33
- πŸ‡ΊπŸ‡ΈYou can fetch US state-specific data πŸ‡ΊπŸ‡Έ
34
- * `kovid state STATE` OR `kovid state "STATE WITH SPACES"`
27
+ πŸ‡ΊπŸ‡ΈπŸ‡ΊπŸ‡ΈπŸ‡ΊπŸ‡Έ
28
+
29
+ You can fetch US state-specific data:
30
+ * `kovid state STATE` OR `kovid state "STATE NAME"`.
35
31
 
36
32
  😷 **Comparing**
37
- * `kovid compare COUNTRYA COUNTRYB` (sorts by cases DESC)
38
- * `kovid compare COUNTRYA COUNTRYB -f` OR `kovid compare COUNTRYA COUNTRYB --full` (sorts by cases DESC)
33
+ * `kovid compare FOO BAR` (sorts by cases DESC).
34
+ * `kovid compare FOO BAR -f` OR `kovid compare FOO BAR --full` (sorts by cases DESC).
35
+
36
+ Where `FOO` and `BAR` are different countries.
39
37
 
40
- You can compare as many countries as you want.
38
+ You can compare as many countries as you want; `kovid compare FOO BAR BAZ` OR `kovid compare FOO BAR BAZ -f`
41
39
 
42
40
  😷 **History**
43
- * `kovid history COUNTRY` (full history)
44
- * `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).
45
43
 
46
44
  😷 **Total figures**
47
- * `kovid cases`
48
-
45
+ * `kovid cases` (summary of reported incidents globally).
49
46
 
47
+ **NOTE:** If you find it irritating to have to type `kovid state STATE`, `covid state STATE` works as well.
50
48
 
51
49
  #### Commands Details
52
50
  To fetch basic data on a country run:
53
51
 
54
- `kovid check ghana`
55
-
56
- If the location contains spaces: `kovid check "Diamond Princess"`
52
+ `kovid check ghana`. If the location contains spaces: `kovid check "Diamond Princess"`
57
53
 
58
54
  ![kovid](https://i.gyazo.com/ab779c3fc838ac279bae5b9d6d10d617.png "Covid data.")
59
55
 
@@ -106,7 +102,7 @@ To install this gem onto your local machine, run `bundle exec rake install`.
106
102
 
107
103
  ## 🀲 Contributing
108
104
 
109
- There are multiple areas in this repo that can be improved or use some refactoring(there's a lot to be refactorted in fact!). For that reason, bug reports and pull requests are welcome! This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/siaw23/kovid/blob/master/CODE_OF_CONDUCT.md).
105
+ There are multiple areas in this repo that can be improved or use some refactoring(there's a lot to be refactored in fact!). For that reason, bug reports and pull requests are welcome! This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/siaw23/kovid/blob/master/CODE_OF_CONDUCT.md).
110
106
 
111
107
 
112
108
  ## πŸ”– License
@@ -14,6 +14,29 @@ Gem::Specification.new do |spec|
14
14
 
15
15
  spec.metadata["allowed_push_host"] = "https://rubygems.org/"
16
16
 
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = "https://github.com/siaw23/kovid"
19
+ spec.metadata["changelog_uri"] = "https://github.com/siaw23/kovid"
20
+
21
+ spec.add_dependency "thor", "~> 1.0"
22
+ spec.add_dependency "terminal-table", "~> 1.8"
23
+ spec.add_dependency "typhoeus", "~> 1.3"
24
+ spec.add_dependency "rainbow", "~> 3.0"
25
+
26
+ spec.add_development_dependency "pry"
27
+ spec.add_development_dependency "cucumber"
28
+ spec.add_development_dependency "aruba"
29
+ spec.add_development_dependency "simplecov"
30
+
31
+ # Specify which files should be added to the gem when it is released.
32
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
33
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
34
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
35
+ end
36
+ spec.bindir = "exe"
37
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
38
+ spec.require_paths = ["lib"]
39
+
17
40
  spec.post_install_message = %q{
18
41
  ============================================================================
19
42
  COVID-19 has devasted the world. But while we're fighting
@@ -31,27 +54,4 @@ Gem::Specification.new do |spec|
31
54
  Emmanuel Hayford.
32
55
  ============================================================================
33
56
  }
34
-
35
- spec.metadata["homepage_uri"] = spec.homepage
36
- spec.metadata["source_code_uri"] = "https://github.com/siaw23/kovid"
37
- spec.metadata["changelog_uri"] = "https://github.com/siaw23/kovid"
38
-
39
- # Specify which files should be added to the gem when it is released.
40
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
41
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
42
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
43
- end
44
- spec.bindir = "exe"
45
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
46
- spec.require_paths = ["lib"]
47
-
48
- spec.add_dependency "thor", "~> 1.0"
49
- spec.add_dependency "terminal-table", "~> 1.8"
50
- spec.add_dependency "typhoeus", "~> 1.3"
51
- spec.add_dependency "rainbow", "~> 3.0"
52
-
53
- spec.add_development_dependency "pry"
54
- spec.add_development_dependency "cucumber"
55
- spec.add_development_dependency "aruba"
56
- spec.add_development_dependency "simplecov"
57
57
  end
@@ -15,21 +15,13 @@ module Kovid
15
15
  desc 'check COUNTRY or check "COUNTRY NAME"', 'Returns reported data on provided country. eg: "kovid check "hong kong".'
16
16
  method_option :full, aliases: '-f'
17
17
  def check(name)
18
- if options[:full]
19
- puts Kovid.country_full(name)
20
- else
21
- puts Kovid.country(name)
22
- end
18
+ fetch_country_stats(name)
23
19
  end
24
20
 
25
21
  desc 'country COUNTRY or country "COUNTRY NAME"', 'Returns reported data on provided country. eg: "kovid country "hong kong".'
26
22
  method_option :full, aliases: '-f'
27
23
  def country(name)
28
- if options[:full]
29
- puts Kovid.country_full(name)
30
- else
31
- puts Kovid.country(name)
32
- end
24
+ fetch_country_stats(name)
33
25
  end
34
26
 
35
27
  desc 'state STATE', 'Return reported data on provided state.'
@@ -59,5 +51,15 @@ module Kovid
59
51
  puts Kovid.history(params.first, nil)
60
52
  end
61
53
  end
54
+
55
+ private
56
+
57
+ def fetch_country_stats(country)
58
+ if options[:full]
59
+ puts Kovid.country_full(country)
60
+ else
61
+ puts Kovid.country(country)
62
+ end
63
+ end
62
64
  end
63
65
  end
@@ -59,8 +59,8 @@ module Kovid
59
59
  private
60
60
 
61
61
  def no_case_in(country)
62
- rows = [['No reported cases OR wrong spelling of country/state!']]
63
- Terminal::Table.new headings: ["You checked: #{country.capitalize}"], rows: rows
62
+ rows = [["Wrong spelling of location/API has no info on #{country.upcase} at the moment."]]
63
+ Terminal::Table.new title: "You checked: #{country.upcase}", rows: rows
64
64
  end
65
65
 
66
66
  def fetch_countries(list)
@@ -28,7 +28,7 @@ module Kovid
28
28
  rows = [[data['cases'], data['deaths'], data['recovered']]]
29
29
 
30
30
  if iso = data['countryInfo']['iso2']
31
- Terminal::Table.new(title: "#{data['country'].upcase}", headings: headings, rows: rows)
31
+ Terminal::Table.new(title: data['country'].upcase.to_s, headings: headings, rows: rows)
32
32
  else
33
33
  Terminal::Table.new(title: data['country'].upcase, headings: headings, rows: rows)
34
34
  end
@@ -63,9 +63,9 @@ module Kovid
63
63
  # headings: headings,
64
64
  # rows: rows)
65
65
  # else
66
- Terminal::Table.new(title: data['country'].upcase,
67
- headings: headings,
68
- rows: rows)
66
+ Terminal::Table.new(title: data['country'].upcase,
67
+ headings: headings,
68
+ rows: rows)
69
69
  # end
70
70
  # TODO: Rafactor this
71
71
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kovid
4
- VERSION = '0.3.1'
4
+ VERSION = '0.3.2'
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.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emmanuel Hayford