unleash 4.2.0 → 4.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/lib/unleash/client.rb +1 -1
- data/lib/unleash/feature_toggle.rb +6 -6
- 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: c185b4a8d20c33f221a482a9f2b58fbf028c019513a89b528a491f738ec1308b
|
4
|
+
data.tar.gz: 8283a887720d6c8f9a72719a8ff4ff800fd88f3941d5f7d5cea83e4ea079a414
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 614df5b819537826bc575a1b6b061ca17561d2108c12e9b32581e458f37ca24beccc83046b1b59c9be0d2f2904087b92f6410f3d31bfa57b176228611a55d96e
|
7
|
+
data.tar.gz: 35528c4f4f5d39db50c13c7266ac620dec6cdb21154b6f0736dea2946e22b81270737d9085144894d7c1b96c858364ce44f5f948ba24f731e2f033ee0677d67c
|
data/lib/unleash/client.rb
CHANGED
@@ -23,8 +23,8 @@ module Unleash
|
|
23
23
|
"<FeatureToggle: name=#{name},enabled=#{enabled},strategies=#{strategies},variant_definitions=#{variant_definitions}>"
|
24
24
|
end
|
25
25
|
|
26
|
-
def is_enabled?(context
|
27
|
-
result = am_enabled?(context
|
26
|
+
def is_enabled?(context)
|
27
|
+
result = am_enabled?(context)
|
28
28
|
|
29
29
|
choice = result ? :yes : :no
|
30
30
|
Unleash.toggle_metrics.increment(name, choice) unless Unleash.configuration.disable_metrics
|
@@ -37,7 +37,7 @@ module Unleash
|
|
37
37
|
|
38
38
|
context = ensure_valid_context(context)
|
39
39
|
|
40
|
-
return Unleash::FeatureToggle.disabled_variant unless self.enabled && am_enabled?(context
|
40
|
+
return Unleash::FeatureToggle.disabled_variant unless self.enabled && am_enabled?(context)
|
41
41
|
return Unleash::FeatureToggle.disabled_variant if sum_variant_defs_weights <= 0
|
42
42
|
|
43
43
|
variant = variant_from_override_match(context) || variant_from_weights(context, resolve_stickiness)
|
@@ -57,7 +57,7 @@ module Unleash
|
|
57
57
|
end
|
58
58
|
|
59
59
|
# only check if it is enabled, do not do metrics
|
60
|
-
def am_enabled?(context
|
60
|
+
def am_enabled?(context)
|
61
61
|
result =
|
62
62
|
if self.enabled
|
63
63
|
self.strategies.empty? ||
|
@@ -65,10 +65,10 @@ module Unleash
|
|
65
65
|
strategy_enabled?(s, context) && strategy_constraint_matches?(s, context)
|
66
66
|
end
|
67
67
|
else
|
68
|
-
|
68
|
+
false
|
69
69
|
end
|
70
70
|
|
71
|
-
Unleash.logger.debug "Unleash::FeatureToggle (enabled:#{self.enabled}
|
71
|
+
Unleash.logger.debug "Unleash::FeatureToggle (enabled:#{self.enabled} " \
|
72
72
|
"and Strategies combined with contraints returned #{result})"
|
73
73
|
|
74
74
|
result
|
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: 4.2.
|
4
|
+
version: 4.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Renato Arruda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: murmurhash3
|