process_settings 0.20.0.pre.1 → 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: b1badef60c71146241a061aebd1a5911d0780cd1eb2aa0b776f931eaab3d9b7d
4
- data.tar.gz: 6b9b1d1b7fcb775b316fb8440e9e2786e9a597314fd4b25214620d594e862fbe
3
+ metadata.gz: 5f4fdf4873dd20b3d35c8582faaaec56b4e611228cbeb605f1d68c1dedeaca91
4
+ data.tar.gz: c4d2f3ac330cb0c7b74c21552487d25399ea05effc81694f6bf0071642c75585
5
5
  SHA512:
6
- metadata.gz: 92c9644c27ec9d38d1e9aeaf39dbaa8a8b20ea3bfd5c7f84e206db81b1b5bdc344e0effe8cf710b6971535b826b2cd98db9e2c3f58dc6e9cf38f3941e65d41d9
7
- data.tar.gz: f29c738cc2f48ae0961e7794968c68b04f450cf1310139ebf76b933c0f25d205e95d7830f84370d833aa89586e659a64c31b39702670d90854327bd525544a18
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
 
@@ -90,8 +90,6 @@ module ProcessSettings
90
90
  end
91
91
  when true, false
92
92
  target_value
93
- when Regexp
94
- context_hash.match?(target_value)
95
93
  else
96
94
  target_value == context_hash
97
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.1'
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.1
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