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 +4 -4
- data/Gemfile +0 -1
- data/README.markdown +1 -0
- data/lib/naturalsorter/version.rb +1 -1
- data/lib/versioncmp.rb +7 -0
- data/spec/version_tag_recognizer_spec.rb +11 -0
- data/spec/versioncmp_spec.rb +4 -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: 4c4429510499e46226a9dba162eb932e2101939a
|
|
4
|
+
data.tar.gz: 3a5cd5eaef785e360ef9ed7d6a7b68513de18ecc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eee736ecc7b16b551da891d6e445c5b886d96b7308a3362f073d423876a181d972105a41b98ad95e33d2bb7c46148dabc8baf8af059bfe1b1d10afeed14694f6
|
|
7
|
+
data.tar.gz: b4ab4cfc4c1fbd7641d6664b8004dc21e3e48983d12a52b78d67cde642a21c834e94244fcc53fbb5408aceedcaef03ea320f019ff697047c9b4874e97335648b
|
data/Gemfile
CHANGED
data/README.markdown
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
[](http://www.versioneye.com/package/naturalsorter)
|
|
5
5
|
[](https://travis-ci.org/versioneye/naturalsorter)
|
|
6
6
|
[](https://codeclimate.com/github/versioneye/naturalsorter)
|
|
7
|
+
[](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
|
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
|
data/spec/versioncmp_spec.rb
CHANGED
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.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:
|
|
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.
|
|
73
|
+
rubygems_version: 2.4.3
|
|
74
74
|
signing_key:
|
|
75
75
|
specification_version: 4
|
|
76
76
|
summary: Sorting arrays in natural order
|