flipper-redis 0.24.1 → 0.25.2

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: d03229764fb9f1ca1443a0e32779bc8a0d23913b57debf63513e6b55251004fa
4
- data.tar.gz: 3ed534fc6218a2df061008e8057beaa08bd6645318ae33d2ca1cb491d1ebb683
3
+ metadata.gz: 13389e639f482e51952030304e02d945aab43ca406ec67daf3f591117160c726
4
+ data.tar.gz: 575f21419f14fab17ebe8d88ae919f2ba127ff580cb21892025abed8e6c0c19e
5
5
  SHA512:
6
- metadata.gz: d487eb67f3e4d9f3b4f5e590eb1a56c5cadd4ac24cfd95fe26f68315e595cfbb3103a9138035f511a282ad07cd7b356ed76fef669538ec6a15d5556996263b72
7
- data.tar.gz: be0cce07afcc3dbb907928698c6c88667c5a3d652f8791936c55842c37451d4e364375e444528c6d64567003455c466fe56633c94385e49b8de18f726d0e78d8
6
+ metadata.gz: 1e2e6fc9c924156f2092c40459543413ec061e9b78fcdd60490cef98bc8cab9096d7e72c6c2568ec66c59f7d06da4839658fc9c01d725eb17f58edbedabc5b55
7
+ data.tar.gz: 0365d12dbfb9dfcff20cd92c1458b97f7b8ba20422ca04fd28b50dcd77f513471b0862251e870c28002eeed873e9906031505aae5e776b4f3fc5a8f97bb990c8
@@ -28,13 +28,21 @@ module Flipper
28
28
 
29
29
  # Public: Adds a feature to the set of known features.
30
30
  def add(feature)
31
- @client.sadd FeaturesKey, feature.key
31
+ if redis_sadd_returns_boolean?
32
+ @client.sadd? FeaturesKey, feature.key
33
+ else
34
+ @client.sadd FeaturesKey, feature.key
35
+ end
32
36
  true
33
37
  end
34
38
 
35
39
  # Public: Removes a feature from the set of known features.
36
40
  def remove(feature)
37
- @client.srem FeaturesKey, feature.key
41
+ if redis_sadd_returns_boolean?
42
+ @client.srem? FeaturesKey, feature.key
43
+ else
44
+ @client.srem FeaturesKey, feature.key
45
+ end
38
46
  @client.del feature.key
39
47
  true
40
48
  end
@@ -109,6 +117,10 @@ module Flipper
109
117
 
110
118
  private
111
119
 
120
+ def redis_sadd_returns_boolean?
121
+ ::Redis.respond_to?(:sadd_returns_boolean) && ::Redis.sadd_returns_boolean
122
+ end
123
+
112
124
  def read_many_features(features)
113
125
  docs = docs_for(features)
114
126
  result = {}
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = '0.24.1'.freeze
2
+ VERSION = '0.25.2'.freeze
3
3
  end
@@ -6,6 +6,7 @@ RSpec.describe Flipper::Adapters::Redis do
6
6
 
7
7
  options[:url] = ENV['REDIS_URL'] if ENV['REDIS_URL']
8
8
 
9
+ Redis.raise_deprecations = true
9
10
  Redis.new(options)
10
11
  end
11
12
 
@@ -25,7 +26,7 @@ RSpec.describe Flipper::Adapters::Redis do
25
26
  Flipper.configuration = nil
26
27
  Flipper.instance = nil
27
28
 
28
- load 'flipper/adapters/redis.rb'
29
+ silence { load 'flipper/adapters/redis.rb' }
29
30
 
30
31
  expect(Flipper.adapter.adapter).to be_a(Flipper::Adapters::Redis)
31
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flipper-redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.1
4
+ version: 0.25.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-13 00:00:00.000000000 Z
11
+ date: 2022-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: flipper
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.24.1
19
+ version: 0.25.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.24.1
26
+ version: 0.25.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: redis
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,7 +44,7 @@ dependencies:
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '5'
47
- description:
47
+ description:
48
48
  email:
49
49
  - nunemaker@gmail.com
50
50
  executables: []
@@ -68,7 +68,7 @@ licenses:
68
68
  - MIT
69
69
  metadata:
70
70
  changelog_uri: https://github.com/jnunemaker/flipper/blob/master/Changelog.md
71
- post_install_message:
71
+ post_install_message:
72
72
  rdoc_options: []
73
73
  require_paths:
74
74
  - lib
@@ -83,8 +83,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  requirements: []
86
- rubygems_version: 3.1.2
87
- signing_key:
86
+ rubygems_version: 3.3.7
87
+ signing_key:
88
88
  specification_version: 4
89
89
  summary: Redis adapter for Flipper
90
90
  test_files: