feature_gate 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/feature_gate/version.rb +1 -1
- data/lib/feature_gate_cleaner.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 100576f603464740849f7f3174e0247342afef42
|
4
|
+
data.tar.gz: 4f33dc6142d5817a57b14b92711bcb20bf62bb4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5b2963daa76ed540a056774836349c7e5284e3da12ac47ca8bad22e5fdc2fd35c390f53982d06fd18647323ed3e6aed85b71baa1b80b99ad97dcdd35e89db95
|
7
|
+
data.tar.gz: 373d3be92f6dfde7281e124f87a266688db00f646c72b1d56a823a8a6372d27aece3475bbbf89153c9a792b80065252e8ec74bd73e37ca0f9a88a3a9dc40a6cd
|
data/README.md
CHANGED
@@ -34,12 +34,12 @@ Add `config/initializers/feature_gate.rb`
|
|
34
34
|
|
35
35
|
All gates are closed by default, meaning the features you gate will be hidden until you toggle the gates open.
|
36
36
|
|
37
|
-
In view files:
|
37
|
+
In view files (comment in `end` is optional and is just to make it removable via the cleaner):
|
38
38
|
|
39
39
|
<% FeatureGate::Manager.gate('gate-name') do %>
|
40
40
|
<h1>This is my gated content</h1>
|
41
41
|
<p>I am not seen if the gate is on</p>
|
42
|
-
<% end %>
|
42
|
+
<% end # gate-name %>
|
43
43
|
|
44
44
|
In controller actions:
|
45
45
|
|
@@ -51,7 +51,7 @@ In controller actions:
|
|
51
51
|
|
52
52
|
#### Option 1: UI interface
|
53
53
|
|
54
|
-
<img src="http://i.imgur.com/
|
54
|
+
<img src="http://i.imgur.com/p4lMIfo.png">
|
55
55
|
|
56
56
|
Go to `/feature_gate` for a preconfigured page that lists all your gates and give you the ability to toggle them open or close.
|
57
57
|
|
data/lib/feature_gate/version.rb
CHANGED
data/lib/feature_gate_cleaner.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module FeatureGateCleaner
|
2
2
|
def self.clean(gate_name)
|
3
|
-
matching_string = "FeatureGate::Manager.gate(\s*'#{gate_name}'\s*)"
|
4
|
-
`
|
3
|
+
matching_string = "FeatureGate::Manager.gate(\s*'#{gate_name}'\s*)|<%\s*end\s*#\s*#{gate_name}\s*%>"
|
4
|
+
`egrep -r -l "#{matching_string}" #{Dir.pwd}/app/views/ | while IFS= read -r file; do grep -v "#{matching_string}" "$file" > "$file".cleaned; mv "$file"{.cleaned,}; done`
|
5
5
|
|
6
6
|
matching_string = "FeatureGate::Manager.gate_page(\s*'#{gate_name}'\s*)"
|
7
7
|
`grep -r -l "#{matching_string}" #{Dir.pwd}/app/controllers/ | while IFS= read -r file; do grep -v "#{matching_string}" "$file" > "$file".cleaned; mv "$file"{.cleaned,}; done`
|