ke_counties 0.0.2 → 0.0.3

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: cf99fa284a462a4a183fee4c1e3c44ed17818369d8ae108cc36d99c7f2ced9b1
4
- data.tar.gz: 1d955b1c1955202ece741df81f59dc3842b35b15858af45736119313b0dce3e5
3
+ metadata.gz: eeecb8d2997b490e19aa4e11b7e3fd7fa616f9a954650ee3d123f71b530c9257
4
+ data.tar.gz: 3691770a5e074d572fcac4c686fec8a3c0d7a73bf8b3d02d3ca65e2e0a196ad0
5
5
  SHA512:
6
- metadata.gz: 8965f478c15541c531299ef11f0242bdebfaa59fa75f3e3dfcfceab0aea287e05ca0f20bfb77a94e5a109aa9c884f57327a5a9b04865826c1fc93529a54c5859
7
- data.tar.gz: ede6c85e6c5ddfb0134c17a5efb5a7da4a858aba8c85b87161ae7436d529c1e853ec3086ad930c06219b141c92cda493ced0336b157d724584341468f2a2a35c
6
+ metadata.gz: c52af155aa92e0ae64d832f0a2726c8d2e9ef42d3439361e181b7cd23c982a9631eb575de1d41f047761b6456994c43c10d47767ec1eaa84222c6c95ba33c19c
7
+ data.tar.gz: 83c58e77b30c50671c3e83171d9ad427f09aaa99ba213754a95f33102fc445bf87cf71443479857a50c363398ba153c3c413ee89c7b62fc0f75c368625493533
data/README.md CHANGED
@@ -54,3 +54,5 @@ List of counties can be found in this [gist](https://gist.github.com/cesswairimu
54
54
  ### Contributing
55
55
 
56
56
  Bugs reports and pull requests are welcome at https://github.com/cesswairimu/ke_counties
57
+
58
+ RubyGems - https://rubygems.org/gems/ke_counties
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
- s.files = `git ls-files -z`.split("\x0").reject do |f|
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
 
@@ -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.all
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
@@ -1,3 +1,3 @@
1
1
  module KeCounties
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/ke_counties.rb CHANGED
@@ -5,41 +5,45 @@ module KeCounties
5
5
  class << self
6
6
 
7
7
  def all
8
- counties.all
8
+ counties
9
9
  end
10
10
 
11
11
  def names
12
- counties.names
12
+ counties.keys
13
13
  end
14
14
 
15
15
  def code(cty)
16
- counties.code(cty)
16
+ counties.dig(cty, :code)
17
17
  end
18
18
 
19
19
  def abbr(cty)
20
- counties.abbr(cty)
20
+ counties.dig(cty, :abbrv)
21
21
  end
22
22
 
23
23
  def capital(cty)
24
- counties.capital(cty)
24
+ counties.dig(cty, :capital)
25
25
  end
26
26
 
27
27
  def province(cty)
28
- counties.province(cty)
28
+ counties.dig(cty, :province)
29
29
  end
30
30
 
31
31
  def codes
32
- counties.content.map{ |i| i[:code]}
32
+ content.map{ |i| i[:code]}
33
33
  end
34
34
 
35
35
  def abbrvs
36
- counties.content.map{ |i| i[:abbrv]}
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.2
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-02 00:00:00.000000000 Z
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.3
95
+ rubygems_version: 3.3.5
93
96
  signing_key:
94
97
  specification_version: 4
95
98
  summary: Kenya Counties