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 CHANGED
@@ -76,7 +76,7 @@ because '~>1.1' doesn't fit anymore the newest version.
76
76
 
77
77
  You should add this line to your Gemfile
78
78
 
79
- `gem 'naturalsorter', '0.5.10'`
79
+ `gem 'naturalsorter', '0.5.11'`
80
80
 
81
81
  and run this command in your app root directory
82
82
 
@@ -1,3 +1,3 @@
1
1
  module Naturalsorter
2
- VERSION = "0.5.10"
2
+ VERSION = "0.5.11"
3
3
  end
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;
@@ -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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: naturalsorter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.10
4
+ version: 0.5.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: