ke_counties 0.0.2 → 0.0.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/README.md +2 -0
- data/ke_counties.gemspec +6 -2
- data/lib/ke_counties/counties.rb +1 -25
- data/lib/ke_counties/version.rb +1 -1
- data/lib/ke_counties.rb +13 -9
- metadata +7 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eeecb8d2997b490e19aa4e11b7e3fd7fa616f9a954650ee3d123f71b530c9257
|
|
4
|
+
data.tar.gz: 3691770a5e074d572fcac4c686fec8a3c0d7a73bf8b3d02d3ca65e2e0a196ad0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c52af155aa92e0ae64d832f0a2726c8d2e9ef42d3439361e181b7cd23c982a9631eb575de1d41f047761b6456994c43c10d47767ec1eaa84222c6c95ba33c19c
|
|
7
|
+
data.tar.gz: 83c58e77b30c50671c3e83171d9ad427f09aaa99ba213754a95f33102fc445bf87cf71443479857a50c363398ba153c3c413ee89c7b62fc0f75c368625493533
|
data/README.md
CHANGED
data/ke_counties.gemspec
CHANGED
|
@@ -9,10 +9,14 @@ Gem::Specification.new do |s|
|
|
|
9
9
|
s.description = 'Collection of Kenya county names, their codes, capitals, abbreviations and provinces'
|
|
10
10
|
s.authors = ['cess']
|
|
11
11
|
s.email = 'cesswairimu@gmail.com'
|
|
12
|
-
#s.files = ["lib/ke_counties.rb"]
|
|
13
12
|
s.homepage = 'https://github.com/cesswairimu/ke_counties'
|
|
14
13
|
s.license = 'MIT'
|
|
15
|
-
|
|
14
|
+
s.metadata = {
|
|
15
|
+
'bug_tracker_uri' => 'https://github.com/cesswairimu/ke_counties/issues',
|
|
16
|
+
'documentation_uri' => 'https://github.com/cesswairimu/ke_counties/blob/main/README.md',
|
|
17
|
+
'source_code_uri' => 'https://github.com/cesswairimu/ke_counties/',
|
|
18
|
+
}
|
|
19
|
+
s.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
16
20
|
f.match(%r{^(test|spec|features)/})
|
|
17
21
|
end
|
|
18
22
|
|
data/lib/ke_counties/counties.rb
CHANGED
|
@@ -49,32 +49,8 @@ module KeCounties
|
|
|
49
49
|
'Nairobi' => { code: '047', abbrv: 'NRB', capital: 'Nairobi', province: 'Nairobi' }
|
|
50
50
|
}.freeze
|
|
51
51
|
|
|
52
|
-
def self.
|
|
52
|
+
def self.counties_hash
|
|
53
53
|
HASH
|
|
54
54
|
end
|
|
55
|
-
|
|
56
|
-
def self.names
|
|
57
|
-
HASH.keys
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
def self.code(cty)
|
|
61
|
-
HASH.dig(cty, :code)
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
def self.abbr(cty)
|
|
65
|
-
HASH.dig(cty, :abbrv)
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
def self.capital(cty)
|
|
69
|
-
HASH.dig(cty, :capital)
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
def self.province(cty)
|
|
73
|
-
HASH.dig(cty, :province)
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
def self.content
|
|
77
|
-
HASH.values
|
|
78
|
-
end
|
|
79
55
|
end
|
|
80
56
|
end
|
data/lib/ke_counties/version.rb
CHANGED
data/lib/ke_counties.rb
CHANGED
|
@@ -5,41 +5,45 @@ module KeCounties
|
|
|
5
5
|
class << self
|
|
6
6
|
|
|
7
7
|
def all
|
|
8
|
-
|
|
8
|
+
counties
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def names
|
|
12
|
-
counties.
|
|
12
|
+
counties.keys
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def code(cty)
|
|
16
|
-
counties.
|
|
16
|
+
counties.dig(cty, :code)
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def abbr(cty)
|
|
20
|
-
counties.
|
|
20
|
+
counties.dig(cty, :abbrv)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def capital(cty)
|
|
24
|
-
counties.
|
|
24
|
+
counties.dig(cty, :capital)
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def province(cty)
|
|
28
|
-
|
|
28
|
+
counties.dig(cty, :province)
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def codes
|
|
32
|
-
|
|
32
|
+
content.map{ |i| i[:code]}
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def abbrvs
|
|
36
|
-
|
|
36
|
+
content.map{ |i| i[:abbrv]}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def content
|
|
40
|
+
counties.values
|
|
37
41
|
end
|
|
38
42
|
|
|
39
43
|
private
|
|
40
44
|
|
|
41
45
|
def counties
|
|
42
|
-
KeCounties::Counties
|
|
46
|
+
KeCounties::Counties.counties_hash
|
|
43
47
|
end
|
|
44
48
|
end
|
|
45
49
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ke_counties
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- cess
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-04-
|
|
11
|
+
date: 2024-04-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec
|
|
@@ -73,7 +73,10 @@ files:
|
|
|
73
73
|
homepage: https://github.com/cesswairimu/ke_counties
|
|
74
74
|
licenses:
|
|
75
75
|
- MIT
|
|
76
|
-
metadata:
|
|
76
|
+
metadata:
|
|
77
|
+
bug_tracker_uri: https://github.com/cesswairimu/ke_counties/issues
|
|
78
|
+
documentation_uri: https://github.com/cesswairimu/ke_counties/blob/main/README.md
|
|
79
|
+
source_code_uri: https://github.com/cesswairimu/ke_counties/
|
|
77
80
|
post_install_message:
|
|
78
81
|
rdoc_options: []
|
|
79
82
|
require_paths:
|
|
@@ -89,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
89
92
|
- !ruby/object:Gem::Version
|
|
90
93
|
version: '0'
|
|
91
94
|
requirements: []
|
|
92
|
-
rubygems_version: 3.5
|
|
95
|
+
rubygems_version: 3.3.5
|
|
93
96
|
signing_key:
|
|
94
97
|
specification_version: 4
|
|
95
98
|
summary: Kenya Counties
|