turkish_cities 0.1.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +5 -0
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +22 -0
  4. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  5. data/.github/pull_request_template.md +38 -0
  6. data/.hound.yml +1 -1
  7. data/.rubocop.yml +6 -10
  8. data/.travis.yml +9 -0
  9. data/CHANGELOG.md +61 -3
  10. data/CONTRIBUTING.md +38 -0
  11. data/Gemfile +0 -1
  12. data/Gemfile.lock +32 -29
  13. data/README.md +290 -33
  14. data/lib/turkish_cities.rb +34 -3
  15. data/lib/turkish_cities/city.rb +47 -28
  16. data/lib/turkish_cities/data/cities.yaml +643 -1
  17. data/lib/turkish_cities/data/districts/adana.yaml +1043 -0
  18. data/lib/turkish_cities/data/districts/adiyaman.yaml +1243 -0
  19. data/lib/turkish_cities/data/districts/afyon.yaml +1253 -0
  20. data/lib/turkish_cities/data/districts/agri.yaml +1038 -0
  21. data/lib/turkish_cities/data/districts/aksaray.yaml +491 -0
  22. data/lib/turkish_cities/data/districts/amasya.yaml +753 -0
  23. data/lib/turkish_cities/data/districts/ankara.yaml +1712 -0
  24. data/lib/turkish_cities/data/districts/antalya.yaml +1114 -0
  25. data/lib/turkish_cities/data/districts/ardahan.yaml +396 -0
  26. data/lib/turkish_cities/data/districts/artvin.yaml +1956 -0
  27. data/lib/turkish_cities/data/districts/aydin.yaml +761 -0
  28. data/lib/turkish_cities/data/districts/balikesir.yaml +1338 -0
  29. data/lib/turkish_cities/data/districts/bartin.yaml +1065 -0
  30. data/lib/turkish_cities/data/districts/batman.yaml +790 -0
  31. data/lib/turkish_cities/data/districts/bayburt.yaml +263 -0
  32. data/lib/turkish_cities/data/districts/bilecik.yaml +425 -0
  33. data/lib/turkish_cities/data/districts/bingol.yaml +1159 -0
  34. data/lib/turkish_cities/data/districts/bitlis.yaml +818 -0
  35. data/lib/turkish_cities/data/districts/bolu.yaml +1730 -0
  36. data/lib/turkish_cities/data/districts/burdur.yaml +592 -0
  37. data/lib/turkish_cities/data/districts/bursa.yaml +1266 -0
  38. data/lib/turkish_cities/data/districts/canakkale.yaml +1035 -0
  39. data/lib/turkish_cities/data/districts/cankiri.yaml +719 -0
  40. data/lib/turkish_cities/data/districts/corum.yaml +1576 -0
  41. data/lib/turkish_cities/data/districts/denizli.yaml +724 -0
  42. data/lib/turkish_cities/data/districts/diyarbakir.yaml +1132 -0
  43. data/lib/turkish_cities/data/districts/duzce.yaml +756 -0
  44. data/lib/turkish_cities/data/districts/edirne.yaml +457 -0
  45. data/lib/turkish_cities/data/districts/elazig.yaml +1560 -0
  46. data/lib/turkish_cities/data/districts/erzincan.yaml +1086 -0
  47. data/lib/turkish_cities/data/districts/erzurum.yaml +1278 -0
  48. data/lib/turkish_cities/data/districts/eskisehir.yaml +673 -0
  49. data/lib/turkish_cities/data/districts/gaziantep.yaml +872 -0
  50. data/lib/turkish_cities/data/districts/giresun.yaml +2753 -0
  51. data/lib/turkish_cities/data/districts/gumushane.yaml +1185 -0
  52. data/lib/turkish_cities/data/districts/hakkari.yaml +478 -0
  53. data/lib/turkish_cities/data/districts/hatay.yaml +680 -0
  54. data/lib/turkish_cities/data/districts/igdir.yaml +272 -0
  55. data/lib/turkish_cities/data/districts/isparta.yaml +676 -0
  56. data/lib/turkish_cities/data/districts/istanbul.yaml +1812 -0
  57. data/lib/turkish_cities/data/districts/izmir.yaml +1657 -0
  58. data/lib/turkish_cities/data/districts/kahramanmaras.yaml +776 -0
  59. data/lib/turkish_cities/data/districts/karabuk.yaml +1171 -0
  60. data/lib/turkish_cities/data/districts/karaman.yaml +477 -0
  61. data/lib/turkish_cities/data/districts/kars.yaml +572 -0
  62. data/lib/turkish_cities/data/districts/kastamonu.yaml +4485 -0
  63. data/lib/turkish_cities/data/districts/kayseri.yaml +852 -0
  64. data/lib/turkish_cities/data/districts/kilis.yaml +328 -0
  65. data/lib/turkish_cities/data/districts/kirikkale.yaml +423 -0
  66. data/lib/turkish_cities/data/districts/kirklareli.yaml +384 -0
  67. data/lib/turkish_cities/data/districts/kirsehir.yaml +475 -0
  68. data/lib/turkish_cities/data/districts/kocaeli.yaml +597 -0
  69. data/lib/turkish_cities/data/districts/konya.yaml +1418 -0
  70. data/lib/turkish_cities/data/districts/kutahya.yaml +1042 -0
  71. data/lib/turkish_cities/data/districts/malatya.yaml +828 -0
  72. data/lib/turkish_cities/data/districts/manisa.yaml +1318 -0
  73. data/lib/turkish_cities/data/districts/mardin.yaml +762 -0
  74. data/lib/turkish_cities/data/districts/mersin.yaml +1013 -0
  75. data/lib/turkish_cities/data/districts/mugla.yaml +622 -0
  76. data/lib/turkish_cities/data/districts/mus.yaml +749 -0
  77. data/lib/turkish_cities/data/districts/nevsehir.yaml +481 -0
  78. data/lib/turkish_cities/data/districts/nigde.yaml +437 -0
  79. data/lib/turkish_cities/data/districts/ordu.yaml +857 -0
  80. data/lib/turkish_cities/data/districts/osmaniye.yaml +655 -0
  81. data/lib/turkish_cities/data/districts/rize.yaml +1447 -0
  82. data/lib/turkish_cities/data/districts/sakarya.yaml +744 -0
  83. data/lib/turkish_cities/data/districts/samsun.yaml +1363 -0
  84. data/lib/turkish_cities/data/districts/sanliurfa.yaml +1505 -0
  85. data/lib/turkish_cities/data/districts/siirt.yaml +579 -0
  86. data/lib/turkish_cities/data/districts/sinop.yaml +2061 -0
  87. data/lib/turkish_cities/data/districts/sirnak.yaml +404 -0
  88. data/lib/turkish_cities/data/districts/sivas.yaml +2476 -0
  89. data/lib/turkish_cities/data/districts/tekirdag.yaml +436 -0
  90. data/lib/turkish_cities/data/districts/tokat.yaml +1553 -0
  91. data/lib/turkish_cities/data/districts/trabzon.yaml +794 -0
  92. data/lib/turkish_cities/data/districts/tunceli.yaml +1074 -0
  93. data/lib/turkish_cities/data/districts/usak.yaml +735 -0
  94. data/lib/turkish_cities/data/districts/van.yaml +754 -0
  95. data/lib/turkish_cities/data/districts/yalova.yaml +151 -0
  96. data/lib/turkish_cities/data/districts/yozgat.yaml +939 -0
  97. data/lib/turkish_cities/data/districts/zonguldak.yaml +1599 -0
  98. data/lib/turkish_cities/data/neighborhoods_parser.rb +52 -0
  99. data/lib/turkish_cities/distance.rb +131 -0
  100. data/lib/turkish_cities/district.rb +53 -0
  101. data/lib/turkish_cities/helpers/decomposer_helper.rb +104 -0
  102. data/lib/turkish_cities/postcode.rb +25 -0
  103. data/lib/turkish_cities/version.rb +1 -1
  104. data/public/assets/img/TurkishCities_darkblue-on-yellow_800X800@3x-8.png +0 -0
  105. data/public/assets/img/TurkishCities_darkblue-on-yellow_914X343@3x-8.png +0 -0
  106. data/public/assets/img/TurkishCities_darkblue-on-yellow_horizontal_914X343@3x-8.png +0 -0
  107. data/public/assets/img/TurkishCities_yellow-on-darkblue_800X800@3x-8.png +0 -0
  108. data/public/assets/img/TurkishCities_yellow-on-darkblue_914X343@3x-8.png +0 -0
  109. data/public/assets/img/TurkishCities_yellow-on-darkblue_horizontal_914X343@3x-8.png +0 -0
  110. data/turkish_cities.gemspec +4 -4
  111. metadata +108 -10
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'csv'
4
+ require 'yaml'
5
+
6
+ require_relative '../helpers/decomposer_helper'
7
+
8
+ module NeighborhoodsParser
9
+ include DecomposerHelper
10
+
11
+ district_hash = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }
12
+ mahalle_array = []
13
+ last_city = 'Adana'
14
+ last_district = ''
15
+ last_subdistrict = ''
16
+ last_postcode = 1720
17
+
18
+ # rubocop:disable Metrics/BlockLength
19
+ CSV.parse(File.read('ptt_list.csv'), headers: true).each do |row|
20
+ data_array = row['il;ilçe;semt_bucak_belde;Mahalle;PK'].split(';')
21
+
22
+ if data_array[0].downcase(:turkic).strip.capitalize(:turkic) != last_city ||
23
+ data_array[4].to_i != last_postcode
24
+ district_hash[last_district][last_subdistrict]['postcode'] = last_postcode
25
+ district_hash[last_district][last_subdistrict]['neighborhoods'] = mahalle_array
26
+ mahalle_array = []
27
+ if data_array[0].downcase(:turkic).strip.capitalize(:turkic) != last_city
28
+ file_name = create_file_path(last_city)
29
+ File.write("#{file_name}.yaml", district_hash.to_yaml)
30
+ district_hash = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }
31
+ end
32
+ end
33
+
34
+ mahalle = []
35
+ data_array[3].downcase(:turkic).strip.split(' ').each do |word|
36
+ if word[0] == '('
37
+ word[1] = word[1].capitalize!(:turkic) unless word[1].to_i.to_s == word[1]
38
+ else
39
+ word.capitalize!(:turkic)
40
+ end
41
+ mahalle << word
42
+ end
43
+
44
+ mahalle_array << mahalle.join(' ')
45
+
46
+ last_city = data_array[0].downcase(:turkic).strip.capitalize(:turkic)
47
+ last_district = data_array[1].downcase(:turkic).strip.capitalize(:turkic)
48
+ last_subdistrict = data_array[2].downcase(:turkic).strip.capitalize(:turkic)
49
+ last_postcode = data_array[4].to_i
50
+ end
51
+ # rubocop:enable Metrics/BlockLength
52
+ end
@@ -0,0 +1,131 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'i18n'
4
+ require 'yaml'
5
+
6
+ require_relative '../turkish_cities/helpers/decomposer_helper'
7
+
8
+ class Distance
9
+ include DecomposerHelper
10
+
11
+ file_path = File.join(File.dirname(__FILE__), 'data/cities.yaml')
12
+ CITY_LIST = YAML.load_file(file_path)
13
+ RADIUS_OF_EARTH = 6371 # Earth radius in km is 6371
14
+
15
+ def initialize(from, to, travel_method)
16
+ @from = from
17
+ @to = to
18
+ @travel_method = travel_method
19
+ end
20
+
21
+ def distance_between
22
+ case @travel_method
23
+ when 'land'
24
+ distance_between_land
25
+ when 'sea'
26
+ distance_between_sea
27
+ when 'air'
28
+ distance_between_air
29
+ else
30
+ unsupported_travel_method(@travel_method)
31
+ end
32
+ end
33
+
34
+ private
35
+
36
+ def distance_between_land
37
+ city_array = find_city_attributes
38
+ case city_array
39
+ when String
40
+ city_array
41
+ when Array
42
+ results = []
43
+ results[0] = calculate_land_distance(city_array)
44
+ results[1] = description_text('Land', city_array, results)
45
+ results
46
+ end
47
+ end
48
+
49
+ def distance_between_sea
50
+ # TODO
51
+ end
52
+
53
+ def distance_between_air
54
+ city_array = find_city_attributes
55
+ case city_array
56
+ when String
57
+ city_array
58
+ when Array
59
+ results = []
60
+ results[0] = calculate_flight_distance(city_array).round(2)
61
+ results[1] = distance_time_estimation(results[0]).to_i
62
+ results[2] = description_text('Air', city_array, results)
63
+ results
64
+ end
65
+ end
66
+
67
+ def find_city_attributes
68
+ from_city = to_city = nil
69
+
70
+ CITY_LIST.each do |city|
71
+ from_city = city if convert_chars(@from) == convert_chars(city['name'])
72
+ to_city = city if convert_chars(@to) == convert_chars(city['name'])
73
+ end
74
+
75
+ from_city.nil? || to_city.nil? ? cities_not_found_error(@from, @to) : [from_city, to_city]
76
+ end
77
+
78
+ # rubocop:disable Metrics/AbcSize
79
+ def calculate_land_distance(city_array)
80
+ # Distance information between cities are kept in yaml files in a plate number order
81
+ # For example if distance between plate number 10 with plate number 3
82
+ # Order should be 3 to 10 not 10 to 3
83
+ if city_array[0]['plate_number'] > city_array[1]['plate_number']
84
+ return city_array[1]['land_distance'][city_array[0]['plate_number'] - city_array[1]['plate_number'] - 1]
85
+ end
86
+
87
+ city_array[0]['land_distance'][city_array[1]['plate_number'] - city_array[0]['plate_number'] - 1]
88
+ end
89
+ # rubocop:enable Metrics/AbcSize
90
+
91
+ def degree_to_radian(degree)
92
+ degree * Math::PI / 180
93
+ end
94
+
95
+ # rubocop:disable Metrics/AbcSize
96
+ def calculate_flight_distance(city_array)
97
+ lat_diff = degree_to_radian(city_array[1]['latitude'] - city_array[0]['latitude'])
98
+ lng_diff = degree_to_radian(city_array[1]['longitude'] - city_array[0]['longitude'])
99
+
100
+ from_lat = degree_to_radian(city_array[0]['latitude'])
101
+ to_lat = degree_to_radian(city_array[1]['latitude'])
102
+
103
+ cosines_var = (Math.sin(lat_diff / 2)**2) + ((Math.sin(lng_diff / 2)**2) * (Math.cos(from_lat) * Math.cos(to_lat)))
104
+ result = 2 * Math.atan2(Math.sqrt(cosines_var), Math.sqrt(1 - cosines_var))
105
+ RADIUS_OF_EARTH * result
106
+ end
107
+ # rubocop:enable Metrics/AbcSize
108
+
109
+ # Time estimation for air travel. For planes take-off and landing took nearly same amount.
110
+ # Longer the distance shorter the time. Flying out at high altitude makes less air resistance / more speed
111
+ def distance_time_estimation(air_distance)
112
+ case air_distance
113
+ when 0..400
114
+ (air_distance / 10) + 30
115
+ when 400..1000
116
+ (air_distance / 11.25) + 30
117
+ else
118
+ (air_distance / 12.5) + 25
119
+ end
120
+ end
121
+
122
+ def description_text(travel_method, city_array, result_set)
123
+ if travel_method == 'Air'
124
+ return "#{travel_method} travel distance between #{city_array[0]['name']} and #{city_array[1]['name']} is " \
125
+ "#{result_set[0]} km. Estimated air travel would take #{result_set[1]} minutes."
126
+ end
127
+
128
+ "#{travel_method} travel distance between #{city_array[0]['name']} and #{city_array[1]['name']} is " \
129
+ "#{result_set[0]} km."
130
+ end
131
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'i18n'
4
+ require 'yaml'
5
+
6
+ require_relative '../turkish_cities/helpers/decomposer_helper'
7
+
8
+ class District
9
+ include DecomposerHelper
10
+
11
+ def initialize(city_name, district_name)
12
+ @city_name = city_name
13
+ @district_name = district_name
14
+ @district_list = create_district_list(city_name)
15
+ end
16
+
17
+ def subdistricts
18
+ return district_not_found_error(@district_name, @city_name) if district_item.nil?
19
+
20
+ sort_alphabetically(district_item.keys)
21
+ end
22
+
23
+ def neighborhoods(subdistrict_name)
24
+ return district_not_found_error(@district_name, @city_name) if district_item.nil?
25
+
26
+ neighborhoods = create_neighborhoods(subdistrict_name)
27
+ neighborhoods.is_a?(Array) ? sort_alphabetically(neighborhoods) : neighborhoods
28
+ end
29
+
30
+ private
31
+
32
+ def create_neighborhoods(subdistrict_name)
33
+ return create_neighborhoods_without_subdistrict_name if subdistrict_name.nil?
34
+
35
+ if district_item[subdistrict_name].nil?
36
+ return subdistrict_not_found_error(subdistrict_name, @district_name, @city_name)
37
+ end
38
+
39
+ create_neighborhoods_with_subdistrict_name(subdistrict_name)
40
+ end
41
+
42
+ def create_neighborhoods_without_subdistrict_name
43
+ district_item.values.map { |subdistrict| subdistrict['neighborhoods'] }.flatten
44
+ end
45
+
46
+ def create_neighborhoods_with_subdistrict_name(subdistrict_name)
47
+ district_item[subdistrict_name]['neighborhoods']
48
+ end
49
+
50
+ def district_item
51
+ @district_list[@district_name]
52
+ end
53
+ end
@@ -0,0 +1,104 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DecomposerHelper
4
+ def check_input_range(input, min, max)
5
+ return if input.to_i.between?(min, max)
6
+
7
+ raise RangeError, "Given value [#{input}] is outside bounds of #{min} to #{max}."
8
+ end
9
+
10
+ def city_not_found_error(input)
11
+ "Couldn't find city name with '#{input}'"
12
+ end
13
+
14
+ def cities_not_found_error(first, second)
15
+ "Couldn't find cities combination with '#{first}/#{second}'"
16
+ end
17
+
18
+ def convert_chars(string)
19
+ I18n.transliterate(string.downcase(:turkic))
20
+ end
21
+
22
+ def create_district_list(city_name)
23
+ file_name = create_file_path(city_name)
24
+ file_path = File.join(File.dirname(__FILE__), "../data/districts/#{file_name}.yaml")
25
+ begin
26
+ YAML.load_file(file_path)
27
+ rescue Errno::ENOENT => e
28
+ "Caught the exception: #{e}"
29
+ end
30
+ end
31
+
32
+ def create_file_path(city_name)
33
+ char_fallbacks = { 'ç' => 'c', 'ğ' => 'g', 'ı' => 'i', 'ö' => 'o', 'ş' => 's', 'ü' => 'u' }
34
+ city_name.downcase(:turkic).encode('ASCII', 'UTF-8', fallback: char_fallbacks)
35
+ end
36
+
37
+ def district_not_found_error(district_input, city_input)
38
+ "Couldn't find district name with '#{district_input}' of '#{city_input}'"
39
+ end
40
+
41
+ def postcode_not_found_error(postcode_input)
42
+ "Couldn't find any subdistrict with postcode '#{postcode_input}'"
43
+ end
44
+
45
+ def prepare_city_list(city_list, options)
46
+ if options[:with]
47
+ city_list.map do |city|
48
+ result = {}
49
+ result[:name] = city['name']
50
+
51
+ add_plate_number_if_requested(result, city, options)
52
+ add_phone_code_if_requested(result, city, options)
53
+ add_metropolitan_municipality_if_requested(result, city, options)
54
+
55
+ result[:region] = city['region'] if options.dig(:with, :region) || options.dig(:with, :all)
56
+ result
57
+ end
58
+ else
59
+ city_list.map do |city|
60
+ city['name']
61
+ end
62
+ end
63
+ end
64
+
65
+ def sort_alphabetically(list, options = nil)
66
+ turkish_alphabet = ' -0123456789abcçdefgğhıijklmnoöprsştuüvyz'
67
+ list.sort_by do |item|
68
+ item_to_sort = if options.nil? || options[:with].nil?
69
+ item
70
+ else
71
+ item[:name]
72
+ end
73
+ item_to_sort.downcase(:turkic).chars.map { |char| turkish_alphabet.index(char) }
74
+ end
75
+ end
76
+
77
+ def subdistrict_not_found_error(subdistrict_input, district_input, city_input)
78
+ "Couldn't find subdistrict with '#{subdistrict_input}' of '#{district_input}'/'#{city_input}'"
79
+ end
80
+
81
+ private
82
+
83
+ def add_plate_number_if_requested(result, city, options = nil)
84
+ return unless options.dig(:with, :plate_number) || options.dig(:with, :all)
85
+
86
+ result[:plate_number] = city['plate_number']
87
+ end
88
+
89
+ def add_phone_code_if_requested(result, city, options = nil)
90
+ return unless options.dig(:with, :phone_code) || options.dig(:with, :all)
91
+
92
+ result[:phone_code] = city['phone_code']
93
+ end
94
+
95
+ def add_metropolitan_municipality_if_requested(result, city, options = nil)
96
+ return unless options.dig(:with, :metropolitan_municipality_since) || options.dig(:with, :all)
97
+
98
+ result[:metropolitan_municipality_since] = city['metropolitan_municipality_since']
99
+ end
100
+
101
+ def unsupported_travel_method(input)
102
+ "Travel method '#{input}' is unsupported"
103
+ end
104
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'i18n'
4
+ require 'yaml'
5
+
6
+ require_relative '../turkish_cities/helpers/decomposer_helper'
7
+
8
+ class Postcode
9
+ include DecomposerHelper
10
+
11
+ def find_by_postcode(postcode)
12
+ check_input_range(postcode, 1010, 81_952)
13
+
14
+ city_name = City.new.find_by_id(postcode.to_i / 1000)
15
+ city_file = create_district_list(city_name)
16
+
17
+ city_file.each do |district|
18
+ district_name = district[0]
19
+ district[1].each do |subdistrict|
20
+ return [city_name, district_name, subdistrict[0]] if subdistrict[1]['postcode'] == postcode.to_i
21
+ end
22
+ end
23
+ postcode_not_found_error(postcode)
24
+ end
25
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class TurkishCities
4
- VERSION = '0.1.2'
4
+ VERSION = '0.4.0'
5
5
  end
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
 
