turkish_cities 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/.hound.yml +1 -1
  3. data/CHANGELOG.md +10 -0
  4. data/Gemfile.lock +13 -13
  5. data/README.md +88 -1
  6. data/config/locales/en.yml +2 -0
  7. data/config/locales/tr.yml +2 -0
  8. data/lib/turkish_cities/data/cities.yaml +81 -0
  9. data/lib/turkish_cities/data/districts/adana.yaml +1 -1
  10. data/lib/turkish_cities/data/districts/adiyaman.yaml +184 -176
  11. data/lib/turkish_cities/data/districts/afyon.yaml +295 -189
  12. data/lib/turkish_cities/data/districts/agri.yaml +28 -28
  13. data/lib/turkish_cities/data/districts/aksaray.yaml +90 -61
  14. data/lib/turkish_cities/data/districts/amasya.yaml +17 -6
  15. data/lib/turkish_cities/data/districts/ankara.yaml +22 -22
  16. data/lib/turkish_cities/data/districts/antalya.yaml +3 -3
  17. data/lib/turkish_cities/data/districts/ardahan.yaml +10 -7
  18. data/lib/turkish_cities/data/districts/artvin.yaml +0 -60
  19. data/lib/turkish_cities/data/districts/bartin.yaml +23 -19
  20. data/lib/turkish_cities/data/districts/batman.yaml +45 -28
  21. data/lib/turkish_cities/data/districts/bayburt.yaml +12 -6
  22. data/lib/turkish_cities/data/districts/bilecik.yaml +18 -14
  23. data/lib/turkish_cities/data/districts/bingol.yaml +29 -35
  24. data/lib/turkish_cities/data/districts/bitlis.yaml +56 -43
  25. data/lib/turkish_cities/data/districts/bolu.yaml +34 -58
  26. data/lib/turkish_cities/data/districts/burdur.yaml +22 -16
  27. data/lib/turkish_cities/data/districts/bursa.yaml +3 -2
  28. data/lib/turkish_cities/data/districts/canakkale.yaml +46 -47
  29. data/lib/turkish_cities/data/districts/cankiri.yaml +23 -18
  30. data/lib/turkish_cities/data/districts/corum.yaml +25 -15
  31. data/lib/turkish_cities/data/districts/denizli.yaml +1 -1
  32. data/lib/turkish_cities/data/districts/diyarbakir.yaml +6 -6
  33. data/lib/turkish_cities/data/districts/duzce.yaml +83 -74
  34. data/lib/turkish_cities/data/districts/edirne.yaml +37 -23
  35. data/lib/turkish_cities/data/districts/elazig.yaml +74 -54
  36. data/lib/turkish_cities/data/districts/erzincan.yaml +47 -38
  37. data/lib/turkish_cities/data/districts/erzurum.yaml +1 -1
  38. data/lib/turkish_cities/data/districts/giresun.yaml +125 -57
  39. data/lib/turkish_cities/data/districts/gumushane.yaml +61 -81
  40. data/lib/turkish_cities/data/districts/hakkari.yaml +22 -15
  41. data/lib/turkish_cities/data/districts/hatay.yaml +1 -1
  42. data/lib/turkish_cities/data/districts/igdir.yaml +20 -11
  43. data/lib/turkish_cities/data/districts/isparta.yaml +67 -40
  44. data/lib/turkish_cities/data/districts/istanbul.yaml +12 -12
  45. data/lib/turkish_cities/data/districts/izmir.yaml +12 -12
  46. data/lib/turkish_cities/data/districts/kahramanmaras.yaml +3 -2
  47. data/lib/turkish_cities/data/districts/karabuk.yaml +15 -28
  48. data/lib/turkish_cities/data/districts/karaman.yaml +36 -31
  49. data/lib/turkish_cities/data/districts/kars.yaml +5 -4
  50. data/lib/turkish_cities/data/districts/kastamonu.yaml +3 -29
  51. data/lib/turkish_cities/data/districts/kayseri.yaml +8 -8
  52. data/lib/turkish_cities/data/districts/kilis.yaml +3 -2
  53. data/lib/turkish_cities/data/districts/kirikkale.yaml +17 -13
  54. data/lib/turkish_cities/data/districts/kirklareli.yaml +63 -45
  55. data/lib/turkish_cities/data/districts/kirsehir.yaml +25 -16
  56. data/lib/turkish_cities/data/districts/kocaeli.yaml +1 -1
  57. data/lib/turkish_cities/data/districts/konya.yaml +7 -8
  58. data/lib/turkish_cities/data/districts/kutahya.yaml +104 -72
  59. data/lib/turkish_cities/data/districts/malatya.yaml +1 -1
  60. data/lib/turkish_cities/data/districts/manisa.yaml +2 -2
  61. data/lib/turkish_cities/data/districts/mersin.yaml +4 -4
  62. data/lib/turkish_cities/data/districts/mus.yaml +118 -74
  63. data/lib/turkish_cities/data/districts/nevsehir.yaml +51 -43
  64. data/lib/turkish_cities/data/districts/nigde.yaml +135 -76
  65. data/lib/turkish_cities/data/districts/ordu.yaml +3 -3
  66. data/lib/turkish_cities/data/districts/osmaniye.yaml +53 -32
  67. data/lib/turkish_cities/data/districts/rize.yaml +68 -46
  68. data/lib/turkish_cities/data/districts/sakarya.yaml +2 -2
  69. data/lib/turkish_cities/data/districts/samsun.yaml +3 -3
  70. data/lib/turkish_cities/data/districts/sanliurfa.yaml +7 -7
  71. data/lib/turkish_cities/data/districts/siirt.yaml +27 -13
  72. data/lib/turkish_cities/data/districts/sinop.yaml +1 -5
  73. data/lib/turkish_cities/data/districts/sirnak.yaml +78 -40
  74. data/lib/turkish_cities/data/districts/sivas.yaml +49 -52
  75. data/lib/turkish_cities/data/districts/tekirdag.yaml +7 -2
  76. data/lib/turkish_cities/data/districts/tokat.yaml +201 -138
  77. data/lib/turkish_cities/data/districts/trabzon.yaml +1 -0
  78. data/lib/turkish_cities/data/districts/tunceli.yaml +13 -9
  79. data/lib/turkish_cities/data/districts/usak.yaml +40 -24
  80. data/lib/turkish_cities/data/districts/van.yaml +6 -4
  81. data/lib/turkish_cities/data/districts/yalova.yaml +45 -21
  82. data/lib/turkish_cities/data/districts/yozgat.yaml +147 -80
  83. data/lib/turkish_cities/data/districts/zonguldak.yaml +127 -90
  84. data/lib/turkish_cities/data/neighborhoods_parser.rb +3 -3
  85. data/lib/turkish_cities/helpers/decomposer_helper.rb +12 -0
  86. data/lib/turkish_cities/population.rb +66 -0
  87. data/lib/turkish_cities/version.rb +1 -1
  88. data/lib/turkish_cities.rb +5 -0
  89. data/turkish_cities.gemspec +1 -1
  90. metadata +5 -5
  91. data/.travis.yml +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bae35e49b4b510ec357661984e1fe58147fb814c0d3fa05884b267d1dc73c3e8
