locations_ng 1.0.0 → 1.0.1

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
  SHA1:
3
- metadata.gz: 93aac4c83695e75a4cb21172cb5f5ae8d59e9397
4
- data.tar.gz: 1818a9e75bf2a78d0c58da85d0b127d2b0e28486
3
+ metadata.gz: cd6a119150f710c2249b1a9023afd76b449a4621
4
+ data.tar.gz: eb979e5c18d214931235c367de8aa3ee7b42de0d
5
5
  SHA512:
6
- metadata.gz: a80cd8305107e43b24513fd9ecf34b812676050891f18cee0a21d9442e1e7687390db404ed3643a22417487e67380dea6462df52b3c7950e8925d6010467357c
7
- data.tar.gz: 2e071f238c8f31d74231188669cadf893202069ca9997fa6daedd785ec7d15530c4506a61338cd8ef4c4da7b3bc936f03ae32f7ec9f938253efca6998542e40e
6
+ metadata.gz: 2649379d702a7a37055c1b8aaec32982edaa3997530a19a68d5e5a6e57a3dff12affe5b6bd7bd3f3e3e6d34432da1b3f853e8ae757895c1e3e9a272f0104309e
7
+ data.tar.gz: b7e514d95187a3177ae6d533d80bf525221c17f3f9b5b5b64ea586f8ef4580b37705cd097369296310d84aaac0d2c5b9a47418e69fd48fdfe69b7c317837a61a
@@ -8,6 +8,10 @@ module LocationsNg
8
8
  state = state.downcase.gsub(' ', '_')
9
9
  all_cities = load_cities
10
10
 
11
+ if state == 'federal_capital_territory'
12
+ state = 'fct'
13
+ end
14
+
11
15
  city_index = all_cities.index{|c| c['alias'] == state}
12
16
 
13
17
  if city_index.nil?
@@ -44,6 +44,10 @@
44
44
  - Awgu
45
45
  - Udi
46
46
  - Oji-River
47
+ - state: Federal Capital Territory
48
+ alias: fct
49
+ cities:
50
+ - Abuja
47
51
  - state: Gombe
48
52
  alias: gombe
49
53
  cities:
@@ -133,7 +133,7 @@
133
133
  maxLat: 9.3574219
134
134
  longitude: 7.179025999999999
135
135
  maxLong: 7.617400000000001
136
- alias: abuja
136
+ alias: fct
137
137
  - minLat: 10.264117
138
138
  name: Gombe
139
139
  capital: Gombe
@@ -1,3 +1,3 @@
1
1
  module LocationsNg
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
@@ -23,6 +23,10 @@ module LocationsNg
23
23
  it 'returns the cities of a specific state' do
24
24
  expect(city.cities('Akwa Ibom')).to eq(['Eket', 'Ikot Ekpene', 'Oron', 'Uyo'])
25
25
  end
26
+
27
+ it 'returns the cities for FCT' do
28
+ expect(city.cities('Federal Capital Territory')).to eq(%w(Abuja))
29
+ end
26
30
  end
27
31
  end
28
32
  end
@@ -44,6 +44,11 @@
44
44
  "alias":"enugu",
45
45
  "cities":["Enugu", "Nsukka", "Agbani", "Awgu", "Udi", "Oji-River"]
46
46
  },
47
+ {
48
+ "state":"Federal Capital Territory",
49
+ "alias":"fct",
50
+ "cities":["Abuja"]
51
+ },
47
52
  {
48
53
  "state":"Gombe",
49
54
  "alias":"gombe",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locations_ng
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fiyin Adebayo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-21 00:00:00.000000000 Z
11
+ date: 2016-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails