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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3621f28c635027008444c50908af24043a632c7939fcde6744d31e4cfc14b87
4
- data.tar.gz: f1fed021ea24ef7f5543d299255035114e099fb5906eecd351dd2b83554b71f5
3
+ metadata.gz: 18d3ceb8b2115e259e3fb2ae66643dafea5009826a25be644ab4c98406b8ef30
4
+ data.tar.gz: 3c22aed38cc800658d422dd41edfd103728e0ebf749110bf510a46259d3c2312
5
5
  SHA512:
6
- metadata.gz: d333fcfb1f5703ba74f639d4f6c4598c1bcaa1dc51ffa0623b84eac15dac20afd938e5b6830a32484f758dcd6964f493c1232bd701d784bba471a05d370f1dfd
7
- data.tar.gz: cf732e0fad85caf4043b26bcfea7f71365e47074672c8acaf455fc8059351fd6882e6c188c0bccc4c750f10a6ba7ca235338a96c7bad179f555d5585ae138152
6
+ metadata.gz: 98a67cbdcee3d72d1aaaf5f54581875c122e58fb3dbd248bbc5c9ab0e7c55f7352dd732b12293a594412f2484535084410984b975400d991dd5b96ce02084a22
7
+ data.tar.gz: a5551b86fc70c7dd6c1b80b8bb7e643524a42dc25220ca962628407a351a6886b95d7115fd77f901ed876033f131d8a112fcbb5a42dfbfa788224867b5d6bc26
@@ -23,7 +23,11 @@ module Unleash
23
23
  end
24
24
 
25
25
  def add(strategy)
26
- @strategies[strategy.name] = strategy
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.add(strategy)
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.add(c.new) }
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 = [
@@ -1,3 +1,3 @@
1
1
  module Unleash
2
- VERSION = "5.0.4".freeze
2
+ VERSION = "5.0.5".freeze
3
3
  end
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
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-15 00:00:00.000000000 Z
11
+ date: 2024-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: murmurhash3