Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fast sorting of version numbers
C Ruby Shell VimL
branch: master

Improve script/release

Now handles creating the release commit
latest commit 2cf3b7514c
@mislav mislav authored

README.md

Version sorter

Fast sorting of strings representing version numbers.

require 'version_sorter'

versions = ["1.0.9", "2.0", "1.0.10", "1.0.3", "2.0.pre"]

VersionSorter.sort(versions)
#=> 1.0.3
#=> 1.0.9
#=> 1.0.10
#=> 2.0.pre
#=> 2.0

Library API:

VersionSorter.sort(versions)   #=> sorted array
VersionSorter.rsort(versions)  #=> reverse sorted array

VersionSorter.sort!(versions)  # sort array in place
VersionSorter.rsort!(versions) # reverse sort array in place

http://github.com/blog/521-speedy-version-sorting

Something went wrong with that request. Please try again.