turkish_cities 0.1.3 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +5 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +22 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/.github/dependabot.yml +20 -0
- data/.github/pull_request_template.md +38 -0
- data/.hound.yml +1 -1
- data/.rubocop.yml +8 -18
- data/.travis.yml +9 -0
- data/CHANGELOG.md +53 -0
- data/Gemfile +0 -1
- data/Gemfile.lock +35 -32
- data/README.md +290 -47
- data/config/locales/en.yml +17 -0
- data/config/locales/tr.yml +17 -0
- data/lib/turkish_cities.rb +42 -4
- data/lib/turkish_cities/city.rb +18 -31
- data/lib/turkish_cities/data/cities.yaml +562 -1
- data/lib/turkish_cities/data/districts/adana.yaml +1043 -0
- data/lib/turkish_cities/data/districts/adiyaman.yaml +1243 -0
- data/lib/turkish_cities/data/districts/afyon.yaml +1253 -0
- data/lib/turkish_cities/data/districts/agri.yaml +1038 -0
- data/lib/turkish_cities/data/districts/aksaray.yaml +491 -0
- data/lib/turkish_cities/data/districts/amasya.yaml +753 -0
- data/lib/turkish_cities/data/districts/ankara.yaml +1712 -0
- data/lib/turkish_cities/data/districts/antalya.yaml +1114 -0
- data/lib/turkish_cities/data/districts/ardahan.yaml +396 -0
- data/lib/turkish_cities/data/districts/artvin.yaml +1956 -0
- data/lib/turkish_cities/data/districts/aydin.yaml +761 -0
- data/lib/turkish_cities/data/districts/balikesir.yaml +1338 -0
- data/lib/turkish_cities/data/districts/bartin.yaml +1065 -0
- data/lib/turkish_cities/data/districts/batman.yaml +790 -0
- data/lib/turkish_cities/data/districts/bayburt.yaml +263 -0
- data/lib/turkish_cities/data/districts/bilecik.yaml +425 -0
- data/lib/turkish_cities/data/districts/bingol.yaml +1159 -0
- data/lib/turkish_cities/data/districts/bitlis.yaml +818 -0
- data/lib/turkish_cities/data/districts/bolu.yaml +1730 -0
- data/lib/turkish_cities/data/districts/burdur.yaml +592 -0
- data/lib/turkish_cities/data/districts/bursa.yaml +1266 -0
- data/lib/turkish_cities/data/districts/canakkale.yaml +1035 -0
- data/lib/turkish_cities/data/districts/cankiri.yaml +719 -0
- data/lib/turkish_cities/data/districts/corum.yaml +1576 -0
- data/lib/turkish_cities/data/districts/denizli.yaml +724 -0
- data/lib/turkish_cities/data/districts/diyarbakir.yaml +1132 -0
- data/lib/turkish_cities/data/districts/duzce.yaml +756 -0
- data/lib/turkish_cities/data/districts/edirne.yaml +457 -0
- data/lib/turkish_cities/data/districts/elazig.yaml +1560 -0
- data/lib/turkish_cities/data/districts/erzincan.yaml +1086 -0
- data/lib/turkish_cities/data/districts/erzurum.yaml +1278 -0
- data/lib/turkish_cities/data/districts/eskisehir.yaml +673 -0
- data/lib/turkish_cities/data/districts/gaziantep.yaml +872 -0
- data/lib/turkish_cities/data/districts/giresun.yaml +2753 -0
- data/lib/turkish_cities/data/districts/gumushane.yaml +1185 -0
- data/lib/turkish_cities/data/districts/hakkari.yaml +478 -0
- data/lib/turkish_cities/data/districts/hatay.yaml +680 -0
- data/lib/turkish_cities/data/districts/igdir.yaml +272 -0
- data/lib/turkish_cities/data/districts/isparta.yaml +676 -0
- data/lib/turkish_cities/data/districts/istanbul.yaml +1812 -0
- data/lib/turkish_cities/data/districts/izmir.yaml +1657 -0
- data/lib/turkish_cities/data/districts/kahramanmaras.yaml +776 -0
- data/lib/turkish_cities/data/districts/karabuk.yaml +1171 -0
- data/lib/turkish_cities/data/districts/karaman.yaml +477 -0
- data/lib/turkish_cities/data/districts/kars.yaml +572 -0
- data/lib/turkish_cities/data/districts/kastamonu.yaml +4485 -0
- data/lib/turkish_cities/data/districts/kayseri.yaml +852 -0
- data/lib/turkish_cities/data/districts/kilis.yaml +328 -0
- data/lib/turkish_cities/data/districts/kirikkale.yaml +423 -0
- data/lib/turkish_cities/data/districts/kirklareli.yaml +384 -0
- data/lib/turkish_cities/data/districts/kirsehir.yaml +475 -0
- data/lib/turkish_cities/data/districts/kocaeli.yaml +597 -0
- data/lib/turkish_cities/data/districts/konya.yaml +1418 -0
- data/lib/turkish_cities/data/districts/kutahya.yaml +1042 -0
- data/lib/turkish_cities/data/districts/malatya.yaml +828 -0
- data/lib/turkish_cities/data/districts/manisa.yaml +1318 -0
- data/lib/turkish_cities/data/districts/mardin.yaml +762 -0
- data/lib/turkish_cities/data/districts/mersin.yaml +1013 -0
- data/lib/turkish_cities/data/districts/mugla.yaml +622 -0
- data/lib/turkish_cities/data/districts/mus.yaml +749 -0
- data/lib/turkish_cities/data/districts/nevsehir.yaml +481 -0
- data/lib/turkish_cities/data/districts/nigde.yaml +437 -0
- data/lib/turkish_cities/data/districts/ordu.yaml +857 -0
- data/lib/turkish_cities/data/districts/osmaniye.yaml +655 -0
- data/lib/turkish_cities/data/districts/rize.yaml +1447 -0
- data/lib/turkish_cities/data/districts/sakarya.yaml +744 -0
- data/lib/turkish_cities/data/districts/samsun.yaml +1363 -0
- data/lib/turkish_cities/data/districts/sanliurfa.yaml +1505 -0
- data/lib/turkish_cities/data/districts/siirt.yaml +579 -0
- data/lib/turkish_cities/data/districts/sinop.yaml +2061 -0
- data/lib/turkish_cities/data/districts/sirnak.yaml +404 -0
- data/lib/turkish_cities/data/districts/sivas.yaml +2476 -0
- data/lib/turkish_cities/data/districts/tekirdag.yaml +436 -0
- data/lib/turkish_cities/data/districts/tokat.yaml +1553 -0
- data/lib/turkish_cities/data/districts/trabzon.yaml +794 -0
- data/lib/turkish_cities/data/districts/tunceli.yaml +1074 -0
- data/lib/turkish_cities/data/districts/usak.yaml +735 -0
- data/lib/turkish_cities/data/districts/van.yaml +754 -0
- data/lib/turkish_cities/data/districts/yalova.yaml +151 -0
- data/lib/turkish_cities/data/districts/yozgat.yaml +939 -0
- data/lib/turkish_cities/data/districts/zonguldak.yaml +1599 -0
- data/lib/turkish_cities/data/neighborhoods_parser.rb +52 -0
- data/lib/turkish_cities/distance.rb +134 -0
- data/lib/turkish_cities/district.rb +53 -0
- data/lib/turkish_cities/helpers/decomposer_helper.rb +106 -0
- data/lib/turkish_cities/postcode.rb +25 -0
- data/lib/turkish_cities/version.rb +1 -1
- data/public/assets/img/TurkishCities_darkblue-on-yellow_800X800@3x-8.png +0 -0
- data/public/assets/img/TurkishCities_darkblue-on-yellow_914X343@3x-8.png +0 -0
- data/public/assets/img/TurkishCities_darkblue-on-yellow_horizontal_914X343@3x-8.png +0 -0
- data/public/assets/img/TurkishCities_yellow-on-darkblue_800X800@3x-8.png +0 -0
- data/public/assets/img/TurkishCities_yellow-on-darkblue_914X343@3x-8.png +0 -0
- data/public/assets/img/TurkishCities_yellow-on-darkblue_horizontal_914X343@3x-8.png +0 -0
- data/turkish_cities.gemspec +4 -5
- metadata +114 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bae35e49b4b510ec357661984e1fe58147fb814c0d3fa05884b267d1dc73c3e8
|
4
|
+
data.tar.gz: e0107fac60f4c94f319a3a7abe9dc0a3d2dcde7be97636ae289755d64a017efa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcbef3333549bcf28f20597ae6b43948fc6555c1e407baaa358bc2da1f13b0a60afbd86e1211b2dfccbe9fd1ca7690bbedd1499db47d553b3d59a44d26b8d995
|
7
|
+
data.tar.gz: bd4196417c877097d240d7d44005debf81d0171c20b1b290cbdbe5b81053dc154dbacf092a20413cda142cecfb83d6eaa8c0f52391d3311961b6b83e0f20b6e3
|
data/.codeclimate.yml
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Create a report to help us improve
|
4
|
+
title: "[BUG] - (Fill here)"
|
5
|
+
labels: bug
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Describe the bug**
|
11
|
+
A clear and concise description of what the bug is.
|
12
|
+
|
13
|
+
**To Reproduce**
|
14
|
+
Steps to reproduce the behavior:
|
15
|
+
1. In terminal ```require 'turkish_cities'```
|
16
|
+
2. Call method ```'....'```
|
17
|
+
|
18
|
+
**Expected behavior**
|
19
|
+
A clear and concise description of what you expected to happen.
|
20
|
+
|
21
|
+
**Additional context**
|
22
|
+
Add any other context about the problem here.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
name: Feature request
|
3
|
+
about: Suggest an idea for this project
|
4
|
+
title: "[FEAT] - (Fill here)"
|
5
|
+
labels: enhancement
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
12
|
+
|
13
|
+
**Describe the solution you'd like**
|
14
|
+
A clear and concise description of what you want to happen.
|
15
|
+
|
16
|
+
**Describe alternatives you've considered**
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
18
|
+
|
19
|
+
**Additional context**
|
20
|
+
Add any other context or screenshots about the feature request here.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
version: 2
|
2
|
+
updates:
|
3
|
+
- package-ecosystem: bundler
|
4
|
+
directory: "/"
|
5
|
+
schedule:
|
6
|
+
interval: monthly
|
7
|
+
time: "09:00"
|
8
|
+
open-pull-requests-limit: 10
|
9
|
+
ignore:
|
10
|
+
- dependency-name: rubocop
|
11
|
+
versions:
|
12
|
+
- 1.8.1
|
13
|
+
- 1.9.1
|
14
|
+
- dependency-name: bundler
|
15
|
+
versions:
|
16
|
+
- 2.2.6
|
17
|
+
- 2.2.7
|
18
|
+
- dependency-name: i18n
|
19
|
+
versions:
|
20
|
+
- 1.8.7
|
@@ -0,0 +1,38 @@
|
|
1
|
+
### Related github issue for this PR
|
2
|
+
|
3
|
+
Resolves #001 <!--fill issue number-->
|
4
|
+
|
5
|
+
### Checklist
|
6
|
+
|
7
|
+
* [ ] I have performed a self-review of my own code
|
8
|
+
* [ ] I added comments, particularly in hard-to-understand areas
|
9
|
+
* [ ] I have made corresponding changes to the documentation `README.md`
|
10
|
+
* [ ] I added tests that prove my fix is effective or that my feature works
|
11
|
+
* [ ] `bundle exec rake` passes locally
|
12
|
+
* [ ] `rubocop` gives no error locally
|
13
|
+
* [ ] My PR title includes "WIP" or is [draft PR](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests#draft-pull-requests) if work is in progress
|
14
|
+
|
15
|
+
### Description
|
16
|
+
|
17
|
+
<!-- Please include a summary of the change and which issue is fixed.
|
18
|
+
Please also include relevant motivation and context.
|
19
|
+
Guide questions:
|
20
|
+
- What changed, and why?
|
21
|
+
- What alternative solutions did you consider?
|
22
|
+
- What are the tradeoffs for your solution?
|
23
|
+
|
24
|
+
Include anything else we should know about. -->
|
25
|
+
|
26
|
+
### Type of change
|
27
|
+
|
28
|
+
<!-- Please delete options that are not relevant. -->
|
29
|
+
|
30
|
+
* Bug fix (non-breaking change which fixes an issue)
|
31
|
+
* New feature (non-breaking change which adds functionality)
|
32
|
+
* Breaking change (fix or feature that would cause existing functionality to not
|
33
|
+
work as expected)
|
34
|
+
* Documentation update
|
35
|
+
|
36
|
+
### Which tests are written for this PR? And what are the expected results for these tests?
|
37
|
+
|
38
|
+
<!-- Please describe the tests that you ran to verify your changes. -->
|
data/.hound.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -3,25 +3,15 @@ AllCops:
|
|
3
3
|
Exclude:
|
4
4
|
- 'Gemfile'
|
5
5
|
- 'turkish_cities.gemspec'
|
6
|
+
NewCops: enable
|
7
|
+
SuggestExtensions: false
|
6
8
|
Layout/LineLength:
|
7
|
-
Max:
|
8
|
-
|
9
|
-
|
10
|
-
Lint/RaiseException:
|
11
|
-
Enabled: true
|
12
|
-
Lint/StructNewOverride:
|
13
|
-
Enabled: true
|
9
|
+
Max: 120
|
10
|
+
Metrics/AbcSize:
|
11
|
+
Max: 20
|
14
12
|
Metrics/BlockLength:
|
15
|
-
|
13
|
+
IgnoredMethods: ['describe', 'context']
|
14
|
+
Metrics/MethodLength:
|
15
|
+
Max: 15
|
16
16
|
Style/Documentation:
|
17
17
|
Enabled: false
|
18
|
-
Style/ExponentialNotation:
|
19
|
-
Enabled: true
|
20
|
-
Style/HashEachMethods:
|
21
|
-
Enabled: true
|
22
|
-
Style/HashTransformKeys:
|
23
|
-
Description: 'Prefer `transform_keys` over `each_with_object` and `map`.'
|
24
|
-
Enabled: true
|
25
|
-
Style/HashTransformValues:
|
26
|
-
Description: 'Prefer `transform_values` over `each_with_object` and `map`.'
|
27
|
-
Enabled: true
|
data/.travis.yml
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
env:
|
2
|
+
global:
|
3
|
+
- CC_TEST_REPORTER_ID=23062197f289fd0ae7601ae06c2dd4a0af4e16c436f2428b99ab4b64a7e4a587
|
1
4
|
language: ruby
|
2
5
|
dist: trusty
|
3
6
|
rvm:
|
@@ -6,7 +9,13 @@ rvm:
|
|
6
9
|
- 2.7
|
7
10
|
before_install:
|
8
11
|
- gem install bundler
|
12
|
+
before_script:
|
13
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
14
|
+
- chmod +x ./cc-test-reporter
|
15
|
+
- ./cc-test-reporter before-build
|
9
16
|
script: bundle exec rspec spec
|
17
|
+
after_script:
|
18
|
+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
10
19
|
notifications:
|
11
20
|
email:
|
12
21
|
- arslanoglusemih93@gmail.com
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,63 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.5.0 (2021-06-06)
|
4
|
+
|
5
|
+
### New features
|
6
|
+
|
7
|
+
* [#68](https://github.com/sarslanoglu/turkish_cities/issues/68): Add localization for all method responses and errors
|
8
|
+
|
9
|
+
## 0.4.0 (2021-04-25)
|
10
|
+
|
11
|
+
### New features
|
12
|
+
|
13
|
+
* [#66](https://github.com/sarslanoglu/turkish_cities/issues/66): Add ```distance_between_land``` method for calculating land travel distances between cities
|
14
|
+
|
15
|
+
## 0.3.0 (2020-11-22)
|
16
|
+
|
17
|
+
### New features
|
18
|
+
|
19
|
+
* [#13](https://github.com/sarslanoglu/turkish_cities/issues/13): Add ```distance``` class and ```distance_between``` method for calculating air travel distance and time estimation between cities
|
20
|
+
|
21
|
+
### Changes
|
22
|
+
|
23
|
+
* [#50](https://github.com/sarslanoglu/turkish_cities/issues/50): Additional improvements on `District` class methods
|
24
|
+
|
25
|
+
* [#45](https://github.com/sarslanoglu/turkish_cities/issues/45): Refactor `District` class
|
26
|
+
|
27
|
+
## 0.2.1 (2020-06-29)
|
28
|
+
|
29
|
+
### Bug fixes
|
30
|
+
|
31
|
+
* [#38](https://github.com/sarslanoglu/turkish_cities/issues/38): ```NoMethodError``` on ```list_neighborhoods``` when called with wrong subdistrict name
|
32
|
+
|
33
|
+
### Changes
|
34
|
+
|
35
|
+
* [#39](https://github.com/sarslanoglu/turkish_cities/issues/39): May maintenance of gem - 2020-05-24
|
36
|
+
|
37
|
+
## 0.2.0 (2020-05-18)
|
38
|
+
|
39
|
+
### New features
|
40
|
+
|
41
|
+
* [#36](https://github.com/sarslanoglu/turkish_cities/issues/36): Add ```postcode``` class and ```find_by_postcode``` method for finding city, district and subdistrict information by given postcode
|
42
|
+
|
43
|
+
* [#33](https://github.com/sarslanoglu/turkish_cities/issues/33): Add ```list_neighborhoods``` method for listing neighborhoods and fix some wrong district names
|
44
|
+
|
45
|
+
* [#29](https://github.com/sarslanoglu/turkish_cities/issues/29): Add ```district``` class and ```list_subdistricts``` method for listing subdistricts
|
46
|
+
|
47
|
+
* [#27](https://github.com/sarslanoglu/turkish_cities/issues/27): Add all subdistricts and neighborhoods of all Turkish cities
|
48
|
+
|
49
|
+
* [#25](https://github.com/sarslanoglu/turkish_cities/issues/25): Add district data to each city at yaml file and add new method ```list_districts``` for listing disctricts of cities alphabetically sorted
|
50
|
+
|
51
|
+
### Changes
|
52
|
+
|
53
|
+
* [#24](https://github.com/sarslanoglu/turkish_cities/issues/24): Add listing support with ```metropolitan_municipality_since, phone_code, plate_number, region``` to ```listing_cities``` method
|
54
|
+
|
3
55
|
## 0.1.3 (2020-04-20)
|
4
56
|
|
5
57
|
### New features
|
6
58
|
|
7
59
|
* [#22](https://github.com/sarslanoglu/turkish_cities/issues/22): Add region data to cities.yaml and update ```list_cities``` method to support regions
|
60
|
+
|
8
61
|
* [#20](https://github.com/sarslanoglu/turkish_cities/issues/20): Add city finding with phone code and vice versa. ```find_name_by_phone_code``` and ```find_phone_code_by_name``` methods are added
|
9
62
|
|
10
63
|
### Bug fixes
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,53 +1,56 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
turkish_cities (0.
|
4
|
+
turkish_cities (0.5.0)
|
5
5
|
i18n (>= 0.6.4, <= 2)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
ast (2.4.
|
11
|
-
concurrent-ruby (1.1.
|
10
|
+
ast (2.4.2)
|
11
|
+
concurrent-ruby (1.1.8)
|
12
12
|
coveralls (0.8.23)
|
13
13
|
json (>= 1.8, < 3)
|
14
14
|
simplecov (~> 0.16.1)
|
15
15
|
term-ansicolor (~> 1.3)
|
16
16
|
thor (>= 0.19.4, < 2.0)
|
17
17
|
tins (~> 1.6)
|
18
|
-
diff-lcs (1.
|
18
|
+
diff-lcs (1.4.4)
|
19
19
|
docile (1.3.2)
|
20
|
-
i18n (1.8.
|
20
|
+
i18n (1.8.10)
|
21
21
|
concurrent-ruby (~> 1.0)
|
22
|
-
jaro_winkler (1.5.4)
|
23
22
|
json (2.3.0)
|
24
|
-
parallel (1.
|
25
|
-
parser (
|
26
|
-
ast (~> 2.4.
|
23
|
+
parallel (1.20.1)
|
24
|
+
parser (3.0.1.1)
|
25
|
+
ast (~> 2.4.1)
|
27
26
|
rainbow (3.0.0)
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
rspec-
|
32
|
-
rspec-
|
33
|
-
|
34
|
-
|
35
|
-
|
27
|
+
regexp_parser (2.1.1)
|
28
|
+
rexml (3.2.5)
|
29
|
+
rspec (3.10.0)
|
30
|
+
rspec-core (~> 3.10.0)
|
31
|
+
rspec-expectations (~> 3.10.0)
|
32
|
+
rspec-mocks (~> 3.10.0)
|
33
|
+
rspec-core (3.10.0)
|
34
|
+
rspec-support (~> 3.10.0)
|
35
|
+
rspec-expectations (3.10.0)
|
36
36
|
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
-
rspec-support (~> 3.
|
38
|
-
rspec-mocks (3.
|
37
|
+
rspec-support (~> 3.10.0)
|
38
|
+
rspec-mocks (3.10.0)
|
39
39
|
diff-lcs (>= 1.2.0, < 2.0)
|
40
|
-
rspec-support (~> 3.
|
41
|
-
rspec-support (3.
|
42
|
-
rubocop (
|
43
|
-
jaro_winkler (~> 1.5.1)
|
40
|
+
rspec-support (~> 3.10.0)
|
41
|
+
rspec-support (3.10.0)
|
42
|
+
rubocop (1.16.0)
|
44
43
|
parallel (~> 1.10)
|
45
|
-
parser (>=
|
44
|
+
parser (>= 3.0.0.0)
|
46
45
|
rainbow (>= 2.2.2, < 4.0)
|
46
|
+
regexp_parser (>= 1.8, < 3.0)
|
47
47
|
rexml
|
48
|
+
rubocop-ast (>= 1.7.0, < 2.0)
|
48
49
|
ruby-progressbar (~> 1.7)
|
49
|
-
unicode-display_width (>= 1.4.0, <
|
50
|
-
|
50
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
51
|
+
rubocop-ast (1.7.0)
|
52
|
+
parser (>= 3.0.1.1)
|
53
|
+
ruby-progressbar (1.11.0)
|
51
54
|
simplecov (0.16.1)
|
52
55
|
docile (~> 1.1)
|
53
56
|
json (>= 1.8, < 3)
|
@@ -57,19 +60,19 @@ GEM
|
|
57
60
|
term-ansicolor (1.7.1)
|
58
61
|
tins (~> 1.0)
|
59
62
|
thor (1.0.1)
|
60
|
-
tins (1.
|
63
|
+
tins (1.25.0)
|
61
64
|
sync
|
62
|
-
unicode-display_width (
|
65
|
+
unicode-display_width (2.0.0)
|
63
66
|
|
64
67
|
PLATFORMS
|
65
68
|
ruby
|
66
69
|
|
67
70
|
DEPENDENCIES
|
68
|
-
bundler (~> 2.
|
71
|
+
bundler (~> 2.2.16)
|
69
72
|
coveralls (~> 0.8.23)
|
70
|
-
rspec (~> 3.
|
71
|
-
rubocop (~>
|
73
|
+
rspec (~> 3.10.0)
|
74
|
+
rubocop (~> 1.16.0)
|
72
75
|
turkish_cities!
|
73
76
|
|
74
77
|
BUNDLED WITH
|
75
|
-
2.
|
78
|
+
2.2.16
|
data/README.md
CHANGED
@@ -1,12 +1,48 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
# ![TurkishCities](./public/assets/img/TurkishCities_yellow-on-darkblue_horizontal_914X343@3x-8.png)
|
2
|
+
|
3
|
+
<p align="center">
|
4
|
+
<a href="https://rubygems.org/gems/turkish_cities">
|
5
|
+
<img src="https://badge.fury.io/rb/turkish_cities.svg" alt="GemVersion"/></a>
|
6
|
+
<a href="https://travis-ci.org/sarslanoglu/turkish_cities">
|
7
|
+
<img src="https://travis-ci.org/sarslanoglu/turkish_cities.svg?branch=master" alt="BuildStatus"/></a>
|
8
|
+
<a href="https://coveralls.io/github/sarslanoglu/turkish_cities?branch=master">
|
9
|
+
<img src="https://coveralls.io/repos/github/sarslanoglu/turkish_cities/badge.svg?branch=master" alt="CoverageStatus"/></a>
|
10
|
+
<a href="https://codeclimate.com/github/sarslanoglu/turkish_cities/maintainability">
|
11
|
+
<img src="https://api.codeclimate.com/v1/badges/c1dbe0cef353b152956e/maintainability" alt="Maintainability"/></a>
|
12
|
+
<a href="https://houndci.com">
|
13
|
+
<img src="https://img.shields.io/badge/Protected_by-Hound-a873d1.svg" alt="Hound"/></a>
|
14
|
+
<a href="https://opensource.org/licenses/MIT">
|
15
|
+
<img src="https://img.shields.io/github/license/sarslanoglu/turkish_cities.svg" alt="License"/></a>
|
16
|
+
</p>
|
17
|
+
|
18
|
+
**Turkish Cities** is a Ruby gem which makes listing and finding Turkish cities easy. Search can be via name, post code, plate number, district name etc. Also calculate your travel distance and travel time between cities via distance methods.
|
19
|
+
https://rubygems.org/gems/turkish_cities
|
20
|
+
|
21
|
+
## Table of Contents
|
22
|
+
* [Installation](#installation)
|
23
|
+
* [Localization](#localization)
|
24
|
+
* [Documentation](#documentation)
|
25
|
+
* [Finding city name by plate number](#finding-city-name-by-plate-number)
|
26
|
+
* [Finding city name by phone code](#finding-city-name-by-phone-code)
|
27
|
+
* [Finding plate number by city name](#finding-plate-number-by-city-name)
|
28
|
+
* [Finding phone code by city name](#finding-phone-code-by-city-name)
|
29
|
+
* [Listing all cities](#listing-all-cities)
|
30
|
+
* [Listing all cities with only name](#listing-all-cities-with-only-name)
|
31
|
+
* [Listing all cities with other parameters](#listing-all-cities-with-other-parameters)
|
32
|
+
* [Listing all districts of given city](#listing-all-districts-of-given-city)
|
33
|
+
* [Listing all subdistricts of given city and district](#listing-all-subdistricts-of-given-city-and-district)
|
34
|
+
* [Listing all neighborhoods of given city and district](#listing-all-neighborhoods-of-given-city-and-district)
|
35
|
+
* [With subdistrict info](#with-subdistrict-info)
|
36
|
+
* [Without subdistrict info](#without-subdistrict-info)
|
37
|
+
* [Finding city, district and subdistrict name by postcode](#finding-city-district-and-subdistrict-name-by-postcode)
|
38
|
+
* [Finding travel distance and time estimation between two cities](#finding-travel-distance-and-time-estimation-between-two-cities)
|
39
|
+
* [By land](#by-land)
|
40
|
+
* [By air](#by-air)
|
41
|
+
* [Data sources](#data-sources)
|
42
|
+
* [Compatibility](#compatibility)
|
43
|
+
* [Contributing](#contributing)
|
44
|
+
* [Changelog](#changelog)
|
45
|
+
* [Copyright](#copyright)
|
10
46
|
|
11
47
|
## Installation
|
12
48
|
|
@@ -28,66 +64,84 @@ and run
|
|
28
64
|
$ bundle
|
29
65
|
```
|
30
66
|
|
67
|
+
## Localization
|
68
|
+
|
69
|
+
Currently gem supports two different languages, Turkish and English. English is default, if no action taken.
|
70
|
+
|
71
|
+
Language can be easily changed by ```change_locale``` method. Valid parameters are 'tr' for Turkish and 'en' for English.
|
72
|
+
|
73
|
+
```rb
|
74
|
+
TurkishCities.change_locale('tr') # => "Dil Türkçe olarak ayarlandı."
|
75
|
+
```
|
76
|
+
|
77
|
+
After changing language all errors and result sets will be in desired language
|
78
|
+
|
79
|
+
```rb
|
80
|
+
TurkishCities.list_districts('Eskişehirrr') # => "'Eskişehirrr' ile bir şehir bulunamadı"
|
81
|
+
TurkishCities.distance_between('kirsehir', 'Ordu', 'land')
|
82
|
+
# => [533, "Kırşehir ile Ordu arasındaki karayolu mesafesi 533 km"]
|
83
|
+
```
|
84
|
+
|
31
85
|
## Documentation
|
32
86
|
|
33
87
|
With using irb just require gem and start using
|
34
88
|
|
35
|
-
```
|
89
|
+
```rb
|
36
90
|
require 'turkish_cities'
|
37
91
|
```
|
38
92
|
|
39
93
|
### Finding city name by plate number
|
40
94
|
|
41
|
-
There are 81 cities in Turkey. By calling a plate number between 1-81 will give city_name
|
95
|
+
There are 81 cities in Turkey. By calling a plate number between 1-81 will give city_name.
|
42
96
|
|
43
|
-
```
|
44
|
-
TurkishCities.find_name_by_plate_number(26)
|
45
|
-
TurkishCities.find_name_by_plate_number(7)
|
97
|
+
```rb
|
98
|
+
TurkishCities.find_name_by_plate_number(26) # => "Eskişehir"
|
99
|
+
TurkishCities.find_name_by_plate_number(7) # => "Antalya"
|
46
100
|
TurkishCities.find_name_by_plate_number(0007) # => "Antalya"
|
47
101
|
TurkishCities.find_name_by_plate_number(43.0) # => "Kütahya"
|
48
102
|
TurkishCities.find_name_by_plate_number('78') # => "Karabük"
|
49
|
-
TurkishCities.find_name_by_plate_number(100)
|
103
|
+
TurkishCities.find_name_by_plate_number(100) # => 'Given value [100] is outside bounds of 1 to 81.'
|
50
104
|
```
|
51
105
|
|
52
106
|
### Finding city name by phone code
|
53
107
|
|
54
|
-
There are
|
108
|
+
There are 82 phone codes for each city in Turkey (Istanbul is an exception with different phone codes for Anatolian side and European side). By calling a phone code between 212-488 will give city_name. All phone codes ending with even numbers. So sending an odd number will give an error without searching.
|
55
109
|
|
56
|
-
```
|
57
|
-
TurkishCities.find_name_by_phone_code(312)
|
58
|
-
TurkishCities.find_name_by_phone_code(242)
|
110
|
+
```rb
|
111
|
+
TurkishCities.find_name_by_phone_code(312) # => "Ankara"
|
112
|
+
TurkishCities.find_name_by_phone_code(242) # => "Antalya"
|
59
113
|
TurkishCities.find_name_by_phone_code(000222) # => "Eskişehir"
|
60
|
-
TurkishCities.find_name_by_phone_code(274.0)
|
61
|
-
TurkishCities.find_name_by_phone_code('212')
|
62
|
-
TurkishCities.find_name_by_phone_code(216)
|
63
|
-
TurkishCities.find_name_by_phone_code(360)
|
64
|
-
TurkishCities.find_name_by_phone_code(0)
|
65
|
-
TurkishCities.find_name_by_phone_code(213)
|
114
|
+
TurkishCities.find_name_by_phone_code(274.0) # => "Kütahya"
|
115
|
+
TurkishCities.find_name_by_phone_code('212') # => "İstanbul"
|
116
|
+
TurkishCities.find_name_by_phone_code(216) # => "İstanbul"
|
117
|
+
TurkishCities.find_name_by_phone_code(360) # => 'Couldn't find city name with phone code 360'
|
118
|
+
TurkishCities.find_name_by_phone_code(0) # => 'Given value [0] is outside bounds of 212 to 488.'
|
119
|
+
TurkishCities.find_name_by_phone_code(213) # => 'Given value [213] must be an even number.'
|
66
120
|
```
|
67
121
|
|
68
122
|
### Finding plate number by city name
|
69
123
|
|
70
|
-
City name can be given case and turkish character insensitive
|
124
|
+
City name can be given case and turkish character insensitive.
|
71
125
|
|
72
|
-
```
|
73
|
-
TurkishCities.find_plate_number_by_name('Ankara')
|
74
|
-
TurkishCities.find_plate_number_by_name('Eskişehir')
|
75
|
-
TurkishCities.find_plate_number_by_name('Canakkale')
|
76
|
-
TurkishCities.find_plate_number_by_name('Istanbul')
|
77
|
-
TurkishCities.find_plate_number_by_name('kirsehir')
|
126
|
+
```rb
|
127
|
+
TurkishCities.find_plate_number_by_name('Ankara') # => 6
|
128
|
+
TurkishCities.find_plate_number_by_name('Eskişehir') # => 26
|
129
|
+
TurkishCities.find_plate_number_by_name('Canakkale') # => 17
|
130
|
+
TurkishCities.find_plate_number_by_name('Istanbul') # => 34
|
131
|
+
TurkishCities.find_plate_number_by_name('kirsehir') # => 40
|
78
132
|
TurkishCities.find_plate_number_by_name('falansehir') # => "Couldn't find city name with 'falansehir'"
|
79
133
|
```
|
80
134
|
|
81
|
-
### Finding phone
|
135
|
+
### Finding phone code by city name
|
82
136
|
|
83
|
-
City name can be given case and turkish character insensitive
|
137
|
+
City name can be given case and turkish character insensitive.
|
84
138
|
|
85
|
-
```
|
86
|
-
TurkishCities.find_phone_code_by_name('Ankara')
|
87
|
-
TurkishCities.find_phone_code_by_name('Eskişehir')
|
88
|
-
TurkishCities.find_phone_code_by_name('Canakkale')
|
89
|
-
TurkishCities.find_phone_code_by_name('Istanbul')
|
90
|
-
TurkishCities.find_phone_code_by_name('kirsehir')
|
139
|
+
```rb
|
140
|
+
TurkishCities.find_phone_code_by_name('Ankara') # => 312
|
141
|
+
TurkishCities.find_phone_code_by_name('Eskişehir') # => 222
|
142
|
+
TurkishCities.find_phone_code_by_name('Canakkale') # => 286
|
143
|
+
TurkishCities.find_phone_code_by_name('Istanbul') # => [212, 216]
|
144
|
+
TurkishCities.find_phone_code_by_name('kirsehir') # => 386
|
91
145
|
TurkishCities.find_phone_code_by_name('filansehir') # => "Couldn't find city name with 'filansehir'"
|
92
146
|
```
|
93
147
|
|
@@ -95,13 +149,15 @@ TurkishCities.find_phone_code_by_name('filansehir') # => "Couldn't find city nam
|
|
95
149
|
|
96
150
|
By default cities will be listed by their plate number ascending.
|
97
151
|
|
98
|
-
```
|
152
|
+
```rb
|
99
153
|
TurkishCities.list_cities # => ["Adana", "Adıyaman" ... "Kilis", "Osmaniye", "Düzce"]
|
100
154
|
```
|
101
155
|
|
102
|
-
|
156
|
+
### Listing all cities with only name
|
157
|
+
|
158
|
+
While listing cities three additional parameters can be sent ```alphabetically_sorted```, ```metropolitan_municipality``` and ```region```. All parameters can be sent separately and together.
|
103
159
|
|
104
|
-
```
|
160
|
+
```rb
|
105
161
|
TurkishCities.list_cities({ alphabetically_sorted: true })
|
106
162
|
# => ["Adana", "Adıyaman" ... "Yalova", "Yozgat", "Zonguldak"]
|
107
163
|
TurkishCities.list_cities({ metropolitan_municipality: true })
|
@@ -116,22 +172,209 @@ TurkishCities.list_cities({ alphabetically_sorted: true, metropolitan_municipali
|
|
116
172
|
# => ["Adana", "Ankara" ... "Tekirdağ", "Trabzon", "Van"]
|
117
173
|
```
|
118
174
|
|
175
|
+
### Listing all cities with other parameters
|
176
|
+
|
177
|
+
While listing cities ```with``` parameter can be used for listing cities with other attributes. These parameters are ```alphabetically_sorted```, ```metropolitan_municipality``` and ```region```. All parameters can be sent separately and together.
|
178
|
+
|
179
|
+
```rb
|
180
|
+
TurkishCities.list_cities({ alphabetically_sorted: true, with: { phone_code: true } })
|
181
|
+
# => [{:name=>"Adana", :phone_code=>322}, {:name=>"Adıyaman", :phone_code=>416}, {:name=>"Afyon", :phone_code=>272} .
|
182
|
+
# .. {:name=>"Yozgat", :phone_code=>354}, {:name=>"Zonguldak", :phone_code=>372}]
|
183
|
+
TurkishCities.list_cities({ with: { plate_number: true } })
|
184
|
+
# => [{:name=>"Adana", :plate_number=>1}, {:name=>"Adıyaman", :plate_number=>2}, {:name=>"Afyon", :plate_number=>3} .
|
185
|
+
# .. {:name=>"Osmaniye", :plate_number=>80}, {:name=>"Düzce", :plate_number=>81}]
|
186
|
+
TurkishCities.list_cities({ metropolitan_municipality: true, region: 'Karadeniz', with: { all: true } })
|
187
|
+
# => [{:name=>"Ordu", :plate_number=>52, :phone_code=>452, :metropolitan_municipality_since=>2012,
|
188
|
+
# :region=>"Karadeniz"},{:name=>"Samsun", :plate_number=>55, :phone_code=>362,
|
189
|
+
# :metropolitan_municipality_since=>1993, :region=>"Karadeniz"}, {:name=>"Trabzon", :plate_number=>61,
|
190
|
+
# :phone_code=>462, :metropolitan_municipality_since=>2012, :region=>"Karadeniz"}]
|
191
|
+
```
|
192
|
+
|
193
|
+
### Listing all districts of given city
|
194
|
+
|
195
|
+
City name can be given case and turkish character insensitive. Listing of districts are alphabetically sorted.
|
196
|
+
|
197
|
+
```rb
|
198
|
+
TurkishCities.list_districts('Ankara')
|
199
|
+
# => ["Akyurt", "Altındağ" ... "Sincan", "Şereflikoçhisar", "Yenimahalle"]
|
200
|
+
TurkishCities.list_districts('Eskişehir')
|
201
|
+
# => ["Alpu", "Beylikova", "Çifteler" ... "Sivrihisar", "Tepebaşı"]
|
202
|
+
TurkishCities.list_districts('Canakkale')
|
203
|
+
# => ["Ayvacık", "Bayramiç" ... "Lapseki", "Merkez", "Yenice"]
|
204
|
+
TurkishCities.list_districts('Bayburt')
|
205
|
+
# => ["Aydıntepe", "Demirözü", "Merkez"]
|
206
|
+
TurkishCities.list_districts('Istanbul').length
|
207
|
+
# => 39
|
208
|
+
TurkishCities.list_districts('filansehir')
|
209
|
+
# => "Couldn't find city name with 'filansehir'"
|
210
|
+
```
|
211
|
+
|
212
|
+
### Listing all subdistricts of given city and district
|
213
|
+
|
214
|
+
City name can be given case and turkish character insensitive. District name should be case and turkish character sensitive.(Correct district names can be obtained by ```list_districts``` method.) Listing of subdistricts are alphabetically sorted.
|
215
|
+
|
216
|
+
```rb
|
217
|
+
TurkishCities.list_subdistricts('Adana', 'Seyhan')
|
218
|
+
# => ["Akkapı", "Denizli" ... "Yeşiloba", "Yeşilyurt", "Ziyapaşa"]
|
219
|
+
TurkishCities.list_subdistricts('Eskişehir', 'Odunpazarı')
|
220
|
+
# => ["Alanönü", "Arifiye", "Büyükdere" ... "Vişnelik", "Yenikent"]
|
221
|
+
TurkishCities.list_subdistricts('Istanbul', 'Beşiktaş')
|
222
|
+
# => ["Abbasağa", "Akatlar", "Arnavutköy", "Bebek", "Etiler", "Gayrettepe", "Levazım", "Levent", "Ortaköy", "Türkali"]
|
223
|
+
TurkishCities.list_subdistricts('filansehir', 'Beşiktaş')
|
224
|
+
# => "Couldn't find district name with 'Beşiktaş' of 'filansehir'"
|
225
|
+
TurkishCities.list_subdistricts('İstanbul', 'Kadılarköyü')
|
226
|
+
# => "Couldn't find district name with 'Kadılarköyü' of 'İstanbul'"
|
227
|
+
```
|
228
|
+
|
229
|
+
### Listing all neighborhoods of given city and district
|
230
|
+
|
231
|
+
### With subdistrict info
|
232
|
+
|
233
|
+
City name can be given case and turkish character insensitive. District name and subdistrict name should be case and turkish character sensitive.(Correct district names can be obtained by the ```list_districts``` method. Correct subdistrict names can be obtained by ```list_subdistricts``` method.) Listings of neighborhoods are alphabetically sorted.
|
234
|
+
|
235
|
+
```rb
|
236
|
+
TurkishCities.list_neighborhoods('Adana', 'Seyhan', 'Emek')
|
237
|
+
# => ["Emek Mah", "Ova Mah", "Şakirpaşa Mah", "Uçak Mah"]
|
238
|
+
TurkishCities.list_neighborhoods('Eskişehir', 'Odunpazarı', 'Büyükdere')
|
239
|
+
# => ["Büyükdere Mah", "Göztepe Mah", "Gültepe Mah", "Yıldıztepe Mah"]
|
240
|
+
TurkishCities.list_neighborhoods('Istanbul', 'Beşiktaş', 'Gayrettepe')
|
241
|
+
# => ["Balmumcu Mah", "Dikilitaş Mah", "Gayrettepe Mah", "Yıldız Mah"]
|
242
|
+
TurkishCities.list_neighborhoods('Adana', 'Beşiktaş', 'Emek')
|
243
|
+
# => "Couldn't find district name with 'Beşiktaş' of 'Adana'"
|
244
|
+
TurkishCities.list_neighborhoods('Eskişehir', 'Odunpazarı', 'Büyükkkkkdere')
|
245
|
+
# => "Couldn't find subdistrict with 'Büyükkkkkdere' of 'Odunpazarı'/'Eskişehir'"
|
246
|
+
```
|
247
|
+
|
248
|
+
### Without subdistrict info
|
249
|
+
|
250
|
+
Also ```list_neighborhoods``` can work without subdistrict information. This time neighborhoods result will be larger based on searched city and district.
|
251
|
+
|
252
|
+
City name can be given case and turkish character insensitive. District name should be case and turkish character sensitive.(Correct district names can be obtained by the ```list_districts``` method.) Listings of neighborhoods are alphabetically sorted.
|
253
|
+
|
254
|
+
```rb
|
255
|
+
TurkishCities.list_neighborhoods('Adana', 'Seyhan')
|
256
|
+
# => ["2000 Evler Mah", "Ahmet Remzi Yüreğir Mah", "Akkapı Mah" ... "Zeytinli Mah", "Ziyapaşa Mah"]
|
257
|
+
TurkishCities.list_neighborhoods('Eskişehir', 'Odunpazarı')
|
258
|
+
# => ["71 Evler Mah", "75. Yıl Osb Mah" ... "Yukarıkalabak Mah", "Yürükkaracaören Mah", "Yürükkırka Mah"]
|
259
|
+
TurkishCities.list_neighborhoods('Istanbul', 'Beşiktaş')
|
260
|
+
# => ["Abbasağa Mah", "Akat Mah", "Arnavutköy Mah" ... "Türkali Mah", "Ulus Mah", "Vişnezade Mah", "Yıldız Mah"]
|
261
|
+
TurkishCities.list_neighborhoods('İstanbul', 'filanmevki')
|
262
|
+
# => "Couldn't find district name with 'filanmevki' of 'İstanbul'"
|
263
|
+
```
|
264
|
+
|
265
|
+
### Finding city, district and subdistrict name by postcode
|
266
|
+
|
267
|
+
In Turkey postcodes are uniq for subdistricts. Basically when a postcode is search through ```find_by_postcode``` it will give city, district and subdistrict information of postcode if valid and found
|
268
|
+
|
269
|
+
```rb
|
270
|
+
TurkishCities.find_by_postcode(34380) # => ["İstanbul", "Şişli", "Cumhuriyet"]
|
271
|
+
TurkishCities.find_by_postcode(34433) # => ["İstanbul", "Beyoğlu", "Cihangir"]
|
272
|
+
TurkishCities.find_by_postcode('26040') # => ["Eskişehir", "Odunpazarı", "Büyükdere"]
|
273
|
+
TurkishCities.find_by_postcode(34382) # => "Couldn't find any subdistrict with postcode '34382'"
|
274
|
+
TurkishCities.find_by_postcode('100000') # => Given value [100000] is outside bounds of 1010 to 81952.
|
275
|
+
```
|
276
|
+
|
277
|
+
### Finding travel distance and time estimation between two cities
|
278
|
+
|
279
|
+
### By land
|
280
|
+
|
281
|
+
City names can be given case and turkish character insensitive. Travel method should be lower case. Array with 2 elements will be returned. First element is distance between cities in kilometers and the second element is the description created by the first element.
|
282
|
+
|
283
|
+
```rb
|
284
|
+
TurkishCities.distance_between('Eskişehir', 'Kastamonu', 'land')
|
285
|
+
# => [480, "Land travel distance between Eskişehir and Kastamonu is 480 km."]
|
286
|
+
TurkishCities.distance_between('kirsehir', 'Ordu', 'land')
|
287
|
+
# => [533, "Land travel distance between Kırşehir and Ordu is 533 km."]
|
288
|
+
TurkishCities.distance_between('İzmir', 'Antalya', 'land')
|
289
|
+
# => [444, "Land travel distance between İzmir and Antalya is 444 km."]
|
290
|
+
TurkishCities.distance_between('istanbul', 'kars', 'land')
|
291
|
+
# => [1427, "Land travel distance between İstanbul and Kars is 1427 km."]
|
292
|
+
TurkishCities.distance_between('Adana', 'Adıyaman', 'time')
|
293
|
+
# => "Travel method 'time' is unsupported"
|
294
|
+
TurkishCities.distance_between('filansa', 'falansa', 'land')
|
295
|
+
# => "Couldn't find cities combination with 'filansa/falansa'"
|
296
|
+
```
|
297
|
+
|
298
|
+
### By air
|
299
|
+
|
300
|
+
City names can be given case and turkish character insensitive. Travel method should be lower case. Array with 3 elements will be returned. First element is distance between cities in kilometers, the second element is estimated travel time and the last element is the description created by the first two elements.
|
301
|
+
|
302
|
+
```rb
|
303
|
+
TurkishCities.distance_between('Eskişehir', 'Kastamonu', 'air')
|
304
|
+
# => [327.74, 62, "Air travel distance between Eskişehir and Kastamonu is 327.74 km. Estimated air travel would take 62 minutes."]
|
305
|
+
TurkishCities.distance_between('kirsehir', 'Ordu', 'air')
|
306
|
+
# => [376.89, 67, "Air travel distance between Kırşehir and Ordu is 376.89 km. Estimated air travel would take 67 minutes."]
|
307
|
+
TurkishCities.distance_between('İzmir', 'Antalya', 'air')
|
308
|
+
# => [357.18, 65, "Air travel distance between İzmir and Antalya is 357.18 km. Estimated air travel would take 65 minutes."]
|
309
|
+
TurkishCities.distance_between('istanbul', 'kars', 'air')
|
310
|
+
# => [1187.94, 120, "Air travel distance between İstanbul and Kars is 1187.94 km. Estimated air travel would take 120 minutes."]
|
311
|
+
TurkishCities.distance_between('Adana', 'Adıyaman', 'time')
|
312
|
+
# => "Travel method 'time' is unsupported"
|
313
|
+
TurkishCities.distance_between('filansa', 'falansa', 'air')
|
314
|
+
# => "Couldn't find cities combination with 'filansa/falansa'"
|
315
|
+
```
|
316
|
+
|
317
|
+
## Data sources
|
318
|
+
|
319
|
+
All information related with cities can be found at:
|
320
|
+
|
321
|
+
```
|
322
|
+
https://tr.wikipedia.org/wiki/{#city_name_here}
|
323
|
+
```
|
324
|
+
|
325
|
+
Districts, subdisctricts, neighborhoods and postcodes can be found at:
|
326
|
+
|
327
|
+
```
|
328
|
+
https://postakodu.ptt.gov.tr/
|
329
|
+
```
|
330
|
+
|
331
|
+
Land distance information can be found at:
|
332
|
+
|
333
|
+
```
|
334
|
+
https://www.kgm.gov.tr/SiteCollectionDocuments/KGMdocuments/Root/Uzakliklar/ilmesafe.xls
|
335
|
+
```
|
336
|
+
|
119
337
|
## Compatibility
|
120
338
|
|
121
|
-
|
122
|
-
|
123
|
-
|
339
|
+
| Ruby Version | Supported |
|
340
|
+
| ------------ | ------------------ |
|
341
|
+
| 2.7.x | :white_check_mark: |
|
342
|
+
| 2.6.x | :white_check_mark: |
|
343
|
+
| 2.5.x | :white_check_mark: |
|
344
|
+
| < 2.5.1 | :x: |
|
345
|
+
|
346
|
+
- TurkishCities heavily depends on ```:turkic``` case mapping support of Ruby string downcase method. Below Ruby version 2.5.1 some functions will run buggy/false or even won't run at all.
|
124
347
|
|
125
|
-
|
348
|
+
## Roadmap
|
349
|
+
|
350
|
+
- Add missing sea travel method
|
351
|
+
- Refactor tests (separate test suites with more edge case tests)
|
126
352
|
|
127
353
|
## Contributing
|
128
354
|
|
129
355
|
Contributing guidelines are available [here](CONTRIBUTING.md).
|
130
356
|
|
357
|
+
People behind the 💻
|
358
|
+
<table>
|
359
|
+
<tr>
|
360
|
+
<td align="center"><a href="https://enderahmetyurt.com/"><img src="https://avatars2.githubusercontent.com/u/447588" width="100px;" alt=""/><br /><sub><b>Ender Ahmet Yurt</b></sub></a><br /></td>
|
361
|
+
<td align="center"><a href="https://www.linkedin.com/in/serpilacar/"><img src="https://avatars0.githubusercontent.com/u/17191440" width="100px;" alt=""/><br /><sub><b>Serpil Acar</b></sub></a><br /></td>
|
362
|
+
<td align="center"><a href="https://www.linkedin.com/in/semiharslanoglu/"><img src="https://avatars2.githubusercontent.com/u/10260283" width="100px;" alt=""/><br /><sub><b>Semih Arslanoğlu</b></sub></a><br /></td>
|
363
|
+
</tr>
|
364
|
+
</table>
|
365
|
+
|
131
366
|
## Changelog
|
132
367
|
|
133
368
|
Changelog is available [here](CHANGELOG.md).
|
134
369
|
|
370
|
+
## Logo
|
371
|
+
|
372
|
+
TurkishCities's logo created by [Nebal Çolpan](https://www.behance.net/nebalcolpan). You can find the logo in various
|
373
|
+
formats [here](https://github.com/sarslanoglu/turkish_cities/tree/master/public/assets/img/).
|
374
|
+
|
375
|
+
The logo is licensed under a
|
376
|
+
[Creative Commons Attribution-NonCommercial 4.0 International License](https://creativecommons.org/licenses/by-nc/4.0/deed.en_GB).
|
377
|
+
|
135
378
|
## Copyright
|
136
379
|
|
137
380
|
Copyright (c) 2020 Semih Arslanoglu. See [LICENSE.txt](LICENSE.txt) for
|