naturalsorter 2.0.9 → 2.0.10

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e7c06f3c9ea76e81248a248f359ba9d47a19585
4
- data.tar.gz: 4d61611758145d82ee30e137486c98a24ce7d176
3
+ metadata.gz: f1efceba12767b1736d4ef3c9cea338fcb28acb1
4
+ data.tar.gz: f0ff0e2df2e64f6ddac53edeffeade414c088221
5
5
  SHA512:
6
- metadata.gz: 8bed886f7de1dc8a87178ef9affcc743eabb81fb3ff845bbc9b7d6873224421463e511be1379cfeb3696a2bc3502917103714a88e13c8c261c008c224e3452e8
7
- data.tar.gz: 324bd9c146b24f4824ebcca9046b8faa05618b2616fd0cd5009b0ea142b4811add5afebd6c5220832e09616bdc22e7b9511c90fdc18161a3ee52f9d2610b60b1
6
+ metadata.gz: 21c3ecc8e3113c476ef677f1a3d8992bc859821f8ff96b46ce1deef9e321e26bb675c2cb0fd154fd503d5c7a4889683d657e703a9599e5c70a8ee1aa224994f6
7
+ data.tar.gz: 7baa67121d6bc657f6bfcdaaab14949323f17971d370227185d8ee004c728870abcbc1567a0487a2a7835780352cb21adcd357f1294e3d7423cef1b55a1a0884
data/README.markdown CHANGED
@@ -25,7 +25,7 @@ Because the default sort method does not recognize the numbers in the string. Th
25
25
 
26
26
  You should add this line to your Gemfile
27
27
 
28
- `gem 'naturalsorter', '2.0.9'`
28
+ `gem 'naturalsorter', '2.0.10'`
29
29
 
30
30
  and run this command in your app root directory
31
31
 
data/lib/naturalsorter.rb CHANGED
@@ -70,24 +70,28 @@ module Naturalsorter
70
70
 
71
71
  def self.bigger?(a, b)
72
72
  return false if a.eql?( b )
73
+ return false if Versioncmp.compare(a, b) == 0
73
74
  newest = self.get_newest a, b
74
75
  newest.eql?( a )
75
76
  end
76
77
 
77
78
  def self.smaller?(a, b)
78
79
  return false if b.eql?( a )
80
+ return false if Versioncmp.compare(a, b) == 0
79
81
  newest = self.get_newest a, b
80
82
  newest.eql?( b )
81
83
  end
82
84
 
83
85
  def self.bigger_or_equal?(a, b)
84
86
  return true if a.eql?(b)
87
+ return true if Versioncmp.compare(a, b) == 0
85
88
  newest = self.get_newest a, b
86
89
  newest.eql?(a)
87
90
  end
88
91
 
89
92
  def self.smaller_or_equal?(a, b)
90
93
  return true if a.eql?(b)
94
+ return true if Versioncmp.compare(a, b) == 0
91
95
  newest = self.get_newest a, b
92
96
  newest.eql?(b)
93
97
  end
@@ -1,3 +1,3 @@
1
1
  module Naturalsorter
2
- VERSION = "2.0.9"
2
+ VERSION = "2.0.10"
3
3
  end
@@ -219,6 +219,12 @@ describe Naturalsorter::Sorter do
219
219
  it "returns true" do
220
220
  Naturalsorter::Sorter.bigger_or_equal?("2.20", "2.20").should be_true
221
221
  end
222
+ it "returns true" do
223
+ Naturalsorter::Sorter.bigger_or_equal?("2.20", "2.20.0").should be_true
224
+ end
225
+ it "returns true" do
226
+ Naturalsorter::Sorter.bigger_or_equal?("2.20", "2.20").should be_true
227
+ end
222
228
  it "returns true" do
223
229
  Naturalsorter::Sorter.bigger_or_equal?("v3.2.0", "3.2.0").should be_true
224
230
  end
@@ -248,6 +254,12 @@ describe Naturalsorter::Sorter do
248
254
  it "returns true" do
249
255
  Naturalsorter::Sorter.smaller?("2.20", "3.0").should be_true
250
256
  end
257
+ it "returns false" do
258
+ Naturalsorter::Sorter.smaller?("2.0", "2.0").should be_false
259
+ end
260
+ it "returns false" do
261
+ Naturalsorter::Sorter.smaller?("2.0", "2.0.0").should be_false
262
+ end
251
263
 
252
264
  end
253
265
 
@@ -262,6 +274,12 @@ describe Naturalsorter::Sorter do
262
274
  it "returns false" do
263
275
  Naturalsorter::Sorter.smaller_or_equal?("2.20", "2.9").should be_false
264
276
  end
277
+ it "returns false" do
278
+ Naturalsorter::Sorter.smaller_or_equal?("2.20", "2.20").should be_true
279
+ end
280
+ it "returns false" do
281
+ Naturalsorter::Sorter.smaller_or_equal?("2.20.0", "2.20").should be_true
282
+ end
265
283
  it "returns true" do
266
284
  Naturalsorter::Sorter.smaller_or_equal?("2.20", "2.20").should be_true
267
285
  end
@@ -174,4 +174,8 @@ describe Versioncmp do
174
174
  Versioncmp.compare("3.0.0", "3.0").should eql(0)
175
175
  end
176
176
 
177
+ it "3.0 is equal to 3.0.0" do
178
+ Versioncmp.compare("3.0", "3.0.0").should eql(0)
179
+ end
180
+
177
181
  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.9
4
+ version: 2.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - reiz