naturalsorter 0.5.10 → 0.5.11
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +1 -1
- data/lib/naturalsorter/version.rb +1 -1
- data/lib/versioncmp.rb +4 -0
- data/spec/versioncmp_spec.rb +4 -0
- metadata +1 -1
data/README.markdown
CHANGED
data/lib/versioncmp.rb
CHANGED
@@ -43,11 +43,15 @@ class Versioncmp
|
|
43
43
|
a = String.new(a_val)
|
44
44
|
if a_val.match(/\.x-dev$/)
|
45
45
|
a = a_val.gsub("x-dev", "9999999")
|
46
|
+
elsif a_val.match(/-dev$/)
|
47
|
+
a = a_val.gsub("-dev", ".9999999")
|
46
48
|
end
|
47
49
|
|
48
50
|
b = String.new(b_val)
|
49
51
|
if b_val.match(/\.x-dev$/)
|
50
52
|
b = b_val.gsub("x-dev", "9999999")
|
53
|
+
elsif b_val.match(/-dev$/)
|
54
|
+
b = b_val.gsub("-dev", ".9999999")
|
51
55
|
end
|
52
56
|
|
53
57
|
offset1 = 0;
|
data/spec/versioncmp_spec.rb
CHANGED
@@ -9,6 +9,10 @@ describe Versioncmp do
|
|
9
9
|
it "smaler" do
|
10
10
|
Versioncmp.compare("1.1.5", "1.1.x-dev").should eql(-1)
|
11
11
|
end
|
12
|
+
|
13
|
+
it "smaler" do
|
14
|
+
Versioncmp.compare("1.1.5", "1.1-dev").should eql(-1)
|
15
|
+
end
|
12
16
|
|
13
17
|
it "bigger" do
|
14
18
|
Versioncmp.compare("1.1", "1.0").should eql(1)
|