flipper-redis 0.22.0 → 0.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0497d67982091158f32724531d3e5b228b2a9386b97f550c14eb2488549b863d'
4
- data.tar.gz: 85a5c6e38629bdfa79a1b6bc5de59da15316b9c3b062c10df3ed4d4c8e105e7a
3
+ metadata.gz: 469aee19d09ded043a929075fecf9c67b7e1ea61097da6509c4fd6470489f60b
4
+ data.tar.gz: be637c1663eedca518817c0e08c3ee437edf668f316ebd3b4de38edfb6090f75
5
5
  SHA512:
6
- metadata.gz: 7f4cb304570ef95e563947a1b50be764a605c211d3b2f7afec71a066cf646f47e6ca4e86b9492588e9923ccdec5634b2d73b88029df227cb0a09497898ca1501
7
- data.tar.gz: a13012afc6064abd528872e0524348f95d998b92cb31e7e34c1d0614dbc584ed8dba7e4af16a2daa785b4a32fd09267f7c4638a624080f77c2e9d2cc14cb340a
6
+ metadata.gz: d508d33094dcdd514dade5bde05e3cd1903d5d485b9fdc548863b50fbea53c0c92d32fefc202d0a73b3f50ce8d8c86b637a811e90aff5295382e008adb3945ac
7
+ data.tar.gz: ea9c330b820bf500990e0602d2077a34fde1a25fba31b9ab7b10f9378387aad6f8ab6882a0871711b7dd6db2cf051ff96d490125be6cd6592d8270849ecfada1
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = '0.22.0'.freeze
2
+ VERSION = '0.23.1'.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.22.0
4
+ version: 0.23.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: 2021-07-08 00:00:00.000000000 Z
11
+ date: 2022-01-19 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.22.0
19
+ version: 0.23.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.22.0
26
+ version: 0.23.1
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