unleash 5.0.5 → 5.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/unleash/client.rb +1 -1
- data/lib/unleash/constraint.rb +5 -3
- data/lib/unleash/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: 609118f8646c4d688a8ec3345a16cce918b75e7ab6ee3384b0f71072168047a2
|
4
|
+
data.tar.gz: 772f7b26e577e0175f474c5d552fd6df04789d800550ac1ad5daedfa372e749e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '00943a145724937cae025f41a877078e0e59e05097c43b1b692d234cf9115fd4418ffe63397e7f2f2e4d8b743887acb22fa36f1478f10e1dd742e7da36fc3e0c'
|
7
|
+
data.tar.gz: de046eb9f79f2bb3323901380f22d0880b4f64c7ae7bda5ccb0be98412e6133bd38721d8ed0dfc4d6c05731c364990e9c058876a267421d756feebdcce4bd07e
|
data/CHANGELOG.md
CHANGED
@@ -13,6 +13,19 @@ Note: These changes are not considered notable:
|
|
13
13
|
|
14
14
|
## [Unreleased]
|
15
15
|
|
16
|
+
|
17
|
+
## [5.0.7] - 2024-09-04
|
18
|
+
### Changed
|
19
|
+
- segments now work with variants (#194)
|
20
|
+
|
21
|
+
## [5.0.6] - 2024-08-29
|
22
|
+
### Changed
|
23
|
+
- do not fail when case insentive enabled while having a complex context object (#191)
|
24
|
+
|
25
|
+
## [5.0.5] - 2024-07-31
|
26
|
+
### Changed
|
27
|
+
- emit warning when overriding a built in strategy (#187)
|
28
|
+
|
16
29
|
## [5.0.4] - 2024-07-15
|
17
30
|
### Changed
|
18
31
|
- Reverted "feat: automatically generated instance_id (#179)" (#185)
|
data/lib/unleash/client.rb
CHANGED
@@ -80,7 +80,7 @@ module Unleash
|
|
80
80
|
return fallback_variant
|
81
81
|
end
|
82
82
|
|
83
|
-
toggle = Unleash::FeatureToggle.new(toggle_as_hash)
|
83
|
+
toggle = Unleash::FeatureToggle.new(toggle_as_hash, Unleash&.segment_cache)
|
84
84
|
variant = toggle.get_variant(context, fallback_variant)
|
85
85
|
|
86
86
|
if variant.nil?
|
data/lib/unleash/constraint.rb
CHANGED
@@ -22,6 +22,8 @@ module Unleash
|
|
22
22
|
FALLBACK_VALIDATOR: ->(_context_v, _constraint_v){ false }
|
23
23
|
}.freeze
|
24
24
|
|
25
|
+
STRING_OPERATORS = [:STR_STARTS_WITH, :STR_ENDS_WITH, :STR_CONTAINS].freeze
|
26
|
+
|
25
27
|
LIST_OPERATORS = [:IN, :NOT_IN, :STR_STARTS_WITH, :STR_ENDS_WITH, :STR_CONTAINS].freeze
|
26
28
|
|
27
29
|
def initialize(context_name, operator, value = [], inverted: false, case_insensitive: false)
|
@@ -106,10 +108,10 @@ module Unleash
|
|
106
108
|
v = self.value.dup
|
107
109
|
context_value = context.get_by_name(self.context_name)
|
108
110
|
|
109
|
-
|
110
|
-
|
111
|
+
# always return false, if we are comparing a non string with a string operator:
|
112
|
+
return false if !context_value.is_a?(String) && STRING_OPERATORS.include?(self.operator)
|
111
113
|
|
112
|
-
OPERATORS[self.operator].call(context_value, v)
|
114
|
+
OPERATORS[self.operator].call(*self.case_insensitive ? [context_value.upcase, v.map(&:upcase)] : [context_value, v])
|
113
115
|
end
|
114
116
|
end
|
115
117
|
end
|
data/lib/unleash/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unleash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Renato Arruda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: murmurhash3
|