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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 100576f603464740849f7f3174e0247342afef42
4
- data.tar.gz: 4f33dc6142d5817a57b14b92711bcb20bf62bb4c
3
+ metadata.gz: 8478e536aefbb9bf8bcd287290ca018a698c22ef
4
+ data.tar.gz: d42b8f51a07bc67d7ea4f2542f6f5a3f71662152
5
5
  SHA512:
6
- metadata.gz: b5b2963daa76ed540a056774836349c7e5284e3da12ac47ca8bad22e5fdc2fd35c390f53982d06fd18647323ed3e6aed85b71baa1b80b99ad97dcdd35e89db95
7
- data.tar.gz: 373d3be92f6dfde7281e124f87a266688db00f646c72b1d56a823a8a6372d27aece3475bbbf89153c9a792b80065252e8ec74bd73e37ca0f9a88a3a9dc40a6cd
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
- #### Option 2: Console
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
 
@@ -1,3 +1,3 @@
1
1
  module FeatureGate
2
- VERSION = '0.1.7'.freeze
2
+ VERSION = '0.1.8'.freeze
3
3
  end
@@ -1,10 +1,13 @@
1
1
  module FeatureGateCleaner
2
2
  def self.clean(gate_name)
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`
3
+ matching_string = "(FeatureGate::Manager.gate(\s|\\()[\\\"\\']#{gate_name}[\\\"\\'])|(<%\s*end\s*#\s*#{gate_name}\s*%>)"
5
4
 
6
- matching_string = "FeatureGate::Manager.gate_page(\s*'#{gate_name}'\s*)"
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`
8
- puts 'Cleaned!'
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feature_gate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiffany Huang