feature_gate 0.1.7 → 0.1.8
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 +4 -4
- data/README.md +7 -3
- data/lib/feature_gate/version.rb +1 -1
- data/lib/feature_gate_cleaner.rb +8 -5
- 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: 8478e536aefbb9bf8bcd287290ca018a698c22ef
|
4
|
+
data.tar.gz: d42b8f51a07bc67d7ea4f2542f6f5a3f71662152
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1df3c5ae90baa07e5d5195c48b67c2dcc2cab8c4e5a2b21ebd506fa441abea62258e80828ee01eb506337c9cd5f855c18bed0d59c94731293e8c80b1b15123bf
|
7
|
+
data.tar.gz: 20ba8947392efdc2021391800c97d2e45b62db8b8f47db0b896deb183f7e1e406b326d93bcb2b788c7ff92d73df10feabeac6689ba1df52e9eef63569a95c28c
|
data/README.md
CHANGED
@@ -49,8 +49,6 @@ In controller actions:
|
|
49
49
|
|
50
50
|
### Managing gates
|
51
51
|
|
52
|
-
#### Option 1: UI interface
|
53
|
-
|
54
52
|
<img src="http://i.imgur.com/p4lMIfo.png">
|
55
53
|
|
56
54
|
Go to `/feature_gate` for a preconfigured page that lists all your gates and give you the ability to toggle them open or close.
|
@@ -61,7 +59,13 @@ To limit accessibility to this page, define `feature_gate_control_allowed?` in `
|
|
61
59
|
# condition for allowing user to toggle feature gates, ex: current_admin_user.present?
|
62
60
|
end
|
63
61
|
|
64
|
-
|
62
|
+
To remove gates from your codebase after the feature has officially launched use the cleaner executable
|
63
|
+
|
64
|
+
$ feature_gate_cleaner gate_name
|
65
|
+
|
66
|
+
#### Console commands
|
67
|
+
|
68
|
+
If you prefer to use the console, you can also manage your gates with the following method calls:
|
65
69
|
|
66
70
|
To deploy your feature:
|
67
71
|
|
data/lib/feature_gate/version.rb
CHANGED
data/lib/feature_gate_cleaner.rb
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
module FeatureGateCleaner
|
2
2
|
def self.clean(gate_name)
|
3
|
-
matching_string = "FeatureGate::Manager.gate(\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`
|
3
|
+
matching_string = "(FeatureGate::Manager.gate(\s|\\()[\\\"\\']#{gate_name}[\\\"\\'])|(<%\s*end\s*#\s*#{gate_name}\s*%>)"
|
5
4
|
|
6
|
-
matching_string = "
|
7
|
-
|
8
|
-
|
5
|
+
`grep -r -l -E "#{matching_string}" #{Dir.pwd}/app/views/ | while IFS= read -r file; do grep -v -E "#{matching_string}" "$file" > "$file".cleaned; mv "$file"{.cleaned,}; done`
|
6
|
+
|
7
|
+
matching_string = "FeatureGate::Manager.gate_page(\s|\\()[\\\"\\']#{gate_name}[\\\"\\']"
|
8
|
+
|
9
|
+
`grep -r -l -E "#{matching_string}" #{Dir.pwd}/app/controllers/ | while IFS= read -r file; do grep -v -E "#{matching_string}" "$file" > "$file".cleaned; mv "$file"{.cleaned,}; done`
|
10
|
+
|
11
|
+
puts "#{gate_name} cleaned!"
|
9
12
|
end
|
10
13
|
end
|