process_settings 0.19.0.pre.1 → 0.20.0.pre.2
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 +8 -0
- data/lib/process_settings/target.rb +12 -0
- data/lib/process_settings/targeted_settings.rb +1 -1
- data/lib/process_settings/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d181fc9c4bdabc2db5115abbc7c99bae9e06a67e590999d403ae001dfb6ab620
|
4
|
+
data.tar.gz: ffe647dc7dc05219275650db9ab3324a8c2b9af9fbaa8812e8f4e5330cae6d39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68209170c9cd7db9bfe54a9c3ebce701b23a244a0c26b96f19150e4b38e63dfc1d3276a5afc9ca3c604155fc6234c6815b7500725062860694816796cdb25d1f
|
7
|
+
data.tar.gz: f2ad2f3fbae440124751d175d8f4083c30b7bd530947ec844049ff91fa190a778ceffad0c2a01250e36919fbaaa22584606e18dcee46bba1e66356394e01a5d4
|
data/README.md
CHANGED
@@ -164,6 +164,14 @@ target:
|
|
164
164
|
```
|
165
165
|
This will be applied in any process that has (`service_name == "frontend"` OR `service_name == "auth"`) AND `datacenter == "AWS-US-EAST-1"`.
|
166
166
|
|
167
|
+
### Regexp Targeting
|
168
|
+
To provide a regular expression for targeting, use the ruby regex keyword `!ruby/regexp` followed by your regular expression. For example:
|
169
|
+
```
|
170
|
+
target:
|
171
|
+
service_name: !ruby/regexp /frontend-\d/
|
172
|
+
```
|
173
|
+
This will be applied in any process that has `service_name` that has `frontend-` followed with a number. As an example this will match `"frontend-1"`
|
174
|
+
|
167
175
|
### Precedence
|
168
176
|
The settings YAML files are always combined in alphabetical order by file path. Later settings take precedence over the earlier ones.
|
169
177
|
|
@@ -38,6 +38,12 @@ module ProcessSettings
|
|
38
38
|
with_static_context_hash(target_value, static_context_hash)
|
39
39
|
when true, false
|
40
40
|
!target_value == !static_context_hash
|
41
|
+
when Regexp
|
42
|
+
if static_context_hash.is_a?(String)
|
43
|
+
static_context_hash.match?(target_value)
|
44
|
+
else
|
45
|
+
static_context_hash == target_value
|
46
|
+
end
|
41
47
|
else
|
42
48
|
target_value == static_context_hash
|
43
49
|
end
|
@@ -90,6 +96,12 @@ module ProcessSettings
|
|
90
96
|
end
|
91
97
|
when true, false
|
92
98
|
target_value
|
99
|
+
when Regexp
|
100
|
+
if context_hash.is_a?(String)
|
101
|
+
context_hash.match?(target_value)
|
102
|
+
else
|
103
|
+
context_hash == target_value
|
104
|
+
end
|
93
105
|
else
|
94
106
|
target_value == context_hash
|
95
107
|
end
|