mixlib-versioning 1.1.0 → 1.2.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/.expeditor/config.yml +14 -0
- data/.expeditor/update_version.sh +9 -0
- data/.github/CODEOWNERS +3 -0
- data/.travis.yml +20 -19
- data/CHANGELOG.md +21 -7
- data/Gemfile +4 -4
- data/README.md +48 -29
- data/Rakefile +20 -6
- data/VERSION +1 -0
- data/lib/mixlib/versioning.rb +10 -8
- data/lib/mixlib/versioning/format.rb +25 -22
- data/lib/mixlib/versioning/format/git_describe.rb +1 -1
- data/lib/mixlib/versioning/format/opscode_semver.rb +3 -3
- data/lib/mixlib/versioning/format/partial_semver.rb +62 -0
- data/lib/mixlib/versioning/format/rubygems.rb +9 -3
- data/lib/mixlib/versioning/format/semver.rb +1 -1
- data/lib/mixlib/versioning/version.rb +1 -1
- data/mixlib-versioning.gemspec +14 -14
- data/spec/mixlib/versioning/format/git_describe_spec.rb +51 -51
- data/spec/mixlib/versioning/format/opscode_semver_spec.rb +43 -43
- data/spec/mixlib/versioning/format/partial_semver_spec.rb +121 -0
- data/spec/mixlib/versioning/format/rubygems_spec.rb +40 -40
- data/spec/mixlib/versioning/format/semver_spec.rb +31 -31
- data/spec/mixlib/versioning/format_spec.rb +39 -12
- data/spec/mixlib/versioning/versioning_spec.rb +100 -100
- data/spec/spec_helper.rb +5 -6
- data/spec/support/shared_examples/basic_semver.rb +7 -7
- data/spec/support/shared_examples/behaviors/comparable.rb +14 -14
- data/spec/support/shared_examples/behaviors/comparable_types.rb +56 -0
- data/spec/support/shared_examples/behaviors/filterable.rb +11 -11
- data/spec/support/shared_examples/behaviors/parses_valid_version_strings.rb +1 -1
- data/spec/support/shared_examples/behaviors/rejects_invalid_version_strings.rb +1 -1
- data/spec/support/shared_examples/behaviors/serializable.rb +7 -7
- data/spec/support/shared_examples/behaviors/sortable.rb +9 -9
- data/spec/support/shared_examples/semver.rb +54 -54
- metadata +25 -18
- data/.rubocop.yml +0 -22
@@ -53,7 +53,7 @@ module Mixlib
|
|
53
53
|
match = version_string.match(GIT_DESCRIBE_REGEX) rescue nil
|
54
54
|
|
55
55
|
unless match
|
56
|
-
|
56
|
+
raise Mixlib::Versioning::ParseError, "'#{version_string}' is not a valid #{self.class} version string!"
|
57
57
|
end
|
58
58
|
|
59
59
|
@major, @minor, @patch, @prerelease, @commits_since, @commit_sha, @iteration = match[1..7]
|
@@ -17,7 +17,7 @@
|
|
17
17
|
# limitations under the License.
|
18
18
|
#
|
19
19
|
|
20
|
-
require
|
20
|
+
require "mixlib/versioning/format/semver"
|
21
21
|
|
22
22
|
module Mixlib
|
23
23
|
class Versioning
|
@@ -71,8 +71,8 @@ module Mixlib
|
|
71
71
|
def parse(version_string)
|
72
72
|
super(version_string)
|
73
73
|
|
74
|
-
|
75
|
-
|
74
|
+
raise Mixlib::Versioning::ParseError, "'#{@prerelease}' is not a valid Opscode pre-release signifier!" unless @prerelease.nil? || @prerelease.match(OPSCODE_PRERELEASE_REGEX)
|
75
|
+
raise Mixlib::Versioning::ParseError, "'#{@build}' is not a valid Opscode build signifier!" unless @build.nil? || @build.match(OPSCODE_BUILD_REGEX)
|
76
76
|
end
|
77
77
|
end # class OpscodeSemVer
|
78
78
|
end # class Format
|
@@ -0,0 +1,62 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Seth Chisamore (<schisamo@chef.io>)
|
3
|
+
# Author:: Christopher Maier (<cm@chef.io>)
|
4
|
+
# Author:: Ryan Hass (<rhass@chef.io>)
|
5
|
+
# Copyright:: Copyright (c) 2017 Chef Software Inc.
|
6
|
+
# License:: Apache License, Version 2.0
|
7
|
+
#
|
8
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
+
# you may not use this file except in compliance with the License.
|
10
|
+
# You may obtain a copy of the License at
|
11
|
+
#
|
12
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
13
|
+
#
|
14
|
+
# Unless required by applicable law or agreed to in writing, software
|
15
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17
|
+
# See the License for the specific language governing permissions and
|
18
|
+
# limitations under the License.
|
19
|
+
#
|
20
|
+
|
21
|
+
module Mixlib
|
22
|
+
class Versioning
|
23
|
+
class Format
|
24
|
+
# Handles partial version strings.
|
25
|
+
# -----------------
|
26
|
+
# ```text
|
27
|
+
# MAJOR
|
28
|
+
# MAJOR.MINOR
|
29
|
+
# ```
|
30
|
+
#
|
31
|
+
# EXAMPLES
|
32
|
+
# --------
|
33
|
+
# ```text
|
34
|
+
# 11
|
35
|
+
# 11.0
|
36
|
+
# ```
|
37
|
+
#
|
38
|
+
# @author Seth Chisamore (<schisamo@chef.io>)
|
39
|
+
# @author Christopher Maier (<cm@chef.io>)
|
40
|
+
# @author Ryan Hass (<rhass@chef.io>)
|
41
|
+
class PartialSemVer < Format
|
42
|
+
# http://rubular.com/r/NmRSN8vCie
|
43
|
+
PARTIAL_REGEX = /^(\d+)\.?(?:(\d*))$/
|
44
|
+
# @see Format#parse
|
45
|
+
def parse(version_string)
|
46
|
+
match = version_string.match(PARTIAL_REGEX) rescue nil
|
47
|
+
|
48
|
+
unless match
|
49
|
+
raise Mixlib::Versioning::ParseError, "'#{version_string}' is not a valid #{self.class} version string!"
|
50
|
+
end
|
51
|
+
|
52
|
+
@major, @minor = match[1..2]
|
53
|
+
@major, @minor, @patch = [@major, @minor, @patch].map(&:to_i)
|
54
|
+
|
55
|
+
# Partial versions do not contain these values, so we just set them to nil.
|
56
|
+
@prerelease = nil
|
57
|
+
@build = nil
|
58
|
+
end
|
59
|
+
end # class Partial
|
60
|
+
end # class Format
|
61
|
+
end # module Versioning
|
62
|
+
end # module Mixlib
|
@@ -49,13 +49,19 @@ module Mixlib
|
|
49
49
|
match = version_string.match(RUBYGEMS_REGEX) rescue nil
|
50
50
|
|
51
51
|
unless match
|
52
|
-
|
52
|
+
raise Mixlib::Versioning::ParseError, "'#{version_string}' is not a valid #{self.class} version string!"
|
53
53
|
end
|
54
54
|
|
55
55
|
@major, @minor, @patch, @prerelease, @iteration = match[1..5]
|
56
|
-
@major, @minor, @patch
|
56
|
+
@major, @minor, @patch = [@major, @minor, @patch].map(&:to_i)
|
57
57
|
|
58
|
-
# Do not convert @
|
58
|
+
# Do not convert @prerelease or @iteration to an integer;
|
59
|
+
# sorting logic will handle the conversion.
|
60
|
+
@iteration = if @iteration.nil? || @iteration.empty?
|
61
|
+
nil
|
62
|
+
else
|
63
|
+
@iteration.to_i
|
64
|
+
end
|
59
65
|
@prerelease = nil if @prerelease.nil? || @prerelease.empty?
|
60
66
|
end
|
61
67
|
end # class Rubygems
|
@@ -49,7 +49,7 @@ module Mixlib
|
|
49
49
|
match = version_string.match(SEMVER_REGEX) rescue nil
|
50
50
|
|
51
51
|
unless match
|
52
|
-
|
52
|
+
raise Mixlib::Versioning::ParseError, "'#{version_string}' is not a valid #{self.class} version string!"
|
53
53
|
end
|
54
54
|
|
55
55
|
@major, @minor, @patch, @prerelease, @build = match[1..5]
|
data/mixlib-versioning.gemspec
CHANGED
@@ -1,28 +1,28 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
lib = File.expand_path(
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
4
|
+
require "mixlib/versioning/version"
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = "mixlib-versioning"
|
8
8
|
spec.version = Mixlib::Versioning::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
11
|
-
spec.description =
|
9
|
+
spec.authors = ["Seth Chisamore", "Christopher Maier"]
|
10
|
+
spec.email = ["schisamo@chef.io", "cm@chef.io"]
|
11
|
+
spec.description = "General purpose Ruby library that allows you to parse, compare and manipulate version strings in multiple formats."
|
12
12
|
spec.summary = spec.description
|
13
|
-
spec.homepage =
|
14
|
-
spec.license =
|
13
|
+
spec.homepage = "https://github.com/chef/mixlib-versioning"
|
14
|
+
spec.license = "Apache 2.0"
|
15
15
|
|
16
|
-
spec.required_ruby_version =
|
16
|
+
spec.required_ruby_version = ">= 2.2"
|
17
17
|
|
18
18
|
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
19
19
|
spec.executables = spec.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
20
20
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
21
|
-
spec.require_paths = [
|
21
|
+
spec.require_paths = ["lib"]
|
22
22
|
|
23
23
|
# Development dependencies
|
24
|
-
spec.add_development_dependency
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
27
|
-
spec.add_development_dependency
|
24
|
+
spec.add_development_dependency "chefstyle"
|
25
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
26
|
+
spec.add_development_dependency "rspec-its"
|
27
|
+
spec.add_development_dependency "rake", "~> 12"
|
28
28
|
end
|
@@ -16,103 +16,103 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
require
|
19
|
+
require "spec_helper"
|
20
20
|
|
21
21
|
describe Mixlib::Versioning::Format::GitDescribe do
|
22
22
|
subject { described_class.new(version_string) }
|
23
23
|
|
24
|
-
it_has_behavior
|
25
|
-
|
24
|
+
it_has_behavior "parses valid version strings", {
|
25
|
+
"0.10.8-231-g59d6185" => {
|
26
26
|
major: 0,
|
27
27
|
minor: 10,
|
28
28
|
patch: 8,
|
29
29
|
prerelease: nil,
|
30
|
-
build:
|
30
|
+
build: "231.g59d6185.0",
|
31
31
|
release?: false,
|
32
32
|
prerelease?: false,
|
33
33
|
build?: true,
|
34
34
|
release_build?: true,
|
35
35
|
prerelease_build?: false,
|
36
36
|
commits_since: 231,
|
37
|
-
commit_sha:
|
37
|
+
commit_sha: "59d6185",
|
38
38
|
iteration: 0,
|
39
39
|
},
|
40
|
-
|
40
|
+
"10.16.2-49-g21353f0-1" => {
|
41
41
|
major: 10,
|
42
42
|
minor: 16,
|
43
43
|
patch: 2,
|
44
44
|
prerelease: nil,
|
45
|
-
build:
|
45
|
+
build: "49.g21353f0.1",
|
46
46
|
release?: false,
|
47
47
|
prerelease?: false,
|
48
48
|
build?: true,
|
49
49
|
release_build?: true,
|
50
50
|
prerelease_build?: false,
|
51
51
|
commits_since: 49,
|
52
|
-
commit_sha:
|
52
|
+
commit_sha: "21353f0",
|
53
53
|
iteration: 1,
|
54
54
|
},
|
55
|
-
|
55
|
+
"10.16.2.rc.1-49-g21353f0-1" => {
|
56
56
|
major: 10,
|
57
57
|
minor: 16,
|
58
58
|
patch: 2,
|
59
|
-
prerelease:
|
60
|
-
build:
|
59
|
+
prerelease: "rc.1",
|
60
|
+
build: "49.g21353f0.1",
|
61
61
|
release?: false,
|
62
62
|
prerelease?: false,
|
63
63
|
build?: true,
|
64
64
|
release_build?: false,
|
65
65
|
prerelease_build?: true,
|
66
66
|
commits_since: 49,
|
67
|
-
commit_sha:
|
67
|
+
commit_sha: "21353f0",
|
68
68
|
iteration: 1,
|
69
69
|
},
|
70
|
-
|
70
|
+
"10.16.2-alpha-49-g21353f0-1" => {
|
71
71
|
major: 10,
|
72
72
|
minor: 16,
|
73
73
|
patch: 2,
|
74
|
-
prerelease:
|
75
|
-
build:
|
74
|
+
prerelease: "alpha",
|
75
|
+
build: "49.g21353f0.1",
|
76
76
|
release?: false,
|
77
77
|
prerelease?: false,
|
78
78
|
build?: true,
|
79
79
|
release_build?: false,
|
80
80
|
prerelease_build?: true,
|
81
81
|
commits_since: 49,
|
82
|
-
commit_sha:
|
82
|
+
commit_sha: "21353f0",
|
83
83
|
iteration: 1,
|
84
84
|
},
|
85
|
-
|
85
|
+
"10.16.2-alpha-49-g21353f0" => {
|
86
86
|
major: 10,
|
87
87
|
minor: 16,
|
88
88
|
patch: 2,
|
89
|
-
prerelease:
|
90
|
-
build:
|
89
|
+
prerelease: "alpha",
|
90
|
+
build: "49.g21353f0.0",
|
91
91
|
release?: false,
|
92
92
|
prerelease?: false,
|
93
93
|
build?: true,
|
94
94
|
release_build?: false,
|
95
95
|
prerelease_build?: true,
|
96
96
|
commits_since: 49,
|
97
|
-
commit_sha:
|
97
|
+
commit_sha: "21353f0",
|
98
98
|
iteration: 0,
|
99
99
|
},
|
100
100
|
}
|
101
101
|
|
102
|
-
it_has_behavior
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
102
|
+
it_has_behavior "rejects invalid version strings", {
|
103
|
+
"1.0.0" => "no git describe data",
|
104
|
+
"1.0.0-alpha.1" => "no git describe data",
|
105
|
+
"1.0.0-alpha.1+build.deadbeef" => "no git describe data",
|
106
|
+
"1.0.0-123-gfd0e3a65282cb5f6df3bab6a53f4fcb722340d499-1" => "too many SHA1 characters",
|
107
|
+
"1.0.0-123-gdeadbe-1" => "too few SHA1 characters",
|
108
|
+
"1.0.0-123-gNOTHEX1-1" => "illegal SHA1 characters",
|
109
|
+
"1.0.0-123-g1234567-alpha" => "non-numeric iteration",
|
110
|
+
"1.0.0-alpha-poop-g1234567-1" => "non-numeric 'commits_since'",
|
111
|
+
"1.0.0-g1234567-1" => "missing 'commits_since'",
|
112
|
+
"1.0.0-123-1" => "missing SHA1",
|
113
113
|
}
|
114
114
|
|
115
|
-
version_strings = %w
|
115
|
+
version_strings = %w{
|
116
116
|
9.0.1-1-gdeadbee-1
|
117
117
|
9.1.2-2-g1234567-1
|
118
118
|
10.0.0-1-gabcdef3-1
|
@@ -123,14 +123,14 @@ describe Mixlib::Versioning::Format::GitDescribe do
|
|
123
123
|
9.0.1-2-gdeadbe1-2
|
124
124
|
9.0.1-2-gdeadbe2-1
|
125
125
|
9.1.1-2-g1234567-1
|
126
|
-
|
126
|
+
}
|
127
127
|
|
128
|
-
it_has_behavior
|
128
|
+
it_has_behavior "serializable", version_strings
|
129
129
|
|
130
|
-
it_has_behavior
|
130
|
+
it_has_behavior "sortable" do
|
131
131
|
let(:unsorted_version_strings) { version_strings }
|
132
132
|
let(:sorted_version_strings) do
|
133
|
-
%w
|
133
|
+
%w{
|
134
134
|
9.0.1-1-gdeadbee-1
|
135
135
|
9.0.1-2-gdeadbe1-1
|
136
136
|
9.0.1-2-gdeadbe1-2
|
@@ -141,17 +141,17 @@ describe Mixlib::Versioning::Format::GitDescribe do
|
|
141
141
|
10.5.7-2-g21353f0-1
|
142
142
|
10.20.2-2-gbbbbbbb-1
|
143
143
|
10.20.2-3-gaaaaaaa-1
|
144
|
-
|
144
|
+
}
|
145
145
|
end
|
146
|
-
let(:min) {
|
147
|
-
let(:max) {
|
146
|
+
let(:min) { "9.0.1-1-gdeadbee-1" }
|
147
|
+
let(:max) { "10.20.2-3-gaaaaaaa-1" }
|
148
148
|
end # it_has_behavior
|
149
149
|
|
150
150
|
# The +GitDescribe+ format only produces release build versions.
|
151
|
-
it_has_behavior
|
151
|
+
it_has_behavior "filterable" do
|
152
152
|
let(:unsorted_version_strings) { version_strings }
|
153
153
|
let(:build_versions) do
|
154
|
-
%w
|
154
|
+
%w{
|
155
155
|
9.0.1-1-gdeadbee-1
|
156
156
|
9.1.2-2-g1234567-1
|
157
157
|
10.0.0-1-gabcdef3-1
|
@@ -162,10 +162,10 @@ describe Mixlib::Versioning::Format::GitDescribe do
|
|
162
162
|
9.0.1-2-gdeadbe1-2
|
163
163
|
9.0.1-2-gdeadbe2-1
|
164
164
|
9.1.1-2-g1234567-1
|
165
|
-
|
165
|
+
}
|
166
166
|
end
|
167
167
|
let(:release_build_versions) do
|
168
|
-
%w
|
168
|
+
%w{
|
169
169
|
9.0.1-1-gdeadbee-1
|
170
170
|
9.1.2-2-g1234567-1
|
171
171
|
10.0.0-1-gabcdef3-1
|
@@ -176,15 +176,15 @@ describe Mixlib::Versioning::Format::GitDescribe do
|
|
176
176
|
9.0.1-2-gdeadbe1-2
|
177
177
|
9.0.1-2-gdeadbe2-1
|
178
178
|
9.1.1-2-g1234567-1
|
179
|
-
|
179
|
+
}
|
180
180
|
end
|
181
|
-
end
|
181
|
+
end # it_has_behavior
|
182
182
|
|
183
|
-
it_has_behavior
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
183
|
+
it_has_behavior "comparable", [
|
184
|
+
"9.0.1-1-gdeadbee-1", "9.0.1-2-gdeadbe1-1",
|
185
|
+
"9.0.1-2-gdeadbe1-2", "9.0.1-2-gdeadbe2-1",
|
186
|
+
"9.1.1-2-g1234567-1", "9.1.2-2-g1234567-1",
|
187
|
+
"10.0.0-1-gabcdef3-1", "10.5.7-2-g21353f0-1",
|
188
|
+
"10.20.2-2-gbbbbbbb-1", "10.20.2-3-gaaaaaaa-1"
|
189
189
|
]
|
190
190
|
end # describe
|
@@ -16,38 +16,38 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
require
|
19
|
+
require "spec_helper"
|
20
20
|
|
21
21
|
describe Mixlib::Versioning::Format::OpscodeSemVer do
|
22
22
|
subject { described_class.new(version_string) }
|
23
23
|
|
24
24
|
it_should_behave_like Mixlib::Versioning::Format::SemVer
|
25
25
|
|
26
|
-
it_has_behavior
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
26
|
+
it_has_behavior "rejects invalid version strings", {
|
27
|
+
"1.0.0-poop.0" => "non-valid pre-release type",
|
28
|
+
"1.0.0+2010AA08010101" => "a malformed timestamp",
|
29
|
+
"1.0.0+cvs.33.e0f985a" => "a malformed git describe: no git string",
|
30
|
+
"1.0.0+git.AA.e0f985a" => "a malformed git describe: non-numeric COMMITS_SINCE",
|
31
|
+
"1.0.0+git.33.z0f985a" => "a malformed git describe: invalid SHA1",
|
32
|
+
"11.0.08-rc.1+20130308110833" => "leading zero invalid",
|
33
|
+
"01.0.8-alpha.2+20130308110833.git.2.94a1dde" => "leading zero invalid",
|
34
|
+
"11.02.8-rc.1+20130308110833" => "leading zero invalid",
|
35
|
+
"0008.1.4" => "leading zero invalid",
|
36
|
+
"11.00000000002.8-rc.1+20130308110833" => "leading zero invalid",
|
37
|
+
"4.67.00012+build.20131219" => "leading zero invalid",
|
38
|
+
"3.6.7-rc.007" => "leading zero invalid",
|
39
39
|
}
|
40
40
|
|
41
|
-
it_has_behavior
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
41
|
+
it_has_behavior "serializable", [
|
42
|
+
"1.0.0",
|
43
|
+
"1.0.0-alpha.1",
|
44
|
+
"1.0.0-alpha.1+20130308110833",
|
45
|
+
"1.0.0+20130308110833.git.2.94a1dde",
|
46
46
|
]
|
47
47
|
|
48
|
-
it_has_behavior
|
48
|
+
it_has_behavior "sortable" do
|
49
49
|
let(:unsorted_version_strings) do
|
50
|
-
%w
|
50
|
+
%w{
|
51
51
|
1.0.0-beta.2
|
52
52
|
1.0.0-alpha
|
53
53
|
1.0.0-rc.1+20130309074433
|
@@ -59,10 +59,10 @@ describe Mixlib::Versioning::Format::OpscodeSemVer do
|
|
59
59
|
1.3.7+20131009104433.git.2.94a1dde
|
60
60
|
1.3.7+20131009104433
|
61
61
|
1.3.7+20131009074433
|
62
|
-
|
62
|
+
}
|
63
63
|
end
|
64
64
|
let(:sorted_version_strings) do
|
65
|
-
%w
|
65
|
+
%w{
|
66
66
|
1.0.0-alpha
|
67
67
|
1.0.0-alpha.1
|
68
68
|
1.0.0-beta.2
|
@@ -74,15 +74,15 @@ describe Mixlib::Versioning::Format::OpscodeSemVer do
|
|
74
74
|
1.3.7+20131009074433
|
75
75
|
1.3.7+20131009104433
|
76
76
|
1.3.7+20131009104433.git.2.94a1dde
|
77
|
-
|
77
|
+
}
|
78
78
|
end
|
79
|
-
let(:min) {
|
80
|
-
let(:max) {
|
79
|
+
let(:min) { "1.0.0-alpha" }
|
80
|
+
let(:max) { "1.3.7+20131009104433.git.2.94a1dde" }
|
81
81
|
end # it_has_behavior
|
82
82
|
|
83
|
-
it_has_behavior
|
83
|
+
it_has_behavior "filterable" do
|
84
84
|
let(:unsorted_version_strings) do
|
85
|
-
%w
|
85
|
+
%w{
|
86
86
|
1.0.0-beta.2
|
87
87
|
1.0.0-alpha
|
88
88
|
1.0.0-rc.1+20130309074433
|
@@ -94,45 +94,45 @@ describe Mixlib::Versioning::Format::OpscodeSemVer do
|
|
94
94
|
1.3.7+20131009104433.git.2.94a1dde
|
95
95
|
1.3.7+20131009104433
|
96
96
|
1.3.7+20131009074433
|
97
|
-
|
97
|
+
}
|
98
98
|
end
|
99
|
-
let(:release_versions) { %w
|
99
|
+
let(:release_versions) { %w{1.0.0} }
|
100
100
|
let(:prerelease_versions) do
|
101
|
-
%w
|
101
|
+
%w{
|
102
102
|
1.0.0-beta.2
|
103
103
|
1.0.0-alpha
|
104
104
|
1.0.0-beta.11
|
105
105
|
1.0.0-rc.1
|
106
106
|
1.0.0-alpha.1
|
107
|
-
|
107
|
+
}
|
108
108
|
end
|
109
109
|
let(:build_versions) do
|
110
|
-
%w
|
110
|
+
%w{
|
111
111
|
1.0.0-rc.1+20130309074433
|
112
112
|
1.0.0+20121009074433
|
113
113
|
1.3.7+20131009104433.git.2.94a1dde
|
114
114
|
1.3.7+20131009104433
|
115
115
|
1.3.7+20131009074433
|
116
|
-
|
116
|
+
}
|
117
117
|
end
|
118
118
|
let(:release_build_versions) do
|
119
|
-
%w
|
119
|
+
%w{
|
120
120
|
1.0.0+20121009074433
|
121
121
|
1.3.7+20131009104433.git.2.94a1dde
|
122
122
|
1.3.7+20131009104433
|
123
123
|
1.3.7+20131009074433
|
124
|
-
|
124
|
+
}
|
125
125
|
end
|
126
126
|
let(:prerelease_build_versions) do
|
127
|
-
%w
|
128
|
-
1.0.0-rc.1+20130309074433
|
127
|
+
%w{
|
128
|
+
1.0.0-rc.1+20130309074433 }
|
129
129
|
end
|
130
130
|
end # it_has_behavior
|
131
131
|
|
132
|
-
it_has_behavior
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
132
|
+
it_has_behavior "comparable", [
|
133
|
+
"0.1.0", "0.2.0",
|
134
|
+
"1.0.0-alpha.1", "1.0.0",
|
135
|
+
"1.2.3", "1.2.3+20121009074433",
|
136
|
+
"2.0.0-beta.1", "2.0.0+20131009104433.git.2.94a1dde"
|
137
137
|
]
|
138
138
|
end # describe
|