{"id":19787221,"url":"https://github.com/logandk/natural_sorting","last_synced_at":"2025-10-26T17:15:38.669Z","repository":{"id":532751,"uuid":"161846","full_name":"logandk/natural_sorting","owner":"logandk","description":"Rails plugin implementing natural sorting of arrays","archived":false,"fork":false,"pushed_at":"2009-04-09T19:12:41.000Z","size":83,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-31T20:49:09.972Z","etag":null,"topics":[],"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/logandk.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-03-28T17:06:28.000Z","updated_at":"2023-03-10T23:02:58.000Z","dependencies_parsed_at":"2022-07-07T14:10:15.299Z","dependency_job_id":null,"html_url":"https://github.com/logandk/natural_sorting","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/logandk/natural_sorting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logandk%2Fnatural_sorting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logandk%2Fnatural_sorting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logandk%2Fnatural_sorting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logandk%2Fnatural_sorting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logandk","download_url":"https://codeload.github.com/logandk/natural_sorting/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logandk%2Fnatural_sorting/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281139272,"owners_count":26450191,"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","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-12T06:21:49.602Z","updated_at":"2025-10-26T17:15:38.637Z","avatar_url":"https://github.com/logandk.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"natural_sorting - Sort arrays in a more human way\n=================================================\n\nThis is a Ruby on Rails plugin, which introduces a new method to the Array\nclass in order to sort values in a natural way.\n\n\n\nInstallation\n============\n\nAs a Rails Plugin\n-----------------\n\nUse this to install as a plugin in a Ruby on Rails app:\n\n\t$ script/plugin install git://github.com/logandk/natural_sorting.git\n\n\nAs a Rails Plugin (using git submodules)\n----------------------------------------\n\nUse this if you prefer the idea of being able to easily switch between using edge or a tagged version:\n\n\t$ git submodule add git://github.com/logandk/natural_sorting.git vendor/plugins/natural_sorting\n\n\n\nUsage\n=====\n\nThe default `sort` method will sort your array like this:\n\n\t\u003e\u003e [\"Image 1\", \"Image 3\", \"Image 11\", \"Image 20\"].sort\n\t=\u003e [\"Image 1\", \"Image 11\", \"Image 20\", \"Image 3\"]\n\nThis plugin introduces the `sort_natural` method, which sorts your array like this:\n\n\t\u003e\u003e [\"Image 1\", \"Image 3\", \"Image 11\", \"Image 20\"].sort_natural\n\t=\u003e [\"Image 1\", \"Image 3\", \"Image 11\", \"Image 20\"]\n\nMuch better.\n\n\nBy default, the `sort_natural` method is not case-sensitive, but this can be controlled like this:\n\n\t\u003e\u003e [\"apple\", \"flaf\", \"Hello world!\", \"Arrrrr\"].sort_natural :case_sensitive =\u003e true\n\t=\u003e [\"Arrrrr\", \"Hello world!\", \"apple\", \"flaf\"]\n\nAlso, the plugin adds a couple of other methods. Replace the array with the sorted version:\n\n\t[...].sort_natural!\n\nCompare two strings naturally, default case_sensitive = false:\n\n\tString.natcmp(\"hello\", \"world\"[, :case_sensitive =\u003e true])\n\n\n\nCredits\n=======\nThe `natcmp` method is based on the work by *Alan Davies*, as described in `lib/core_ext/string.rb`.\n\nCopyright (c) 2008 Logan Raarup, released under the MIT license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogandk%2Fnatural_sorting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogandk%2Fnatural_sorting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogandk%2Fnatural_sorting/lists"}