Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fast sorting of version numbers
C Ruby Shell
branch: master

Improve script/release

Now handles creating the release commit
latest commit 2cf3b7514c
Mislav Marohnić mislav authored
Failed to load latest commit information.
bin Add readygo benchmark
ext/version_sorter Ensure we always have a string...
script Improve script/release
test Add tests for `sort!` and `rsort!`
.gitmodules Add readygo benchmark
.readygo Record a new benchmark baseline after C changes
.travis.yml Enable Travis CI
.vimrc Whitespace fixes
Gemfile Ruby 2.2 test compatibility
Gemfile.lock Fix CI by bumping bundle lockfile
LICENSE Add MIT, credit @pope Nicer README
Rakefile Rewrite with a more efficient algorithm
version_sorter.gemspec version_sorter 2.0.0

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"]

#=> 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

Something went wrong with that request. Please try again.