unleash 5.0.4 → 5.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/unleash/strategies.rb +15 -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: 18d3ceb8b2115e259e3fb2ae66643dafea5009826a25be644ab4c98406b8ef30
|
4
|
+
data.tar.gz: 3c22aed38cc800658d422dd41edfd103728e0ebf749110bf510a46259d3c2312
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98a67cbdcee3d72d1aaaf5f54581875c122e58fb3dbd248bbc5c9ab0e7c55f7352dd732b12293a594412f2484535084410984b975400d991dd5b96ce02084a22
|
7
|
+
data.tar.gz: a5551b86fc70c7dd6c1b80b8bb7e643524a42dc25220ca962628407a351a6886b95d7115fd77f901ed876033f131d8a112fcbb5a42dfbfa788224867b5d6bc26
|
data/lib/unleash/strategies.rb
CHANGED
@@ -23,7 +23,11 @@ module Unleash
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def add(strategy)
|
26
|
-
|
26
|
+
if default_strategy_names.include?(strategy.name)
|
27
|
+
Unleash.logger.error "WARNING: Overriding built in strategy '#{strategy.name}'. OVERIDING BUILT IN STRATEGIES IS \
|
28
|
+
DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE."
|
29
|
+
end
|
30
|
+
self.internal_add(strategy)
|
27
31
|
end
|
28
32
|
|
29
33
|
def []=(key, strategy)
|
@@ -52,12 +56,20 @@ module Unleash
|
|
52
56
|
.each do |c|
|
53
57
|
strategy = c.new
|
54
58
|
warn_deprecated_registration(strategy, 'adding custom class into Unleash::Strategy namespace')
|
55
|
-
self.
|
59
|
+
self.internal_add(strategy)
|
56
60
|
end
|
57
61
|
end
|
58
62
|
|
59
63
|
def register_base_strategies
|
60
|
-
DEFAULT_STRATEGIES.each{ |c| self.
|
64
|
+
DEFAULT_STRATEGIES.each{ |c| self.internal_add(c.new) }
|
65
|
+
end
|
66
|
+
|
67
|
+
def internal_add(strategy)
|
68
|
+
@strategies[strategy.name] = strategy
|
69
|
+
end
|
70
|
+
|
71
|
+
def default_strategy_names
|
72
|
+
DEFAULT_STRATEGIES.map{ |strategy_class| strategy_class.new.name }
|
61
73
|
end
|
62
74
|
|
63
75
|
DEFAULT_STRATEGIES = [
|
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.5
|
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-07-
|
11
|
+
date: 2024-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: murmurhash3
|