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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d181fc9c4bdabc2db5115abbc7c99bae9e06a67e590999d403ae001dfb6ab620
4
- data.tar.gz: ffe647dc7dc05219275650db9ab3324a8c2b9af9fbaa8812e8f4e5330cae6d39
3
+ metadata.gz: 5f4fdf4873dd20b3d35c8582faaaec56b4e611228cbeb605f1d68c1dedeaca91
4
+ data.tar.gz: c4d2f3ac330cb0c7b74c21552487d25399ea05effc81694f6bf0071642c75585
5
5
  SHA512:
6
- metadata.gz: 68209170c9cd7db9bfe54a9c3ebce701b23a244a0c26b96f19150e4b38e63dfc1d3276a5afc9ca3c604155fc6234c6815b7500725062860694816796cdb25d1f
7
- data.tar.gz: f2ad2f3fbae440124751d175d8f4083c30b7bd530947ec844049ff91fa190a778ceffad0c2a01250e36919fbaaa22584606e18dcee46bba1e66356394e01a5d4
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 ProcessSettings::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}")
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
@@ -73,7 +73,7 @@ module ProcessSettings
73
73
  end
74
74
 
75
75
  def from_file(file_path, only_meta: false)
76
- json_doc = Psych.safe_load_file(file_path, permitted_classes: [Regexp])
76
+ json_doc = Psych.safe_load_file(file_path)
77
77
  from_array(json_doc, only_meta: only_meta)
78
78
  end
79
79
  end
@@ -60,12 +60,18 @@ module ProcessSettings
60
60
 
61
61
  class << self
62
62
  def included(including_klass)
63
- including_klass.define_method(:teardown) do
64
- ProcessSettings.instance = initial_instance
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ProcessSettings
4
- VERSION = '0.20.0.pre.2'
4
+ VERSION = '0.20.0'
5
5
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'active_support'
4
4
  require 'active_support/deprecation'
5
+ require 'active_support/core_ext'
5
6
 
6
7
  module ProcessSettings
7
8
  end
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.pre.2
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: '4.2'
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: '4.2'
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: 1.3.1
122
+ version: '0'
129
123
  requirements: []
130
- rubygems_version: 3.0.3
124
+ rubygems_version: 3.4.20
131
125
  signing_key:
132
126
  specification_version: 4
133
127
  summary: Dynamic process settings