Skip to content

Commit 3454bc3

Browse files
committed
Nicer README
1 parent 2cd0122 commit 3454bc3

2 files changed

Lines changed: 28 additions & 18 deletions

File tree

README.markdown

Lines changed: 0 additions & 18 deletions
This file was deleted.

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Version sorter
2+
3+
Fast sorting of strings representing version numbers.
4+
5+
```rb
6+
require 'version_sorter'
7+
8+
versions = ["1.0.9", "2.0", "1.0.10", "1.0.3", "2.0.pre"]
9+
10+
VersionSorter.sort(versions)
11+
#=> 1.0.3
12+
#=> 1.0.9
13+
#=> 1.0.10
14+
#=> 2.0.pre
15+
#=> 2.0
16+
```
17+
18+
Library API:
19+
20+
```rb
21+
VersionSorter.sort(versions) #=> sorted array
22+
VersionSorter.rsort(versions) #=> reverse sorted array
23+
24+
VersionSorter.sort!(versions) # sort array in place
25+
VersionSorter.rsort!(versions) # reverse sort array in place
26+
```
27+
28+
<http://github.com/blog/521-speedy-version-sorting>

0 commit comments

Comments
 (0)