naturalsorter 3.0.18 → 3.0.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 00d43f59d162fae1a70fd22f3362d15c2425c62a
4
- data.tar.gz: fc581607d0658b4f8bb5392e55a148804821b5aa
3
+ metadata.gz: 842fac0c8a6456189c21ff91b5a5b297d1af062e
4
+ data.tar.gz: 942e788e64f51c95a7052c4bdf83cd8ae5ec3ce3
5
5
  SHA512:
6
- metadata.gz: 8949a480245b8db9ea956ed9aec2c4668dcb2b50213d83e16f49d0028444899e08595a65df75f4f9d14dc4edef7df507fc3829ba7e54ae61bba5cde58518aca1
7
- data.tar.gz: 89a45aa107e5afca1f9a019a42cc2ce5a2cbc763719837d518cdd228311c22a8c7c04f01c546b12509ef58e8de7f77e6e958258412445346abd37ad60cc86e75
6
+ metadata.gz: 855652f170d372a653a4851309ef6e9fb860130cc87ba576d6fae304838292c5b234d006f930a5a85486b5af0dd8105ddeba19419264be05738043a91e4d6edb
7
+ data.tar.gz: f6f5544efb8bbc286db2d7ed68441fd95567d75d67cb24dcd4b80f215f6befa7116ef5ab9fa94566406627207b339cf1e5e426d26365da7efb8ca0029e90a5bf
@@ -27,7 +27,7 @@ Because the default sort method does not recognize the numbers in the string. Th
27
27
 
28
28
  You should add this line to your Gemfile
29
29
 
30
- `gem 'naturalsorter', '3.0.16'`
30
+ `gem 'naturalsorter', '3.0.19'`
31
31
 
32
32
  and run this command in your app root directory
33
33
 
@@ -1,3 +1,3 @@
1
1
  module Naturalsorter
2
- VERSION = "3.0.18"
2
+ VERSION = "3.0.19"
3
3
  end
@@ -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.18
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-07-14 00:00:00.000000000 Z
12
+ date: 2017-11-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec