determinator 2.5.4 → 2.6.0

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: 7e5cd27cbcca013e18d0a941c9a196e9b8e7e908a97d67b857514f58d35def5d
4
- data.tar.gz: 18c86d3448b136bb996702d0bbcdba97f5280f496bd580daf145013b2dd054f8
3
+ metadata.gz: 9fe6fd684f160e1d955e9528bd225942068320361d554102b63667125503e610
4
+ data.tar.gz: f70731d2a63bffa170ee0d545fa9efbc2271fc32995c6635fc4feea33ac38c65
5
5
  SHA512:
6
- metadata.gz: f892fed72664d8dd47fb50d710678ff33ebe274f25fa8885ab048a13a7b3db5e496b7e39d67ce1fcea14c805bfaa390cc905241fb6e3e63405687d0ea2fe8355
7
- data.tar.gz: a9c104b252ba508445957ee1f249f39ace127f294104693153e96afae9f3903c7dcf497ead2d1b255b1ff429fde9340db37551d82ecee6888576bae01eea6395
6
+ metadata.gz: 0debe679036a419091917171e90ce4360ec0ea8afdc3d2b0d536b1796cd93b2ffe1fe3b6dc933cfe03642be61bde94c12b471a6aca2d7a04c087f24e6b6b8e94
7
+ data.tar.gz: 423c16ff61e48e2da9e8883329b70a031819be4741b2f9031fe0cd6c1681e0df43d52f98028b5002a6e6ad82f6774aa24fed5ddf227b56a8d75bb59e3a81ccde
@@ -1,3 +1,8 @@
1
+ # 2.6.0
2
+
3
+ Interface change:
4
+ - A `feature_cache` is now required to use Determinator. See the `examples/determinator-rails/config/initializers/determinator.rb` for a quick start.
5
+
1
6
  # 2.5.4
2
7
 
3
8
  Bug fix:
@@ -15,13 +15,13 @@ module Determinator
15
15
  class << self
16
16
  attr_reader :feature_cache, :retrieval
17
17
  # @param :retrieval [Determinator::Retrieve::Routemaster] A retrieval instance for Features
18
+ # @param :feature_cache [#call] a caching proc, accepting a feature name, which will return the named feature or yield (and store) if not available
18
19
  # @param :errors [#call, nil] a proc, accepting an error, which will be called with any errors which occur while determinating
19
20
  # @param :missing_feature [#call, nil] a proc, accepting a feature name, which will be called any time a feature is requested but isn't available
20
- # @param :feature_cache [#call, nil] a caching proc, accepting a feature name, which will return the named feature or yield (and store) if not available
21
- def configure(retrieval:, errors: nil, missing_feature: nil, feature_cache: nil)
21
+ def configure(retrieval:, feature_cache:, errors: nil, missing_feature: nil)
22
22
  self.on_error(&errors) if errors
23
23
  self.on_missing_feature(&missing_feature) if missing_feature
24
- @feature_cache = feature_cache if feature_cache.respond_to?(:call)
24
+ @feature_cache = feature_cache
25
25
  @retrieval = retrieval
26
26
  @instance = Control.new(retrieval: retrieval)
27
27
  end
@@ -1,3 +1,3 @@
1
1
  module Determinator
2
- VERSION = '2.5.4'
2
+ VERSION = '2.6.0'
3
3
  end
@@ -3,6 +3,9 @@ require_relative '../determinator/retrieve/in_memory_retriever'
3
3
 
4
4
  module RSpec
5
5
  module Determinator
6
+
7
+ DO_NOT_USE_IN_PRODUCTION_CODE_NULL_FEATURE_CACHE = -> (name, &block) { block.call(name) }
8
+
6
9
  def self.included(by)
7
10
  by.extend(DSL)
8
11
 
@@ -12,10 +15,10 @@ module RSpec
12
15
  old_retriever = ::Determinator.instance.retrieval
13
16
  begin
14
17
  fake_retriever.clear!
15
- ::Determinator.configure(retrieval: fake_retriever)
18
+ ::Determinator.configure(retrieval: fake_retriever, feature_cache: DO_NOT_USE_IN_PRODUCTION_CODE_NULL_FEATURE_CACHE)
16
19
  example.run
17
20
  ensure
18
- ::Determinator.configure(retrieval: old_retriever)
21
+ ::Determinator.configure(retrieval: old_retriever, feature_cache: DO_NOT_USE_IN_PRODUCTION_CODE_NULL_FEATURE_CACHE)
19
22
  end
20
23
  end
21
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: determinator
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.4
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JP Hastings-Spital
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-15 00:00:00.000000000 Z
11
+ date: 2021-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -150,7 +150,7 @@ dependencies:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
- description:
153
+ description:
154
154
  email:
155
155
  - jp@deliveroo.co.uk
156
156
  executables: []
@@ -234,7 +234,7 @@ homepage: https://github.com/deliveroo/determinator
234
234
  licenses:
235
235
  - MIT
236
236
  metadata: {}
237
- post_install_message:
237
+ post_install_message:
238
238
  rdoc_options: []
239
239
  require_paths:
240
240
  - lib
@@ -250,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
250
250
  version: '0'
251
251
  requirements: []
252
252
  rubygems_version: 3.0.3
253
- signing_key:
253
+ signing_key:
254
254
  specification_version: 4
255
255
  summary: Determine which experiments and features a specific actor should see.
256
256
  test_files: []