record_store 6.5.0 → 6.5.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad3694c8bdf89c030abd7d0b6e4dda77f6b0627783c11d5f96194b18c0be047d
|
4
|
+
data.tar.gz: 65a8d64e1a5feff467d78297d9ed299d409d2bad617829d99291f9ddd0557558
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 257591b26a8b5b58d3752742d43be0acd79268ba0d3f69f2bf09b8469beefc70171900ba04f2b651ffd97d4bed82a49a42c65d002b3cb666e20178ba8d15864c
|
7
|
+
data.tar.gz: 8a605452495449a6a18e55ea57facb5d582977c21df5b74863fdda8ed185a9eafce3d788f6cab8b680bad019edf152c52548aa1dae7356700cf8026c1d5c5e1e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 6.5.1
|
4
|
+
|
5
|
+
Add support for a new parameter in the implicit records templates:
|
6
|
+
|
7
|
+
- `except_record`: the template will *NOT* generate the `injected_records` for records matching `except_record`, even if they matched `each_record`.
|
8
|
+
|
9
|
+
Also added support for regular expressions in the matching, using the already available `!ruby/regexp` text in a YAML value. The object loaded from the YAML
|
10
|
+
will be of `Regexp` type, and will thus be used to _match_ the value, instead of being identical only. This is supported in both `except_record` and
|
11
|
+
`each_record` fields.
|
12
|
+
|
13
|
+
## 6.5.0
|
14
|
+
|
15
|
+
...
|
16
|
+
|
3
17
|
## 6.4.0
|
4
18
|
|
5
19
|
Add support for injecting implicit records into a zone based on a pre-configured template. Brief overview of template keys:
|
data/lib/record_store/version.rb
CHANGED
@@ -26,9 +26,14 @@ module RecordStore
|
|
26
26
|
def from_file(filename:)
|
27
27
|
filepath = template_filepath_for(filename: filename)
|
28
28
|
template_file = File.read(filepath)
|
29
|
-
filters_for_records_to_template = YAML.load(template_file).deep_symbolize_keys[:each_record]
|
30
29
|
|
31
|
-
|
30
|
+
template_file_yaml = YAML.load(template_file).deep_symbolize_keys
|
31
|
+
filters_for_records_to_template = template_file_yaml[:each_record]
|
32
|
+
filters_for_records_to_exclude = template_file_yaml[:except_record]
|
33
|
+
|
34
|
+
new(template: ERB.new(template_file),
|
35
|
+
filters_for_records_to_template: filters_for_records_to_template,
|
36
|
+
filters_for_records_to_exclude: filters_for_records_to_exclude)
|
32
37
|
end
|
33
38
|
|
34
39
|
private
|
@@ -38,9 +43,10 @@ module RecordStore
|
|
38
43
|
end
|
39
44
|
end
|
40
45
|
|
41
|
-
def initialize(template:, filters_for_records_to_template:)
|
46
|
+
def initialize(template:, filters_for_records_to_template:, filters_for_records_to_exclude:)
|
42
47
|
@template = template
|
43
48
|
@filters_for_records_to_template = filters_for_records_to_template
|
49
|
+
@filters_for_records_to_exclude = filters_for_records_to_exclude
|
44
50
|
end
|
45
51
|
|
46
52
|
def generate_records_to_inject(current_records:)
|
@@ -61,7 +67,7 @@ module RecordStore
|
|
61
67
|
|
62
68
|
private
|
63
69
|
|
64
|
-
attr_reader :template, :filters_for_records_to_template
|
70
|
+
attr_reader :template, :filters_for_records_to_template, :filters_for_records_to_exclude
|
65
71
|
|
66
72
|
def should_inject?(template_records:, current_records:)
|
67
73
|
current_records.none? do |record|
|
@@ -72,12 +78,17 @@ module RecordStore
|
|
72
78
|
end
|
73
79
|
|
74
80
|
def should_template?(record:)
|
75
|
-
filters_for_records_to_template.any? { |filter| record_match?(record: record, filter: filter) }
|
81
|
+
filters_for_records_to_template.any? { |filter| record_match?(record: record, filter: filter) } && \
|
82
|
+
filters_for_records_to_exclude.none? { |filter| record_match?(record: record, filter: filter) }
|
76
83
|
end
|
77
84
|
|
78
85
|
def record_match?(record:, filter:)
|
79
86
|
filter.all? do |key, value|
|
80
|
-
|
87
|
+
if value.is_a?(Regexp)
|
88
|
+
value.match(record.public_send(key))
|
89
|
+
else
|
90
|
+
record.public_send(key) == value
|
91
|
+
end
|
81
92
|
end
|
82
93
|
end
|
83
94
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: record_store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.5.
|
4
|
+
version: 6.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Willem van Bergen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-08-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -417,7 +417,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
417
417
|
- !ruby/object:Gem::Version
|
418
418
|
version: '0'
|
419
419
|
requirements: []
|
420
|
-
rubygems_version: 3.2.
|
420
|
+
rubygems_version: 3.2.20
|
421
421
|
signing_key:
|
422
422
|
specification_version: 4
|
423
423
|
summary: Manage DNS using git
|