GithubHelp home page GithubHelp logo

sarslanoglu / turkish_cities Goto Github PK

View Code? Open in Web Editor NEW
45.0 2.0 10.0 1.23 MB

List and find Turkish cities via name, district name, post code, plate number etc.

Home Page: https://rubygems.org/gems/turkish_cities

License: MIT License

Ruby 100.00%
ruby-gem turkey turkish turkish-cities listing-cities turkish-city finding-cities subdistricts neighborhoods

turkish_cities's Introduction

Hello there 👋

  • 💻 6+ years development working experience
  • 🎓 Experienced with Ruby on Rails
  • 🔭 Working on Turkish Cities open source project
  • 🌱 Interested in Go, Elixir and Rust
  • ⛵ Encouraging people for open source collaborations
  • 🤔 Looking for help with new ideas for Turkish Cities

Take a look at my repositories and let's get in touch!

visitor badge

turkish_cities's People

Contributors

atagunay avatar dependabot-preview[bot] avatar dependabot[bot] avatar enderahmetyurt avatar sarslanoglu avatar serpilacar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

turkish_cities's Issues

[BUG] - NoMethodError on list_neighborhoods

Describe the bug
When I run TurkishCities.list_neighborhoods('Eskişehir', 'Odunpazarı', 'Büyükkkkkdere') it gives me NoMethodError (undefined method `[]' for nil:NilClass)

To Reproduce
Steps to reproduce the behavior:

  1. In terminal require 'turkish_cities'
  2. Call TurkishCities.list_neighborhoods('Eskişehir', 'Odunpazarı', 'Büyükkkkkdere')

Expected behavior
It should return more meaningful error messages to user like "Couldn't find subdistrict name with 'Büyükkkkkdere' of 'Odunpazarı/Eskişehir'"

[BUG] - ArgumentError: comparison of Array with Array failed

Describe the bug
When processing the "sort alphabetically" method if the list has any record that contains a dot character, the program throws an exception.

To Reproduce
Steps to reproduce the behavior:

  1. run rails c
  2. run TurkishCities.list_neighborhoods("İzmir", "Konak")
  3. program throws =>
ArgumentError: comparison of Array with Array failed
from /Users/username/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/turkish_cities-0.7.0/lib/turkish_cities/helpers/decomposer_helper.rb:80:in `sort_by'

Expected behavior
Users can see the neighborhoods of İzmir, Konak.
Example output:

[
  "1.kadriye Mah",
  "19 Mayıs Mah",
  "2.kadriye Mah",
  "26 Ağustos Mah"
]

List cities with options

Listing cities should also include some basic data inside. These can be

  • plate_number
  • region
  • phone_code
  • metropolitan_municipality_since

Dependabot can't resolve your Ruby dependency files

Dependabot can't resolve your Ruby dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Bundler::VersionConflict with message: Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    bundler (~> 2.1.4)

  Current Bundler version:
    bundler (2.2.15)

Your bundle requires a different version of Bundler than the one you're running.
Install the necessary version with `gem install bundler:2.1.4` and rerun bundler using `run.rb _2.1.4_`

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

[BUG] - undefined method `values' for "xxx":String

Describe the bug
This bug occurs with sending dummy or nested similar parameters to list_neighborhoods method.
To briefly explain, If a district is not exist gem can not open yaml file and throw an error like

Caught the exception: No such file or directory @ rb_sysopen - /Users/atagunay/.asdf/installs/ruby/3.2.1/lib/ruby/gems/3.2.0/gems/turkish_cities 0.7.0/lib/turkish_cities/helpers/../data/districts/xxxx.yaml

Under normal conditions, this error can handle via district_item method. Because it return nil.
But if a person send nested parameters like:

city: xxx
district: xx

district_item can not return nil with these parameters. Because it find "xx" in "xxx". And then code broken.

To Reproduce
Steps to reproduce the behavior:

  1. TurkishCities.list_neighborhoods('xxx','xx')

Expected behavior
As a user, I should see meaningful error message like "Couldn't find district name with 'xxx' of 'xx'"

image

Refactor create_neighborhoods on district.rb

Is your feature request related to a problem? Please describe.
create_neighborhoods method is accepting 4 parameters and quite confusing for contributors.

Describe the solution you'd like
Refactoring to simpler method would be more beneficial.

#43

[FEAT] - Control For Missing Chars in turkish_alphabet

Is your feature request related to a problem? Please describe.

Unforeseen characters may appear while sorting. For this reason, a control mechanism should be developed for these characters.

Describe the solution you'd like

If the character is not in the predefined character set, skip to the last in the sequence.

[BUG] - ArgumentError: comparison of Array with Array failed

Describe the bug
When processing the "sort alphabetically" method if the list has any record that contains a dot character, the program throws an exception.

To Reproduce
Steps to reproduce the behavior:

  1. run rails c
  2. run TurkishCities.list_neighborhoods('Artvin', 'Yusufeli')
  3. program throws =>
ArgumentError: comparison of Array with Array failed
from /Users/username/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/turkish_cities-0.7.0/lib/turkish_cities/helpers/decomposer_helper.rb:80:in `sort_by'

Expected behavior
Users can see the neighborhoods of İzmir, Konak.
Example output:

[
...
"Abanoz Mah (Bahçeli Köyü)",
 "Abramet -kakrazevl Mah (Altıparmak Köyü)",
 "Ada Mah (Çevreli Köyü)",
 "Ada Mah (Irmakyanı Köyü)",
...
]

[FEAT] - Update city/district/subdistrict informations to 2022

Is your feature request related to a problem? Please describe.
Some subdistrict became district. And some subdistrict merged with larger ones

Describe the solution you'd like
Up to date list of districts

Describe alternatives you've considered

Additional context

Enhancements for district class

Is your feature request related to a problem? Please describe.
Some of the methods were overlooked in district class while fixing #45 .

Describe the solution you'd like
Improve the code for these methods and similar ones.

[BUG] - "translation missing: tr.errors.city_not_found_error"

Describe the bug
In 0.6.1 version, if gem can not find anything, it return this string "translation missing: tr.errors.city_not_found_error". But it should something like that "Couldn't find city name with 'İstan'".

To Reproduce

  1. districts = TurkishCities.list_districts('istanb')
  2. "translation missing: tr.errors.city_not_found_error".

Expected behavior

  1. districts = TurkishCities.list_districts('istanb')
  2. "Couldn't find city name with 'İstan'"

Additional context
I try to use 0.3.0. There are not a problem. But 0.6.1 has this bug.

Fix YAML file read issue

While reading YAML file in Rails apps, gem gives no file error like

errno::ENOENT: No such file or directory - bs_fetch:open_current_file:open

[BUG] - (After installation, rails server throw a exception)

Describe the bug
I installed the gem clearly as shown in documentation. After this step, I want to start my rails server. But I came across an error. I tried rails 5 and 7. Ruby 2.7.2.

To Reproduce
Steps to reproduce the behavior:

  1. $ gem install turkish_cities
  2. add gem 'turkish_cities' into the gem file
  3. $ bundle
  4. $ rails s

Expected behavior
Server should start.

Additional context
image

Dependabot can't resolve your Ruby dependency files

Dependabot can't resolve your Ruby dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Bundler::VersionConflict with message: Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    bundler (~> 2.2.16)

  Current Bundler version:
    bundler (2.2.15)

Your bundle requires a different version of Bundler than the one you're running.
Install the necessary version with `gem install bundler:2.2.16` and rerun bundler using `run.rb _2.2.16_`

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.