flipper-rollout 0.22.0 → 0.23.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flipper/version.rb +1 -1
- data/spec/flipper/adapters/rollout_spec.rb +0 -2
- metadata +5 -6
- data/docs/rollout/README.md +0 -77
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05edd5c4292da02d45bbf09e44b9114424500882e5df50aa464a23a531477594
|
4
|
+
data.tar.gz: 0ebb7385a1e890cacbb5e7db3dea9158cd635c7cd2d0bc0d77ede1867d807f8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a68a5eae202111d9ec6d66ca178365fa81af8ca28ed5a23983f0907e434d222908d521f36bc01760d20ca3066acc77747e1e60b2a9d8087610e2747e3c885a2
|
7
|
+
data.tar.gz: 261741cd2c74c6d9a2754a69b4949f4409abc4c311978d91f8d07bb621f694462c040119061d0fe8876646614930b0873e4e3ae424b7da3a923ab151c5428a64
|
data/lib/flipper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flipper-rollout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 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:
|
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.
|
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.
|
26
|
+
version: 0.23.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: redis
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -65,7 +65,6 @@ executables: []
|
|
65
65
|
extensions: []
|
66
66
|
extra_rdoc_files: []
|
67
67
|
files:
|
68
|
-
- docs/rollout/README.md
|
69
68
|
- examples/rollout/basic.rb
|
70
69
|
- examples/rollout/import.rb
|
71
70
|
- flipper-rollout.gemspec
|
@@ -92,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
91
|
- !ruby/object:Gem::Version
|
93
92
|
version: '0'
|
94
93
|
requirements: []
|
95
|
-
rubygems_version: 3.
|
94
|
+
rubygems_version: 3.1.2
|
96
95
|
signing_key:
|
97
96
|
specification_version: 4
|
98
97
|
summary: Rollout adapter for Flipper
|
data/docs/rollout/README.md
DELETED
@@ -1,77 +0,0 @@
|
|
1
|
-
# Flipper Rollout
|
2
|
-
|
3
|
-
A [Rollout](https://github.com/fetlife/rollout) adapter for [importing](https://github.com/jnunemaker/flipper/blob/master/docs/Adapters.md#user-content-swapping-adapters
|
4
|
-
) Rollout data into [Flipper](https://github.com/jnunemaker/flipper).
|
5
|
-
|
6
|
-
requires:
|
7
|
-
* Rollout ~> 2.0
|
8
|
-
* Flipper >= 11.0
|
9
|
-
|
10
|
-
## Installation
|
11
|
-
|
12
|
-
Add this line to your application's Gemfile:
|
13
|
-
|
14
|
-
gem 'flipper-rollout'
|
15
|
-
|
16
|
-
And then execute:
|
17
|
-
|
18
|
-
$ bundle
|
19
|
-
|
20
|
-
Or install it yourself with:
|
21
|
-
|
22
|
-
$ gem install flipper-redis
|
23
|
-
|
24
|
-
## Usage
|
25
|
-
|
26
|
-
```ruby
|
27
|
-
require 'redis'
|
28
|
-
require 'rollout'
|
29
|
-
require 'flipper'
|
30
|
-
require 'flipper/adapters/redis'
|
31
|
-
require 'flipper/adapters/rollout'
|
32
|
-
|
33
|
-
# setup redis, rollout and rollout flipper
|
34
|
-
redis = Redis.new
|
35
|
-
rollout = Rollout.new(redis)
|
36
|
-
rollout_adapter = Flipper::Adapters::Rollout.new(rollout)
|
37
|
-
rollout_flipper = Flipper.new(rollout_adapter)
|
38
|
-
|
39
|
-
# setup flipper default instance
|
40
|
-
Flipper.configure do |config|
|
41
|
-
config.adapter { Flipper::Adapters::Redis.new(redis) }
|
42
|
-
end
|
43
|
-
|
44
|
-
# import rollout into redis flipper
|
45
|
-
Flipper.import(rollout_flipper)
|
46
|
-
```
|
47
|
-
|
48
|
-
That was easy.
|
49
|
-
|
50
|
-
### Groups
|
51
|
-
If you're using [Rollout groups](https://github.com/fetlife/rollout#user-content-groups) you'll need to register them as [Flipper groups](https://github.com/jnunemaker/flipper/blob/master/docs/Gates.md#user-content-2-group):
|
52
|
-
|
53
|
-
*Rollout*
|
54
|
-
```ruby
|
55
|
-
$rollout.define_group(:caretakers) do |user|
|
56
|
-
user.caretaker?
|
57
|
-
end
|
58
|
-
```
|
59
|
-
|
60
|
-
*Flipper*
|
61
|
-
```ruby
|
62
|
-
Flipper.register(:caretakers) do |user|
|
63
|
-
user.caretaker?
|
64
|
-
end
|
65
|
-
```
|
66
|
-
|
67
|
-
### flipper_id
|
68
|
-
|
69
|
-
Rollout expects users to respond to *id* (or method specified in [Rollout#initialize](https://github.com/fetlife/rollout/blob/master/lib/rollout.rb#L135) opts) and stores this value in Redis when a feature is activated for a user. You'll want to make sure that your Flipper actor's [flipper_id](https://github.com/jnunemaker/flipper/blob/master/docs/Gates.md#user-content-3-individual-actor) matches this logic.
|
70
|
-
|
71
|
-
## Contributing
|
72
|
-
|
73
|
-
1. Fork it
|
74
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
75
|
-
3. Commit your changes (`git commit -am 'Added some feature'`)
|
76
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
77
|
-
5. Create new Pull Request
|