rollout 2.2.3 → 2.2.4
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 +4 -4
- data/Gemfile.lock +1 -45
- data/README.md +7 -8
- data/lib/rollout.rb +10 -5
- data/lib/rollout/version.rb +1 -1
- data/rollout.gemspec +0 -1
- data/spec/rollout_spec.rb +12 -0
- data/spec/spec_helper.rb +14 -7
- metadata +3 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3784af8ad4c004b68a7a82919b817aa8bbc7d2be
|
4
|
+
data.tar.gz: 576389f114e7a59c035dd1a32e5de72d696a1bc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48f5979f7396375cbdd583bf90bb50137169ef0796f1298e25ef65577ab6b5cdeaaa657f7ec9fabf6b2a40deb036efe43a154f50a3147b2b554f16b16a5f45b6
|
7
|
+
data.tar.gz: a379d25c430a815a84e17e406f587560c6ec67c0832e8458523bdde5bb477383a6380779f25f42506a8f26c4872aed62eb210d9773807694c8406019f054cf5b
|
data/Gemfile.lock
CHANGED
@@ -1,60 +1,18 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rollout (2.2.
|
4
|
+
rollout (2.2.4)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
addressable (2.4.0)
|
10
|
-
builder (3.2.2)
|
11
9
|
codeclimate-test-reporter (0.4.8)
|
12
10
|
simplecov (>= 0.7.1, < 1.0.0)
|
13
|
-
descendants_tracker (0.0.4)
|
14
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
15
11
|
diff-lcs (1.2.5)
|
16
12
|
docile (1.1.5)
|
17
13
|
fakeredis (0.5.0)
|
18
14
|
redis (~> 3.0)
|
19
|
-
faraday (0.9.2)
|
20
|
-
multipart-post (>= 1.2, < 3)
|
21
|
-
git (1.2.9.1)
|
22
|
-
github_api (0.13.1)
|
23
|
-
addressable (~> 2.4.0)
|
24
|
-
descendants_tracker (~> 0.0.4)
|
25
|
-
faraday (~> 0.8, < 0.10)
|
26
|
-
hashie (>= 3.4)
|
27
|
-
multi_json (>= 1.7.5, < 2.0)
|
28
|
-
oauth2
|
29
|
-
hashie (3.4.3)
|
30
|
-
highline (1.7.8)
|
31
|
-
jeweler (2.0.1)
|
32
|
-
builder
|
33
|
-
bundler (>= 1.0)
|
34
|
-
git (>= 1.2.5)
|
35
|
-
github_api
|
36
|
-
highline (>= 1.6.15)
|
37
|
-
nokogiri (>= 1.5.10)
|
38
|
-
rake
|
39
|
-
rdoc
|
40
15
|
json (1.8.3)
|
41
|
-
jwt (1.5.1)
|
42
|
-
mini_portile2 (2.0.0)
|
43
|
-
multi_json (1.11.2)
|
44
|
-
multi_xml (0.5.5)
|
45
|
-
multipart-post (2.0.0)
|
46
|
-
nokogiri (1.6.7.2)
|
47
|
-
mini_portile2 (~> 2.0.0.rc2)
|
48
|
-
oauth2 (1.1.0)
|
49
|
-
faraday (>= 0.8, < 0.10)
|
50
|
-
jwt (~> 1.0, < 1.5.2)
|
51
|
-
multi_json (~> 1.3)
|
52
|
-
multi_xml (~> 0.5)
|
53
|
-
rack (>= 1.2, < 3)
|
54
|
-
rack (1.6.4)
|
55
|
-
rake (10.5.0)
|
56
|
-
rdoc (4.2.2)
|
57
|
-
json (~> 1.4)
|
58
16
|
redis (3.2.2)
|
59
17
|
rspec (3.4.0)
|
60
18
|
rspec-core (~> 3.4.0)
|
@@ -74,7 +32,6 @@ GEM
|
|
74
32
|
json (~> 1.8)
|
75
33
|
simplecov-html (~> 0.10.0)
|
76
34
|
simplecov-html (0.10.0)
|
77
|
-
thread_safe (0.3.5)
|
78
35
|
|
79
36
|
PLATFORMS
|
80
37
|
ruby
|
@@ -83,7 +40,6 @@ DEPENDENCIES
|
|
83
40
|
bundler (>= 1.0.0)
|
84
41
|
codeclimate-test-reporter
|
85
42
|
fakeredis
|
86
|
-
jeweler
|
87
43
|
redis
|
88
44
|
rollout!
|
89
45
|
rspec
|
data/README.md
CHANGED
@@ -2,11 +2,10 @@
|
|
2
2
|
|
3
3
|
Feature flippers.
|
4
4
|
|
5
|
-
[](https://codeclimate.com/github/
|
7
|
-
[](https://gemnasium.com/
|
9
|
-
[//]: # ([](https://codeclimate.com/github/FetLife/rollout/coverage))
|
5
|
+
[](https://travis-ci.org/fetlife/rollout)
|
6
|
+
[](https://codeclimate.com/github/fetlife/rollout)
|
7
|
+
[](https://codeclimate.com/github/fetlife/rollout/coverage)
|
8
|
+
[](https://gemnasium.com/fetlife/rollout)
|
10
9
|
|
11
10
|
## MAKE SURE TO READ THIS: 2.X Changes and Migration Path
|
12
11
|
|
@@ -153,7 +152,7 @@ $rollout.deactivate(:chat)
|
|
153
152
|
|
154
153
|
For many of our features, we keep track of error rates using redis, and
|
155
154
|
deactivate them automatically when a threshold is reached to prevent service
|
156
|
-
failures from cascading. See
|
155
|
+
failures from cascading. See https://github.com/jamesgolick/degrade for the
|
157
156
|
failure detection code.
|
158
157
|
|
159
158
|
## Namespacing
|
@@ -175,9 +174,9 @@ This example would use the "development:feature:chat:groups" key.
|
|
175
174
|
|
176
175
|
## Implementations in other languages
|
177
176
|
|
178
|
-
* Python:
|
177
|
+
* Python: https://github.com/asenchi/proclaim
|
179
178
|
* PHP: https://github.com/opensoft/rollout
|
180
|
-
* Clojure: https://github.com/
|
179
|
+
* Clojure: https://github.com/yeller/shoutout
|
181
180
|
|
182
181
|
|
183
182
|
## Contributors
|
data/lib/rollout.rb
CHANGED
@@ -59,6 +59,10 @@ class Rollout
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
+
def user_in_active_users?(user)
|
63
|
+
@users.include?(user_id(user))
|
64
|
+
end
|
65
|
+
|
62
66
|
def to_hash
|
63
67
|
{
|
64
68
|
percentage: @percentage,
|
@@ -92,10 +96,6 @@ class Rollout
|
|
92
96
|
end
|
93
97
|
end
|
94
98
|
|
95
|
-
def user_in_active_users?(user)
|
96
|
-
@users.include?(user_id(user))
|
97
|
-
end
|
98
|
-
|
99
99
|
def user_in_active_group?(user, rollout)
|
100
100
|
@groups.any? do |g|
|
101
101
|
rollout.active_in_group?(g, user)
|
@@ -183,8 +183,13 @@ class Rollout
|
|
183
183
|
feature.active?(self, user)
|
184
184
|
end
|
185
185
|
|
186
|
+
def user_in_active_users?(feature, user = nil)
|
187
|
+
feature = get(feature)
|
188
|
+
feature.user_in_active_users?(user)
|
189
|
+
end
|
190
|
+
|
186
191
|
def inactive?(feature, user = nil)
|
187
|
-
!active(feature, user)
|
192
|
+
!active?(feature, user)
|
188
193
|
end
|
189
194
|
|
190
195
|
def activate_percentage(feature, percentage)
|
data/lib/rollout/version.rb
CHANGED
data/rollout.gemspec
CHANGED
@@ -18,7 +18,6 @@ Gem::Specification.new do |s|
|
|
18
18
|
|
19
19
|
s.add_development_dependency "rspec"
|
20
20
|
s.add_development_dependency "bundler", ">= 1.0.0"
|
21
|
-
s.add_development_dependency "jeweler"
|
22
21
|
s.add_development_dependency "redis"
|
23
22
|
s.add_development_dependency "fakeredis"
|
24
23
|
s.add_development_dependency "codeclimate-test-reporter"
|
data/spec/rollout_spec.rb
CHANGED
@@ -493,6 +493,18 @@ RSpec.describe "Rollout" do
|
|
493
493
|
end
|
494
494
|
end
|
495
495
|
end
|
496
|
+
|
497
|
+
describe "#user_in_active_users?" do
|
498
|
+
it "returns true if activated for user" do
|
499
|
+
@rollout.activate_user(:chat, double(id: 5))
|
500
|
+
expect(@rollout.user_in_active_users?(:chat, "5")).to eq(true)
|
501
|
+
end
|
502
|
+
|
503
|
+
it "returns false if activated for group" do
|
504
|
+
@rollout.activate_group(:chat, :all)
|
505
|
+
expect(@rollout.user_in_active_users?(:chat, "5")).to eq(false)
|
506
|
+
end
|
507
|
+
end
|
496
508
|
end
|
497
509
|
|
498
510
|
describe "Rollout::Feature" do
|
data/spec/spec_helper.rb
CHANGED
@@ -1,17 +1,24 @@
|
|
1
1
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
2
2
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
3
|
-
|
3
|
+
|
4
|
+
require "codeclimate-test-reporter"
|
4
5
|
require "rspec"
|
5
6
|
require ENV["USE_REAL_REDIS"] == "true" ? "redis" : "fakeredis"
|
6
|
-
require "codeclimate-test-reporter"
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
if ENV["CODECLIMATE_REPO_TOKEN"]
|
9
|
+
CodeClimate::TestReporter.start
|
10
|
+
else
|
11
|
+
SimpleCov.start do
|
12
|
+
formatter SimpleCov::Formatter::MultiFormatter.new([
|
13
|
+
SimpleCov::Formatter::HTMLFormatter,
|
14
|
+
CodeClimate::TestReporter::Formatter,
|
15
|
+
])
|
16
|
+
end
|
13
17
|
end
|
14
18
|
|
19
|
+
|
20
|
+
require "rollout"
|
21
|
+
|
15
22
|
RSpec.configure do |config|
|
16
23
|
config.before { Redis.new.flushdb }
|
17
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rollout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Golick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 1.0.0
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: jeweler
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: redis
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,3 +126,4 @@ summary: Feature flippers with redis.
|
|
140
126
|
test_files:
|
141
127
|
- spec/rollout_spec.rb
|
142
128
|
- spec/spec_helper.rb
|
129
|
+
has_rdoc:
|