togls 3.1.0 → 3.2.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 +7 -1
- data/lib/togls/feature_repository.rb +3 -3
- data/lib/togls/rule_repository.rb +3 -3
- data/lib/togls/toggle.rb +6 -2
- data/lib/togls/version.rb +1 -1
- 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: 5656ae6b55d75e746b8f76289a56bdad7f2abd0f
|
4
|
+
data.tar.gz: 796aeadd5ff7da40c31ad2e5dec9bd2c4fcec409
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55ea4cf6a8738b9199ee6f17a453eadaf4c4b987d76fd11b6bea86f5903bad2c14e2831f148df098dc3293a26aa0efcbab1abf43392e29899c7dd153c56733a6
|
7
|
+
data.tar.gz: baac92d2f9ed7af9c6e6efd97423ebb7e934f5570d593c6a82740e1cdf949ea5101089b06b800384f226dcbe9ddd2f998b0c8781c95f0ca4cc18f91200ecc218
|
data/CHANGELOG.md
CHANGED
@@ -10,6 +10,11 @@ that you can set version constraints properly.
|
|
10
10
|
|
11
11
|
#### [Unreleased] - now
|
12
12
|
|
13
|
+
#### [v3.2.0] - 2016-10-27
|
14
|
+
|
15
|
+
* `Added`: toggle evelaution logging
|
16
|
+
* `Changed`: debug logging to warn logging
|
17
|
+
|
13
18
|
#### [v3.1.0] - 2016-10-26
|
14
19
|
|
15
20
|
* `Changed`: `optional_logger` to v2.0.0
|
@@ -125,7 +130,8 @@ that you can set version constraints properly.
|
|
125
130
|
feature toggles
|
126
131
|
* `Added`: basic feature toggles able to be switched on/off
|
127
132
|
|
128
|
-
[Unreleased]: https://github.com/codebreakdown/togls/compare/v3.
|
133
|
+
[Unreleased]: https://github.com/codebreakdown/togls/compare/v3.2.0...HEAD
|
134
|
+
[v3.2.0]: https://github.com/codebreakdown/togls/compare/v3.2.0...v3.1.0
|
129
135
|
[v3.1.0]: https://github.com/codebreakdown/togls/compare/v3.1.0...v3.0.0
|
130
136
|
[v3.0.0]: https://github.com/codebreakdown/togls/compare/v2.2.1...v3.0.0
|
131
137
|
[v2.2.1]: https://github.com/codebreakdown/togls/compare/v2.2.0...v2.2.1
|
@@ -53,18 +53,18 @@ module Togls
|
|
53
53
|
|
54
54
|
def validate_feature_data(feature_data)
|
55
55
|
if feature_data.nil?
|
56
|
-
Togls.logger.
|
56
|
+
Togls.logger.warn("None of the feature repository drivers claim to have the feature")
|
57
57
|
raise Togls::RepositoryFeatureDataInvalid, "None of the feature repository drivers claim to have the feature"
|
58
58
|
end
|
59
59
|
|
60
60
|
['key', 'description', 'target_type'].each do |k|
|
61
61
|
if !feature_data.has_key? k
|
62
|
-
Togls.logger.
|
62
|
+
Togls.logger.warn("One of the feature repository drivers returned feature data that is missing the '#{k}'")
|
63
63
|
raise Togls::RepositoryFeatureDataInvalid, "One of the feature repository drivers returned feature data that is missing the '#{k}'"
|
64
64
|
end
|
65
65
|
|
66
66
|
if !feature_data[k].is_a?(String)
|
67
|
-
Togls.logger.
|
67
|
+
Togls.logger.warn("One of the feature repository drivers returned feature data with '#{k}' not being a string")
|
68
68
|
raise Togls::RepositoryFeatureDataInvalid, "One of the feature repository drivers returned feature data with '#{k}' not being a string"
|
69
69
|
end
|
70
70
|
end
|
@@ -48,20 +48,20 @@ module Togls
|
|
48
48
|
|
49
49
|
def validate_rule_data(rule_data)
|
50
50
|
if rule_data.nil?
|
51
|
-
Togls.logger.
|
51
|
+
Togls.logger.warn "None of the rule repository drivers claim to have the rule"
|
52
52
|
raise Togls::RepositoryRuleDataInvalid, "None of the rule repository drivers claim to have the rule"
|
53
53
|
end
|
54
54
|
|
55
55
|
['id', 'type_id', 'data', 'target_type'].each do |k|
|
56
56
|
if !rule_data.has_key? k
|
57
|
-
Togls.logger.
|
57
|
+
Togls.logger.warn "One of the rule repository drivers returned rule data that is missing the '#{k}'"
|
58
58
|
raise Togls::RepositoryRuleDataInvalid, "One of the rule repository drivers returned rule data that is missing the '#{k}'"
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
62
|
['id', 'type_id', 'target_type'].each do |k|
|
63
63
|
if !rule_data[k].is_a?(String)
|
64
|
-
Togls.logger.
|
64
|
+
Togls.logger.warn "One of the rule repository drivers returned rule data with '#{k}' not being a string"
|
65
65
|
raise Togls::RepositoryRuleDataInvalid, "One of the rule repository drivers returned rule data with '#{k}' not being a string"
|
66
66
|
end
|
67
67
|
end
|
data/lib/togls/toggle.rb
CHANGED
@@ -71,12 +71,16 @@ module Togls
|
|
71
71
|
|
72
72
|
def on?(target = nil)
|
73
73
|
validate_target(target)
|
74
|
-
@rule.run(@feature.key, target)
|
74
|
+
result = @rule.run(@feature.key, target)
|
75
|
+
Togls.logger.info("Togls evaluated feature(#{@feature.key}).on?(#{target.inspect}) to #{result.inspect} using rule, #{@rule.id}.")
|
76
|
+
result
|
75
77
|
end
|
76
78
|
|
77
79
|
def off?(target = nil)
|
78
80
|
validate_target(target)
|
79
|
-
!@rule.run(@feature.key, target)
|
81
|
+
result = !@rule.run(@feature.key, target)
|
82
|
+
Togls.logger.info("Togls evaluated feature(#{@feature.key}).off?(#{target.inspect}) to #{result.inspect} using rule, #{@rule.id}.")
|
83
|
+
result
|
80
84
|
end
|
81
85
|
end
|
82
86
|
end
|
data/lib/togls/version.rb
CHANGED