12
12
  s.date = '2020-04-13'
13
13
  s.summary = 'List and find Turkish cities'
14
- s.description = 'Simple ruby gem for listing and finding Turkish cities via name, plate number or size'
14
+ s.description = 'List and find Turkish cities via name, district name, post code, plate number. Calculate air travel distance between cities and get realistic estimates of travel time'
15
15
  s.homepage = 'https://github.com/sarslanoglu/turkish_cities'
16
16
  s.license = 'MIT'
17
17
 
@@ -21,10 +21,10 @@ Gem::Specification.new do |s|
21
21
 
22
22
  s.add_dependency 'i18n', ['>= 0.6.4', '<= 2']
23
23
 
24
- s.add_development_dependency 'bundler', '~> 2.1.4'
24
+ s.add_development_dependency 'bundler', '~> 2.2.16'
25
25
  s.add_development_dependency 'coveralls', '~> 0.8.23'
26
- s.add_development_dependency 'rspec', '~> 3.9.0'
27
- s.add_development_dependency 'rubocop', '~> 0.80.1'
26
+ s.add_development_dependency 'rspec', '~> 3.10.0'
27
+ s.add_development_dependency 'rubocop', '~> 1.3.1'
28
28
 
29
29
  if s.respond_to?(:metadata)
30
30
  s.metadata['changelog_uri'] = 'https://github.com/sarslanoglu/turkish_cities/blob/master/CHANGELOG.md'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turkish_cities
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Semih Arslanoglu
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 2.1.4
39
+ version: 2.2.16
40
40
  type: :development
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: 2.1.4
46
+ version: 2.2.16
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: coveralls
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -64,35 +64,40 @@ dependencies:
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: 3.9.0
67
+ version: 3.10.0
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: 3.9.0
74
+ version: 3.10.0
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: rubocop
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: 0.80.1
81
+ version: 1.3.1
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: 0.80.1
89
- description: Simple ruby gem for listing and finding Turkish cities via name, plate
90
- number or size
88
+ version: 1.3.1
89
+ description: List and find Turkish cities via name, district name, post code, plate
90
+ number. Calculate air travel distance between cities and get realistic estimates
91
+ of travel time
91
92
  email: arslanoglusemih93@gmail.com
