naturalsorter 3.0.0 → 3.0.1

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: 92e0886e8c42c1ba9393d8f9cd9dde1689c84f6c
4
- data.tar.gz: 5accede726dcb7a76064895723e5b5af74840914
3
+ metadata.gz: 4c4429510499e46226a9dba162eb932e2101939a
4
+ data.tar.gz: 3a5cd5eaef785e360ef9ed7d6a7b68513de18ecc
5
5
  SHA512:
6
- metadata.gz: 8d6951fa1be0d7397c3bf982517b705e88dfe5145600d2a40d9e4eb85d204ad9eafd2efd97f7ee64afbccb7213307e4e295ee59b069cebeacdc66968754ce749
7
- data.tar.gz: 8674ce8e672a03ee2ad2cccf17877218b8e008f6ac1599ba543e481bffdcd6a18bddf02ff30f9f790cd2adbba36af327adb39afa8b7485d3832c3ce9b5ae49fd
6
+ metadata.gz: eee736ecc7b16b551da891d6e445c5b886d96b7308a3362f073d423876a181d972105a41b98ad95e33d2bb7c46148dabc8baf8af059bfe1b1d10afeed14694f6
7
+ data.tar.gz: b4ab4cfc4c1fbd7641d6664b8004dc21e3e48983d12a52b78d67cde642a21c834e94244fcc53fbb5408aceedcaef03ea320f019ff697047c9b4874e97335648b
data/Gemfile CHANGED
@@ -1,5 +1,4 @@
1
1
  source 'http://rubygems.org'
2
- ruby "2.0.0"
3
2
 
4
3
  # dependencies specified in naturalsorter.gemspec
5
4
  gemspec
data/README.markdown CHANGED
@@ -4,6 +4,7 @@
4
4
  [![Dependency Status](http://www.versioneye.com/package/naturalsorter/badge.png)](http://www.versioneye.com/package/naturalsorter)
5
5
  [![Build Status](https://travis-ci.org/versioneye/naturalsorter.png)](https://travis-ci.org/versioneye/naturalsorter)
6
6
  [![Code Climate](https://codeclimate.com/github/versioneye/naturalsorter.png)](https://codeclimate.com/github/versioneye/naturalsorter)
7
+ [![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=157523)](https://www.bountysource.com/trackers/157523-versioneye-naturalsorter?utm_source=157523&utm_medium=shield&utm_campaign=TRACKER_BADGE)
7
8
 
8
9
 
9
10
  ## The Mission
@@ -1,3 +1,3 @@
1
1
  module Naturalsorter
2
- VERSION = "3.0.0"
2
+ VERSION = "3.0.1"
3
3
  end
data/lib/versioncmp.rb CHANGED
@@ -166,6 +166,7 @@ class Versioncmp
166
166
  replace_leading_v cleaned_version
167
167
  replace_99_does_not_exist cleaned_version
168
168
  replace_timestamps cleaned_version
169
+ replace_groovy cleaned_version
169
170
  VersionTagRecognizer.remove_minimum_stability cleaned_version
170
171
  cleaned_version
171
172
  end
@@ -177,6 +178,12 @@ class Versioncmp
177
178
  end
178
179
  end
179
180
 
181
+ def self.replace_groovy val
182
+ if val.match(/\-groovy\-/)
183
+ val.gsub!("-groovy-", ".")
184
+ end
185
+ end
186
+
180
187
 
181
188
  # Some glory Java Devs used the timestamp as version string
182
189
  # http://www.versioneye.com/package/commons-beanutils--commons-beanutils
@@ -248,6 +248,11 @@ describe VersionTagRecognizer do
248
248
  end
249
249
 
250
250
 
251
+ it 'is a build' do
252
+ VersionTagRecognizer.build?("1.3.0-build.2921+sha.02c0ed2").should be_true
253
+ end
254
+
255
+
251
256
  it "returns the right value for dev" do
252
257
  VersionTagRecognizer.value_for("1.1.1-dev").should eql(0)
253
258
  end
@@ -296,6 +301,12 @@ describe VersionTagRecognizer do
296
301
  it "does not fit stability" do
297
302
  VersionTagRecognizer.does_it_fit_stability?( "2.2.1-BETA", "stable" ).should be_false
298
303
  end
304
+ it "does not fit stability" do
305
+ VersionTagRecognizer.does_it_fit_stability?( "1.3.0-build.2921+sha.02c0ed2", "stable" ).should be_false
306
+ end
307
+ it "does not fit stability" do
308
+ VersionTagRecognizer.does_it_fit_stability?( "1.3.0-build.2809+sha.94bcc03", "stable" ).should be_false
309
+ end
299
310
  it "does fit stability" do
300
311
  VersionTagRecognizer.does_it_fit_stability?( "2.2.1-BETA", "alpha" ).should be_true
301
312
  end
@@ -14,6 +14,10 @@ describe Versioncmp do
14
14
  Versioncmp.compare("1.1.5", "1.1-dev").should eql(-1)
15
15
  end
16
16
 
17
+ it "smaler" do
18
+ Versioncmp.compare("0.3", "0.7-groovy-2.0").should eql(-1)
19
+ end
20
+
17
21
  it "bigger" do
18
22
  Versioncmp.compare("1.1", "1.0").should eql(1)
19
23
  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.0
4
+ version: 3.0.1
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: 2014-07-27 00:00:00.000000000 Z
12
+ date: 2015-01-28 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.1.11
73
+ rubygems_version: 2.4.3
74
74
  signing_key:
75
75
  specification_version: 4
76
76
  summary: Sorting arrays in natural order