rollout 2.2.2 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ba2a7c48e65a966b1b16abcb9efa4469eaadf61
4
- data.tar.gz: ac9a3df6b56547de407611ee9f6faecf5b60acca
3
+ metadata.gz: e144c36d4bea33448c00e67139f6a96b484a6880
4
+ data.tar.gz: b7de1dcc0f142ccefb919818837c832fb3d6534a
5
5
  SHA512:
6
- metadata.gz: 04d929b8f4cd7879140135c48f41a68080be70a6e17f6030657b68acae16f78459adf99a08772e491f64decbfbbcfe717699c2bf27c9cafc95be7acfad6d14d3
7
- data.tar.gz: 39a9083e5295d7797a6c4aac21a1736c6df7a121c047f106b160de9400d2272bbf205529cf7f7a479aa922d418d14f0fe362bba896d099f3aa8ad67f1003d6bf
6
+ metadata.gz: db1e11964fc48dd3fd2d1afe7eaa927ac7bea6929302f6c60257e0849e52a36fa585f1c7fc9b74e8e0f6ef4729df3d65b2535fafb9a5863cb0d9a57c71d60718
7
+ data.tar.gz: ed7d052d1851df8837a671607b4aa3e5a723a7da2ac3459cf28851243453affe934108bdd6c4f624a277322cd4fa983a0e17c9096b28a69c11cdd07050c35c2d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rollout (2.2.2)
4
+ rollout (2.2.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/lib/rollout.rb CHANGED
@@ -107,7 +107,6 @@ class Rollout
107
107
  @storage = storage
108
108
  @options = opts
109
109
  @groups = { all: lambda { |user| true } }
110
- @legacy = Legacy.new(opts[:legacy_storage] || @storage) if opts[:migrate]
111
110
  end
112
111
 
113
112
  def activate(feature)
@@ -207,18 +206,7 @@ class Rollout
207
206
 
208
207
  def get(feature)
209
208
  string = @storage.get(key(feature))
210
- if string || !migrate?
211
- Feature.new(feature, string, @options)
212
- else
213
- info = @legacy.info(feature)
214
- f = Feature.new(feature)
215
- f.percentage = info[:percentage]
216
- f.percentage = 100 if info[:global].include? feature
217
- f.groups = info[:groups].map { |g| g.to_sym }
218
- f.users = info[:users].map { |u| u.to_s }
219
- save(f)
220
- f
221
- end
209
+ Feature.new(feature, string, @options)
222
210
  end
223
211
 
224
212
  def features
@@ -247,26 +235,23 @@ class Rollout
247
235
  end
248
236
 
249
237
  private
250
- def key(name)
251
- "feature:#{name}"
252
- end
253
238
 
254
- def features_key
255
- "feature:__features__"
256
- end
239
+ def key(name)
240
+ "feature:#{name}"
241
+ end
257
242
 
258
- def with_feature(feature)
259
- f = get(feature)
260
- yield(f)
261
- save(f)
262
- end
243
+ def features_key
244
+ "feature:__features__"
245
+ end
263
246
 
264
- def save(feature)
265
- @storage.set(key(feature.name), feature.serialize)
266
- @storage.set(features_key, (features | [feature.name.to_sym]).join(","))
267
- end
247
+ def with_feature(feature)
248
+ f = get(feature)
249
+ yield(f)
250
+ save(f)
251
+ end
268
252
 
269
- def migrate?
270
- @legacy
271
- end
253
+ def save(feature)
254
+ @storage.set(key(feature.name), feature.serialize)
255
+ @storage.set(features_key, (features | [feature.name.to_sym]).join(","))
256
+ end
272
257
  end
@@ -1,3 +1,3 @@
1
1
  class Rollout
2
- VERSION = "2.2.2"
2
+ VERSION = "2.2.3"
3
3
  end
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.2.2
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Golick