{"id":19527217,"url":"https://github.com/sbagdat/turkish_support","last_synced_at":"2025-04-13T08:18:16.967Z","repository":{"id":15682424,"uuid":"18420018","full_name":"sbagdat/turkish_support","owner":"sbagdat","description":"Turkish character support for core ruby methods. ","archived":false,"fork":false,"pushed_at":"2021-03-21T12:56:51.000Z","size":126,"stargazers_count":76,"open_issues_count":0,"forks_count":5,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-13T08:18:09.561Z","etag":null,"topics":["rails","refinements","ruby","ruby-methods","turkce","turkish"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbagdat.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-03T22:19:50.000Z","updated_at":"2024-09-20T20:58:57.000Z","dependencies_parsed_at":"2022-09-10T08:41:28.843Z","dependency_job_id":null,"html_url":"https://github.com/sbagdat/turkish_support","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbagdat%2Fturkish_support","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbagdat%2Fturkish_support/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbagdat%2Fturkish_support/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbagdat%2Fturkish_support/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbagdat","download_url":"https://codeload.github.com/sbagdat/turkish_support/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681519,"owners_count":21144703,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rails","refinements","ruby","ruby-methods","turkce","turkish"],"created_at":"2024-11-11T01:13:58.774Z","updated_at":"2025-04-13T08:18:16.919Z","avatar_url":"https://github.com/sbagdat.png","language":"Ruby","readme":"# TurkishSupport \n[![Gem Version](https://badge.fury.io/rb/turkish_support.svg)](https://badge.fury.io/rb/turkish_support) \n[![Build Status](https://travis-ci.com/sbagdat/turkish_support.svg?branch=master)](https://travis-ci.com/sbagdat/turkish_support) \n[![Code Climate](https://codeclimate.com/github/sbagdat/turkish_support/badges/gpa.svg)](https://codeclimate.com/github/sbagdat/turkish_support)\n[![Coverage Status](https://coveralls.io/repos/github/sbagdat/turkish_support/badge.svg?branch=development)](https://coveralls.io/github/sbagdat/turkish_support?branch=development)\n\nTurkish character support for core ruby methods. This gem provides support nearly all `String` methods,\nsuch as `String#split`, `String#match`, `String#gsub`. It also provides support for `Array#sort`and some \nbonus methods like `String#titleize`.\n\n## Requirements\n* Ruby  \u003e= 2.7.0\n* Rails \u003e= 6.0.0\n\n* [Installation](#installation)\n* [Usage](#usage)\n  * [Using with ruby](#using-with-ruby)\n  * [Using with ruby on rails](#using-with-ruby-on-rails)\n* [String Methods](#string-methods)\n  * [#\u003c=\u003e](#-spaceship)\n  * [#\u003e](#----comparisons)\n  * [#\u003e=](#----comparisons)\n  * [#\u003c](#----comparisons)\n  * [#\u003c=](#----comparisons)\n  * [#[] and #[]=](#-and-)\n  * [capitalize](#capitalize-and-capitalize)\n  * [casecmp](#casecmp)\n  * [downcase](#downcase-and-downcase)\n  * [gsub](#gsub-and-gsub)\n  * [index](#index)\n  * [match](#match)\n  * [partition](#partition)\n  * [rpartition](#rpartition)\n  * [rindex](#rindex)\n  * [scan](#scan)\n  * [slice](#slice-and-slice)\n  * [split](#split)\n  * [sub](#sub-and-sub)\n  * [swapcase](#swapcase-and-swapcase)\n  * [titleize](#titleize-and-titleize)\n  * [upcase](#upcase-and-upcase)\n* [Array Methods](#array-methods)\n  * [sort](#sort-and-sort)\n\n## Installation\nAdd this line to your application's Gemfile:\n\n```\ngem 'turkish_support'\n```\n\nAnd then execute:\n\n```\n$ bundle\n```\n\nOr install it yourself as:\n\n```\n$ gem install turkish_support\n```\n\n## Usage\n\nAfter the installation of the gem, you should follow these steps.\n\n### Using with ruby\n\n* Require the gem:\n\n```ruby\n  require 'turkish_support'\n```\n\n* Add `using TurkishSupport` line to a class or a module.\n\nExample usage inside a class:\n\n```ruby\nrequire 'turkish_support'\n\nclass CanSpeakInTurkish\n  using TurkishSupport\n\n  def split_me_up(string, sep)\n    string.split(sep)\n  end\nend\n\nCanSpeakInTurkish.new.split_me_up('çarçarıçarşı', 'ç')\n# ['ar', 'arı', 'arşı']\n```\n\n### Using with ruby on rails\n\n__Note:__ You don't need to require, because it is already required by the rails.\n\n* You must add `using TurkishSupport` line to the top of the scope.\n\n```ruby\n  using TurkishSupport\n\n  class TopModel \u003c ApplicationRecord\n    # your code goes here\n  end\n```\n\n* If you want to use TurkishSupport with a custom class or a module that is not inherited from any rails tie, \nyou must add `using TurkishSupport` line to the class or module.\n\n```ruby\n  class CustomClass\n    using TurkishSupport\n\n    # your code goes here\n  end\n```\n\n## String Methods\n\n### \u003c=\u003e (spaceship)\n```ruby\n  'Cahit' \u003c=\u003e 'Çağla' # =\u003e -1\n  'Sıtkı' \u003c=\u003e 'Ömer'  # =\u003e  1\n  'Eren'  \u003c=\u003e 'Eren'  # =\u003e  0\n  'c'     \u003c=\u003e 'ca'    # =\u003e -1\n```\n\n### \u003c, \u003c=, \u003e, \u003e= (comparisons)\n```ruby\n  'd'   \u003e  'ç'     # =\u003e true\n  'aha' \u003e= 'ağa'   # =\u003e true\n  'd'   \u003c  'ç'     # =\u003e false\n  'ağa' \u003c= 'aha'   # =\u003e true\n```\n\n### [] and []=\n```ruby\n  'Türkiye Cumhuriyeti'[/\\w+/] # =\u003e \"Türkiye\"\n  'Çetin'[/[a-ğ]+/i]           # =\u003e \"Çe\"\n```\n\n### capitalize and capitalize!\n```ruby\n  str = 'türkÇE desteĞİ'\n\n  str.capitalize    # =\u003e \"Türkçe desteği\"\n  str.capitalize!   # =\u003e \"Türkçe desteği\"\n```\n\n### casecmp\n```ruby\n  'sıtKI'.casecmp('SITkı')     # =\u003e 0\n```\n\n### downcase and downcase!\n```ruby\n  str = 'İSMAİL'\n\n  str.downcase    # =\u003e \"ismail\"\n  str.downcase!   # =\u003e \"ismail\"\n```\n\n### gsub and gsub!\n```ruby\n  'ağa paşa ağa'.gsub(/\\b[a-h]+\\b/, 'bey') # =\u003e \"bey paşa bey\"\n```\n\n### index\n```ruby\n  '?ç-!+*/-ğüı'.index(/\\w+/)        # =\u003e 1\n  '?ç-!+*/-ğüı'.index(/[a-z]+/, 2)  # =\u003e 8\n```\n\n### match\n```ruby\n  'Aşağı'.match(/\\w+/)\n  # =\u003e #\u003cMatchData \"Aşağı\"\u003e\n\n  'Aşağı Ayrancı'.match(/^\\w+\\s\\w+$/)\n  # =\u003e #\u003cMatchData \"Aşağı Ayrancı\"\u003e\n\n  'aüvvağğ öövvaağ'.match(/^[a-z]+\\s[a-z]+$/)\n  # =\u003e #\u003cMatchData \"aüvvağğ öövvaağ\"\u003e\n\n  'BAĞCIlar'.match(/[A-Z]+/)\n  # =\u003e #\u003cMatchData \"BAĞCI\"\u003e\n\n  'Aşağı Ayrancı'.match(/\\W+/)\n  # =\u003e #\u003cMatchData \"\"\u003e\n```\n\n### partition\n```ruby\n  'Bağlarbaşı Çarşı'.partition(/\\W+/) # =\u003e [\"Bağlarbaşı\", \" \", \"Çarşı\"]\n```\n\n### rpartition\n```ruby\n  'Bağlarbaşı Çarşı Kalabalık'.rpartition(/\\W+/)\n  # =\u003e [\"Bağlarbaşı Çarşı\", \" \", \"Kalabalık\"]\n```\n\n### rindex\n```ruby\n  'şç-!+*/-ğüı'.rindex(/\\w+/, 7)  # =\u003e 1\n```\n\n### scan\n```ruby\n  'Bağlarbaşı Çarşı Kalabalık'.scan(/[a-z]+/i)\n  # =\u003e [\"Bağlarbaşı\", \"Çarşı\", \"Kalabalık\"]\n```\n\n\n### slice and slice!\n```ruby\n  'Duayen'.slice(/[^h-ö]+/) # =\u003e \"Duaye\"\n```\n\n### split\n```ruby\n  'Bağlarbaşı Çarşı Kalabalık'.split(/\\W+/)\n  # =\u003e [\"Bağlarbaşı\", \"Çarşı\", \"Kalabalık\"]\n\n  'Bağlarbaşı Çarşı Kalabalık'.split(/[ç-ş]+/)\n  # =\u003e [\"Ba\", \"a\", \"ba\", \" Ça\", \" Ka\", \"aba\"]\n```\n\n### sub and sub!\n```ruby\n  'ağapaşaağa'.sub(/[a-h]+/, 'bey')  # =\u003e \"beypaşaağa\"\n```\n\n### swapcase and swapcase!\n```ruby\n  'TuğÇE'.swapcase    # =\u003e \"tUĞçe\"\n  'TuğÇE'.swapcase!   # =\u003e \"tUĞçe\"\n```\n\n### titleize and titleize!\n*These methods are not core methods of ruby, but they are accepted as useful in most situations.*\n```ruby\n  'türkÇE desteĞİ'.titleize           # =\u003e \"Türkçe Desteği\"\n  'türkÇE desteĞİ'.titleize!          # =\u003e \"Türkçe Desteği\"\n\n  # Parenthesis, quotes, etc. support\n  \"rUBY roCkS... (really! 'tRUSt' ME)\".titleize\n  # =\u003e \"Ruby Rocks... (Really! 'Trust' Me)\"\n```\n\n### upcase and upcase!\n\n```ruby\n  str = 'Bağcılar'\n\n  str.upcase    # =\u003e \"BAĞCILAR\"\n  str           # =\u003e \"Bağcılar\"\n\n  str.upcase!   # =\u003e \"BAĞCILAR\"\n  str           # =\u003e \"BAĞCILAR\"\n```\n\n## Array Methods\n\n### sort and sort!\n\n```ruby\n  %w(iki üç dört ılık iğne iyne).sort\n  # =\u003e [\"dört\", \"ılık\", \"iğne\", \"iki\", \"iyne\", \"üç\"]\n```\n\n## Development\n\nTo install this gem onto your local machine, run `bundle exec rake install`. \n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/sbagdat/turkish_support. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/sbagdat/turkish_suppport/blob/master/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the TurkishSupport project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct]\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbagdat%2Fturkish_support","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbagdat%2Fturkish_support","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbagdat%2Fturkish_support/lists"}