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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/udb/logic.rb +18 -10
  3. data/lib/udb/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e7687f0e4c119216f5dd6a404f916175fd0b6c124e8eaacf3ffe5dbe49357548
4
- data.tar.gz: 6642f33deff3b2accac49af918e563983e79418a5f2b4def6bc73ea043c6dde8
3
+ metadata.gz: eacb60feeaaca9c368b3e7785efe85a03e6cf32a228b2e9b73a75eee1e527a6b
4
+ data.tar.gz: da1c153ff0e163d593f2ece814b9e71d3de7a421795920f9f688913f26ae170e
5
5
  SHA512:
6
- metadata.gz: adb8bb54fdf64e9a4646cbb201c84b784c36833961ef806b150f08c9070389092711c2914e10d19d0be08d7a73b92bef482a12959f2f0edd8f30341aab1aa439
7
- data.tar.gz: 3634460333a51b33b843f68cee58091f28da5fbcb818e56efe51d343fe3ebdce16579b601a83782a9360e5aae777f9f17bf8186b9b48e5410c14ec3935ae34e2
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.to_h.key?("oneOf")
1038
- if @yaml.key?("oneOf") && other_param.to_h.key?("oneOf")
1039
- @yaml.fetch("oneOf") <=> other_param.to_h.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
- if cv.is_a?(String)
1058
- cv <=> T.cast(other_param.comparison_value, String)
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
- cv <=> T.cast(other_param.comparison_value, T::Array[T.any(String, T::Boolean, Integer)])
1061
- elsif cv.is_a?(Integer)
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
- T.cast(comparison_value, T::Boolean) <=> T.cast(other_param.comparison_value, T::Boolean)
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
@@ -5,5 +5,5 @@
5
5
  # frozen_string_literal: true
6
6
 
7
7
  module Udb
8
- def self.version = "0.1.8"
8
+ def self.version = "0.1.9"
9
9
  end
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.8
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-01 00:00:00.000000000 Z
12
+ date: 2026-04-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport