udb 0.1.8 → 0.1.9
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/lib/udb/logic.rb +18 -10
- data/lib/udb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eacb60feeaaca9c368b3e7785efe85a03e6cf32a228b2e9b73a75eee1e527a6b
|
|
4
|
+
data.tar.gz: da1c153ff0e163d593f2ece814b9e71d3de7a421795920f9f688913f26ae170e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 920b67cb9bf2b9a6227b1251c3387050e2ea9257d400152dfc10c71dd53ff7f79bbf336749859755d415dff899b0f519a764a8e75e9d0c62d0cfedb88cef09fa
|
|
7
|
+
data.tar.gz: 34d834ebf04de3fc3da7e9ea61e84236235ef4001aadb4f53237d8afbdf5f169064ddad49c717eedee9444e4860875105623b7ef6b292a2ab94364404d9f6afa
|
data/lib/udb/logic.rb
CHANGED
|
@@ -316,7 +316,7 @@ module Udb
|
|
|
316
316
|
end
|
|
317
317
|
end
|
|
318
318
|
|
|
319
|
-
ValueType = T.type_alias { T.any(Integer, String, T::Boolean, T::Array[T.any(Integer, String)]) }
|
|
319
|
+
ValueType = T.type_alias { T.any(Integer, String, T::Boolean, T::Array[T.any(Integer, String, T::Boolean)]) }
|
|
320
320
|
|
|
321
321
|
sig { params(yaml: T::Hash[String, T.untyped]).void }
|
|
322
322
|
def initialize(yaml)
|
|
@@ -1034,9 +1034,11 @@ module Udb
|
|
|
1034
1034
|
elsif !@yaml.key?("includes") && other_param.to_h.key?("includes")
|
|
1035
1035
|
-1
|
|
1036
1036
|
end
|
|
1037
|
-
elsif @yaml.key?("oneOf") || other_param.
|
|
1038
|
-
if @yaml.key?("oneOf") && other_param.
|
|
1039
|
-
@yaml.fetch("oneOf")
|
|
1037
|
+
elsif @yaml.key?("oneOf") || other_param.comparison_type == ParameterComparisonType::OneOf
|
|
1038
|
+
if @yaml.key?("oneOf") && other_param.comparison_type == ParameterComparisonType::OneOf
|
|
1039
|
+
one_of = @yaml.fetch("oneOf")
|
|
1040
|
+
other_one_of = T.cast(other_param.comparison_value, T::Array[T.untyped])
|
|
1041
|
+
one_of.map { |e| [e.class.name, e.to_s] } <=> other_one_of.map { |e| [e.class.name, e.to_s] }
|
|
1040
1042
|
elsif @yaml.key?("oneOf")
|
|
1041
1043
|
1
|
|
1042
1044
|
else
|
|
@@ -1054,14 +1056,20 @@ module Udb
|
|
|
1054
1056
|
comparison_type <=> other_param.comparison_type
|
|
1055
1057
|
elsif comparison_value != other_param.comparison_value
|
|
1056
1058
|
cv = comparison_value
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
+
ocv = other_param.comparison_value
|
|
1060
|
+
if cv.class != ocv.class
|
|
1061
|
+
cv.class.name <=> ocv.class.name
|
|
1062
|
+
elsif cv.is_a?(String)
|
|
1063
|
+
cv <=> T.cast(ocv, String)
|
|
1059
1064
|
elsif cv.is_a?(Array)
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
T.cast(comparison_value, Integer) <=> T.cast(other_param.comparison_value, Integer)
|
|
1065
|
+
ocv_arr = T.cast(ocv, T::Array[T.any(String, T::Boolean, Integer)])
|
|
1066
|
+
cv.map { |e| [e.class.name, e.to_s] } <=> ocv_arr.map { |e| [e.class.name, e.to_s] }
|
|
1063
1067
|
else
|
|
1064
|
-
|
|
1068
|
+
# cv and ocv have the same class (not String, not Array).
|
|
1069
|
+
# Given the type constraints (String, Boolean, Integer), this is Integer.
|
|
1070
|
+
# Two booleans with the same value are equal (cv != ocv is false), so
|
|
1071
|
+
# TrueClass or FalseClass values never reach here.
|
|
1072
|
+
T.cast(cv, Integer) <=> T.cast(ocv, Integer)
|
|
1065
1073
|
end
|
|
1066
1074
|
else
|
|
1067
1075
|
# these are the same (ignoring reason)
|
data/lib/udb/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: udb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Derek Hower
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2026-04-
|
|
12
|
+
date: 2026-04-11 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|