process_settings 0.20.0.pre.2 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -8
- data/lib/process_settings/helpers/watchdog.rb +1 -1
- data/lib/process_settings/target.rb +0 -12
- data/lib/process_settings/targeted_settings.rb +1 -1
- data/lib/process_settings/testing/helpers.rb +9 -3
- data/lib/process_settings/version.rb +1 -1
- data/lib/process_settings.rb +1 -0
- metadata +8 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f4fdf4873dd20b3d35c8582faaaec56b4e611228cbeb605f1d68c1dedeaca91
|
4
|
+
data.tar.gz: c4d2f3ac330cb0c7b74c21552487d25399ea05effc81694f6bf0071642c75585
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efac2c40e90993c769e9ef4581c284b4bcd2a1c0aa7a7d96b602179051cde72950145271f00d4ea631dc8f2a2d12f8f7bb0b876395a231a7872b080a5776d546
|
7
|
+
data.tar.gz: b9bf0a4a64b9c4e5eb362ebcef2f99f0cfff989ac969c031958de5fa7756487f4daacdb9a91ddee2cf21b5b68cd179cd33b27ad692801b9826c9e33d061575bf
|
data/README.md
CHANGED
@@ -164,14 +164,6 @@ 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
|
-
|
175
167
|
### Precedence
|
176
168
|
The settings YAML files are always combined in alphabetical order by file path. Later settings take precedence over the earlier ones.
|
177
169
|
|
@@ -14,7 +14,7 @@ module ProcessSettings
|
|
14
14
|
|
15
15
|
def check
|
16
16
|
if version_from_memory != version_from_disk && (Time.now - mtime_from_disk) > MAX_MTIME_DIFFERENCE
|
17
|
-
raise
|
17
|
+
raise OutOfSync.new("ProcessSettings versions are out of sync!\n Version from Disk: #{version_from_disk}\n Version from Memory: #{version_from_memory}\n mtime of file: #{mtime_from_disk}")
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -38,12 +38,6 @@ 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
|
47
41
|
else
|
48
42
|
target_value == static_context_hash
|
49
43
|
end
|
@@ -96,12 +90,6 @@ module ProcessSettings
|
|
96
90
|
end
|
97
91
|
when true, false
|
98
92
|
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
|
105
93
|
else
|
106
94
|
target_value == context_hash
|
107
95
|
end
|
@@ -60,12 +60,18 @@ module ProcessSettings
|
|
60
60
|
|
61
61
|
class << self
|
62
62
|
def included(including_klass)
|
63
|
-
|
64
|
-
|
65
|
-
end
|
63
|
+
# Prepend the teardown method in case the test class has already defined one.
|
64
|
+
including_klass.prepend(TeardownProcessSettings)
|
66
65
|
end
|
67
66
|
end
|
68
67
|
end
|
68
|
+
|
69
|
+
module TeardownProcessSettings
|
70
|
+
def teardown
|
71
|
+
ProcessSettings.instance = initial_instance
|
72
|
+
super
|
73
|
+
end
|
74
|
+
end
|
69
75
|
end
|
70
76
|
|
71
77
|
Helpers = RSpec::Helpers # for backward-compatibility
|
data/lib/process_settings.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: process_settings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.0
|
4
|
+
version: 0.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Invoca
|
@@ -16,20 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '7'
|
19
|
+
version: '0'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
24
|
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
30
|
-
- - "<"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '7'
|
26
|
+
version: '0'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: json
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -62,14 +56,14 @@ dependencies:
|
|
62
56
|
name: psych
|
63
57
|
requirement: !ruby/object:Gem::Requirement
|
64
58
|
requirements:
|
65
|
-
- - "
|
59
|
+
- - ">="
|
66
60
|
- !ruby/object:Gem::Version
|
67
61
|
version: '3.2'
|
68
62
|
type: :runtime
|
69
63
|
prerelease: false
|
70
64
|
version_requirements: !ruby/object:Gem::Requirement
|
71
65
|
requirements:
|
72
|
-
- - "
|
66
|
+
- - ">="
|
73
67
|
- !ruby/object:Gem::Version
|
74
68
|
version: '3.2'
|
75
69
|
description: Targeted process settings that dynamically reload without restarting
|
@@ -123,11 +117,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
123
117
|
version: '0'
|
124
118
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
119
|
requirements:
|
126
|
-
- - "
|
120
|
+
- - ">="
|
127
121
|
- !ruby/object:Gem::Version
|
128
|
-
version:
|
122
|
+
version: '0'
|
129
123
|
requirements: []
|
130
|
-
rubygems_version: 3.
|
124
|
+
rubygems_version: 3.4.20
|
131
125
|
signing_key:
|
132
126
|
specification_version: 4
|
133
127
|
summary: Dynamic process settings
|