naturalsorter 2.0.0 → 2.0.1

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', '2.0.0'`
79
+ `gem 'naturalsorter', '2.0.1'`
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 = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
data/lib/versioncmp.rb CHANGED
@@ -133,11 +133,18 @@ class Versioncmp
133
133
 
134
134
  def self.pre_process val
135
135
  a = replace_x_dev val
136
- replace_leading_v( a )
137
- VersionTagRecognizer.remove_minimum_stability( a )
136
+ replace_leading_v a
137
+ replace_99_does_not_exist a
138
+ VersionTagRecognizer.remove_minimum_stability a
138
139
  a
139
140
  end
140
141
 
142
+ def self.replace_99_does_not_exist val
143
+ if val.eql?("99.0-does-not-exist")
144
+ val.gsub!("99.0-does-not-exist", "0.0.0")
145
+ end
146
+ end
147
+
141
148
  def self.replace_x_dev val
142
149
  new_val = String.new(val)
143
150
  if val.eql?("dev-master")
@@ -150,4 +150,8 @@ describe Versioncmp do
150
150
  Versioncmp.compare("1.7.2", "1.7.1rc1").should eql(1)
151
151
  end
152
152
 
153
+ it "99.0-does-not-exist is smaller than 1.7.1" do
154
+ Versioncmp.compare("99.0-does-not-exist", "1.7.1").should eql(-1)
155
+ end
156
+
153
157
  end
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: 2.0.0
4
+ version: 2.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-03-14 00:00:00.000000000 Z
13
+ date: 2013-03-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec