naturalsorter 3.0.18 → 3.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.markdown +1 -1
- data/lib/naturalsorter/version.rb +1 -1
- data/lib/versioncmp.rb +7 -0
- data/spec/naturalsorter/versioncmp_spec.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 842fac0c8a6456189c21ff91b5a5b297d1af062e
|
|
4
|
+
data.tar.gz: 942e788e64f51c95a7052c4bdf83cd8ae5ec3ce3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 855652f170d372a653a4851309ef6e9fb860130cc87ba576d6fae304838292c5b234d006f930a5a85486b5af0dd8105ddeba19419264be05738043a91e4d6edb
|
|
7
|
+
data.tar.gz: f6f5544efb8bbc286db2d7ed68441fd95567d75d67cb24dcd4b80f215f6befa7116ef5ab9fa94566406627207b339cf1e5e426d26365da7efb8ca0029e90a5bf
|
data/README.markdown
CHANGED
data/lib/versioncmp.rb
CHANGED
|
@@ -234,6 +234,7 @@ class Versioncmp
|
|
|
234
234
|
replace_99_does_not_exist cleaned_version
|
|
235
235
|
replace_timestamps cleaned_version
|
|
236
236
|
replace_groovy cleaned_version
|
|
237
|
+
replace_redhatx cleaned_version
|
|
237
238
|
VersionTagRecognizer.remove_minimum_stability cleaned_version
|
|
238
239
|
cleaned_version
|
|
239
240
|
end
|
|
@@ -257,6 +258,12 @@ class Versioncmp
|
|
|
257
258
|
end
|
|
258
259
|
end
|
|
259
260
|
|
|
261
|
+
def self.replace_redhatx val
|
|
262
|
+
if val.match(/\-redhat\-[0-9]+$/i)
|
|
263
|
+
val.gsub!(/\-redhat\-[0-9]+$/i, "")
|
|
264
|
+
end
|
|
265
|
+
end
|
|
266
|
+
|
|
260
267
|
|
|
261
268
|
# Some glory Java Devs used the timestamp as version string
|
|
262
269
|
# http://www.versioneye.com/package/commons-beanutils--commons-beanutils
|
|
@@ -141,6 +141,14 @@ describe Versioncmp do
|
|
|
141
141
|
expect( Versioncmp.compare("1.0", "1.0.0")).to eql(0)
|
|
142
142
|
end
|
|
143
143
|
|
|
144
|
+
it "equal" do
|
|
145
|
+
expect( Versioncmp.compare("3.3.1.Final", "3.3.1.Final-redhat-1")).to eql(0)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
it "equal" do
|
|
149
|
+
expect( Versioncmp.compare("3.3.1.Final", "3.3.1.Final-RedHat-33")).to eql(0)
|
|
150
|
+
end
|
|
151
|
+
|
|
144
152
|
it "1.0.0 is smaller than 1.0.*" do
|
|
145
153
|
expect( Versioncmp.compare("1.0.0", "1.0.*")).to eql(-1)
|
|
146
154
|
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.19
|
|
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: 2017-
|
|
12
|
+
date: 2017-11-25 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rspec
|