semantic_puppet 0.1.4 → 1.0.0
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/.rubocop.yml +672 -0
- data/.travis.yml +14 -0
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/semantic_puppet/gem_version.rb +1 -1
- data/lib/semantic_puppet/version.rb +122 -114
- data/lib/semantic_puppet/version_range.rb +654 -343
- data/semantic_puppet.gemspec +9 -5
- data/spec/spec_helper.rb +0 -1
- data/spec/unit/semantic_puppet/dependency_spec.rb +21 -21
- data/spec/unit/semantic_puppet/version_range_spec.rb +468 -79
- data/spec/unit/semantic_puppet/version_spec.rb +31 -70
- metadata +6 -5
@@ -9,6 +9,14 @@ describe SemanticPuppet::Version do
|
|
9
9
|
|
10
10
|
describe '.parse' do
|
11
11
|
|
12
|
+
let(:parse_failure) do
|
13
|
+
/Unable to parse .* as a semantic version identifier/
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:no_leading_zeroes) do
|
17
|
+
'Numeric pre-release identifiers MUST NOT contain leading zeroes'
|
18
|
+
end
|
19
|
+
|
12
20
|
context 'Spec v2.0.0' do
|
13
21
|
context 'Section 2' do
|
14
22
|
# A normal version number MUST take the form X.Y.Z where X, Y, and Z are
|
@@ -17,10 +25,6 @@ describe SemanticPuppet::Version do
|
|
17
25
|
# Each element MUST increase numerically.
|
18
26
|
# For instance: 1.9.0 -> 1.10.0 -> 1.11.0.
|
19
27
|
|
20
|
-
let(:parse_failure) do
|
21
|
-
/Unable to parse .* as a semantic version identifier/
|
22
|
-
end
|
23
|
-
|
24
28
|
it 'rejects versions that contain too few parts' do
|
25
29
|
expect { subject('1.2') }.to raise_error(parse_failure)
|
26
30
|
end
|
@@ -89,31 +93,19 @@ describe SemanticPuppet::Version do
|
|
89
93
|
# by its associated normal version.
|
90
94
|
# Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92.
|
91
95
|
|
92
|
-
let(:restricted_charset) do
|
93
|
-
'Prerelease identifiers MUST use only ASCII alphanumerics and hyphens'
|
94
|
-
end
|
95
|
-
|
96
|
-
let(:must_not_be_empty) do
|
97
|
-
'Prerelease identifiers MUST NOT be empty'
|
98
|
-
end
|
99
|
-
|
100
|
-
let(:no_leading_zeroes) do
|
101
|
-
'Prerelease identifiers MUST NOT contain leading zeroes'
|
102
|
-
end
|
103
|
-
|
104
96
|
it 'rejects prerelease identifiers with non-alphanumerics' do
|
105
|
-
expect { subject('1.2.3-$100') }.to raise_error(
|
106
|
-
expect { subject('1.2.3-rc.1@me') }.to raise_error(
|
97
|
+
expect { subject('1.2.3-$100') }.to raise_error(parse_failure)
|
98
|
+
expect { subject('1.2.3-rc.1@me') }.to raise_error(parse_failure)
|
107
99
|
end
|
108
100
|
|
109
101
|
it 'rejects empty prerelease versions' do
|
110
|
-
expect { subject('1.2.3-') }.to raise_error(
|
102
|
+
expect { subject('1.2.3-') }.to raise_error(parse_failure)
|
111
103
|
end
|
112
104
|
|
113
105
|
it 'rejects empty prerelease version identifiers' do
|
114
|
-
expect { subject('1.2.3-.rc1') }.to raise_error(
|
115
|
-
expect { subject('1.2.3-rc1.') }.to raise_error(
|
116
|
-
expect { subject('1.2.3-rc..1') }.to raise_error(
|
106
|
+
expect { subject('1.2.3-.rc1') }.to raise_error(parse_failure)
|
107
|
+
expect { subject('1.2.3-rc1.') }.to raise_error(parse_failure)
|
108
|
+
expect { subject('1.2.3-rc..1') }.to raise_error(parse_failure)
|
117
109
|
end
|
118
110
|
|
119
111
|
it 'rejects numeric prerelease identifiers with leading zeroes' do
|
@@ -167,14 +159,6 @@ describe SemanticPuppet::Version do
|
|
167
159
|
end
|
168
160
|
|
169
161
|
context 'Section 10' do
|
170
|
-
# Build metadata is not yet in scope so
|
171
|
-
it 'rejects build identifiers' do
|
172
|
-
ver = '1.2.3+anything'
|
173
|
-
expect { subject(ver) }.to raise_error("'#{ver}' MUST NOT include build identifiers")
|
174
|
-
end
|
175
|
-
end
|
176
|
-
|
177
|
-
context 'Section 10', :pending => "build metadata is not yet in scope" do
|
178
162
|
# Build metadata MAY be denoted by appending a plus sign and a series
|
179
163
|
# of dot separated identifiers immediately following the patch or
|
180
164
|
# pre-release version. Identifiers MUST comprise only ASCII
|
@@ -185,28 +169,19 @@ describe SemanticPuppet::Version do
|
|
185
169
|
# Examples: 1.0.0-alpha+001, 1.0.0+20130313144700,
|
186
170
|
# 1.0.0-beta+exp.sha.5114f85.
|
187
171
|
|
188
|
-
|
189
|
-
let(:restricted_charset) do
|
190
|
-
'Build identifiers MUST use only ASCII alphanumerics and hyphens'
|
191
|
-
end
|
192
|
-
|
193
|
-
let(:must_not_be_empty) do
|
194
|
-
'Build identifiers MUST NOT be empty'
|
195
|
-
end
|
196
|
-
|
197
172
|
it 'rejects build identifiers with non-alphanumerics' do
|
198
|
-
expect { subject('1.2.3+$100') }.to raise_error(
|
199
|
-
expect { subject('1.2.3+rc.1@me') }.to raise_error(
|
173
|
+
expect { subject('1.2.3+$100') }.to raise_error(parse_failure)
|
174
|
+
expect { subject('1.2.3+rc.1@me') }.to raise_error(parse_failure)
|
200
175
|
end
|
201
176
|
|
202
177
|
it 'rejects empty build metadata' do
|
203
|
-
expect { subject('1.2.3+') }.to raise_error(
|
178
|
+
expect { subject('1.2.3+') }.to raise_error(parse_failure)
|
204
179
|
end
|
205
180
|
|
206
181
|
it 'rejects empty build identifiers' do
|
207
|
-
expect { subject('1.2.3+.rc1') }.to raise_error(
|
208
|
-
expect { subject('1.2.3+rc1.') }.to raise_error(
|
209
|
-
expect { subject('1.2.3+rc..1') }.to raise_error(
|
182
|
+
expect { subject('1.2.3+.rc1') }.to raise_error(parse_failure)
|
183
|
+
expect { subject('1.2.3+rc1.') }.to raise_error(parse_failure)
|
184
|
+
expect { subject('1.2.3+rc..1') }.to raise_error(parse_failure)
|
210
185
|
end
|
211
186
|
|
212
187
|
it 'permits numeric build identifiers with leading zeroes' do
|
@@ -263,10 +238,6 @@ describe SemanticPuppet::Version do
|
|
263
238
|
# increments of one.
|
264
239
|
# For instance: 1.9.0 -> 1.10.0 -> 1.11.0
|
265
240
|
|
266
|
-
let(:parse_failure) do
|
267
|
-
/Unable to parse .* as a semantic version identifier/
|
268
|
-
end
|
269
|
-
|
270
241
|
it 'rejects versions that contain too few parts' do
|
271
242
|
expect { subject('1.2') }.to raise_error(parse_failure)
|
272
243
|
end
|
@@ -320,25 +291,13 @@ describe SemanticPuppet::Version do
|
|
320
291
|
# lexicographic ASCII sort order.
|
321
292
|
# For instance: 1.0.0-alpha1 < 1.0.0-beta1 < 1.0.0-beta2 < 1.0.0-rc1
|
322
293
|
|
323
|
-
let(:restricted_charset) do
|
324
|
-
'Prerelease identifiers MUST use only ASCII alphanumerics and hyphens'
|
325
|
-
end
|
326
|
-
|
327
|
-
let(:must_not_be_empty) do
|
328
|
-
'Prerelease identifiers MUST NOT be empty'
|
329
|
-
end
|
330
|
-
|
331
|
-
let(:no_leading_zeroes) do
|
332
|
-
'Prerelease identifiers MUST NOT contain leading zeroes'
|
333
|
-
end
|
334
|
-
|
335
294
|
it 'rejects prerelease identifiers with non-alphanumerics' do
|
336
|
-
expect { subject('1.2.3-$100') }.to raise_error(
|
337
|
-
expect { subject('1.2.3-rc.1@me') }.to raise_error(
|
295
|
+
expect { subject('1.2.3-$100') }.to raise_error(parse_failure)
|
296
|
+
expect { subject('1.2.3-rc.1@me') }.to raise_error(parse_failure)
|
338
297
|
end
|
339
298
|
|
340
299
|
it 'rejects empty prerelease versions' do
|
341
|
-
expect { subject('1.2.3-') }.to raise_error(
|
300
|
+
expect { subject('1.2.3-') }.to raise_error(parse_failure)
|
342
301
|
end
|
343
302
|
|
344
303
|
it 'rejects numeric prerelease identifiers with leading zeroes' do
|
@@ -540,14 +499,19 @@ describe SemanticPuppet::Version do
|
|
540
499
|
expect(b).to be > a
|
541
500
|
end
|
542
501
|
|
543
|
-
example 'build metadata does
|
544
|
-
pending 'build metadata is not yet in scope'
|
502
|
+
example 'build metadata does figure into equality' do
|
545
503
|
a = parse('1.0.0-alpha+SHA1')
|
546
504
|
b = parse('1.0.0-alpha+MD5')
|
547
|
-
expect(a).
|
505
|
+
expect(a).not_to eql b
|
548
506
|
expect(a.to_s).to_not eql b.to_s
|
549
507
|
end
|
550
508
|
|
509
|
+
example 'build metadata does not figure into precendence' do
|
510
|
+
a = parse('1.0.0-alpha+SHA1')
|
511
|
+
b = parse('1.0.0-alpha+MD5')
|
512
|
+
expect(a <=> b).to eql(0)
|
513
|
+
end
|
514
|
+
|
551
515
|
example 'sorted order' do
|
552
516
|
list = %w[
|
553
517
|
1.0.0-alpha
|
@@ -631,7 +595,6 @@ describe SemanticPuppet::Version do
|
|
631
595
|
end
|
632
596
|
|
633
597
|
it 'removes any build information' do
|
634
|
-
pending 'build metadata is not yet in scope'
|
635
598
|
expect(subject('1.0.0+abc').next(:major)).to eql(subject('2.0.0'))
|
636
599
|
end
|
637
600
|
end
|
@@ -656,7 +619,6 @@ describe SemanticPuppet::Version do
|
|
656
619
|
end
|
657
620
|
|
658
621
|
it 'removes any build information' do
|
659
|
-
pending 'build metadata is not yet in scope'
|
660
622
|
expect(subject('1.1.0+abc').next(:minor)).to eql(subject('1.2.0'))
|
661
623
|
end
|
662
624
|
end
|
@@ -677,7 +639,6 @@ describe SemanticPuppet::Version do
|
|
677
639
|
end
|
678
640
|
|
679
641
|
it 'removes any build information' do
|
680
|
-
pending 'build metadata is not yet in scope'
|
681
642
|
expect(subject('1.0.0+abc').next(:patch)).to eql(subject('1.0.1'))
|
682
643
|
end
|
683
644
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semantic_puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gettext-setup
|
@@ -117,6 +117,8 @@ extensions: []
|
|
117
117
|
extra_rdoc_files: []
|
118
118
|
files:
|
119
119
|
- ".gitignore"
|
120
|
+
- ".rubocop.yml"
|
121
|
+
- ".travis.yml"
|
120
122
|
- ".yardopts"
|
121
123
|
- CHANGELOG.md
|
122
124
|
- Gemfile
|
@@ -156,7 +158,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
156
158
|
requirements:
|
157
159
|
- - ">="
|
158
160
|
- !ruby/object:Gem::Version
|
159
|
-
version: 1.
|
161
|
+
version: 1.9.3
|
160
162
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
163
|
requirements:
|
162
164
|
- - ">="
|
@@ -164,9 +166,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
166
|
version: '0'
|
165
167
|
requirements: []
|
166
168
|
rubyforge_project:
|
167
|
-
rubygems_version: 2.
|
169
|
+
rubygems_version: 2.6.10
|
168
170
|
signing_key:
|
169
171
|
specification_version: 4
|
170
172
|
summary: Useful tools for working with Semantic Versions.
|
171
173
|
test_files: []
|
172
|
-
has_rdoc:
|