feature_flagger 0.7.2 → 0.7.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a86dad466ea3472db2912775bba5d1b7412b86d
4
- data.tar.gz: fe6eefd07a2d78b1b52661ff06a15399c30881ca
3
+ metadata.gz: '08ad3deca247deb946f6fd7f95fe12747978303e'
4
+ data.tar.gz: 8512e9a0a733eaaa95c8faa61caf340786b10189
5
5
  SHA512:
6
- metadata.gz: 176eaee71d771fbe687ae92e099f39f1fc268eef4cc8ff8c382692d6af4a027243472046f49efdf40727811f3b1c569cc70482efd558be9ff86a15c7c9bf49dc
7
- data.tar.gz: 22593e2d0c21ed1b7712d6bb8c7dc38efafe9e3cad89b939674188271b96605eda29d2ac2625ac4dcfdb8a785664ed64db9a311aeab47f058f466391243d4c2f
6
+ metadata.gz: 11e2542ada2893c96bd7588a959f424f1904e29e8b7a4a1425557e995a8cefa95c4e47b839282e28bb8a4e7d6b4ef753e24dc538ebdfbba6c8a590b8904af509
7
+ data.tar.gz: fd70b4252d581ff110ca37ce59a5e5dcae514fa040e52e1580f4ef5c24ca51313b9ec7c041a8b1c9898c3c0ce4be884605fe1d420e17b6bde0d2594db2a29140
data/README.md CHANGED
@@ -24,20 +24,19 @@ Or install it yourself as:
24
24
  ## Configuration
25
25
 
26
26
  By default, feature_flagger uses the REDIS_URL env var to setup it's storage.
27
- You can configure this by using `configure` like such:
28
-
29
- 1. In a initializer file (e.g. `config/initializers/feature_flagger.rb`):
27
+ You can set up FeatureFlagger by creating a file called ```config/initializers/feature_flagger``` with the following lines:
30
28
  ```ruby
31
29
  require 'redis-namespace'
32
30
  require 'feature_flagger'
33
31
 
34
32
  FeatureFlagger.configure do |config|
35
- namespaced = ::Redis::Namespace.new("feature_flagger", redis: $redis)
33
+ redis = Redis.new(host: ENV['REDIS_URL'])
34
+ namespaced = Redis::Namespace.new('feature_flagger', redis: redis)
36
35
  config.storage = FeatureFlagger::Storage::Redis.new(namespaced)
37
36
  end
38
37
  ```
39
38
 
40
- 2. Create a `rollout.yml` in _config_ path and declare a rollout:
39
+ 1. Create a `rollout.yml` in _config_ path and declare a rollout:
41
40
  ```yml
42
41
  account: # model name
43
42
  email_marketing: # namespace (optional)
@@ -46,7 +45,7 @@ account: # model name
46
45
  @dispatch team uses this rollout to introduce a new email flow for certains users. Read more at [link]
47
46
  ```
48
47
 
49
- 3. Adds rollout funcionality to your model:
48
+ 2. Adds rollout funcionality to your model:
50
49
  ```ruby
51
50
  class Account < ActiveRecord::Base
52
51
  include FeatureFlagger::Model
@@ -79,6 +78,10 @@ FeatureFlagger::KeyNotFoundError: ["account", "email_marketing", "new_email_flo"
79
78
  Account.released_id?(42, :email_marketing, :new_email_flow)
80
79
  #=> true
81
80
 
81
+ # Release a feature for a specific account id
82
+ Account.release_id(42, :email_marketing, :new_email_flow)
83
+ #=> true
84
+
82
85
  # Get an array with all released Account ids
83
86
  Account.all_released_ids_for(:email_marketing, :new_email_flow)
84
87
 
@@ -23,9 +23,7 @@ module FeatureFlagger
23
23
  end
24
24
 
25
25
  def release(*feature_key)
26
- resource_name = self.class.rollout_resource_name
27
- feature = Feature.new(feature_key, resource_name)
28
- FeatureFlagger.control.release(feature.key, id)
26
+ self.class.release_id(id, *feature_key)
29
27
  end
30
28
 
31
29
  # <b>DEPRECATED:</b> Please use <tt>unrelease</tt> instead.
@@ -46,6 +44,11 @@ module FeatureFlagger
46
44
  FeatureFlagger.control.rollout?(feature.key, resource_id)
47
45
  end
48
46
 
47
+ def release_id(resource_id, *feature_key)
48
+ feature = Feature.new(feature_key, rollout_resource_name)
49
+ FeatureFlagger.control.release(feature.key, resource_id)
50
+ end
51
+
49
52
  def all_released_ids_for(*feature_key)
50
53
  feature_key.flatten!
51
54
  feature = Feature.new(feature_key, rollout_resource_name)
@@ -1,3 +1,3 @@
1
1
  module FeatureFlagger
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feature_flagger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Sousa
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-09-19 00:00:00.000000000 Z
12
+ date: 2019-01-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: redis
@@ -132,9 +132,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  version: '0'
133
133
  requirements: []
134
134
  rubyforge_project:
135
- rubygems_version: 2.4.8
135
+ rubygems_version: 2.5.2.3
136
136
  signing_key:
137
137
  specification_version: 4
138
138
  summary: Partial release your features.
139
139
  test_files: []
140
- has_rdoc: