kovid 0.1.5 → 0.1.6

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: dc492b1db4fbad2610746bda15de7f45ac939c0c57a0a1f2dd8d82e4c3c3e81b
4
- data.tar.gz: 869d6aad3ae168466b2afdc1868f201ec225385ad4f06f369674081f3f310893
3
+ metadata.gz: 29a085cad77bc261e7c65efbddbff9af592c328e2e980ce785a868ce1f7dd88d
4
+ data.tar.gz: 310c0a2f5139cc26fa0a20159d8fb5ad3b141722f4e28360e67ad89afd9a6763
5
5
  SHA512:
6
- metadata.gz: af38d3e6afe8f676e063d09e61469c484c81ba08c5c8e10db290456085e0988006ca6c9306c3e418eee34fed2fdbf2b6f45f7d4f56946b59e765018a9a18d373
7
- data.tar.gz: beaf2002b291bfdeb333284f28f2ec89ec18fb3f9c9b5e89e45e9244ac5d3b3d6255c3be8cb82a7d7e37b8d0ffc46cbea95ab6b17aba000bae5984947a5eeaee
6
+ metadata.gz: 4225dbced44ac4a1c6cde1c5aea535a626f9df380e06cc2960c8c9c2be104508ca5b8818b44470f0b1af605714a168e2ef3ad73cbd5524fe80bc455558b85c75
7
+ data.tar.gz: b890a173fca7a3c34f103954d6f3f97c43e286d4b99dc57dffadbb772dd4dd487743bf81db32e36b938534698465a7fe51d6995d480407b8a7edecd22c081f4b
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # 🦠 Kovid
2
2
 
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 and since I work mostly in the terminal, like most of you, I thought I'd build this to literally 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 and since I work mostly in the terminal, like most of you, I thought I'd build this to put the data right at our fingertips.
4
4
 
5
5
 
6
6
 
@@ -19,21 +19,36 @@ After installing:
19
19
 
20
20
  ☝️ Avoid touching your eyes, nose and mouth with unwashed hands later.
21
21
 
22
- ✌️ Disinfect your phones, keys, door knobs and anything you touch often than you should.
22
+ ✌️ Disinfect your phones, keys, doorknobs and anything you touch often than you should.
23
23
 
24
24
 
25
25
 
26
26
  ## ⚒️ Usage
27
27
 
28
+ #### Commands Overview
29
+ **Fetching**
30
+ * `kovid check ghana`.
31
+ * `kovid check ghana -f` OR `kovid check ghana --full`
32
+
33
+ **Comparing**
34
+ * `kovid compare ghana poland`
35
+ * `kovid compare ghana poland -f` OR `kovid compare ghana poland --full`
36
+
37
+ **Total figures**
38
+ * `kovid cases`
39
+
40
+
41
+
42
+ #### Commands Details
28
43
  To fetch basic data on a country run:
29
44
 
30
- `kovid check ghana`.
45
+ `kovid check ghana`
31
46
 
32
47
  If the location contains spaces: `kovid check "Diamond Princess"`
33
48
 
34
49
  ![kovid](https://i.gyazo.com/ca57d9250c7523a921d0d7e1104716be.png "Covid data.")
35
50
 
36
- For a full table info on a country:
51
+ For full table info on a country:
37
52
 
38
53
  `kovid check ghana -f` OR `kovid check ghana --full`
39
54
 
@@ -70,7 +85,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/siaw23
70
85
 
71
86
  ## 🔖 License
72
87
 
73
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
88
+ The gem is available as open-source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
74
89
 
75
90
  ## ❤️ Code of Conduct
76
91
 
data/{exe → bin}/kovid RENAMED
File without changes
data/kovid.gemspec CHANGED
@@ -23,8 +23,8 @@ Gem::Specification.new do |spec|
23
23
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
24
24
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
25
  end
26
- spec.bindir = "exe"
27
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
+ spec.bindir = "bin"
27
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
29
29
 
30
30
  spec.add_dependency "thor"
data/lib/kovid/request.rb CHANGED
@@ -11,11 +11,26 @@ module Kovid
11
11
  class << self
12
12
  require 'pry'
13
13
  def by_country(name)
14
- path = "/countries/#{name}"
15
- fetch_url = BASE_URL + path
14
+ # path = "/countries/#{name}"
15
+ # fetch_url = BASE_URL + path
16
16
 
17
- response ||= JSON.parse(Typhoeus.get(fetch_url.to_s, cache_ttl: 3600).response_body)
18
- Kovid::Tablelize.country_table(response)
17
+ # binding.pry
18
+ # response ||= JSON.parse(Typhoeus.get(fetch_url.to_s, cache_ttl: 3600).response_body)
19
+ # Kovid::Tablelize.country_table(response)
20
+
21
+ begin
22
+ path = "/countries/#{name}"
23
+ fetch_url = BASE_URL + path
24
+
25
+ response ||= JSON.parse(Typhoeus.get(fetch_url.to_s, cache_ttl: 3600).response_body)
26
+ Kovid::Tablelize.country_table(response)
27
+
28
+ rescue JSON::ParserError
29
+ rows = []
30
+ rows << ["Thankfully there are no reported cases in #{name.capitalize}!"]
31
+ table = Terminal::Table.new :headings => ["#{name}",], :rows => rows
32
+ puts table
33
+ end
19
34
  end
20
35
 
21
36
  def by_country_full(name)
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.1.5'
4
+ VERSION = '0.1.6'
5
5
  end
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kovid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emmanuel Hayford
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2020-03-21 00:00:00.000000000 Z
12
12
  dependencies:
@@ -98,7 +98,9 @@ description: A CLI tool to fetch and compare the 2019 coronavirus pandemic numbe
98
98
  email:
99
99
  - siawmensah@gmail.com
100
100
  executables:
101
+ - console
101
102
  - kovid
103
+ - setup
102
104
  extensions: []
103
105
  extra_rdoc_files: []
104
106
  files:
@@ -112,8 +114,8 @@ files:
112
114
  - README.md
113
115
  - Rakefile
114
116
  - bin/console
117
+ - bin/kovid
115
118
  - bin/setup
116
- - exe/kovid
117
119
  - kovid.gemspec
118
120
  - lib/kovid.rb
119
121
  - lib/kovid/cli.rb