process_settings 0.5.7 → 0.6.0.pre.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c01f21d1a609e75d09d459cc715b40ce3f38ee558fee76d2e510db8b77408c45
4
- data.tar.gz: 9c437b1e4269497b5a4fc0c31494fdd20f931c7932f7a3089cc467978a616b37
3
+ metadata.gz: f734f05f17341b43dbd7337e8f631f04eef9cad8e1c094a17008dd1bf1e4788b
4
+ data.tar.gz: a5e4811fcd892649f81dc398912abdef48ee4301e016246eacd4daa32f3e1df5
5
5
  SHA512:
6
- metadata.gz: 502b11b1f6d46fd1b82f95349100f7bc5055ce0a5ca1162557267f26aeb4db75ea6a247309e7a2ddc6b4714f84211915799396d9dbaf0c464655d6dd4030ad13
7
- data.tar.gz: bc8d9bbb64c0813b31483b0a065ec1b6d75462f77346d48fe095af92cff2498ea0bfff57379bcb8f6aab444dc871756f23325f0bc34c802020a272c07787a329
6
+ metadata.gz: f83ce76ae7c8dbb5ff0569c7b94c38d7b48495c6111490a29a0d68a214e58f2decb597b02d337f7343b21017b614733e4c9b28c80a315b706ab4d37f1c3a711f
7
+ data.tar.gz: 129b0454ee4392d7fddcd7fbc367ecec1c0c436df5a9e95ab441a1b494318592c79a59675df98d4e8c425d40795ca3f3de2c3e6d0e61279ab11a51bb43923286
@@ -25,13 +25,22 @@ module ProcessSettings
25
25
  @last_untargetted_settings = nil
26
26
  @last_untargetted_settings = nil
27
27
 
28
+ start
29
+ end
30
+
31
+ # starts listening for changes
32
+ # Note: This method creates a new thread that will be monitoring for changes
33
+ # do to the nature of how the Listen gem works, there is no record of
34
+ # existing threads, calling this mutliple times will result in spinning off
35
+ # multiple listen threads and will have unknow effects
36
+ def start
37
+ path = File.dirname(@file_path)
38
+
28
39
  # to eliminate any race condition:
29
40
  # 1. set up file watcher
30
41
  # 2. start it (this should trigger if any changes have been made since (1))
31
42
  # 3. load the file
32
43
 
33
- path = File.dirname(@file_path)
34
-
35
44
  @listener = file_change_notifier.to(path) do |modified, added, _removed|
36
45
  if modified.include?(@file_path) || added.include?(@file_path)
37
46
  @logger.info("ProcessSettings::Monitor file #{@file_path} changed. Reloading.")
@@ -46,13 +55,12 @@ module ProcessSettings
46
55
  end
47
56
 
48
57
  load_untargeted_settings
49
-
50
58
  load_statically_targeted_settings
51
59
  end
52
60
 
53
61
  # stops listening for changes
54
62
  def stop
55
- @listener.stop
63
+ @listener&.stop
56
64
  end
57
65
 
58
66
  # TODO:
@@ -109,6 +117,10 @@ module ProcessSettings
109
117
 
110
118
  private
111
119
 
120
+ def listener
121
+
122
+ end
123
+
112
124
  # Loads the most recent settings from disk
113
125
  def load_untargeted_settings
114
126
  new_untargeted_settings = load_file(file_path)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ProcessSettings
4
- VERSION = '0.5.7'
4
+ VERSION = '0.6.0.pre.1'
5
5
  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.5.7
4
+ version: 0.6.0.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Invoca
@@ -98,11 +98,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
98
98
  version: '0'
99
99
  required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - ">"
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: 1.3.1
104
104
  requirements: []
105
- rubygems_version: 3.0.1
105
+ rubygems_version: 3.0.3
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: Dynamic process settings