flipper-redis 0.21.0 → 0.23.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: cb99d58e35c7f9ef6e7009d590b10567f892e12219d7e9932efd1fbf8738ca93
4
- data.tar.gz: 29e58a9005b46a3c5369b627c4e202900c6f26fa3a21a037ce4bad5402027281
3
+ metadata.gz: f706a006cded4a69aae9111b474980bb860266a46783837a034cea02e5c1eadd
4
+ data.tar.gz: 7bba88347b296d211bda3d56579eaf50d2df927cfe3b9e420fafbabeb4a48fe7
5
5
  SHA512:
6
- metadata.gz: 993919ce04acf986020d41383393f15312366f903eefc8db7331dfbe3b3223d6c15fab41b3755ac7e480bee71bf4dc257ab1425984d5203098a03b621e18c22e
7
- data.tar.gz: eca5fc0aa2ffccd136dd5972c4e6bae7d43a28e27d5696a419e0fb3e94b6b5ac0227a1491b85f7c30e9600144033b5c4272da80c1d50330a6d35a26fce39643f
6
+ metadata.gz: 78af61d87f2e96da7871633d71cc678b6130e4a8d32c8681077cb2a972e38ee11380989a2814aa3bcda569a2da493128388b460d6dff1a294780e629570b905b
7
+ data.tar.gz: 0aeed67601a79e5936d8501478a6bb797b59000c4694c6875b9325ff9ef50518674cfad633efebb572295bcbad465529b5309b53c52a979d8e9013ec35757b3f
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = '0.21.0'.freeze
2
+ VERSION = '0.23.0'.freeze
3
3
  end
@@ -1,7 +1,5 @@
1
- require 'helper'
2
1
  require 'flipper/adapters/operation_logger'
3
2
  require 'flipper/adapters/redis_cache'
4
- require 'flipper/spec/shared_adapter_specs'
5
3
 
6
4
  RSpec.describe Flipper::Adapters::RedisCache do
7
5
  let(:client) do
@@ -1,6 +1,4 @@
1
- require 'helper'
2
1
  require 'flipper/adapters/redis'
3
- require 'flipper/spec/shared_adapter_specs'
4
2
 
5
3
  RSpec.describe Flipper::Adapters::Redis do
6
4
  let(:client) do
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.21.0
4
+ version: 0.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-09 00:00:00.000000000 Z
11
+ date: 2021-12-24 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.21.0
19
+ version: 0.23.0
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.21.0
26
+ version: 0.23.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: redis
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -51,7 +51,6 @@ executables: []
51
51
  extensions: []
52
52
  extra_rdoc_files: []
53
53
  files:
54
- - docs/redis/README.md
55
54
  - examples/redis/basic.rb
56
55
  - examples/redis/internals.rb
57
56
  - examples/redis/namespaced.rb
@@ -84,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
83
  - !ruby/object:Gem::Version
85
84
  version: '0'
86
85
  requirements: []
87
- rubygems_version: 3.0.3
86
+ rubygems_version: 3.1.2
88
87
  signing_key:
89
88
  specification_version: 4
90
89
  summary: Redis adapter for Flipper
data/docs/redis/README.md DELETED
@@ -1,109 +0,0 @@
1
- # Flipper Redis
2
-
3
- A [Redis](https://github.com/redis/redis-rb) adapter for [Flipper](https://github.com/jnunemaker/flipper).
4
-
5
- ## Installation
6
-
7
- Add this line to your application's Gemfile:
8
-
9
- gem 'flipper-redis'
10
-
11
- And then execute:
12
-
13
- $ bundle
14
-
15
- Or install it yourself with:
16
-
17
- $ gem install flipper-redis
18
-
19
- ## Usage
20
-
21
- In most cases, all you need to do is require the adapter. It will connect to the Redis instance specified in the `REDIS_URL` or `FLIPPER_REDIS_URL` environment vairable, or localhost by default.
22
-
23
- ```ruby
24
- require 'flipper/adapters/redis'
25
- ```
26
-
27
- **If you need to customize the adapter**, you can add this to an initializer:
28
-
29
- ```ruby
30
- Flipper.configure do |config|
31
- config.adapter { Flipper::Adapters::Redis.new(Redis.new) }
32
- end
33
- ```
34
-
35
- ## Internals
36
-
37
- Each feature is stored in a redis hash, which means getting a feature is single query.
38
-
39
- ```ruby
40
- require 'flipper/adapters/redis'
41
-
42
- client = Redis.new
43
- adapter = Flipper::Adapters::Redis.new(client)
44
- flipper = Flipper.new(adapter)
45
-
46
- # Register a few groups.
47
- Flipper.register(:admins) { |thing| thing.admin? }
48
- Flipper.register(:early_access) { |thing| thing.early_access? }
49
-
50
- # Create a user class that has flipper_id instance method.
51
- User = Struct.new(:flipper_id)
52
-
53
- flipper[:stats].enable
54
- flipper[:stats].enable_group :admins
55
- flipper[:stats].enable_group :early_access
56
- flipper[:stats].enable_actor User.new('25')
57
- flipper[:stats].enable_actor User.new('90')
58
- flipper[:stats].enable_actor User.new('180')
59
- flipper[:stats].enable_percentage_of_time 15
60
- flipper[:stats].enable_percentage_of_actors 45
61
-
62
- flipper[:search].enable
63
-
64
- print 'all keys: '
65
- pp client.keys
66
- # all keys: ["stats", "flipper_features", "search"]
67
- puts
68
-
69
- print "known flipper features: "
70
- pp client.smembers("flipper_features")
71
- # known flipper features: ["stats", "search"]
72
- puts
73
-
74
- puts 'stats keys'
75
- pp client.hgetall('stats')
76
- # stats keys
77
- # {"boolean"=>"true",
78
- # "groups/admins"=>"1",
79
- # "actors/25"=>"1",
80
- # "percentage_of_time"=>"15",
81
- # "percentage_of_actors"=>"45",
82
- # "groups/early_access"=>"1",
83
- # "actors/90"=>"1",
84
- # "actors/180"=>"1"}
85
- puts
86
-
87
- puts 'search keys'
88
- pp client.hgetall('search')
89
- # search keys
90
- # {"boolean"=>"true"}
91
- puts
92
-
93
- puts 'flipper get of feature'
94
- pp adapter.get(flipper[:stats])
95
- # flipper get of feature
96
- # {:boolean=>"true",
97
- # :groups=>#<Set: {"admins", "early_access"}>,
98
- # :actors=>#<Set: {"25", "90", "180"}>,
99
- # :percentage_of_actors=>"45",
100
- # :percentage_of_time=>"15"}
101
- ```
102
-
103
- ## Contributing
104
-
105
- 1. Fork it
106
- 2. Create your feature branch (`git checkout -b my-new-feature`)
107
- 3. Commit your changes (`git commit -am 'Added some feature'`)
108
- 4. Push to the branch (`git push origin my-new-feature`)
109
- 5. Create new Pull Request