rollout 2.0.0a → 2.0.0b
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile.lock +2 -2
- data/README.rdoc +4 -4
- data/lib/rollout.rb +2 -2
- data/lib/rollout/version.rb +1 -1
- data/spec/rollout_spec.rb +6 -2
- metadata +13 -13
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rollout (
|
4
|
+
rollout (2.0.0a)
|
5
5
|
redis
|
6
6
|
|
7
7
|
GEM
|
@@ -18,7 +18,7 @@ GEM
|
|
18
18
|
mocha (0.9.8)
|
19
19
|
rake
|
20
20
|
rake (0.9.2.2)
|
21
|
-
redis (
|
21
|
+
redis (3.0.2)
|
22
22
|
rspec (2.10.0)
|
23
23
|
rspec-core (~> 2.10.0)
|
24
24
|
rspec-expectations (~> 2.10.0)
|
data/README.rdoc
CHANGED
@@ -4,15 +4,15 @@ Feature flippers.
|
|
4
4
|
|
5
5
|
== MAKE SURE TO READ THIS: 2.0 Changes and Migration Path
|
6
6
|
|
7
|
-
|
7
|
+
As of rollout-2.x, only one key is used per feature for performance reasons. The data format is <tt>percentage|user_id,user_id,...|group,_group...</tt>. This has the effect of making concurrent feature modifications unsafe, but in practice, I doubt this will actually be a problem.
|
8
8
|
|
9
|
-
|
9
|
+
This also has the effect of rollout no longer being dependent on redis. Just give it something that responds to <tt>set(key,value)</tt> and <tt>get(key)</tt>.
|
10
10
|
|
11
|
-
|
11
|
+
If you have been using the 1.x format, you can initialize Rollout with <tt>:migrate => true</tt> and it'll do its best to automatically migrate your old features to the new format. There will be some performance impact, but it should be limited and short-lived since each feature only needs to get migrated once.
|
12
12
|
|
13
13
|
== Rollout::Legacy
|
14
14
|
|
15
|
-
|
15
|
+
If you'd prefer to continue to use the old layout in redis, <tt>Rollout::Legacy</tt> is a copy and paste of the old code :-).
|
16
16
|
|
17
17
|
== Install it
|
18
18
|
|
data/lib/rollout.rb
CHANGED
@@ -26,7 +26,7 @@ class Rollout
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def remove_user(user)
|
29
|
-
@users.delete(user.id)
|
29
|
+
@users.delete(user.id.to_i)
|
30
30
|
end
|
31
31
|
|
32
32
|
def add_group(group)
|
@@ -34,7 +34,7 @@ class Rollout
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def remove_group(group)
|
37
|
-
@groups.delete(group)
|
37
|
+
@groups.delete(group.to_sym)
|
38
38
|
end
|
39
39
|
|
40
40
|
def clear
|
data/lib/rollout/version.rb
CHANGED
data/spec/rollout_spec.rb
CHANGED
@@ -40,8 +40,10 @@ describe "Rollout" do
|
|
40
40
|
before do
|
41
41
|
@rollout.define_group(:fivesonly) { |user| user.id == 5 }
|
42
42
|
@rollout.activate_group(:chat, :all)
|
43
|
+
@rollout.activate_group(:chat, :some)
|
43
44
|
@rollout.activate_group(:chat, :fivesonly)
|
44
45
|
@rollout.deactivate_group(:chat, :all)
|
46
|
+
@rollout.deactivate_group(:chat, "some")
|
45
47
|
end
|
46
48
|
|
47
49
|
it "deactivates the rules for that group" do
|
@@ -49,7 +51,7 @@ describe "Rollout" do
|
|
49
51
|
end
|
50
52
|
|
51
53
|
it "leaves the other groups active" do
|
52
|
-
@rollout.
|
54
|
+
@rollout.get(:chat).groups.should == [:fivesonly]
|
53
55
|
end
|
54
56
|
end
|
55
57
|
|
@@ -98,8 +100,10 @@ describe "Rollout" do
|
|
98
100
|
describe "deactivating a specific user" do
|
99
101
|
before do
|
100
102
|
@rollout.activate_user(:chat, stub(:id => 42))
|
103
|
+
@rollout.activate_user(:chat, stub(:id => 4242))
|
101
104
|
@rollout.activate_user(:chat, stub(:id => 24))
|
102
105
|
@rollout.deactivate_user(:chat, stub(:id => 42))
|
106
|
+
@rollout.deactivate_user(:chat, stub(:id => "4242"))
|
103
107
|
end
|
104
108
|
|
105
109
|
it "that user should no longer be active" do
|
@@ -107,7 +111,7 @@ describe "Rollout" do
|
|
107
111
|
end
|
108
112
|
|
109
113
|
it "remains active for other active users" do
|
110
|
-
@rollout.
|
114
|
+
@rollout.get(:chat).users.should == [24]
|
111
115
|
end
|
112
116
|
end
|
113
117
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rollout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.0b
|
5
5
|
prerelease: 5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-11-10 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70157179413940 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.10.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70157179413940
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bundler
|
27
|
-
requirement: &
|
27
|
+
requirement: &70157179413360 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.0.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70157179413360
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: jeweler
|
38
|
-
requirement: &
|
38
|
+
requirement: &70157179412840 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.6.4
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70157179412840
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bourne
|
49
|
-
requirement: &
|
49
|
+
requirement: &70157179412320 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - =
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '1.0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70157179412320
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: mocha
|
60
|
-
requirement: &
|
60
|
+
requirement: &70157179411820 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - =
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 0.9.8
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70157179411820
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: redis
|
71
|
-
requirement: &
|
71
|
+
requirement: &70157179411400 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70157179411400
|
80
80
|
description: Feature flippers with redis.
|
81
81
|
email:
|
82
82
|
- jamesgolick@gmail.com
|