precursor 0.8.1 → 0.8.3

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: 82e8cf0cbc5bb84dd597bbc9a2cc47e44091a10127778f942518f5325aeaf35d
4
- data.tar.gz: fea586355a0c7e3a974d1b15253314cd19305436edfe73c5c9b01ca9577fdb06
3
+ metadata.gz: d1e8452a55b4591e95701068d5d50ca3e9d97cfa04fe73df8bda6d378b81791e
4
+ data.tar.gz: 4a3a53f199006ed571a796eae5f8a09f76cb25e8d611e7f94854163d7a959de7
5
5
  SHA512:
6
- metadata.gz: 59009fca0d5ef42c486420a9c2cb165e3d379c713e585b1c02d4227998a813d1dc951c669e510698ec1014b4b3f39047d434fb906d8290bb29797f56813199bb
7
- data.tar.gz: d45995519de94c99c2ce86c408e7249d412595e286efdff928fb857a8141a836b25bba553dfa84d57c53c27ee5b4e800dc4bc9b306526c9d552e79ea48922fe0
6
+ metadata.gz: 3d00844c3eaa43d227d4c31a83776a35eecdb1538aa2307c65b9fdc9c3eb8db8c094ff8f03978d283dfc419771d2b49574a2b9a40de64fc3d6f4cd0c562f3d9c
7
+ data.tar.gz: 3cbe8bfc3b0e3a5b17be0f29762597eb750571654f11d876df1cf17dbf363ea9e3016d5a8f63251b182a9be8e85002b835cdff387d97771ed2cc28e0cdabf14b
data/lib/config_root.rb CHANGED
@@ -21,6 +21,13 @@ module Precursor
21
21
  value.is_a?(String) ? resolve(value) : value
22
22
  end
23
23
 
24
+ # Tests if config value exist for a given key
25
+ # @param key [Symbol] Config key
26
+ # return [Boolean] True if value exists; false otherwise
27
+ def key?(key)
28
+ @vaults.any? { |v| v.key? key }
29
+ end
30
+
24
31
  def resolve(str)
25
32
  res = str
26
33
  until (m = res.match(VAR_PATTERN)).nil?
data/lib/precursor.rb CHANGED
@@ -8,6 +8,7 @@ require_relative 'hash_vault'
8
8
  require_relative 'override_vault'
9
9
  require_relative 'thread_local_override_vault'
10
10
  require_relative 'yaml_vault'
11
+ require_relative 'yaml_file_vault'
11
12
 
12
13
  # Entry point to Precursor
13
14
  module Precursor
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Precursor
4
- VERSION = '0.8.1'
4
+ VERSION = '0.8.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: precursor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Maraev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-17 00:00:00.000000000 Z
11
+ date: 2022-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: optparse