92
93
  executables: []
93
94
  extensions: []
94
95
  extra_rdoc_files: []
95
96
  files:
97
+ - ".codeclimate.yml"
98
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
99
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
100
+ - ".github/pull_request_template.md"
96
101
  - ".gitignore"
97
102
  - ".hound.yml"
98
103
  - ".rspec"
@@ -100,6 +105,7 @@ files:
100
105
  - ".travis.yml"
101
106
  - CHANGELOG.md
102
107
  - CODE_OF_CONDUCT.md
108
+ - CONTRIBUTING.md
103
109
  - Gemfile
104
110
  - Gemfile.lock
105
111
  - LICENSE.txt
@@ -107,7 +113,99 @@ files:
107
113
  - lib/turkish_cities.rb
108
114
  - lib/turkish_cities/city.rb
109
115
  - lib/turkish_cities/data/cities.yaml
116
+ - lib/turkish_cities/data/districts/adana.yaml
117
+ - lib/turkish_cities/data/districts/adiyaman.yaml
118
+ - lib/turkish_cities/data/districts/afyon.yaml
119
+ - lib/turkish_cities/data/districts/agri.yaml
120
+ - lib/turkish_cities/data/districts/aksaray.yaml
121
+ - lib/turkish_cities/data/districts/amasya.yaml
122
+ - lib/turkish_cities/data/districts/ankara.yaml
123
+ - lib/turkish_cities/data/districts/antalya.yaml
124
+ - lib/turkish_cities/data/districts/ardahan.yaml
125
+ - lib/turkish_cities/data/districts/artvin.yaml
126
+ - lib/turkish_cities/data/districts/aydin.yaml
127
+ - lib/turkish_cities/data/districts/balikesir.yaml
128
+ - lib/turkish_cities/data/districts/bartin.yaml
129
+ - lib/turkish_cities/data/districts/batman.yaml
130
+ - lib/turkish_cities/data/districts/bayburt.yaml
131
+ - lib/turkish_cities/data/districts/bilecik.yaml
132
+ - lib/turkish_cities/data/districts/bingol.yaml
133
+ - lib/turkish_cities/data/districts/bitlis.yaml
134
+ - lib/turkish_cities/data/districts/bolu.yaml
135
+ - lib/turkish_cities/data/districts/burdur.yaml
136
+ - lib/turkish_cities/data/districts/bursa.yaml
137
+ - lib/turkish_cities/data/districts/canakkale.yaml
138
+ - lib/turkish_cities/data/districts/cankiri.yaml
139
+ - lib/turkish_cities/data/districts/corum.yaml
140
+ - lib/turkish_cities/data/districts/denizli.yaml
141
+ - lib/turkish_cities/data/districts/diyarbakir.yaml
142
+ - lib/turkish_cities/data/districts/duzce.yaml
143
+ - lib/turkish_cities/data/districts/edirne.yaml
144
+ - lib/turkish_cities/data/districts/elazig.yaml
145
+ - lib/turkish_cities/data/districts/erzincan.yaml
146
+ - lib/turkish_cities/data/districts/erzurum.yaml
147
+ - lib/turkish_cities/data/districts/eskisehir.yaml
148
+ - lib/turkish_cities/data/districts/gaziantep.yaml
149
+ - lib/turkish_cities/data/districts/giresun.yaml
150
+ - lib/turkish_cities/data/districts/gumushane.yaml
151
+ - lib/turkish_cities/data/districts/hakkari.yaml
152
+ - lib/turkish_cities/data/districts/hatay.yaml
153
+ - lib/turkish_cities/data/districts/igdir.yaml
154
+ - lib/turkish_cities/data/districts/isparta.yaml
155
+ - lib/turkish_cities/data/districts/istanbul.yaml
156
+ - lib/turkish_cities/data/districts/izmir.yaml
157
+ - lib/turkish_cities/data/districts/kahramanmaras.yaml
158
+ - lib/turkish_cities/data/districts/karabuk.yaml
159
+ - lib/turkish_cities/data/districts/karaman.yaml
160
+ - lib/turkish_cities/data/districts/kars.yaml
161
+ - lib/turkish_cities/data/districts/kastamonu.yaml
162
+ - lib/turkish_cities/data/districts/kayseri.yaml
163
+ - lib/turkish_cities/data/districts/kilis.yaml
164
+ - lib/turkish_cities/data/districts/kirikkale.yaml
165
+ - lib/turkish_cities/data/districts/kirklareli.yaml
166
+ - lib/turkish_cities/data/districts/kirsehir.yaml
167
+ - lib/turkish_cities/data/districts/kocaeli.yaml
168
+ - lib/turkish_cities/data/districts/konya.yaml
169
+ - lib/turkish_cities/data/districts/kutahya.yaml
170
+ - lib/turkish_cities/data/districts/malatya.yaml
171
+ - lib/turkish_cities/data/districts/manisa.yaml
172
+ - lib/turkish_cities/data/districts/mardin.yaml
173
+ - lib/turkish_cities/data/districts/mersin.yaml
174
+ - lib/turkish_cities/data/districts/mugla.yaml
175
+ - lib/turkish_cities/data/districts/mus.yaml
176
+ - lib/turkish_cities/data/districts/nevsehir.yaml
177
+ - lib/turkish_cities/data/districts/nigde.yaml
178
+ - lib/turkish_cities/data/districts/ordu.yaml
179
+ - lib/turkish_cities/data/districts/osmaniye.yaml
180
+ - lib/turkish_cities/data/districts/rize.yaml
181
+ - lib/turkish_cities/data/districts/sakarya.yaml
182
+ - lib/turkish_cities/data/districts/samsun.yaml
183
+ - lib/turkish_cities/data/districts/sanliurfa.yaml
184
+ - lib/turkish_cities/data/districts/siirt.yaml
185
+ - lib/turkish_cities/data/districts/sinop.yaml
186
+ - lib/turkish_cities/data/districts/sirnak.yaml
187
+ - lib/turkish_cities/data/districts/sivas.yaml
188
+ - lib/turkish_cities/data/districts/tekirdag.yaml
189
+ - lib/turkish_cities/data/districts/tokat.yaml
190
+ - lib/turkish_cities/data/districts/trabzon.yaml
191
+ - lib/turkish_cities/data/districts/tunceli.yaml
192
+ - lib/turkish_cities/data/districts/usak.yaml
193
+ - lib/turkish_cities/data/districts/van.yaml
194
+ - lib/turkish_cities/data/districts/yalova.yaml
195
+ - lib/turkish_cities/data/districts/yozgat.yaml
196
+ - lib/turkish_cities/data/districts/zonguldak.yaml
197
+ - lib/turkish_cities/data/neighborhoods_parser.rb
198
+ - lib/turkish_cities/distance.rb
199
+ - lib/turkish_cities/district.rb
200
+ - lib/turkish_cities/helpers/decomposer_helper.rb
201
+ - lib/turkish_cities/postcode.rb
110
202
  - lib/turkish_cities/version.rb
203
+ - public/assets/img/TurkishCities_darkblue-on-yellow_800X800@3x-8.png
204
+ - public/assets/img/TurkishCities_darkblue-on-yellow_914X343@3x-8.png
205
+ - public/assets/img/TurkishCities_darkblue-on-yellow_horizontal_914X343@3x-8.png
206
+ - public/assets/img/TurkishCities_yellow-on-darkblue_800X800@3x-8.png
207
+ - public/assets/img/TurkishCities_yellow-on-darkblue_914X343@3x-8.png
208
+ - public/assets/img/TurkishCities_yellow-on-darkblue_horizontal_914X343@3x-8.png
111
209
  - turkish_cities.gemspec
112
210
  homepage: https://github.com/sarslanoglu/turkish_cities
113
211
  licenses:
@@ -131,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
229
  - !ruby/object:Gem::Version
132
230
  version: '0'
133
231
  requirements: []
134
- rubygems_version: 3.1.2
232
+ rubygems_version: 3.0.3
135
233
  signing_key:
136
234
  specification_version: 4
137
235
  summary: List and find Turkish cities