4
- data.tar.gz: e0107fac60f4c94f319a3a7abe9dc0a3d2dcde7be97636ae289755d64a017efa
3
+ metadata.gz: 3ec20706a6b0a7afa3bdca2e6dfc0c6e70c2a67b1cfc1f3ce31f6390c107a4ad
4
+ data.tar.gz: 603d48232efc5ada2b0210814be61569f4e547776db4e4cfb9998df5a6e85277
5
5
  SHA512:
6
- metadata.gz: dcbef3333549bcf28f20597ae6b43948fc6555c1e407baaa358bc2da1f13b0a60afbd86e1211b2dfccbe9fd1ca7690bbedd1499db47d553b3d59a44d26b8d995
7
- data.tar.gz: bd4196417c877097d240d7d44005debf81d0171c20b1b290cbdbe5b81053dc154dbacf092a20413cda142cecfb83d6eaa8c0f52391d3311961b6b83e0f20b6e3
6
+ metadata.gz: 9f55936144b6e0c926e12df2ccc16fa4e52d2a48c28ac248749422122af16a241b5b33501dd8234939bc6ff66278bf02f5bc435cf715ddb1f26c0c68a6197515
7
+ data.tar.gz: 3df41060bd4478b0875f316c358074b5881002a631a1b9fe1bff4864b74de15c6618e2c16c3b59ef2fc8ab5894914da71f9f31a041ca8845f8031b974d1f6468
data/.hound.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  rubocop:
2
- version: 1.5.2
2
+ version: 1.22.1
3
3
  config_file: .rubocop.yml
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.0 (2022-02-26)
4
+
5
+ ### New features
6
+
7
+ * [#12](https://github.com/sarslanoglu/turkish_cities/issues/12): Add city population data and ```find_by_population``` method
8
+
9
+ ### Changes
10
+
11
+ * [#103](https://github.com/sarslanoglu/turkish_cities/issues/103): Update city/district/subdistrict informations to 2022
12
+
3
13
  ## 0.5.0 (2021-06-06)
4
14
 
5
15
  ### New features
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- turkish_cities (0.5.0)
4
+ turkish_cities (0.6.0)
5
5
  i18n (>= 0.6.4, <= 2)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
10
  ast (2.4.2)
11
- concurrent-ruby (1.1.8)
11
+ concurrent-ruby (1.1.9)
12
12
  coveralls (0.8.23)
13
13
  json (>= 1.8, < 3)
14
14
  simplecov (~> 0.16.1)
@@ -17,14 +17,14 @@ GEM
17
17
  tins (~> 1.6)
18
18
  diff-lcs (1.4.4)
19
19
  docile (1.3.2)
20
- i18n (1.8.10)
20
+ i18n (1.10.0)
21
21
  concurrent-ruby (~> 1.0)
22
22
  json (2.3.0)
23
- parallel (1.20.1)
24
- parser (3.0.1.1)
23
+ parallel (1.21.0)
24
+ parser (3.1.0.0)
25
25
  ast (~> 2.4.1)
26
- rainbow (3.0.0)
27
- regexp_parser (2.1.1)
26
+ rainbow (3.1.1)
27
+ regexp_parser (2.2.0)
28
28
  rexml (3.2.5)
29
29
  rspec (3.10.0)
30
30
  rspec-core (~> 3.10.0)
@@ -39,16 +39,16 @@ GEM
39
39
  diff-lcs (>= 1.2.0, < 2.0)
40
40
  rspec-support (~> 3.10.0)
41
41
  rspec-support (3.10.0)
42
- rubocop (1.16.0)
42
+ rubocop (1.25.0)
43
43
  parallel (~> 1.10)
44
- parser (>= 3.0.0.0)
44
+ parser (>= 3.1.0.0)
45
45
  rainbow (>= 2.2.2, < 4.0)
46
46
  regexp_parser (>= 1.8, < 3.0)
47
47
  rexml
48
- rubocop-ast (>= 1.7.0, < 2.0)
48
+ rubocop-ast (>= 1.15.1, < 2.0)
49
49
  ruby-progressbar (~> 1.7)
50
50
  unicode-display_width (>= 1.4.0, < 3.0)
51
- rubocop-ast (1.7.0)
51
+ rubocop-ast (1.15.1)
52
52
  parser (>= 3.0.1.1)
53
53
  ruby-progressbar (1.11.0)
54
54
  simplecov (0.16.1)
@@ -62,7 +62,7 @@ GEM
62
62
  thor (1.0.1)
63
63
  tins (1.25.0)
64
64
  sync
65
- unicode-display_width (2.0.0)
65
+ unicode-display_width (2.1.0)
66
66
 
67
67
  PLATFORMS
68
68
  ruby
@@ -71,7 +71,7 @@ DEPENDENCIES
71
71
  bundler (~> 2.2.16)
72
72
  coveralls (~> 0.8.23)
73
73
  rspec (~> 3.10.0)
74
- rubocop (~> 1.16.0)
74
+ rubocop (~> 1.25.0)
75
75
  turkish_cities!
76
76
 
77
77
  BUNDLED WITH
data/README.md CHANGED
@@ -7,6 +7,8 @@
7
7
  <img src="https://travis-ci.org/sarslanoglu/turkish_cities.svg?branch=master" alt="BuildStatus"/></a>
8
8
  <a href="https://coveralls.io/github/sarslanoglu/turkish_cities?branch=master">
9
9
  <img src="https://coveralls.io/repos/github/sarslanoglu/turkish_cities/badge.svg?branch=master" alt="CoverageStatus"/></a>
10
+ <a href="https://rubygems.org/gems/turkish_cities">
11
+ <img src="https://img.shields.io/gem/dt/turkish_cities.svg" alt="DownloadCount"/></a>
10
12
  <a href="https://codeclimate.com/github/sarslanoglu/turkish_cities/maintainability">
11
13
  <img src="https://api.codeclimate.com/v1/badges/c1dbe0cef353b152956e/maintainability" alt="Maintainability"/></a>
12
14
  <a href="https://houndci.com">
@@ -35,6 +37,11 @@ https://rubygems.org/gems/turkish_cities
35
37
  * [With subdistrict info](#with-subdistrict-info)
36
38
  * [Without subdistrict info](#without-subdistrict-info)
37
39
  * [Finding city, district and subdistrict name by postcode](#finding-city-district-and-subdistrict-name-by-postcode)
40
+ * [Finding city name with population data](#finding-city-name-with-population-data)
41
+ * [Exact search](#exact-search)
42
+ * [Below given](#below-given)
43
+ * [Above given](#above-given)
44
+ * [Between search](#between-search)
38
45
  * [Finding travel distance and time estimation between two cities](#finding-travel-distance-and-time-estimation-between-two-cities)
39
46
  * [By land](#by-land)
40
47
  * [By air](#by-air)
@@ -274,6 +281,78 @@ TurkishCities.find_by_postcode(34382) # => "Couldn't find any subdistrict wit
274
281
  TurkishCities.find_by_postcode('100000') # => Given value [100000] is outside bounds of 1010 to 81952.
275
282
  ```
276
283
 
284
+ ### Finding city name with population data
285
+
286
+ ### Exact search
287
+
288
+ Search city name with exact population
289
+
290
+ ```rb
291
+ TurkishCities.find_by_population('exact', 15840900)
292
+ # => ["İstanbul"]
293
+ TurkishCities.find_by_population('exatc', 2130432)
294
+ # => "Population type 'exatc' is unsupported"
295
+ TurkishCities.find_by_population('exact', 10432)
296
+ # => []
297
+ TurkishCities.find_by_population('exact', 22130432)
298
+ # => []
299
+ ```
300
+
301
+ ### Below given
302
+
303
+ Search city name with below population
304
+
305
+ ```rb
306
+ TurkishCities.find_by_population('below', 86000)
307
+ # => ["Tunceli", "Bayburt"]
308
+ TurkishCities.find_by_population('below', 500000)
309
+ # => ["Amasya", "Artvin" ... "Kilis", "Düzce"]
310
+ TurkishCities.find_by_population('below', 5000000)
311
+ # => ["Adana", "Adıyaman" ... "Kilis", "Osmaniye", "Düzce"]
312
+ TurkishCities.find_by_population('woleb', 2130432)
313
+ # => "Population type 'woleb' is unsupported"
314
+ TurkishCities.find_by_population('below', 10432)
315
+ # => []
316
+ TurkishCities.find_by_population('below', 22130432)
317
+ # => []
318
+ ```
319
+
320
+ ### Above given
321
+
322
+ Search city name with above population
323
+
324
+ ```rb
325
+ TurkishCities.find_by_population('above', 860000)
326
+ # => ["Adana", "Ankara" ... "Şanlıurfa", "Van"]
327
+ TurkishCities.find_by_population('above', 2500000)
328
+ # => ["Ankara", "Antalya", "Bursa", "İstanbul", "İzmir"]
329
+ TurkishCities.find_by_population('above', 5000000)
330
+ # => ["Ankara", "İstanbul"]
331
+ TurkishCities.find_by_population('abov', 2130432)
332
+ # => "Population type 'abov' is unsupported"
333
+ TurkishCities.find_by_population('above', 10432)
334
+ # => []
335
+ TurkishCities.find_by_population('above', 22130432)
336
+ # => []
337
+ ```
338
+
339
+ ### Between search
340
+
341
+ Search city name with between population
342
+
343
+ ```rb
344
+ TurkishCities.find_by_population('between', 15840900, 3000000)
345
+ # => ["Ankara", "Bursa", "İzmir"]
346
+ TurkishCities.find_by_population('between', 828369, 985732)
347
+ # => ["Eskişehir", "Mardin"]
348
+ TurkishCities.find_by_population('between', 2130432, 3500000)
349
+ # => ["Adana", "Antalya", "Bursa", "Konya", "Şanlıurfa"]
350
+ TurkishCities.find_by_population('between', 10432, 100000)
351
+ # => []
352
+ TurkishCities.find_by_population('between', 2130432, 34000000)
353
+ # => []
354
+ ```
355
+
277
356
  ### Finding travel distance and time estimation between two cities
278
357
 
279
358
  ### By land
@@ -322,11 +401,12 @@ All information related with cities can be found at:
322
401
  https://tr.wikipedia.org/wiki/{#city_name_here}
323
402
  ```
324
403
 
325
- Districts, subdisctricts, neighborhoods and postcodes can be found at:
404
+ Districts, subdisctricts, neighborhoods and postcodes information can be found at:
326
405
 
327
406
  ```
328
407
  https://postakodu.ptt.gov.tr/
329
408
  ```
409
+ All districts/subdistricts are up to date at: 23 January 2022 with using PTT file released at 22 November 2021
330
410
 
331
411
  Land distance information can be found at:
332
412
 
@@ -334,6 +414,13 @@ Land distance information can be found at:
334
414
  https://www.kgm.gov.tr/SiteCollectionDocuments/KGMdocuments/Root/Uzakliklar/ilmesafe.xls
335
415
  ```
336
416
 
417
+ Population of cities are up to date as 15 February 2022 as using February 2022 report of Türkiye İstatistik Kurumu (TÜİK) / Turkish Statistical Institute (TURKSTAT)
418
+
419
+ Statistics for gem can be found at:
420
+ ```
421
+ https://bestgems.org/gems/turkish_cities
422
+ ```
423
+
337
424
  ## Compatibility
338
425
 
339
426
  | Ruby Version | Supported |
@@ -5,11 +5,13 @@ en:
5
5
  errors:
6
6
  cities_not_found_error: "Couldn't find cities combination with '%{first}/%{second}'"
7
7
  city_not_found_error: "Couldn't find city name with '%{input}'"
8
+ city_population_not_found_error: "Couldn't find any city with population data"
8
9
  district_not_found_error: "Couldn't find district name with '%{district_input}' of '%{city_input}'"
9
10
  not_even_input: "Given value [%{input}] must be an even number"
10
11
  outside_bounds: "Given value [%{input}] is outside bounds of %{min} to %{max}"
11
12
  postcode_not_found_error: "Couldn't find any subdistrict with postcode '%{postcode_input}'"
12
13
  subdistrict_not_found_error: "Couldn't find subdistrict with '%{subdistrict_input}' of '%{district_input}'/'%{city_input}'"
14
+ unsupported_population_type: "Population type '%{input}' is unsupported"
13
15
  unsupported_travel_method: "Travel method '%{input}' is unsupported"
14
16
  language:
15
17
  errors:
@@ -5,11 +5,13 @@ tr:
5
5
  errors:
6
6
  cities_not_found_error: "'%{first}/%{second}' ile şehir kombinasyonu bulunamadı"
7
7
  city_not_found_error: "'%{input}' ile bir şehir bulunamadı"
8
+ city_population_not_found_error: "Verilen nüfus verisi ile şehir bulunamadı"
8
9
  district_not_found_error: "'%{city_input}' şehrine ait '%{district_input}' ilçesi ile bir kayıt bulunamadı"
9
10
  not_even_input: "Girilen değer [%{input}] çift sayı olmalı"
10
11
  outside_bounds: "Girilen değer [%{input}] %{min} ile %{max} değerleri dışında"
11
12
  postcode_not_found_error: "'%{postcode_input}' posta kodu ile kayıt bulunamadı"
12
13
  subdistrict_not_found_error: "'%{subdistrict_input}' ile '%{district_input}'/'%{city_input}' ait bir kayıt bulunamdı"
14
+ unsupported_population_type: "'%{input}' ile arama methodu desteklenmiyor"
13
15
  unsupported_travel_method: "'%{input}' yolculuk methodu desteklenmiyor"
14
16
  language:
15
17
  errors: