rollout 2.4.3 → 2.5.0
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 +5 -5
- data/.circleci/config.yml +95 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +11 -0
- data/.travis.yml +5 -5
- data/Gemfile +3 -1
- data/README.md +18 -6
- data/Rakefile +5 -7
- data/lib/rollout.rb +64 -156
- data/lib/rollout/feature.rb +131 -0
- data/lib/rollout/logging.rb +198 -0
- data/lib/rollout/version.rb +3 -1
- data/rollout.gemspec +27 -23
- data/spec/rollout/logging_spec.rb +143 -0
- data/spec/rollout_spec.rb +15 -6
- data/spec/spec_helper.rb +21 -12
- metadata +42 -45
- data/.document +0 -5
- data/Appraisals +0 -7
- data/Gemfile.lock +0 -56
- data/gemfiles/redis_3.gemfile +0 -13
- data/gemfiles/redis_4.gemfile +0 -13
data/spec/rollout_spec.rb
CHANGED
|
@@ -2,8 +2,7 @@ require "spec_helper"
|
|
|
2
2
|
|
|
3
3
|
RSpec.describe "Rollout" do
|
|
4
4
|
before do
|
|
5
|
-
@
|
|
6
|
-
@rollout = Rollout.new(@redis)
|
|
5
|
+
@rollout = Rollout.new(Redis.current)
|
|
7
6
|
end
|
|
8
7
|
|
|
9
8
|
describe "when a group is activated" do
|
|
@@ -430,7 +429,8 @@ RSpec.describe "Rollout" do
|
|
|
430
429
|
expect(feature.to_hash).to eq(
|
|
431
430
|
groups: [:caretakers, :greeters],
|
|
432
431
|
percentage: 10,
|
|
433
|
-
users: %w(42)
|
|
432
|
+
users: %w(42),
|
|
433
|
+
data: {},
|
|
434
434
|
)
|
|
435
435
|
|
|
436
436
|
feature = @rollout.get(:signup)
|
|
@@ -450,7 +450,8 @@ RSpec.describe "Rollout" do
|
|
|
450
450
|
expect(feature.to_hash).to eq(
|
|
451
451
|
groups: [:caretakers, :greeters].to_set,
|
|
452
452
|
percentage: 10,
|
|
453
|
-
users: %w(42).to_set
|
|
453
|
+
users: %w(42).to_set,
|
|
454
|
+
data: {},
|
|
454
455
|
)
|
|
455
456
|
|
|
456
457
|
feature = @rollout.get(:signup)
|
|
@@ -474,7 +475,8 @@ RSpec.describe "Rollout" do
|
|
|
474
475
|
expect(@rollout.get(feature).to_hash).to eq(
|
|
475
476
|
percentage: 0,
|
|
476
477
|
users: [],
|
|
477
|
-
groups: []
|
|
478
|
+
groups: [],
|
|
479
|
+
data: {},
|
|
478
480
|
)
|
|
479
481
|
end
|
|
480
482
|
end
|
|
@@ -486,7 +488,8 @@ RSpec.describe "Rollout" do
|
|
|
486
488
|
expect(@rollout.get(feature).to_hash).to eq(
|
|
487
489
|
percentage: 0,
|
|
488
490
|
users: Set.new,
|
|
489
|
-
groups: Set.new
|
|
491
|
+
groups: Set.new,
|
|
492
|
+
data: {},
|
|
490
493
|
)
|
|
491
494
|
end
|
|
492
495
|
end
|
|
@@ -605,6 +608,12 @@ RSpec.describe "Rollout" do
|
|
|
605
608
|
expect(features[2].percentage).to eq 100
|
|
606
609
|
expect(features.size).to eq 3
|
|
607
610
|
end
|
|
611
|
+
|
|
612
|
+
describe 'when given feature keys is empty' do
|
|
613
|
+
it 'returns empty array' do
|
|
614
|
+
expect(@rollout.multi_get(*[])).to match_array([])
|
|
615
|
+
end
|
|
616
|
+
end
|
|
608
617
|
end
|
|
609
618
|
|
|
610
619
|
describe "#set_feature_data" do
|
data/spec/spec_helper.rb
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
1
|
+
# frozen_string_literal: true
|
|
3
2
|
|
|
4
|
-
require
|
|
5
|
-
require "rspec"
|
|
6
|
-
require ENV["USE_REAL_REDIS"] == "true" ? "redis" : "fakeredis"
|
|
3
|
+
require 'simplecov'
|
|
7
4
|
|
|
8
|
-
SimpleCov.start
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
SimpleCov.start
|
|
6
|
+
|
|
7
|
+
require 'bundler/setup'
|
|
8
|
+
require 'redis'
|
|
9
|
+
require 'rollout'
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
Redis.current = Redis.new(
|
|
12
|
+
host: ENV.fetch('REDIS_HOST', '127.0.0.1'),
|
|
13
|
+
port: ENV.fetch('REDIS_PORT', '6379'),
|
|
14
|
+
db: ENV.fetch('REDIS_DB', '7'),
|
|
15
|
+
)
|
|
15
16
|
|
|
16
17
|
RSpec.configure do |config|
|
|
17
|
-
config.
|
|
18
|
+
config.example_status_persistence_file_path = '.rspec_status'
|
|
19
|
+
|
|
20
|
+
# config.disable_monkey_patching!
|
|
21
|
+
|
|
22
|
+
config.expect_with :rspec do |c|
|
|
23
|
+
c.syntax = :expect
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
config.before { Redis.current.flushdb }
|
|
18
27
|
end
|
metadata
CHANGED
|
@@ -1,113 +1,113 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rollout
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Golick
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2020-07-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
14
|
+
name: redis
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '0'
|
|
20
|
-
type: :
|
|
19
|
+
version: '4.0'
|
|
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: '4.0'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
28
|
+
name: bundler
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
31
|
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
33
|
+
version: '1.17'
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
38
|
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
40
|
+
version: '1.17'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
42
|
+
name: pry
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
45
|
- - ">="
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version:
|
|
47
|
+
version: '0'
|
|
48
48
|
type: :development
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
52
|
- - ">="
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version:
|
|
54
|
+
version: '0'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
|
-
name:
|
|
56
|
+
name: rspec
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
58
58
|
requirements:
|
|
59
|
-
- - "
|
|
59
|
+
- - "~>"
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '0'
|
|
61
|
+
version: '3.0'
|
|
62
62
|
type: :development
|
|
63
63
|
prerelease: false
|
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements:
|
|
66
|
-
- - "
|
|
66
|
+
- - "~>"
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '0'
|
|
68
|
+
version: '3.0'
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
|
-
name:
|
|
70
|
+
name: rspec_junit_formatter
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
|
73
|
-
- - "
|
|
73
|
+
- - "~>"
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: '0'
|
|
75
|
+
version: '0.4'
|
|
76
76
|
type: :development
|
|
77
77
|
prerelease: false
|
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
|
80
|
-
- - "
|
|
80
|
+
- - "~>"
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: '0'
|
|
82
|
+
version: '0.4'
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
|
-
name:
|
|
84
|
+
name: rubocop
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
|
86
86
|
requirements:
|
|
87
|
-
- - "
|
|
87
|
+
- - "~>"
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
|
-
version: '0'
|
|
89
|
+
version: '0.71'
|
|
90
90
|
type: :development
|
|
91
91
|
prerelease: false
|
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
|
94
|
-
- - "
|
|
94
|
+
- - "~>"
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: '0'
|
|
96
|
+
version: '0.71'
|
|
97
97
|
- !ruby/object:Gem::Dependency
|
|
98
|
-
name:
|
|
98
|
+
name: simplecov
|
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
|
100
100
|
requirements:
|
|
101
|
-
- -
|
|
101
|
+
- - '='
|
|
102
102
|
- !ruby/object:Gem::Version
|
|
103
|
-
version: '0'
|
|
103
|
+
version: '0.17'
|
|
104
104
|
type: :development
|
|
105
105
|
prerelease: false
|
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
107
|
requirements:
|
|
108
|
-
- -
|
|
108
|
+
- - '='
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
|
-
version: '0'
|
|
110
|
+
version: '0.17'
|
|
111
111
|
description: Feature flippers with redis.
|
|
112
112
|
email:
|
|
113
113
|
- jamesgolick@gmail.com
|
|
@@ -115,21 +115,21 @@ executables: []
|
|
|
115
115
|
extensions: []
|
|
116
116
|
extra_rdoc_files: []
|
|
117
117
|
files:
|
|
118
|
-
- ".
|
|
118
|
+
- ".circleci/config.yml"
|
|
119
119
|
- ".gitignore"
|
|
120
120
|
- ".rspec"
|
|
121
|
+
- ".rubocop.yml"
|
|
121
122
|
- ".travis.yml"
|
|
122
|
-
- Appraisals
|
|
123
123
|
- Gemfile
|
|
124
|
-
- Gemfile.lock
|
|
125
124
|
- LICENSE
|
|
126
125
|
- README.md
|
|
127
126
|
- Rakefile
|
|
128
|
-
- gemfiles/redis_3.gemfile
|
|
129
|
-
- gemfiles/redis_4.gemfile
|
|
130
127
|
- lib/rollout.rb
|
|
128
|
+
- lib/rollout/feature.rb
|
|
129
|
+
- lib/rollout/logging.rb
|
|
131
130
|
- lib/rollout/version.rb
|
|
132
131
|
- rollout.gemspec
|
|
132
|
+
- spec/rollout/logging_spec.rb
|
|
133
133
|
- spec/rollout_spec.rb
|
|
134
134
|
- spec/spec_helper.rb
|
|
135
135
|
homepage: https://github.com/FetLife/rollout
|
|
@@ -144,18 +144,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
144
144
|
requirements:
|
|
145
145
|
- - ">="
|
|
146
146
|
- !ruby/object:Gem::Version
|
|
147
|
-
version: '
|
|
147
|
+
version: '2.3'
|
|
148
148
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
requirements:
|
|
150
150
|
- - ">="
|
|
151
151
|
- !ruby/object:Gem::Version
|
|
152
152
|
version: '0'
|
|
153
153
|
requirements: []
|
|
154
|
-
|
|
155
|
-
rubygems_version: 2.6.12
|
|
154
|
+
rubygems_version: 3.1.2
|
|
156
155
|
signing_key:
|
|
157
156
|
specification_version: 4
|
|
158
157
|
summary: Feature flippers with redis.
|
|
159
|
-
test_files:
|
|
160
|
-
- spec/rollout_spec.rb
|
|
161
|
-
- spec/spec_helper.rb
|
|
158
|
+
test_files: []
|
data/.document
DELETED
data/Appraisals
DELETED
data/Gemfile.lock
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
PATH
|
|
2
|
-
remote: .
|
|
3
|
-
specs:
|
|
4
|
-
rollout (2.4.3)
|
|
5
|
-
|
|
6
|
-
GEM
|
|
7
|
-
remote: https://rubygems.org/
|
|
8
|
-
specs:
|
|
9
|
-
appraisal (2.2.0)
|
|
10
|
-
bundler
|
|
11
|
-
rake
|
|
12
|
-
thor (>= 0.14.0)
|
|
13
|
-
codeclimate-test-reporter (1.0.8)
|
|
14
|
-
simplecov (<= 0.13)
|
|
15
|
-
diff-lcs (1.3)
|
|
16
|
-
docile (1.1.5)
|
|
17
|
-
fakeredis (0.6.0)
|
|
18
|
-
redis (~> 3.2)
|
|
19
|
-
json (2.1.0)
|
|
20
|
-
rake (12.0.0)
|
|
21
|
-
redis (3.3.3)
|
|
22
|
-
rspec (3.6.0)
|
|
23
|
-
rspec-core (~> 3.6.0)
|
|
24
|
-
rspec-expectations (~> 3.6.0)
|
|
25
|
-
rspec-mocks (~> 3.6.0)
|
|
26
|
-
rspec-core (3.6.0)
|
|
27
|
-
rspec-support (~> 3.6.0)
|
|
28
|
-
rspec-expectations (3.6.0)
|
|
29
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
30
|
-
rspec-support (~> 3.6.0)
|
|
31
|
-
rspec-mocks (3.6.0)
|
|
32
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
33
|
-
rspec-support (~> 3.6.0)
|
|
34
|
-
rspec-support (3.6.0)
|
|
35
|
-
simplecov (0.13.0)
|
|
36
|
-
docile (~> 1.1.0)
|
|
37
|
-
json (>= 1.8, < 3)
|
|
38
|
-
simplecov-html (~> 0.10.0)
|
|
39
|
-
simplecov-html (0.10.1)
|
|
40
|
-
thor (0.19.4)
|
|
41
|
-
|
|
42
|
-
PLATFORMS
|
|
43
|
-
ruby
|
|
44
|
-
|
|
45
|
-
DEPENDENCIES
|
|
46
|
-
appraisal
|
|
47
|
-
bundler (>= 1.0.0)
|
|
48
|
-
codeclimate-test-reporter
|
|
49
|
-
fakeredis
|
|
50
|
-
redis
|
|
51
|
-
rollout!
|
|
52
|
-
rspec
|
|
53
|
-
simplecov
|
|
54
|
-
|
|
55
|
-
BUNDLED WITH
|
|
56
|
-
1.15.1
|
data/gemfiles/redis_3.gemfile
DELETED