naturalsorter 3.0.6 → 3.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/README.markdown +1 -1
- data/lib/naturalsorter/version.rb +1 -1
- data/lib/versioncmp.rb +4 -2
- data/spec/versioncmp_spec.rb +12 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f901c5d097daae7a6b248ce1c8de2565d689da1
|
4
|
+
data.tar.gz: 8bf904b4355e90fc2a64176334eea038db18636f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40371da5502c6a66f244bcf443f0a0fed91f13771ba7a22997896969a3a1c150a412d1144f854926077862feff4ab6ac3ffb48bf784128a281a73f78e2591ae5
|
7
|
+
data.tar.gz: 7b6e21aadacca041e5c1d924474b6733c316be7bbb5b74fb14014cc68c12b65b7a1906b59f6cd35ba5294a6f47b8bff80f8f1b33994f7b761bc5315eb2acadfa
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.2.2
|
data/README.markdown
CHANGED
data/lib/versioncmp.rb
CHANGED
@@ -228,9 +228,11 @@ class Versioncmp
|
|
228
228
|
|
229
229
|
def self.replace_x_dev val
|
230
230
|
new_val = String.new(val)
|
231
|
-
if val.eql?("dev-master")
|
231
|
+
if val.eql?("dev-master") || val.eql?("dev-develop")
|
232
232
|
new_val = "9999999"
|
233
|
-
elsif val.match(
|
233
|
+
elsif val.match(/\Adev-/i)
|
234
|
+
new_val = "9999999"
|
235
|
+
elsif val.match(/\.x-dev$/i)
|
234
236
|
new_val = val.gsub("x-dev", "9999999")
|
235
237
|
elsif val.match(/-dev$/)
|
236
238
|
new_val = val.gsub("-dev", ".9999999")
|
data/spec/versioncmp_spec.rb
CHANGED
@@ -198,4 +198,16 @@ describe Versioncmp do
|
|
198
198
|
Versioncmp.compare("1.5.2", "1.5.2-patch1").should eql(-1)
|
199
199
|
end
|
200
200
|
|
201
|
+
it "dev-master is bigger than 1.0.0" do
|
202
|
+
Versioncmp.compare("dev-master", "1.0.0").should eql(1)
|
203
|
+
end
|
204
|
+
|
205
|
+
it "dev-develop is bigger than 1.0.0" do
|
206
|
+
Versioncmp.compare("dev-develop", "1.0.0").should eql(1)
|
207
|
+
end
|
208
|
+
|
209
|
+
it "dev-something is bigger than 1.0.0" do
|
210
|
+
Versioncmp.compare("dev-something", "1.0.0").should eql(1)
|
211
|
+
end
|
212
|
+
|
201
213
|
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: 3.0.
|
4
|
+
version: 3.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- reiz
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-06-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
70
|
version: '0'
|
71
71
|
requirements: []
|
72
72
|
rubyforge_project: naturalsorter
|
73
|
-
rubygems_version: 2.4.
|
73
|
+
rubygems_version: 2.4.7
|
74
74
|
signing_key:
|
75
75
|
specification_version: 4
|
76
76
|
summary: Sorting arrays in natural order
|