togls 1.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +8 -0
- data/README.md +2 -0
- data/lib/tasks/togls.rake +1 -1
- data/lib/togls/feature_toggle_registry.rb +8 -3
- data/lib/togls/version.rb +1 -1
- data/lib/togls.rb +13 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f11f55bb24ae3654bcebd4c45ce99a10f325b5d
|
4
|
+
data.tar.gz: dcd73b550500f2c72bff92a9f7bf78ba6a8f2844
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31e475eedfd5e2e93e2abc494afdb2ad98cc287ea7a2cbda630ecb23eb67490f40523dd046a6b41888f885d6cdc1cf5187dacd6b4ba8a22d48b0a1b2322da450
|
7
|
+
data.tar.gz: 7c9401b65661dd1be31e08528b06c5dc31d26f35f7035590e89881835eedf3eb251e6df9329498e5f046a9e07af3eb30b1c1c2d8213805a6d9ed460d15e76ad0
|
data/ChangeLog.md
CHANGED
@@ -6,6 +6,14 @@ versions, as well as provide a rough history.
|
|
6
6
|
|
7
7
|
#### Next Release
|
8
8
|
|
9
|
+
### v2.0.0
|
10
|
+
|
11
|
+
* Add ability to create empty feature toggle set via `Togls.features`
|
12
|
+
* Add toggle definition expansion with multiple `Togls.features` blocks
|
13
|
+
* Add set FeatureToggleRegistry instance, `Togls.features = toggle_registry`
|
14
|
+
* Change `Togls.features` to return FeatureToggleRegistry instance
|
15
|
+
rather than an Array of Toggle objects.
|
16
|
+
|
9
17
|
#### v1.1.0
|
10
18
|
|
11
19
|
* Add `off?` method for asking if a defined feature is off
|
data/README.md
CHANGED
@@ -212,6 +212,8 @@ Reference](https://github.com/codebreakdown/togls/wiki/Provided-Rules-Reference)
|
|
212
212
|
Rules](https://github.com/codebreakdown/togls/wiki/Custom-Rules),
|
213
213
|
[Review Feature
|
214
214
|
Toggles](https://github.com/codebreakdown/togls/wiki/Review-Feature-Toggles),
|
215
|
+
[Testing with
|
216
|
+
Toggles](https://github.com/codebreakdown/togls/wiki/Testing-with-Toggles)
|
215
217
|
etc.
|
216
218
|
|
217
219
|
## Development
|
data/lib/tasks/togls.rake
CHANGED
@@ -18,12 +18,17 @@ module Togls
|
|
18
18
|
@rule_repository.store(@boolean_true_rule)
|
19
19
|
end
|
20
20
|
|
21
|
-
def self.create(&
|
21
|
+
def self.create(&block)
|
22
22
|
feature_toggle_registry = self.new
|
23
|
-
feature_toggle_registry.instance_eval(&
|
23
|
+
feature_toggle_registry.instance_eval(&block)
|
24
24
|
return feature_toggle_registry
|
25
25
|
end
|
26
26
|
|
27
|
+
def expand(&block)
|
28
|
+
self.instance_eval(&block)
|
29
|
+
return self
|
30
|
+
end
|
31
|
+
|
27
32
|
def feature(key, desc)
|
28
33
|
feature = Togls::Feature.new(key, desc)
|
29
34
|
toggle = Togls::Toggle.new(feature)
|
@@ -39,7 +44,7 @@ module Togls
|
|
39
44
|
return toggle
|
40
45
|
end
|
41
46
|
|
42
|
-
def
|
47
|
+
def all
|
43
48
|
@toggle_repository.all
|
44
49
|
end
|
45
50
|
end
|
data/lib/togls/version.rb
CHANGED
data/lib/togls.rb
CHANGED
@@ -21,16 +21,20 @@ require "togls/rules"
|
|
21
21
|
require "logger"
|
22
22
|
|
23
23
|
module Togls
|
24
|
-
def self.features(&
|
25
|
-
if
|
26
|
-
@feature_toggle_registry = FeatureToggleRegistry.
|
27
|
-
else
|
28
|
-
if @feature_toggle_registry.nil?
|
29
|
-
raise Togls::NoFeaturesError, "Need to define features before you can get them"
|
30
|
-
else
|
31
|
-
@feature_toggle_registry.registry
|
32
|
-
end
|
24
|
+
def self.features(&block)
|
25
|
+
if @feature_toggle_registry.nil?
|
26
|
+
@feature_toggle_registry = FeatureToggleRegistry.new
|
33
27
|
end
|
28
|
+
|
29
|
+
if block
|
30
|
+
@feature_toggle_registry.expand(&block)
|
31
|
+
end
|
32
|
+
|
33
|
+
return @feature_toggle_registry
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.features=(feature_toggle_registry)
|
37
|
+
@feature_toggle_registry = feature_toggle_registry
|
34
38
|
end
|
35
39
|
|
36
40
|
def self.feature(key)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: togls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Miller
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-11-
|
13
|
+
date: 2015-11-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|