flipper-redis 0.16.2 → 0.19.1

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
- SHA1:
3
- metadata.gz: a2b3af59dc0147d8df4b09edf48fd242e8c60d2c
4
- data.tar.gz: 79ac495a2bf9c4dfd429c6f668a4830578870dc7
2
+ SHA256:
3
+ metadata.gz: 24b3fe9225f6427ff95f4dbd3126ebd38a318bf53c22584749048e31311c8bd0
4
+ data.tar.gz: '03869e872e06a60b2d2af8392ee90770195e2b0650c91729f11d0d924a3db55e'
5
5
  SHA512:
6
- metadata.gz: 16c31602b5dc3e967cc4d2d2566d3806ca03ffb07e6fabba3a64539fc64819036f6f65c6dedf0ee18525f32f0b6a083846aedbbca3d3f3df5b6a7bb4ea912ab5
7
- data.tar.gz: ea2b9b7c5c6ebb356d2d82fe013997c1d53cfef84c005fd2571d22f4da1bb28a27a301b06acc328b38ab5ff58b064f7590c65c7af8b7080a71379555b1c5a5bc
6
+ metadata.gz: adcb3b9367fded83a7fbf6802794c6cebc59aad8c40529b0b651b3f17da1798953ed86b11bed7e67bbc7a4e1e3dea5e949aeb1bcb02fc86a388e61fd6ccb4a80
7
+ data.tar.gz: e6c85f1ff29235daa57abb2a4866c6eb4c9dc27c452a83b75903ea3dfdf6def18242a3f8cbda38b118d8a8c2a9c962021bba2a7ca87f167a4e0a340be36c3143
@@ -10,7 +10,6 @@ Gem::Specification.new do |gem|
10
10
  gem.authors = ['John Nunemaker']
11
11
  gem.email = ['nunemaker@gmail.com']
12
12
  gem.summary = 'Redis adapter for Flipper'
13
- gem.description = 'Redis adapter for Flipper'
14
13
  gem.license = 'MIT'
15
14
  gem.homepage = 'https://github.com/jnunemaker/flipper'
16
15
 
@@ -34,10 +34,8 @@ module Flipper
34
34
 
35
35
  # Public: Removes a feature from the set of known features.
36
36
  def remove(feature)
37
- @client.multi do
38
- @client.srem FeaturesKey, feature.key
39
- @client.del feature.key
40
- end
37
+ @client.srem FeaturesKey, feature.key
38
+ @client.del feature.key
41
39
  true
42
40
  end
43
41
 
@@ -73,7 +71,10 @@ module Flipper
73
71
  # Returns true.
74
72
  def enable(feature, gate, thing)
75
73
  case gate.data_type
76
- when :boolean, :integer
74
+ when :boolean
75
+ clear(feature)
76
+ @client.hset feature.key, gate.key, thing.value.to_s
77
+ when :integer
77
78
  @client.hset feature.key, gate.key, thing.value.to_s
78
79
  when :set
79
80
  @client.hset feature.key, to_field(gate, thing), 1
@@ -145,6 +145,8 @@ module Flipper
145
145
  end
146
146
 
147
147
  def multi_cache_get(keys)
148
+ return [] if keys.empty?
149
+
148
150
  cache_keys = keys.map { |key| key_for(key) }
149
151
  @cache.mget(cache_keys).map do |value|
150
152
  value ? Marshal.load(value) : nil
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = '0.16.2'.freeze
2
+ VERSION = '0.19.1'.freeze
3
3
  end
@@ -1,7 +1,7 @@
1
1
  require 'test_helper'
2
2
  require 'flipper/adapters/redis_cache'
3
3
 
4
- class DalliTest < MiniTest::Test
4
+ class RedisCacheTest < MiniTest::Test
5
5
  prepend Flipper::Test::SharedAdapterTests
6
6
 
7
7
  def setup
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.16.2
4
+ version: 0.19.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: 2019-04-20 00:00:00.000000000 Z
11
+ date: 2020-12-04 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.16.2
19
+ version: 0.19.1
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.16.2
26
+ version: 0.19.1
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: Redis adapter for Flipper
47
+ description:
48
48
  email:
49
49
  - nunemaker@gmail.com
50
50
  executables: []
@@ -84,8 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
86
  requirements: []
87
- rubyforge_project:
88
- rubygems_version: 2.4.5.4
87
+ rubygems_version: 3.0.3
89
88
  signing_key:
90
89
  specification_version: 4
91
90
  summary: Redis adapter for Flipper