{"id":15048082,"url":"https://github.com/github/version_sorter","last_synced_at":"2025-05-05T04:03:46.882Z","repository":{"id":554419,"uuid":"184996","full_name":"github/version_sorter","owner":"github","description":"Fast sorting of version numbers","archived":false,"fork":false,"pushed_at":"2024-04-02T17:38:10.000Z","size":723,"stargazers_count":126,"open_issues_count":4,"forks_count":34,"subscribers_count":319,"default_branch":"master","last_synced_at":"2025-05-05T04:03:40.935Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","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/github.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2009-04-25T00:05:19.000Z","updated_at":"2025-03-10T12:56:32.000Z","dependencies_parsed_at":"2024-04-02T18:42:41.971Z","dependency_job_id":"9cb937e5-d616-4203-b1a4-bbce58d06d90","html_url":"https://github.com/github/version_sorter","commit_stats":{"total_commits":110,"total_committers":15,"mean_commits":7.333333333333333,"dds":0.6545454545454545,"last_synced_commit":"9f3bcbab75ac6aed83a82d7d8b439f544f93ec97"},"previous_names":["defunkt/version_sorter"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fversion_sorter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fversion_sorter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fversion_sorter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fversion_sorter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/github","download_url":"https://codeload.github.com/github/version_sorter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252436291,"owners_count":21747470,"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":[],"created_at":"2024-09-24T21:07:58.951Z","updated_at":"2025-05-05T04:03:46.864Z","avatar_url":"https://github.com/github.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Version sorter\n\nFast sorting of strings representing version numbers.\n\n```rb\nrequire 'version_sorter'\n\nversions = [\"1.0.9\", \"2.0\", \"1.0.10\", \"1.0.3\", \"2.0.pre\"]\n\nVersionSorter.sort(versions)\n#=\u003e 1.0.3\n#=\u003e 1.0.9\n#=\u003e 1.0.10\n#=\u003e 2.0.pre\n#=\u003e 2.0\n```\n\nYou can also sort arrays of arbitrary objects by providing a block.\n\n```rb\nVersionSorter.sort(tags) { |tag| tag.name }\n```\n\nLibrary API:\n\n```rb\nVersionSorter.sort(versions)   #=\u003e sorted array\nVersionSorter.rsort(versions)  #=\u003e reverse sorted array\n\nVersionSorter.sort!(versions)  # sort array in place\nVersionSorter.rsort!(versions) # reverse sort array in place\n\nVersionSorter.compare(version_a, version_b) #=\u003e positive or negative number depending on which way to sort \n```\n\n\u003chttp://github.com/blog/521-speedy-version-sorting\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fversion_sorter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithub%2Fversion_sorter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fversion_sorter/lists"}