flipper 0.24.0 → 0.24.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +11 -1
- data/lib/flipper/actor.rb +4 -0
- data/lib/flipper/dsl.rb +4 -2
- data/lib/flipper/types/actor.rb +8 -2
- data/lib/flipper/version.rb +1 -1
- data/spec/flipper/actor_spec.rb +10 -0
- data/spec/flipper/dsl_spec.rb +13 -3
- 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: a73ea66b4ab3342f5cf63a162bf8b0482fdc644dc0fff38fcb2d3fa2b39015be
|
4
|
+
data.tar.gz: a680008dad6bc0affee30e0d150aab5cc869d46d37ac2ae3ce8b7b2f57de9e9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50d1ff58301b4040e2ac0ed6590c057952f3c926aa88371858cec083be2d5fcdb17920fa120f6c59f9a5625ad2260aa0cdf40c26dfa64239a4790f247287c720
|
7
|
+
data.tar.gz: 40d68ac75fde3051cece778aa09145891ca3cf289abb795c66695f3e3fac569c28e81864d3be386d7ab03d0fd9c1b9c303fca6f5865ef6a2cd4eb9edbdc12eee
|
data/Changelog.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
## 0.24.1
|
2
|
+
|
3
|
+
### Additions/Changes
|
4
|
+
|
5
|
+
* flipper-api: `exclude_gates` parameter to exclude gate data in GETs (https://github.com/jnunemaker/flipper/pull/572).
|
6
|
+
* Make it possible to disable internal memoization (https://github.com/jnunemaker/flipper/pull/612).
|
7
|
+
* Add Flipper::Actor#hash so actors can be hash keys (https://github.com/jnunemaker/flipper/pull/616).
|
8
|
+
* Pretty Up `rails routes` again and make rack-protection dependency less strict (https://github.com/jnunemaker/flipper/pull/619).
|
9
|
+
* Add kwargs for method_missing using ruby 3.0 (https://github.com/jnunemaker/flipper/pull/620).
|
10
|
+
|
1
11
|
## 0.24.0
|
2
12
|
|
3
13
|
### Additions/Changes
|
@@ -6,7 +16,7 @@
|
|
6
16
|
* Removed support for Ruby 2.5 (which was end of line 9 months ago)
|
7
17
|
* Add (alpha) client side instrumentation of events to cloud (https://github.com/jnunemaker/flipper/pull/602)
|
8
18
|
* Fix deprecated uses of Redis#pipelined (https://github.com/jnunemaker/flipper/pull/603). redis-rb >= 3 now required.
|
9
|
-
* Fix Flipper UI Rack application when `Rack::Session::Pool` is used to build it.
|
19
|
+
* Fix Flipper UI Rack application when `Rack::Session::Pool` is used to build it (https://github.com/jnunemaker/flipper/pull/606).
|
10
20
|
|
11
21
|
## 0.23.1
|
12
22
|
|
data/lib/flipper/actor.rb
CHANGED
data/lib/flipper/dsl.rb
CHANGED
@@ -17,10 +17,12 @@ module Flipper
|
|
17
17
|
# adapter - The adapter that this DSL instance should use.
|
18
18
|
# options - The Hash of options.
|
19
19
|
# :instrumenter - What should be used to instrument all the things.
|
20
|
+
# :memoize - Should adapter be wrapped by memoize adapter or not.
|
20
21
|
def initialize(adapter, options = {})
|
21
22
|
@instrumenter = options.fetch(:instrumenter, Instrumenters::Noop)
|
22
|
-
|
23
|
-
|
23
|
+
memoize = options.fetch(:memoize, true)
|
24
|
+
adapter = Adapters::Memoizable.new(adapter) if memoize
|
25
|
+
@adapter = adapter
|
24
26
|
@memoized_features = {}
|
25
27
|
end
|
26
28
|
|
data/lib/flipper/types/actor.rb
CHANGED
@@ -23,8 +23,14 @@ module Flipper
|
|
23
23
|
super || @thing.respond_to?(*args)
|
24
24
|
end
|
25
25
|
|
26
|
-
|
27
|
-
|
26
|
+
if RUBY_VERSION >= '3.0'
|
27
|
+
def method_missing(name, *args, **kwargs, &block)
|
28
|
+
@thing.send name, *args, **kwargs, &block
|
29
|
+
end
|
30
|
+
else
|
31
|
+
def method_missing(name, *args, &block)
|
32
|
+
@thing.send name, *args, &block
|
33
|
+
end
|
28
34
|
end
|
29
35
|
end
|
30
36
|
end
|
data/lib/flipper/version.rb
CHANGED
data/spec/flipper/actor_spec.rb
CHANGED
@@ -43,4 +43,14 @@ RSpec.describe Flipper::Actor do
|
|
43
43
|
expect(actor1.==(actor2)).to be(false)
|
44
44
|
end
|
45
45
|
end
|
46
|
+
|
47
|
+
describe '#hash' do
|
48
|
+
it 'returns a hash-value based on the flipper id' do
|
49
|
+
h = {
|
50
|
+
described_class.new("User;123") => true
|
51
|
+
}
|
52
|
+
expect(h).to have_key(described_class.new("User;123"))
|
53
|
+
expect(h).not_to have_key(described_class.new("User;456"))
|
54
|
+
end
|
55
|
+
end
|
46
56
|
end
|
data/spec/flipper/dsl_spec.rb
CHANGED
@@ -6,9 +6,19 @@ RSpec.describe Flipper::DSL do
|
|
6
6
|
let(:adapter) { Flipper::Adapters::Memory.new }
|
7
7
|
|
8
8
|
describe '#initialize' do
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
context 'when using default memoize strategy' do
|
10
|
+
it 'wraps the given adapter with Flipper::Adapters::Memoizable' do
|
11
|
+
dsl = described_class.new(adapter)
|
12
|
+
expect(dsl.adapter.class).to be(Flipper::Adapters::Memoizable)
|
13
|
+
expect(dsl.adapter.adapter).to be(adapter)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
context 'when disabling memoization' do
|
18
|
+
it 'uses the given adapter directly' do
|
19
|
+
dsl = described_class.new(adapter, memoize: false)
|
20
|
+
expect(dsl.adapter).to be(adapter)
|
21
|
+
end
|
12
22
|
end
|
13
23
|
|
14
24
|
it 'defaults instrumenter to noop' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flipper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.24.
|
4
|
+
version: 0.24.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|