semver_dialects 1.5.1 → 1.6.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cc2bd801dde6d272799f9d459e65dd035a8b2ae65e66a635d6ae423d7667a9f
|
4
|
+
data.tar.gz: bc3692ba314609875927812115cca95199a88af38eb6b69a652dc69f22183099
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6417b415513cbc8a0c579303630ac62971cba025d4ee5b8a47fe3d819e538344dfb69f645dc852c188a1afee2cc753c9ffc9454b59454e152fb7060aa1f9b711
|
7
|
+
data.tar.gz: 8ec38eb372ff41181bd336d7724008296a18cca71d461c2484df2b86dee7e554540f76182f0f40496b4ddba0be0e6fcba4511df6ba897ad41e7a1f7d870f2d9a
|
@@ -16,6 +16,8 @@ class VersionInterval
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def intersect(other_interval)
|
19
|
+
return EmptyInterval.new if self.empty?
|
20
|
+
|
19
21
|
# this look odd -- we have to use it here though, because it may be that placeholders are present inside
|
20
22
|
# the version for which > and < would yield true
|
21
23
|
return EmptyInterval.new if !(@start_cut <= other_interval.end_cut) || !(other_interval.start_cut <= @end_cut)
|
@@ -2,22 +2,19 @@ require_relative "version_cut"
|
|
2
2
|
require_relative "version_interval"
|
3
3
|
|
4
4
|
module VersionParser
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
interval = self.all_versions
|
11
|
-
|
12
|
-
version_constraint.split(" ").each do |version_specifier|
|
13
|
-
matches = VERSION_SPECIFIER_REGEX.match(version_specifier)
|
14
|
-
|
15
|
-
if matches.nil? || matches.size == 0
|
16
|
-
raise SemverDialects::Error, "could not parse version specifier \"#{version_specifier}\" from version constraint \"#{version_constraint}\""
|
17
|
-
end
|
5
|
+
def self.parse(versionstring)
|
6
|
+
if (versionstring == "=*")
|
7
|
+
# special case = All Versions
|
8
|
+
return VersionInterval.new(IntervalType::LEFT_OPEN | IntervalType::RIGHT_OPEN, BelowAll.new(), AboveAll.new())
|
9
|
+
end
|
18
10
|
|
19
|
-
|
20
|
-
|
11
|
+
version_items = versionstring.split(" ")
|
12
|
+
interval = VersionInterval.new(IntervalType::LEFT_OPEN | IntervalType::RIGHT_OPEN, BelowAll.new(), AboveAll.new())
|
13
|
+
version_items.each do
|
14
|
+
|version_item|
|
15
|
+
matches = version_item.match /(?<op>[><=]+) *(?<version>[a-zA-Z0-9\-_\.\*]+)/
|
16
|
+
version_string = matches[:version]
|
17
|
+
case matches[:op]
|
21
18
|
when ">="
|
22
19
|
new_interval = VersionInterval.new(IntervalType::LEFT_CLOSED | IntervalType::RIGHT_OPEN, VersionCut.new(version_string), AboveAll.new())
|
23
20
|
interval = interval.intersect(new_interval)
|
@@ -35,13 +32,6 @@ module VersionParser
|
|
35
32
|
interval = interval.intersect(new_interval)
|
36
33
|
end
|
37
34
|
end
|
38
|
-
|
39
35
|
interval
|
40
36
|
end
|
41
|
-
|
42
|
-
private
|
43
|
-
|
44
|
-
def self.all_versions
|
45
|
-
VersionInterval.new(IntervalType::LEFT_OPEN | IntervalType::RIGHT_OPEN, BelowAll.new(), AboveAll.new())
|
46
|
-
end
|
47
37
|
end
|
data/lib/utils.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semver_dialects
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian Thome
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2024-01-
|
13
|
+
date: 2024-01-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: pastel
|
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
169
|
- !ruby/object:Gem::Version
|
170
170
|
version: '0'
|
171
171
|
requirements: []
|
172
|
-
rubygems_version: 3.4.
|
172
|
+
rubygems_version: 3.4.19
|
173
173
|
signing_key:
|
174
174
|
specification_version: 4
|
175
175
|
summary: This gem provides utility function to process semantic versions expressed
|