naturalsorter 3.0.1 → 3.0.2
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/naturalsorter.gemspec +1 -1
- data/spec/naturalsorter_spec.rb +39 -39
- data/spec/version_tag_recognizer_spec.rb +65 -65
- data/spec/versioncmp_spec.rb +12 -0
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c762c987d60b195b0a8a48a7c2a1b17c6de16824
|
|
4
|
+
data.tar.gz: ca7b0eab9886f475ca06c3c07a6c74891d37b72c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: adafaad2b904c1aa3f56b37831a930251f9fd173f8019a221d58860adf3e38d6dda4b92a59edf5f1a9ed44e20aa35d2c9c2883d4f829d9f0d7ac088b7a4ab597
|
|
7
|
+
data.tar.gz: 7fe82852f1cdf428b8bf3fab7692abed35aec1fa7560ccaabf48969d86f40176ab6f52ad24116f9b275964eeb9db22c1bf1d764520c090cdedf63bff0a71c3fe
|
data/README.markdown
CHANGED
data/lib/versioncmp.rb
CHANGED
|
@@ -163,6 +163,7 @@ class Versioncmp
|
|
|
163
163
|
def self.pre_process val
|
|
164
164
|
cleaned_version = replace_x_dev val
|
|
165
165
|
cleaned_version = replace_wildcards cleaned_version
|
|
166
|
+
replace_snapshot cleaned_version
|
|
166
167
|
replace_leading_v cleaned_version
|
|
167
168
|
replace_99_does_not_exist cleaned_version
|
|
168
169
|
replace_timestamps cleaned_version
|
|
@@ -184,6 +185,12 @@ class Versioncmp
|
|
|
184
185
|
end
|
|
185
186
|
end
|
|
186
187
|
|
|
188
|
+
def self.replace_snapshot val
|
|
189
|
+
if val.match(/\-SNAPSHOT/)
|
|
190
|
+
val.gsub!("-SNAPSHOT", "")
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
|
|
187
194
|
|
|
188
195
|
# Some glory Java Devs used the timestamp as version string
|
|
189
196
|
# http://www.versioneye.com/package/commons-beanutils--commons-beanutils
|
data/naturalsorter.gemspec
CHANGED
|
@@ -22,5 +22,5 @@ Gem::Specification.new do |s|
|
|
|
22
22
|
# specify any dependencies here; for example:
|
|
23
23
|
# s.add_development_dependency "rspec"
|
|
24
24
|
# s.add_runtime_dependency "rest-client"
|
|
25
|
-
s.add_development_dependency "rspec", "2.
|
|
25
|
+
s.add_development_dependency "rspec", "3.2.0"
|
|
26
26
|
end
|
data/spec/naturalsorter_spec.rb
CHANGED
|
@@ -116,28 +116,28 @@ describe Naturalsorter::Sorter do
|
|
|
116
116
|
|
|
117
117
|
describe "is_version_current?" do
|
|
118
118
|
it "returns true" do
|
|
119
|
-
Naturalsorter::Sorter.is_version_current?("1.1.1", "1.1.9").should
|
|
119
|
+
Naturalsorter::Sorter.is_version_current?("1.1.1", "1.1.9").should be_truthy
|
|
120
120
|
end
|
|
121
121
|
it "returns true" do
|
|
122
|
-
Naturalsorter::Sorter.is_version_current?("1.1.1", "1.1.2").should
|
|
122
|
+
Naturalsorter::Sorter.is_version_current?("1.1.1", "1.1.2").should be_truthy
|
|
123
123
|
end
|
|
124
124
|
it "returns true" do
|
|
125
|
-
Naturalsorter::Sorter.is_version_current?("1.1.1", "1.1.12").should
|
|
125
|
+
Naturalsorter::Sorter.is_version_current?("1.1.1", "1.1.12").should be_truthy
|
|
126
126
|
end
|
|
127
127
|
it "returns false" do
|
|
128
|
-
Naturalsorter::Sorter.is_version_current?("1.1.1", "1.2.0").should
|
|
128
|
+
Naturalsorter::Sorter.is_version_current?("1.1.1", "1.2.0").should be_falsey
|
|
129
129
|
end
|
|
130
130
|
it "returns false" do
|
|
131
|
-
Naturalsorter::Sorter.is_version_current?("1.1.1", "1.2").should
|
|
131
|
+
Naturalsorter::Sorter.is_version_current?("1.1.1", "1.2").should be_falsey
|
|
132
132
|
end
|
|
133
133
|
it "returns false" do
|
|
134
|
-
Naturalsorter::Sorter.is_version_current?("1.1.1", "2.0").should
|
|
134
|
+
Naturalsorter::Sorter.is_version_current?("1.1.1", "2.0").should be_falsey
|
|
135
135
|
end
|
|
136
136
|
it "returns false" do
|
|
137
|
-
Naturalsorter::Sorter.is_version_current?("1.1.1", "2").should
|
|
137
|
+
Naturalsorter::Sorter.is_version_current?("1.1.1", "2").should be_falsey
|
|
138
138
|
end
|
|
139
139
|
it "returns false" do
|
|
140
|
-
Naturalsorter::Sorter.is_version_current?("1.1", "2.0").should
|
|
140
|
+
Naturalsorter::Sorter.is_version_current?("1.1", "2.0").should be_falsey
|
|
141
141
|
end
|
|
142
142
|
end
|
|
143
143
|
|
|
@@ -182,25 +182,25 @@ describe Naturalsorter::Sorter do
|
|
|
182
182
|
describe "bigger?" do
|
|
183
183
|
|
|
184
184
|
it "returns true" do
|
|
185
|
-
Naturalsorter::Sorter.bigger?("1.1", "1.0").should
|
|
185
|
+
Naturalsorter::Sorter.bigger?("1.1", "1.0").should be_truthy
|
|
186
186
|
end
|
|
187
187
|
it "returns true" do
|
|
188
|
-
Naturalsorter::Sorter.bigger?("1.1", "20030211.134440").should
|
|
188
|
+
Naturalsorter::Sorter.bigger?("1.1", "20030211.134440").should be_truthy
|
|
189
189
|
end
|
|
190
190
|
it "returns true" do
|
|
191
|
-
Naturalsorter::Sorter.bigger?("1.1", "20030211").should
|
|
191
|
+
Naturalsorter::Sorter.bigger?("1.1", "20030211").should be_truthy
|
|
192
192
|
end
|
|
193
193
|
it "returns true" do
|
|
194
|
-
Naturalsorter::Sorter.bigger?("2.0", "1.0").should
|
|
194
|
+
Naturalsorter::Sorter.bigger?("2.0", "1.0").should be_truthy
|
|
195
195
|
end
|
|
196
196
|
it "returns true" do
|
|
197
|
-
Naturalsorter::Sorter.bigger?("2.20", "2.9").should
|
|
197
|
+
Naturalsorter::Sorter.bigger?("2.20", "2.9").should be_truthy
|
|
198
198
|
end
|
|
199
199
|
it "returns false" do
|
|
200
|
-
Naturalsorter::Sorter.bigger?("2.20", "2.20").should
|
|
200
|
+
Naturalsorter::Sorter.bigger?("2.20", "2.20").should be_falsey
|
|
201
201
|
end
|
|
202
202
|
it "returns false" do
|
|
203
|
-
Naturalsorter::Sorter.bigger?("2.20", "3.0").should
|
|
203
|
+
Naturalsorter::Sorter.bigger?("2.20", "3.0").should be_falsey
|
|
204
204
|
end
|
|
205
205
|
|
|
206
206
|
end
|
|
@@ -208,31 +208,31 @@ describe Naturalsorter::Sorter do
|
|
|
208
208
|
describe "bigger_or_equal?" do
|
|
209
209
|
|
|
210
210
|
it "returns true" do
|
|
211
|
-
Naturalsorter::Sorter.bigger_or_equal?("1.1", "1.0").should
|
|
211
|
+
Naturalsorter::Sorter.bigger_or_equal?("1.1", "1.0").should be_truthy
|
|
212
212
|
end
|
|
213
213
|
it "returns true" do
|
|
214
|
-
Naturalsorter::Sorter.bigger_or_equal?("2.0", "1.0").should
|
|
214
|
+
Naturalsorter::Sorter.bigger_or_equal?("2.0", "1.0").should be_truthy
|
|
215
215
|
end
|
|
216
216
|
it "returns true" do
|
|
217
|
-
Naturalsorter::Sorter.bigger_or_equal?("2.20", "2.9").should
|
|
217
|
+
Naturalsorter::Sorter.bigger_or_equal?("2.20", "2.9").should be_truthy
|
|
218
218
|
end
|
|
219
219
|
it "returns true" do
|
|
220
|
-
Naturalsorter::Sorter.bigger_or_equal?("2.20", "2.20").should
|
|
220
|
+
Naturalsorter::Sorter.bigger_or_equal?("2.20", "2.20").should be_truthy
|
|
221
221
|
end
|
|
222
222
|
it "returns true" do
|
|
223
|
-
Naturalsorter::Sorter.bigger_or_equal?("2.20", "2.20.0").should
|
|
223
|
+
Naturalsorter::Sorter.bigger_or_equal?("2.20", "2.20.0").should be_truthy
|
|
224
224
|
end
|
|
225
225
|
it "returns true" do
|
|
226
|
-
Naturalsorter::Sorter.bigger_or_equal?("2.20", "2.20").should
|
|
226
|
+
Naturalsorter::Sorter.bigger_or_equal?("2.20", "2.20").should be_truthy
|
|
227
227
|
end
|
|
228
228
|
it "returns true" do
|
|
229
|
-
Naturalsorter::Sorter.bigger_or_equal?("v3.2.0", "3.2.0").should
|
|
229
|
+
Naturalsorter::Sorter.bigger_or_equal?("v3.2.0", "3.2.0").should be_truthy
|
|
230
230
|
end
|
|
231
231
|
it "returns true" do
|
|
232
|
-
Naturalsorter::Sorter.bigger_or_equal?("v3.2.0", "3.1.0").should
|
|
232
|
+
Naturalsorter::Sorter.bigger_or_equal?("v3.2.0", "3.1.0").should be_truthy
|
|
233
233
|
end
|
|
234
234
|
it "returns false" do
|
|
235
|
-
Naturalsorter::Sorter.bigger_or_equal?("2.20", "3.0").should
|
|
235
|
+
Naturalsorter::Sorter.bigger_or_equal?("2.20", "3.0").should be_falsey
|
|
236
236
|
end
|
|
237
237
|
|
|
238
238
|
end
|
|
@@ -240,25 +240,25 @@ describe Naturalsorter::Sorter do
|
|
|
240
240
|
describe "smaller?" do
|
|
241
241
|
|
|
242
242
|
it "returns false" do
|
|
243
|
-
Naturalsorter::Sorter.smaller?("1.1", "1.0").should
|
|
243
|
+
Naturalsorter::Sorter.smaller?("1.1", "1.0").should be_falsey
|
|
244
244
|
end
|
|
245
245
|
it "returns false" do
|
|
246
|
-
Naturalsorter::Sorter.smaller?("2.0", "1.0").should
|
|
246
|
+
Naturalsorter::Sorter.smaller?("2.0", "1.0").should be_falsey
|
|
247
247
|
end
|
|
248
248
|
it "returns false" do
|
|
249
|
-
Naturalsorter::Sorter.smaller?("2.20", "2.9").should
|
|
249
|
+
Naturalsorter::Sorter.smaller?("2.20", "2.9").should be_falsey
|
|
250
250
|
end
|
|
251
251
|
it "returns false" do
|
|
252
|
-
Naturalsorter::Sorter.smaller?("2.20", "2.20").should
|
|
252
|
+
Naturalsorter::Sorter.smaller?("2.20", "2.20").should be_falsey
|
|
253
253
|
end
|
|
254
254
|
it "returns true" do
|
|
255
|
-
Naturalsorter::Sorter.smaller?("2.20", "3.0").should
|
|
255
|
+
Naturalsorter::Sorter.smaller?("2.20", "3.0").should be_truthy
|
|
256
256
|
end
|
|
257
257
|
it "returns false" do
|
|
258
|
-
Naturalsorter::Sorter.smaller?("2.0", "2.0").should
|
|
258
|
+
Naturalsorter::Sorter.smaller?("2.0", "2.0").should be_falsey
|
|
259
259
|
end
|
|
260
260
|
it "returns false" do
|
|
261
|
-
Naturalsorter::Sorter.smaller?("2.0", "2.0.0").should
|
|
261
|
+
Naturalsorter::Sorter.smaller?("2.0", "2.0.0").should be_falsey
|
|
262
262
|
end
|
|
263
263
|
|
|
264
264
|
end
|
|
@@ -266,28 +266,28 @@ describe Naturalsorter::Sorter do
|
|
|
266
266
|
describe "smaller_or_equal?" do
|
|
267
267
|
|
|
268
268
|
it "returns false" do
|
|
269
|
-
Naturalsorter::Sorter.smaller_or_equal?("1.1", "1.0").should
|
|
269
|
+
Naturalsorter::Sorter.smaller_or_equal?("1.1", "1.0").should be_falsey
|
|
270
270
|
end
|
|
271
271
|
it "returns false" do
|
|
272
|
-
Naturalsorter::Sorter.smaller_or_equal?("2.0", "1.0").should
|
|
272
|
+
Naturalsorter::Sorter.smaller_or_equal?("2.0", "1.0").should be_falsey
|
|
273
273
|
end
|
|
274
274
|
it "returns false" do
|
|
275
|
-
Naturalsorter::Sorter.smaller_or_equal?("2.20", "2.9").should
|
|
275
|
+
Naturalsorter::Sorter.smaller_or_equal?("2.20", "2.9").should be_falsey
|
|
276
276
|
end
|
|
277
277
|
it "returns false" do
|
|
278
|
-
Naturalsorter::Sorter.smaller_or_equal?("2.20", "2.20").should
|
|
278
|
+
Naturalsorter::Sorter.smaller_or_equal?("2.20", "2.20").should be_truthy
|
|
279
279
|
end
|
|
280
280
|
it "returns false" do
|
|
281
|
-
Naturalsorter::Sorter.smaller_or_equal?("2.20.0", "2.20").should
|
|
281
|
+
Naturalsorter::Sorter.smaller_or_equal?("2.20.0", "2.20").should be_truthy
|
|
282
282
|
end
|
|
283
283
|
it "returns true" do
|
|
284
|
-
Naturalsorter::Sorter.smaller_or_equal?("2.20", "2.20").should
|
|
284
|
+
Naturalsorter::Sorter.smaller_or_equal?("2.20", "2.20").should be_truthy
|
|
285
285
|
end
|
|
286
286
|
it "returns true" do
|
|
287
|
-
Naturalsorter::Sorter.smaller_or_equal?("2.20", "3.0").should
|
|
287
|
+
Naturalsorter::Sorter.smaller_or_equal?("2.20", "3.0").should be_truthy
|
|
288
288
|
end
|
|
289
289
|
it "returns true" do
|
|
290
|
-
Naturalsorter::Sorter.smaller_or_equal?("2.20", "v3.0").should
|
|
290
|
+
Naturalsorter::Sorter.smaller_or_equal?("2.20", "v3.0").should be_truthy
|
|
291
291
|
end
|
|
292
292
|
|
|
293
293
|
end
|
|
@@ -3,145 +3,145 @@ require "naturalsorter"
|
|
|
3
3
|
describe VersionTagRecognizer do
|
|
4
4
|
|
|
5
5
|
it "release? is true" do
|
|
6
|
-
VersionTagRecognizer.release?("1.1").should
|
|
6
|
+
VersionTagRecognizer.release?("1.1").should be_truthy
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
it "release? is true" do
|
|
10
|
-
VersionTagRecognizer.release?("1.0.0").should
|
|
10
|
+
VersionTagRecognizer.release?("1.0.0").should be_truthy
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
it "release? is true" do
|
|
14
|
-
VersionTagRecognizer.release?("1").should
|
|
14
|
+
VersionTagRecognizer.release?("1").should be_truthy
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
it "release? is true" do
|
|
18
|
-
VersionTagRecognizer.release?("3.3.2.GA").should
|
|
18
|
+
VersionTagRecognizer.release?("3.3.2.GA").should be_truthy
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
it "release? is true" do
|
|
22
|
-
VersionTagRecognizer.release?("4.1.5.SP1").should
|
|
22
|
+
VersionTagRecognizer.release?("4.1.5.SP1").should be_truthy
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
it "release? is true" do
|
|
26
|
-
VersionTagRecognizer.release?("3.1.0.RELEASE").should
|
|
26
|
+
VersionTagRecognizer.release?("3.1.0.RELEASE").should be_truthy
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
it "release? is true" do
|
|
30
|
-
VersionTagRecognizer.release?("3.2.0.BUILD").should
|
|
30
|
+
VersionTagRecognizer.release?("3.2.0.BUILD").should be_falsey
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
it "release? is true" do
|
|
34
|
-
VersionTagRecognizer.release?("3.2.0buiLd").should
|
|
34
|
+
VersionTagRecognizer.release?("3.2.0buiLd").should be_falsey
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
it "release? is true" do
|
|
38
|
-
VersionTagRecognizer.release?("3.2.0.Final").should
|
|
38
|
+
VersionTagRecognizer.release?("3.2.0.Final").should be_truthy
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
it "release? is true" do
|
|
42
|
-
VersionTagRecognizer.release?("3.2.0FINAL").should
|
|
42
|
+
VersionTagRecognizer.release?("3.2.0FINAL").should be_truthy
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
it "release? is false" do
|
|
46
|
-
VersionTagRecognizer.release?("1.1.pre").should
|
|
46
|
+
VersionTagRecognizer.release?("1.1.pre").should be_falsey
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
it "release? is false" do
|
|
50
|
-
VersionTagRecognizer.release?("2.5.6.SEC03").should
|
|
50
|
+
VersionTagRecognizer.release?("2.5.6.SEC03").should be_falsey
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
it "release? is false" do
|
|
54
|
-
VersionTagRecognizer.release?("2.3.8.pre1").should
|
|
54
|
+
VersionTagRecognizer.release?("2.3.8.pre1").should be_falsey
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
it "release? is false" do
|
|
58
|
-
VersionTagRecognizer.release?("2.3.9.pre").should
|
|
58
|
+
VersionTagRecognizer.release?("2.3.9.pre").should be_falsey
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
it "release? is false" do
|
|
62
|
-
VersionTagRecognizer.release?("3.0.0.beta4").should
|
|
62
|
+
VersionTagRecognizer.release?("3.0.0.beta4").should be_falsey
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
it "release? is false" do
|
|
66
|
-
VersionTagRecognizer.release?("3.0.0.BETA4").should
|
|
66
|
+
VersionTagRecognizer.release?("3.0.0.BETA4").should be_falsey
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
it "release? is false" do
|
|
70
|
-
VersionTagRecognizer.release?("3.0.0.beta").should
|
|
70
|
+
VersionTagRecognizer.release?("3.0.0.beta").should be_falsey
|
|
71
71
|
end
|
|
72
72
|
|
|
73
73
|
it "release? is false" do
|
|
74
|
-
VersionTagRecognizer.release?("3.0.0.rc").should
|
|
74
|
+
VersionTagRecognizer.release?("3.0.0.rc").should be_falsey
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
it "release? is false" do
|
|
78
|
-
VersionTagRecognizer.release?("3.0.0.rc2").should
|
|
78
|
+
VersionTagRecognizer.release?("3.0.0.rc2").should be_falsey
|
|
79
79
|
end
|
|
80
80
|
|
|
81
81
|
it "release? is false" do
|
|
82
|
-
VersionTagRecognizer.release?("3.0.0.RC2").should
|
|
82
|
+
VersionTagRecognizer.release?("3.0.0.RC2").should be_falsey
|
|
83
83
|
end
|
|
84
84
|
|
|
85
85
|
it "release? is false" do
|
|
86
|
-
VersionTagRecognizer.release?("2.0.x-dev").should
|
|
86
|
+
VersionTagRecognizer.release?("2.0.x-dev").should be_falsey
|
|
87
87
|
end
|
|
88
88
|
|
|
89
89
|
it "release? is false" do
|
|
90
|
-
VersionTagRecognizer.release?("2.0.x-DEV").should
|
|
90
|
+
VersionTagRecognizer.release?("2.0.x-DEV").should be_falsey
|
|
91
91
|
end
|
|
92
92
|
|
|
93
93
|
it "release? is false" do
|
|
94
|
-
VersionTagRecognizer.release?("1.8b1").should
|
|
94
|
+
VersionTagRecognizer.release?("1.8b1").should be_falsey
|
|
95
95
|
end
|
|
96
96
|
|
|
97
97
|
it "release? is false" do
|
|
98
|
-
VersionTagRecognizer.release?("1.8B1").should
|
|
98
|
+
VersionTagRecognizer.release?("1.8B1").should be_falsey
|
|
99
99
|
end
|
|
100
100
|
|
|
101
101
|
it "release? is false" do
|
|
102
|
-
VersionTagRecognizer.release?("1.1.3a").should
|
|
102
|
+
VersionTagRecognizer.release?("1.1.3a").should be_falsey
|
|
103
103
|
end
|
|
104
104
|
|
|
105
105
|
it "release? is false" do
|
|
106
|
-
VersionTagRecognizer.release?("1.1.3A").should
|
|
106
|
+
VersionTagRecognizer.release?("1.1.3A").should be_falsey
|
|
107
107
|
end
|
|
108
108
|
|
|
109
109
|
it "release? is false" do
|
|
110
|
-
VersionTagRecognizer.release?("1.SNAPSHOT").should
|
|
110
|
+
VersionTagRecognizer.release?("1.SNAPSHOT").should be_falsey
|
|
111
111
|
end
|
|
112
112
|
|
|
113
113
|
it "release? is false" do
|
|
114
|
-
VersionTagRecognizer.release?("1.snapshot").should
|
|
114
|
+
VersionTagRecognizer.release?("1.snapshot").should be_falsey
|
|
115
115
|
end
|
|
116
116
|
|
|
117
117
|
it "release? is false" do
|
|
118
|
-
VersionTagRecognizer.release?("1.M1").should
|
|
118
|
+
VersionTagRecognizer.release?("1.M1").should be_falsey
|
|
119
119
|
end
|
|
120
120
|
|
|
121
121
|
it "release? is false" do
|
|
122
|
-
VersionTagRecognizer.release?("2.0-m4").should
|
|
122
|
+
VersionTagRecognizer.release?("2.0-m4").should be_falsey
|
|
123
123
|
end
|
|
124
124
|
|
|
125
125
|
|
|
126
126
|
|
|
127
127
|
it "is alpha? is true" do
|
|
128
|
-
VersionTagRecognizer.alpha?("2.0.alpha").should
|
|
128
|
+
VersionTagRecognizer.alpha?("2.0.alpha").should be_truthy
|
|
129
129
|
end
|
|
130
130
|
|
|
131
131
|
it "is alpha? is true" do
|
|
132
|
-
VersionTagRecognizer.alpha?("2.1.0alpha").should
|
|
132
|
+
VersionTagRecognizer.alpha?("2.1.0alpha").should be_truthy
|
|
133
133
|
end
|
|
134
134
|
|
|
135
135
|
it "is alpha? is false" do
|
|
136
|
-
VersionTagRecognizer.alpha?("2.0.1").should
|
|
136
|
+
VersionTagRecognizer.alpha?("2.0.1").should be_falsey
|
|
137
137
|
end
|
|
138
138
|
|
|
139
139
|
it "is alpha? is false" do
|
|
140
|
-
VersionTagRecognizer.alpha?("2.1.0-BETA1").should
|
|
140
|
+
VersionTagRecognizer.alpha?("2.1.0-BETA1").should be_falsey
|
|
141
141
|
end
|
|
142
142
|
|
|
143
143
|
it "is tagged? is true" do
|
|
144
|
-
VersionTagRecognizer.tagged?("2.1.0alpha").should
|
|
144
|
+
VersionTagRecognizer.tagged?("2.1.0alpha").should be_truthy
|
|
145
145
|
end
|
|
146
146
|
|
|
147
147
|
|
|
@@ -162,27 +162,27 @@ describe VersionTagRecognizer do
|
|
|
162
162
|
|
|
163
163
|
|
|
164
164
|
it "is beta? is true" do
|
|
165
|
-
VersionTagRecognizer.beta?("2.0.beta").should
|
|
165
|
+
VersionTagRecognizer.beta?("2.0.beta").should be_truthy
|
|
166
166
|
end
|
|
167
167
|
|
|
168
168
|
it "is beta? is true" do
|
|
169
|
-
VersionTagRecognizer.beta?("2.1.0beta").should
|
|
169
|
+
VersionTagRecognizer.beta?("2.1.0beta").should be_truthy
|
|
170
170
|
end
|
|
171
171
|
|
|
172
172
|
it "is beta? is false" do
|
|
173
|
-
VersionTagRecognizer.beta?("2.0.1").should
|
|
173
|
+
VersionTagRecognizer.beta?("2.0.1").should be_falsey
|
|
174
174
|
end
|
|
175
175
|
|
|
176
176
|
it "is beta? is true" do
|
|
177
|
-
VersionTagRecognizer.beta?("2.2.0-BETA2").should
|
|
177
|
+
VersionTagRecognizer.beta?("2.2.0-BETA2").should be_truthy
|
|
178
178
|
end
|
|
179
179
|
|
|
180
180
|
it "is beta? is true" do
|
|
181
|
-
VersionTagRecognizer.beta?("2.1.0-BETA1").should
|
|
181
|
+
VersionTagRecognizer.beta?("2.1.0-BETA1").should be_truthy
|
|
182
182
|
end
|
|
183
183
|
|
|
184
184
|
it "is tagged? is true" do
|
|
185
|
-
VersionTagRecognizer.tagged?("2.1.0-BETA1").should
|
|
185
|
+
VersionTagRecognizer.tagged?("2.1.0-BETA1").should be_truthy
|
|
186
186
|
end
|
|
187
187
|
|
|
188
188
|
it "remove_tag is right" do
|
|
@@ -192,64 +192,64 @@ describe VersionTagRecognizer do
|
|
|
192
192
|
|
|
193
193
|
|
|
194
194
|
it "is dev? is true" do
|
|
195
|
-
VersionTagRecognizer.dev?("dev-master").should
|
|
195
|
+
VersionTagRecognizer.dev?("dev-master").should be_truthy
|
|
196
196
|
end
|
|
197
197
|
|
|
198
198
|
it "is dev? is true" do
|
|
199
|
-
VersionTagRecognizer.dev?("dev-progress-helper").should
|
|
199
|
+
VersionTagRecognizer.dev?("dev-progress-helper").should be_truthy
|
|
200
200
|
end
|
|
201
201
|
|
|
202
202
|
it "is dev? is true" do
|
|
203
|
-
VersionTagRecognizer.dev?("dev-deprecated").should
|
|
203
|
+
VersionTagRecognizer.dev?("dev-deprecated").should be_truthy
|
|
204
204
|
end
|
|
205
205
|
|
|
206
206
|
it "is dev? is true" do
|
|
207
|
-
VersionTagRecognizer.dev?("2.2.x-dev").should
|
|
207
|
+
VersionTagRecognizer.dev?("2.2.x-dev").should be_truthy
|
|
208
208
|
end
|
|
209
209
|
|
|
210
210
|
it "is dev? is false" do
|
|
211
|
-
VersionTagRecognizer.dev?("2.0.1").should
|
|
211
|
+
VersionTagRecognizer.dev?("2.0.1").should be_falsey
|
|
212
212
|
end
|
|
213
213
|
|
|
214
214
|
|
|
215
215
|
|
|
216
216
|
it "is rc? is true" do
|
|
217
|
-
VersionTagRecognizer.rc?("2.0.rc").should
|
|
217
|
+
VersionTagRecognizer.rc?("2.0.rc").should be_truthy
|
|
218
218
|
end
|
|
219
219
|
|
|
220
220
|
it "is rc? is true" do
|
|
221
|
-
VersionTagRecognizer.rc?("2.1.0rc").should
|
|
221
|
+
VersionTagRecognizer.rc?("2.1.0rc").should be_truthy
|
|
222
222
|
end
|
|
223
223
|
|
|
224
224
|
it "is rc? is true" do
|
|
225
|
-
VersionTagRecognizer.rc?("2.2.0-RC3").should
|
|
225
|
+
VersionTagRecognizer.rc?("2.2.0-RC3").should be_truthy
|
|
226
226
|
end
|
|
227
227
|
|
|
228
228
|
it "is rc? is false" do
|
|
229
|
-
VersionTagRecognizer.rc?("2.0.1").should
|
|
229
|
+
VersionTagRecognizer.rc?("2.0.1").should be_falsey
|
|
230
230
|
end
|
|
231
231
|
|
|
232
232
|
|
|
233
233
|
|
|
234
234
|
it "is snapshot? is true" do
|
|
235
|
-
VersionTagRecognizer.snapshot?("2.0.snapshot").should
|
|
235
|
+
VersionTagRecognizer.snapshot?("2.0.snapshot").should be_truthy
|
|
236
236
|
end
|
|
237
237
|
|
|
238
238
|
it "is snapshot? is true" do
|
|
239
|
-
VersionTagRecognizer.snapshot?("2.1.0snapshot").should
|
|
239
|
+
VersionTagRecognizer.snapshot?("2.1.0snapshot").should be_truthy
|
|
240
240
|
end
|
|
241
241
|
|
|
242
242
|
it "is snapshot? is true" do
|
|
243
|
-
VersionTagRecognizer.snapshot?("2.2.0-snapshot3").should
|
|
243
|
+
VersionTagRecognizer.snapshot?("2.2.0-snapshot3").should be_truthy
|
|
244
244
|
end
|
|
245
245
|
|
|
246
246
|
it "is snapshot? is false" do
|
|
247
|
-
VersionTagRecognizer.snapshot?("2.0.1").should
|
|
247
|
+
VersionTagRecognizer.snapshot?("2.0.1").should be_falsey
|
|
248
248
|
end
|
|
249
249
|
|
|
250
250
|
|
|
251
251
|
it 'is a build' do
|
|
252
|
-
VersionTagRecognizer.build?("1.3.0-build.2921+sha.02c0ed2").should
|
|
252
|
+
VersionTagRecognizer.build?("1.3.0-build.2921+sha.02c0ed2").should be_truthy
|
|
253
253
|
end
|
|
254
254
|
|
|
255
255
|
|
|
@@ -296,34 +296,34 @@ describe VersionTagRecognizer do
|
|
|
296
296
|
|
|
297
297
|
|
|
298
298
|
it "does fit stability" do
|
|
299
|
-
VersionTagRecognizer.does_it_fit_stability?( "2.2.1", "stable" ).should
|
|
299
|
+
VersionTagRecognizer.does_it_fit_stability?( "2.2.1", "stable" ).should be_truthy
|
|
300
300
|
end
|
|
301
301
|
it "does not fit stability" do
|
|
302
|
-
VersionTagRecognizer.does_it_fit_stability?( "2.2.1-BETA", "stable" ).should
|
|
302
|
+
VersionTagRecognizer.does_it_fit_stability?( "2.2.1-BETA", "stable" ).should be_falsey
|
|
303
303
|
end
|
|
304
304
|
it "does not fit stability" do
|
|
305
|
-
VersionTagRecognizer.does_it_fit_stability?( "1.3.0-build.2921+sha.02c0ed2", "stable" ).should
|
|
305
|
+
VersionTagRecognizer.does_it_fit_stability?( "1.3.0-build.2921+sha.02c0ed2", "stable" ).should be_falsey
|
|
306
306
|
end
|
|
307
307
|
it "does not fit stability" do
|
|
308
|
-
VersionTagRecognizer.does_it_fit_stability?( "1.3.0-build.2809+sha.94bcc03", "stable" ).should
|
|
308
|
+
VersionTagRecognizer.does_it_fit_stability?( "1.3.0-build.2809+sha.94bcc03", "stable" ).should be_falsey
|
|
309
309
|
end
|
|
310
310
|
it "does fit stability" do
|
|
311
|
-
VersionTagRecognizer.does_it_fit_stability?( "2.2.1-BETA", "alpha" ).should
|
|
311
|
+
VersionTagRecognizer.does_it_fit_stability?( "2.2.1-BETA", "alpha" ).should be_truthy
|
|
312
312
|
end
|
|
313
313
|
it "does fit stability" do
|
|
314
|
-
VersionTagRecognizer.does_it_fit_stability?( "2.2.1-BETA", "beta" ).should
|
|
314
|
+
VersionTagRecognizer.does_it_fit_stability?( "2.2.1-BETA", "beta" ).should be_truthy
|
|
315
315
|
end
|
|
316
316
|
it "does fit stability" do
|
|
317
|
-
VersionTagRecognizer.does_it_fit_stability?( "2.2.x-dev", "dev" ).should
|
|
317
|
+
VersionTagRecognizer.does_it_fit_stability?( "2.2.x-dev", "dev" ).should be_truthy
|
|
318
318
|
end
|
|
319
319
|
it "does not fit stability" do
|
|
320
|
-
VersionTagRecognizer.does_it_fit_stability?( "2.2.x-dev", "alpha" ).should
|
|
320
|
+
VersionTagRecognizer.does_it_fit_stability?( "2.2.x-dev", "alpha" ).should be_falsey
|
|
321
321
|
end
|
|
322
322
|
it "does not fit stability" do
|
|
323
|
-
VersionTagRecognizer.does_it_fit_stability?( "2.2.x-dev", "RC" ).should
|
|
323
|
+
VersionTagRecognizer.does_it_fit_stability?( "2.2.x-dev", "RC" ).should be_falsey
|
|
324
324
|
end
|
|
325
325
|
it "does fit stability" do
|
|
326
|
-
VersionTagRecognizer.does_it_fit_stability?( "2.2.1-RC", "RC" ).should
|
|
326
|
+
VersionTagRecognizer.does_it_fit_stability?( "2.2.1-RC", "RC" ).should be_truthy
|
|
327
327
|
end
|
|
328
328
|
|
|
329
329
|
|
data/spec/versioncmp_spec.rb
CHANGED
|
@@ -182,4 +182,16 @@ describe Versioncmp do
|
|
|
182
182
|
Versioncmp.compare("3.0", "3.0.0").should eql(0)
|
|
183
183
|
end
|
|
184
184
|
|
|
185
|
+
it "3.1-SNAPSHOT is equal to 3.1-SNAPSHOT" do
|
|
186
|
+
Versioncmp.compare("3.1-SNAPSHOT", "3.1-SNAPSHOT").should eql(0)
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
it "3.1-SNAPSHOT is smaller than 3.2-SNAPSHOT" do
|
|
190
|
+
Versioncmp.compare("3.1-SNAPSHOT", "3.2-SNAPSHOT").should eql(-1)
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
it "3.1 is smaller than 3.2-SNAPSHOT" do
|
|
194
|
+
Versioncmp.compare("3.1", "3.2-SNAPSHOT").should eql(-1)
|
|
195
|
+
end
|
|
196
|
+
|
|
185
197
|
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.2
|
|
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: 2015-
|
|
12
|
+
date: 2015-03-15 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rspec
|
|
@@ -17,14 +17,14 @@ dependencies:
|
|
|
17
17
|
requirements:
|
|
18
18
|
- - '='
|
|
19
19
|
- !ruby/object:Gem::Version
|
|
20
|
-
version: 2.
|
|
20
|
+
version: 3.2.0
|
|
21
21
|
type: :development
|
|
22
22
|
prerelease: false
|
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
|
24
24
|
requirements:
|
|
25
25
|
- - '='
|
|
26
26
|
- !ruby/object:Gem::Version
|
|
27
|
-
version: 2.
|
|
27
|
+
version: 3.2.0
|
|
28
28
|
description: This GEM is sorting Arrays in a natural order. a2 < a10. Beside that
|
|
29
29
|
this GEM has some methods to sort version strings. It even recognises alpha, beta,
|
|
30
30
|
RC, dev and stable versions.
|
|
@@ -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.4.
|
|
73
|
+
rubygems_version: 2.4.6
|
|
74
74
|
signing_key:
|
|
75
75
|
specification_version: 4
|
|
76
76
|
summary: Sorting arrays in natural order
|