eventhub-processor2 1.15.0 → 1.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +8 -0
- data/.github/workflows/ci.yml +1 -1
- data/CHANGELOG.md +10 -0
- data/Gemfile.lock +20 -18
- data/README.md +41 -0
- data/eventhub-processor2.gemspec +2 -2
- data/lib/eventhub/configuration.rb +19 -1
- data/lib/eventhub/logger.rb +1 -1
- data/lib/eventhub/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78506dd98d394a48e12d31f9e3548bda5ef44674e4e964bf783a3b0374ee100d
|
4
|
+
data.tar.gz: 24f228ec36df83139a4b44d8ac80e51dc60639422f74ebe3713a5eddc7c05c74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b631a080f4e71f3739f2c8ebdc75ea50173493518f623ec0e394bdf42a10c524fadc123c6ad0e4a42b71d5b7cae625d0c58850f47ccbdb7e78eb411870aaa90
|
7
|
+
data.tar.gz: c3809dc7e46f87ce03e3ca44c2fb3caec3213d70b85d1e565bdf945f3a5b32b752c85281524a21197e30eb55bb7bd7fe6bfce423f0c0e564da65c30c7d3daefc
|
data/.github/dependabot.yml
CHANGED
data/.github/workflows/ci.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# Changelog of EventHub::Processor2
|
2
2
|
|
3
|
+
## 1.17.0 / 2022-12-21
|
4
|
+
|
5
|
+
* Ability to load and merge more config file based on a name or a pattern
|
6
|
+
* Update dependencies
|
7
|
+
|
8
|
+
## 1.16.0 / 2022-12-18
|
9
|
+
|
10
|
+
* Updated gem dependencies
|
11
|
+
* Improve access on undefined @logger instance
|
12
|
+
|
3
13
|
## 1.15.0 / 2022-10-28
|
4
14
|
|
5
15
|
* Updated gem dependencies
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
eventhub-processor2 (1.
|
5
|
-
bunny (~> 2.
|
4
|
+
eventhub-processor2 (1.17.0)
|
5
|
+
bunny (~> 2.20)
|
6
6
|
celluloid (~> 0.18)
|
7
7
|
eventhub-components (~> 0.2)
|
8
8
|
uuidtools (~> 2.1)
|
@@ -12,7 +12,7 @@ GEM
|
|
12
12
|
specs:
|
13
13
|
amq-protocol (2.3.2)
|
14
14
|
ast (2.4.2)
|
15
|
-
bunny (2.
|
15
|
+
bunny (2.20.1)
|
16
16
|
amq-protocol (~> 2.3, >= 2.3.1)
|
17
17
|
sorted_set (~> 1, >= 1.0.2)
|
18
18
|
celluloid (0.18.0)
|
@@ -21,17 +21,18 @@ GEM
|
|
21
21
|
docile (1.4.0)
|
22
22
|
eventhub-components (0.3.1)
|
23
23
|
logstash-logger (~> 0.26)
|
24
|
-
json (2.6.
|
24
|
+
json (2.6.3)
|
25
|
+
language_server-protocol (3.17.0.2)
|
25
26
|
logstash-event (1.2.02)
|
26
27
|
logstash-logger (0.26.1)
|
27
28
|
logstash-event (~> 1.2)
|
28
29
|
parallel (1.22.1)
|
29
|
-
parser (3.1.
|
30
|
+
parser (3.1.3.0)
|
30
31
|
ast (~> 2.4.1)
|
31
32
|
rainbow (3.1.1)
|
32
33
|
rake (13.0.6)
|
33
|
-
rbtree (0.4.
|
34
|
-
regexp_parser (2.6.
|
34
|
+
rbtree (0.4.6)
|
35
|
+
regexp_parser (2.6.1)
|
35
36
|
rexml (3.2.5)
|
36
37
|
rspec (3.12.0)
|
37
38
|
rspec-core (~> 3.12.0)
|
@@ -39,26 +40,26 @@ GEM
|
|
39
40
|
rspec-mocks (~> 3.12.0)
|
40
41
|
rspec-core (3.12.0)
|
41
42
|
rspec-support (~> 3.12.0)
|
42
|
-
rspec-expectations (3.12.
|
43
|
+
rspec-expectations (3.12.1)
|
43
44
|
diff-lcs (>= 1.2.0, < 2.0)
|
44
45
|
rspec-support (~> 3.12.0)
|
45
|
-
rspec-mocks (3.12.
|
46
|
+
rspec-mocks (3.12.1)
|
46
47
|
diff-lcs (>= 1.2.0, < 2.0)
|
47
48
|
rspec-support (~> 3.12.0)
|
48
49
|
rspec-support (3.12.0)
|
49
|
-
rubocop (1.
|
50
|
+
rubocop (1.40.0)
|
50
51
|
json (~> 2.3)
|
51
52
|
parallel (~> 1.10)
|
52
53
|
parser (>= 3.1.2.1)
|
53
54
|
rainbow (>= 2.2.2, < 4.0)
|
54
55
|
regexp_parser (>= 1.8, < 3.0)
|
55
56
|
rexml (>= 3.2.5, < 4.0)
|
56
|
-
rubocop-ast (>= 1.
|
57
|
+
rubocop-ast (>= 1.23.0, < 2.0)
|
57
58
|
ruby-progressbar (~> 1.7)
|
58
59
|
unicode-display_width (>= 1.4.0, < 3.0)
|
59
|
-
rubocop-ast (1.
|
60
|
+
rubocop-ast (1.24.0)
|
60
61
|
parser (>= 3.1.1.0)
|
61
|
-
rubocop-performance (1.
|
62
|
+
rubocop-performance (1.15.1)
|
62
63
|
rubocop (>= 1.7.0, < 2.0)
|
63
64
|
rubocop-ast (>= 0.4.0)
|
64
65
|
ruby-progressbar (1.11.0)
|
@@ -72,9 +73,10 @@ GEM
|
|
72
73
|
sorted_set (1.0.3)
|
73
74
|
rbtree
|
74
75
|
set (~> 1.0)
|
75
|
-
standard (1.
|
76
|
-
|
77
|
-
rubocop
|
76
|
+
standard (1.20.0)
|
77
|
+
language_server-protocol (~> 3.17.0.2)
|
78
|
+
rubocop (= 1.40.0)
|
79
|
+
rubocop-performance (= 1.15.1)
|
78
80
|
timers (4.3.5)
|
79
81
|
unicode-display_width (2.3.0)
|
80
82
|
uuidtools (2.2.0)
|
@@ -91,7 +93,7 @@ DEPENDENCIES
|
|
91
93
|
rake (~> 13.0)
|
92
94
|
rspec (~> 3.11)
|
93
95
|
simplecov (~> 0.21)
|
94
|
-
standard (~> 1.
|
96
|
+
standard (~> 1.20)
|
95
97
|
|
96
98
|
BUNDLED WITH
|
97
|
-
2.3.
|
99
|
+
2.3.26
|
data/README.md
CHANGED
@@ -19,6 +19,7 @@ Processor2 is using Bunny http://rubybunny.info a feature complete RabbitMQ Clie
|
|
19
19
|
|
20
20
|
Currently supported and tested ruby versions are:
|
21
21
|
|
22
|
+
- 3.2
|
22
23
|
- 3.1
|
23
24
|
- 3.0
|
24
25
|
- 2.7
|
@@ -180,6 +181,46 @@ Processor2 symbolizes keys and sub-keys from configuration files automatically.
|
|
180
181
|
database['name']['subname'] # => "value"
|
181
182
|
```
|
182
183
|
|
184
|
+
Version 1.17 and newer allows you to load and merge more configuration files programmatically. It is expected that load! is called once (implicit during class initialization) and then load_more! zero, one, or multiple times. All additional files loaded with load_more! are hash deep merged into one configuration structure. Exceptions while loading of files will be catched and shown as warnings.
|
185
|
+
```ruby
|
186
|
+
# specify a file
|
187
|
+
EventHub::Configuration.load_more!(pattern: "config/another_config.json")
|
188
|
+
|
189
|
+
# specify glob patterns to load multiple files
|
190
|
+
EventHub::Configuration.load_more!(pattern: "config/processes/**/*.json")
|
191
|
+
EventHub::Configuration.load_more!(pattern: "config/templates/**/*.json")
|
192
|
+
```
|
193
|
+
If you have conflicting hashes, the previous settings will be overwritten.
|
194
|
+
|
195
|
+
1st file loaded
|
196
|
+
```json
|
197
|
+
{
|
198
|
+
"test": {
|
199
|
+
"a": "a_value",
|
200
|
+
"b": "b_value"
|
201
|
+
}
|
202
|
+
}
|
203
|
+
```
|
204
|
+
2nd file loaded
|
205
|
+
```json
|
206
|
+
{
|
207
|
+
"test": {
|
208
|
+
"b": "another_value"
|
209
|
+
}
|
210
|
+
}
|
211
|
+
```
|
212
|
+
|
213
|
+
Final configuration result
|
214
|
+
```json
|
215
|
+
{
|
216
|
+
"test": {
|
217
|
+
"a": "a_value",
|
218
|
+
"b": "another_value"
|
219
|
+
}
|
220
|
+
}
|
221
|
+
|
222
|
+
```
|
223
|
+
|
183
224
|
## Development
|
184
225
|
|
185
226
|
```
|
data/eventhub-processor2.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
|
25
25
|
spec.add_dependency "celluloid", "~> 0.18"
|
26
|
-
spec.add_dependency "bunny", "~> 2.
|
26
|
+
spec.add_dependency "bunny", "~> 2.20"
|
27
27
|
spec.add_dependency "eventhub-components", "~> 0.2"
|
28
28
|
spec.add_dependency "uuidtools", "~> 2.1"
|
29
29
|
|
@@ -31,5 +31,5 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_development_dependency "rake", "~> 13.0"
|
32
32
|
spec.add_development_dependency "rspec", "~> 3.11"
|
33
33
|
spec.add_development_dependency "simplecov", "~> 0.21"
|
34
|
-
spec.add_development_dependency "standard", "~> 1.
|
34
|
+
spec.add_development_dependency "standard", "~> 1.20"
|
35
35
|
end
|
@@ -79,12 +79,30 @@ module EventHub
|
|
79
79
|
deep_merge!(@config_data, new_data)
|
80
80
|
end
|
81
81
|
|
82
|
+
# load and merge more configuration files
|
83
|
+
def load_more!(args = {})
|
84
|
+
return unless args[:pattern]
|
85
|
+
|
86
|
+
Dir.glob(args[:pattern]).each do |name|
|
87
|
+
next if File.directory?(name)
|
88
|
+
|
89
|
+
begin
|
90
|
+
EventHub.logger.info("About to load file [#{name}]...")
|
91
|
+
new_data = JSON.parse(File.read(name), symbolize_names: true)
|
92
|
+
new_data = new_data[@environment.to_sym]
|
93
|
+
deep_merge!(@config_data, new_data)
|
94
|
+
rescue => e
|
95
|
+
EventHub.logger.warn("Exception while loading file [#{name}]: #{e}")
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
82
100
|
# Deep merging of hashes
|
83
101
|
# deep_merge by Stefan Rusterholz, see http://www.ruby-forum.com/topic/142809
|
84
102
|
def deep_merge!(target, data)
|
85
103
|
return if data.nil?
|
86
104
|
merger = proc do |_, v1, v2|
|
87
|
-
v1.is_a?(Hash) && v2.is_a?(Hash) ? v1.merge(v2, &merger) : v2
|
105
|
+
(v1.is_a?(Hash) && v2.is_a?(Hash)) ? v1.merge(v2, &merger) : v2
|
88
106
|
end
|
89
107
|
target.merge! data, &merger
|
90
108
|
end
|
data/lib/eventhub/logger.rb
CHANGED
data/lib/eventhub/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eventhub-processor2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steiner, Thomas
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: celluloid
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '2.
|
33
|
+
version: '2.20'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '2.
|
40
|
+
version: '2.20'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: eventhub-components
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '1.
|
131
|
+
version: '1.20'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '1.
|
138
|
+
version: '1.20'
|
139
139
|
description: Next generation gem to build ruby based eventhub processor
|
140
140
|
email:
|
141
141
|
- thomas.steiner@ikey.ch
|
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
206
|
- !ruby/object:Gem::Version
|
207
207
|
version: '0'
|
208
208
|
requirements: []
|
209
|
-
rubygems_version: 3.3.
|
209
|
+
rubygems_version: 3.3.26
|
210
210
|
signing_key:
|
211
211
|
specification_version: 4
|
212
212
|
summary: Next generation gem to build ruby based eventhub processor
|