bruce (owner)

Revisions

gist: 228408 Download_button fork
public
Description:
An example of alphanumeric versioning support in RubyGems
Public Clone URL: git://gist.github.com/228408.git
Embed All Files: show embed
alnum_versions.rb #
1
2
3
4
5
6
7
require 'rubygems'
 
raw = %w(1.0 1.1 1.0b1 1.0b2 1.0a 1.0.b.1 1.0a2 1.0.b.2 1.0.b1 1.0.b2 0.9)
 
versions = raw.map { |s| Gem::Version.create(s) }
 
puts versions.sort
output.txt #
1
2
3
4
5
6
7
8
9
10
11
0.9
1.0a
1.0a2
1.0b1
1.0b2
1.0.b.1
1.0.b.2
1.0.b1
1.0.b2
1.0
1.1