flipper-rollout 0.22.1 → 0.24.0
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: e2f1e8f40f31bb37a0edb5d1a70e4df219f3ad8d25b54cadff62c8ff6ae8c39c
|
4
|
+
data.tar.gz: e8155e0a9860836b07394397989d4683f7805e187c2567ba9b4d3d727a869154
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 244bd5cead7c21cf9c041104fbe2189486fb57ad62aaa11fa0f85ea499d3c99ba8118b49528d3d53e3dedc597b77d5b8a272ec51b797d57d4d9471626b7bed0a
|
7
|
+
data.tar.gz: ab678ae2f5d3ba4716bc08d97492a03d03c3035e3c6ea4a238b706d4e29b72d69c25df4ccbeb755a8064f0722286d4b5c3406a96b9c720eee9f8b4065fbf413c
|
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.24.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:
|
11
|
+
date: 2022-02-17 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.24.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.
|
26
|
+
version: 0.24.0
|
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
|