process_settings 0.7.1 → 0.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93261c11e45446632a8a1ccead49e7eb6671cd3a8543488103b6ae3764c97804
4
- data.tar.gz: 949bf56302c900a057661c1d91fec7cb15f2ebc6f888e351ec25d0be4702ec0c
3
+ metadata.gz: 0763f49b68a52e5858cf539fc18adaa575d0e374b3f0490e63c972b340dc75ab
4
+ data.tar.gz: d8d82eb1674afbfaa0ffd1e94b12555af51811c73f84f8cb3ebf11e0f6602581
5
5
  SHA512:
6
- metadata.gz: b510569576c842eafa5bbcf9fbad51c5677c649301b5db786f0a4d5658ed5ad7664f7fccc53568f8874b957e9b319ebcdaebf003935eb7dc563417075c24e825
7
- data.tar.gz: d9c72be3f0081e85f7c3e03c7ddfcba2132e38cc65488628a88c2d40271bf29fc15aafb2e9e0a8d62f7ee9ac1c0a97a0d507e779fcbab87e5218e5c8041e0454
6
+ metadata.gz: 506febcd2fee4fec9e19f44e3de774a2ea2878526b80e93e71f3f51eab6ff807983914f998a0576c294b9b0e8bda6d47a7cc81704fa59ef8514f61cd0d1e1e97
7
+ data.tar.gz: 2e2d84671c400c0c9a1711957e33c6757fe1420879cf4f830ba167592d3cb1420c8f345df46189de4be299480b63772609531ef25761a37f0318b9e53ab358e7
@@ -31,6 +31,33 @@ module ProcessSettings
31
31
  start
32
32
  end
33
33
 
34
+ # []
35
+ #
36
+ # This is the main entry point for looking up settings on the Monitor instance.
37
+ #
38
+ # @example
39
+ #
40
+ # ['path', 'to', 'setting']
41
+ #
42
+ # will return 42 in this example settings YAML:
43
+ # +code+
44
+ # path:
45
+ # to:
46
+ # setting:
47
+ # 42
48
+ # +code+
49
+ #
50
+ # @param [Array(String)] path The path of one or more strings.
51
+ #
52
+ # @param [Hash] dynamic_context Optional dynamic context hash. It will be merged with the static context.
53
+ #
54
+ # @param [boolean] required If true (default) will raise `SettingsPathNotFound` if not found; otherwise returns `nil` if not found.
55
+ #
56
+ # @return setting value
57
+ def [](*path, dynamic_context: {}, required: true)
58
+ targeted_value(*path, dynamic_context: dynamic_context, required: required)
59
+ end
60
+
34
61
  # starts listening for changes
35
62
  # Note: This method creates a new thread that will be monitoring for changes
36
63
  # do to the nature of how the Listen gem works, there is no record of
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ProcessSettings
4
- VERSION = '0.7.1'
4
+ VERSION = '0.7.2'
5
5
  end
@@ -7,8 +7,31 @@ require 'process_settings/monitor'
7
7
 
8
8
  module ProcessSettings
9
9
  class << self
10
+ # []
11
+ #
12
+ # This is the main entry point for looking up settings in the process.
13
+ #
14
+ # @example
15
+ #
16
+ # ProcessSettings['path', 'to', 'setting']
17
+ #
18
+ # will return 42 in this example settings YAML:
19
+ # +code+
20
+ # path:
21
+ # to:
22
+ # setting:
23
+ # 42
24
+ # +code+
25
+ #
26
+ # @param [Array(String)] path The path of one or more strings.
27
+ #
28
+ # @param [Hash] dynamic_context Optional dynamic context hash. It will be merged with the static context.
29
+ #
30
+ # @param [boolean] required If true (default) will raise `SettingsPathNotFound` if not found; otherwise returns `nil` if not found.
31
+ #
32
+ # @return setting value
10
33
  def [](*path, dynamic_context: {}, required: true)
11
- Monitor.instance.targeted_value(*path, dynamic_context: dynamic_context, required: required)
34
+ Monitor.instance[*path, dynamic_context: dynamic_context, required: required]
12
35
  end
13
36
  end
14
37
  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.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Invoca