flipper-redis 0.25.1 → 0.25.3

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: 8b7131af89e261ecbff16099802e59f50fb2cdd71a761c3b0cb19dc18122fe85
4
- data.tar.gz: 9d002c2225bf2d3edcf8cdad97ad83fa31885748f771fc73d68b881a5a243fe1
3
+ metadata.gz: 489edca49fecba63f87c5256c7fb8dc5219390e281a8543c6450ffa5a4e19c5d
4
+ data.tar.gz: f4030ae9b41263b1761028554083b66210ca7ab405f4c0b170a303794cefe0fa
5
5
  SHA512:
6
- metadata.gz: b22f75f217bef79ce89384ee004e09a507e521149bd1274fd13a143ce201e8ae1ac18da566a6d8b39e9d4ce67700001db93326c0123c2db920679b20fad0e31d
7
- data.tar.gz: 4fedae8289ac0b72ec52dcb16759423a0d0277cd7e3d76f7ed89d02600a7cc0a70623f742ab0ec68aa71491f7597d072ef93cc70f232e861cff36c816f4b8cd5
6
+ metadata.gz: 3e2908360c21af3de8dde8747371464b5db6b151566a4309f2d0db1cc1cee96982e75fe80f218f3af3b60979bf554b9e8bcf65c8c8e817fba4601e8cd0fddae1
7
+ data.tar.gz: 6c0d4591ade0a82aa44edbb98f1427caad348d7bf28b492ea677a1d1acf445814a4cf0f698dc19d3c43e11f823ee6c42abc72f68ac9a4e186a981dec72fd8f37
@@ -21,5 +21,5 @@ Gem::Specification.new do |gem|
21
21
  gem.metadata = Flipper::METADATA
22
22
 
23
23
  gem.add_dependency 'flipper', "~> #{Flipper::VERSION}"
24
- gem.add_dependency 'redis', '>= 3.0', '< 5'
24
+ gem.add_dependency 'redis', '>= 3.0', '< 6'
25
25
  end
@@ -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
+ @client.class.respond_to?(:sadd_returns_boolean) && @client.class.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.25.1'.freeze
2
+ VERSION = '0.25.3'.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
 
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.25.1
4
+ version: 0.25.3
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-08-19 00:00:00.000000000 Z
11
+ date: 2022-11-03 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.25.1
19
+ version: 0.25.3
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.25.1
26
+ version: 0.25.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: redis
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '3.0'
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: '5'
36
+ version: '6'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '3.0'
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
- version: '5'
46
+ version: '6'
47
47
  description:
48
48
  email:
49
49
  - nunemaker@gmail.com