flipper 0.7.0.beta6 → 0.7.0

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: fbc4122278d701b4a97828cb9fbfe1f66328ff48
4
- data.tar.gz: 87a4ad6f4b5da8b4a3c9d61fae53231a156f10c3
3
+ metadata.gz: 03893918187a23f82ff77ec7c88587be111ffb7f
4
+ data.tar.gz: 6c4ebaabd49273abaeeb9803266cc2d81aff58d5
5
5
  SHA512:
6
- metadata.gz: 0f870e8966135ca803eb0aabe97dce999cd710db15720d67374a8b81e1fc13f608e7ba0ec082b079075b6b8c2a6509bc37db5b8b5af1e27f758b5de4a31de7db
7
- data.tar.gz: b5f89715dcb5e10989f1e2fd2f63cc19d62854011d1f08aee29f1d3e7cc17d7280638c12d98576dcf099f5960cbc0f6e25d7f3868fac0a942f6259d6a8eb92a3
6
+ metadata.gz: d8d36b6752af084d8e3e087bedfe02d2074d8d1846b602a0a50b644deadf4bfd1f95b9299975c43b464e522a60137dc4513f9161597565496fd89e9984a36b02
7
+ data.tar.gz: 5149b9bba88fd4f5cc3de1893517f22d3cf02f3427df4d67efde604891233f2a37200696f77ac801421c1082d77ae99cd8ca8ed51f4547281e2946448b3453e3
@@ -1,4 +1,4 @@
1
- ## master (0.7)
1
+ ## 0.7
2
2
 
3
3
  * Added Flipper.groups and Flipper.group_names
4
4
  * Changed percentage_of_random to percentage_of_time
data/README.md CHANGED
@@ -72,6 +72,7 @@ Of course there are more [examples for you to peruse](examples/). You could also
72
72
  * [Instrumentation](docs/Instrumentation.md) - ActiveSupport::Notifications, Statsd and Metriks
73
73
  * [Optimization](docs/Optimization.md) - Memoization middleware
74
74
  * [Web Interface](docs/ui/README.md) - Point and click...
75
+ * [Caveats](docs/Caveats.md) - Flipper beware! (see what I did there)
75
76
 
76
77
  ## Contributing
77
78
 
@@ -0,0 +1,4 @@
1
+ # Caveats
2
+
3
+ 1. The [individual actor gate](https://github.com/jnunemaker/flipper/blob/master/docs/Gates.md#3-individual-actor) is typically not designed for hundreds or thousands of actors to be enabled. This is an explicit choice to make it easier to batch load data from the adapters instead of performing individual checks for actors over and over. If you need to enable something for more than 20 individual people, I would recommend using a [group](https://github.com/jnunemaker/flipper/blob/master/docs/Gates.md#2-group).
4
+ 2. The disable method exists only to clear something that is enabled. If the thing you are disabling is not enabled, the disable is pointless. This means that if you enable one group an actor is in and disable another group, the feature will be enabled for the actor. ([related issue](https://github.com/jnunemaker/flipper/issues/71))
@@ -0,0 +1,39 @@
1
+ require File.expand_path('../example_setup', __FILE__)
2
+
3
+ require 'flipper'
4
+ require 'flipper/adapters/memory'
5
+
6
+ adapter = Flipper::Adapters::Memory.new
7
+ flipper = Flipper.new(adapter)
8
+
9
+ # Some class that represents what will be trying to do something
10
+ class User
11
+ attr_reader :id
12
+
13
+ def initialize(id)
14
+ @id = id
15
+ end
16
+
17
+ # Must respond to flipper_id
18
+ alias_method :flipper_id, :id
19
+ end
20
+
21
+ # checking a bunch
22
+ gate = Flipper::Gates::PercentageOfActors.new
23
+ feature_name = "data_migration"
24
+ percentage_enabled = 10
25
+ total = 20_000
26
+ enabled = []
27
+
28
+ (1..total).each do |id|
29
+ user = User.new(id)
30
+ if gate.open?(user, percentage_enabled, feature_name: feature_name)
31
+ enabled << user
32
+ end
33
+ end
34
+
35
+ p actual: enabled.size, expected: total * (percentage_enabled * 0.01)
36
+
37
+ # checking one
38
+ user = User.new(1)
39
+ p user_1_enabled: Flipper::Gates::PercentageOfActors.new.open?(user, percentage_enabled, feature_name: feature_name)
@@ -1,3 +1,3 @@
1
1
  module Flipper
2
- VERSION = "0.7.0.beta6"
2
+ VERSION = "0.7.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flipper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0.beta6
4
+ version: 0.7.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: 2015-05-13 00:00:00.000000000 Z
11
+ date: 2015-06-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Feature flipper is the act of enabling/disabling features in your application,
14
14
  ideally without re-deploying or changing anything in your code base. Flipper makes
@@ -25,6 +25,7 @@ files:
25
25
  - README.md
26
26
  - Rakefile
27
27
  - docs/Adapters.md
28
+ - docs/Caveats.md
28
29
  - docs/Gates.md
29
30
  - docs/Instrumentation.md
30
31
  - docs/Optimization.md
@@ -35,6 +36,7 @@ files:
35
36
  - examples/individual_actor.rb
36
37
  - examples/instrumentation.rb
37
38
  - examples/percentage_of_actors.rb
39
+ - examples/percentage_of_actors_enabled_check.rb
38
40
  - examples/percentage_of_time.rb
39
41
  - flipper.gemspec
40
42
  - lib/flipper.rb
@@ -124,9 +126,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
124
126
  version: '0'
125
127
  required_rubygems_version: !ruby/object:Gem::Requirement
126
128
  requirements:
127
- - - ">"
129
+ - - ">="
128
130
  - !ruby/object:Gem::Version
129
- version: 1.3.1
131
+ version: '0'
130
132
  requirements: []
131
133
  rubyforge_project:
132
134
  rubygems_version: 2.2.3