diff --git a/Gemfile.lock b/Gemfile.lock index a0a1af5..11f7f86 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,41 +15,41 @@ GEM term-ansicolor (~> 1.3) thor (>= 0.19.4, < 2.0) tins (~> 1.6) - diff-lcs (1.3) + diff-lcs (1.4.4) docile (1.3.2) i18n (1.8.5) concurrent-ruby (~> 1.0) json (2.3.0) - parallel (1.19.2) - parser (2.7.1.4) + parallel (1.20.0) + parser (2.7.2.0) ast (~> 2.4.1) rainbow (3.0.0) - regexp_parser (1.7.1) + regexp_parser (1.8.2) rexml (3.2.4) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.2) - rspec-support (~> 3.9.3) - rspec-expectations (3.9.2) + rspec (3.10.0) + rspec-core (~> 3.10.0) + rspec-expectations (~> 3.10.0) + rspec-mocks (~> 3.10.0) + rspec-core (3.10.0) + rspec-support (~> 3.10.0) + rspec-expectations (3.10.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) + rspec-support (~> 3.10.0) + rspec-mocks (3.10.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.3) - rubocop (0.88.0) + rspec-support (~> 3.10.0) + rspec-support (3.10.0) + rubocop (1.3.1) parallel (~> 1.10) - parser (>= 2.7.1.1) + parser (>= 2.7.1.5) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.7) + regexp_parser (>= 1.8) rexml - rubocop-ast (>= 0.1.0, < 1.0) + rubocop-ast (>= 1.1.1) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 2.0) - rubocop-ast (0.2.0) - parser (>= 2.7.0.1) + rubocop-ast (1.1.1) + parser (>= 2.7.1.5) ruby-progressbar (1.10.1) simplecov (0.16.1) docile (~> 1.1) @@ -70,8 +70,8 @@ PLATFORMS DEPENDENCIES bundler (~> 2.1.4) coveralls (~> 0.8.23) - rspec (~> 3.9.0) - rubocop (~> 0.88.0) + rspec (~> 3.10.0) + rubocop (~> 1.3.1) turkish_cities! BUNDLED WITH diff --git a/README.md b/README.md index e009924..39ae429 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,22 @@ -# 🏙️ Turkish Cities -[![Gem Version](https://badge.fury.io/rb/turkish_cities.svg)](https://rubygems.org/gems/turkish_cities) -[![Build Status](https://travis-ci.org/sarslanoglu/turkish_cities.svg?branch=master)](https://travis-ci.org/sarslanoglu/turkish_cities) -[![Coverage Status](https://coveralls.io/repos/github/sarslanoglu/turkish_cities/badge.svg?branch=master)](https://coveralls.io/github/sarslanoglu/turkish_cities?branch=master) -[![Maintainability](https://api.codeclimate.com/v1/badges/c1dbe0cef353b152956e/maintainability)](https://codeclimate.com/github/sarslanoglu/turkish_cities/maintainability) -[![Test Coverage](https://api.codeclimate.com/v1/badges/c1dbe0cef353b152956e/test_coverage)](https://codeclimate.com/github/sarslanoglu/turkish_cities/test_coverage) -[![Protected by Hound](https://img.shields.io/badge/Protected_by-Hound-a873d1.svg)](https://houndci.com) -[![License](https://img.shields.io/github/license/sarslanoglu/turkish_cities.svg)](https://opensource.org/licenses/MIT) - -**turkish_cities** is a Ruby gem which makes searching and listing Turkish cities easy. https://rubygems.org/gems/turkish_cities +# ![TurkishCities](./public/assets/img/TurkishCities_yellow-on-darkblue_horizontal_914X343@3x-8.png) + +

+ + GemVersion + + BuildStatus + + CoverageStatus + + Maintainability + + Hound + + License +

+ +**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. +https://rubygems.org/gems/turkish_cities ## Table of Contents * [Installation](#installation) @@ -291,17 +300,37 @@ https://postakodu.ptt.gov.tr/ - 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. +## Roadmap + +- Add missing land travel method +- Add missing sea travel method +- Add localization to gem +- Refactor tests (seperate test suites with more edge case tests) + ## Contributing Contributing guidelines are available [here](CONTRIBUTING.md). +People behind the 💻 + + + + + + +

Ender Ahmet Yurt


Serpil Acar


Semih Arslanoğlu

+ ## Changelog Changelog is available [here](CHANGELOG.md). ## Logo -TurkishCities's logo created by [Nebal Çolpan](https://www.behance.net/nebalcolpan) +TurkishCities's logo created by [Nebal Çolpan](https://www.behance.net/nebalcolpan). You can find the logo in various +formats [here](https://github.com/sarslanoglu/turkish_cities/tree/master/public/assets/img/). + +The logo is licensed under a +[Creative Commons Attribution-NonCommercial 4.0 International License](https://creativecommons.org/licenses/by-nc/4.0/deed.en_GB). ## Copyright diff --git a/lib/turkish_cities/distance.rb b/lib/turkish_cities/distance.rb index b308c1d..eae1ef1 100644 --- a/lib/turkish_cities/distance.rb +++ b/lib/turkish_cities/distance.rb @@ -98,7 +98,7 @@ def distance_time_estimation(air_distance) end def description_text(travel_method, city_array, result_set) - travel_method + ' travel distance between ' + city_array[0]['name'] + ' and ' + city_array[1]['name'] + ' is ' + - result_set[0].to_s + ' km. Estimated air travel would take ' + result_set[1].to_s + ' minutes.' + "#{travel_method} travel distance between #{city_array[0]['name']} and #{city_array[1]['name']} is " \ + "#{result_set[0]} km. Estimated air travel would take #{result_set[1]} minutes." end end diff --git a/lib/turkish_cities/helpers/decomposer_helper.rb b/lib/turkish_cities/helpers/decomposer_helper.rb index bf95566..844efee 100644 --- a/lib/turkish_cities/helpers/decomposer_helper.rb +++ b/lib/turkish_cities/helpers/decomposer_helper.rb @@ -43,7 +43,7 @@ def postcode_not_found_error(postcode_input) end def prepare_city_list(city_list, options) - if options.dig(:with) + if options[:with] city_list.map do |city| result = {} result[:name] = city['name'] @@ -65,7 +65,7 @@ def prepare_city_list(city_list, options) def sort_alphabetically(list, options = nil) turkish_alphabet = ' -0123456789abcçdefgğhıijklmnoöprsştuüvyz' list.sort_by do |item| - item_to_sort = if options.nil? || options.dig(:with).nil? + item_to_sort = if options.nil? || options[:with].nil? item else item[:name] diff --git a/turkish_cities.gemspec b/turkish_cities.gemspec index 902f43d..3135684 100644 --- a/turkish_cities.gemspec +++ b/turkish_cities.gemspec @@ -23,8 +23,8 @@ Gem::Specification.new do |s| s.add_development_dependency 'bundler', '~> 2.1.4' s.add_development_dependency 'coveralls', '~> 0.8.23' - s.add_development_dependency 'rspec', '~> 3.9.0' - s.add_development_dependency 'rubocop', '~> 0.88.0' + s.add_development_dependency 'rspec', '~> 3.10.0' + s.add_development_dependency 'rubocop', '~> 1.3.1' if s.respond_to?(:metadata) s.metadata['changelog_uri'] = 'https://github.com/sarslanoglu/turkish_cities/blob/master/CHANGELOG.md'