rimless 1.11.0 → 1.12.0
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 +4 -4
- data/.rubocop.yml +2 -0
- data/CHANGELOG.md +5 -0
- data/doc/kafka-playground/Dockerfile +2 -2
- data/doc/kafka-playground/Gemfile +1 -1
- data/doc/kafka-playground/Gemfile.lock +97 -85
- data/doc/kafka-playground/config/docker/shell/.bashrc +3 -1
- data/lib/rimless/avro_utils.rb +1 -1
- data/lib/rimless/compatibility/karafka_1_4.rb +1 -1
- data/lib/rimless/configuration_handling.rb +3 -3
- data/lib/rimless/consumer.rb +4 -4
- data/lib/rimless/dependencies.rb +3 -2
- data/lib/rimless/kafka_helpers.rb +7 -5
- data/lib/rimless/karafka/base64_interchanger.rb +1 -1
- data/lib/rimless/rspec/helpers.rb +3 -2
- data/lib/rimless/rspec/matchers.rb +4 -3
- data/lib/rimless/rspec.rb +12 -3
- data/lib/rimless/tasks/consumer.rake +1 -1
- data/lib/rimless/tasks/generator.rake +2 -2
- data/lib/rimless/tasks/stats.rake +2 -2
- data/lib/rimless/version.rb +1 -1
- data/lib/rimless.rb +1 -0
- data/rimless.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04bb4b887c5dbf5f6c558771b78278589212ffbac474bf856ac431f9da6b9c2e
|
4
|
+
data.tar.gz: 9befff3cd099e8326950d9a5dd3ff759acf44a2afa3e7c2f4b0bbc36ef2cc9ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cdbe62c2f3bb36a995172258011e0dea87e2f14f928dc79d8ba1cc2557de4f0db74271bb347961e56c29c8903be04aca01923af18ef166cee7476488e5ac4f7
|
7
|
+
data.tar.gz: b4da1d214e985c93442ec8a0aedebc8c681b9ab1a6f19e4010006260ba0782cf343e67e7e73a6fa5c187ee2b123496b78bde9f04ddc92338bd781f866d6a0de4
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
* TODO: Replace this bullet point with an actual description of a change.
|
4
4
|
|
5
|
+
### 1.12.0 (27 February 2025)
|
6
|
+
|
7
|
+
* Corrected some RuboCop glitches ([#50](https://github.com/hausgold/rimless/pull/50))
|
8
|
+
* Relaxed the sinatra gem dependency to >= 2.0 ([#51](https://github.com/hausgold/rimless/pull/51))
|
9
|
+
|
5
10
|
### 1.11.0 (30 January 2025)
|
6
11
|
|
7
12
|
* Added all versions up to Ruby 3.4 to the CI matrix ([#49](https://github.com/hausgold/rimless/pull/49))
|
@@ -8,8 +8,8 @@ RUN gem update --system '3.4.22'
|
|
8
8
|
RUN echo 'deb http://archive.debian.org/debian buster-backports main' \
|
9
9
|
>> /etc/apt/sources.list
|
10
10
|
|
11
|
-
# Install nodejs
|
12
|
-
RUN curl -sL https://deb.nodesource.com/
|
11
|
+
# Install nodejs 22
|
12
|
+
RUN curl -sL https://deb.nodesource.com/setup_22.x | bash -
|
13
13
|
|
14
14
|
# Install system packages and the ruby bundless
|
15
15
|
RUN apt-get update -yqqq && \
|
@@ -1,161 +1,173 @@
|
|
1
1
|
GEM
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
|
-
activesupport (
|
4
|
+
activesupport (7.1.5.1)
|
5
|
+
base64
|
6
|
+
benchmark (>= 0.3)
|
7
|
+
bigdecimal
|
5
8
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
9
|
+
connection_pool (>= 2.2.5)
|
10
|
+
drb
|
6
11
|
i18n (>= 1.6, < 2)
|
12
|
+
logger (>= 1.4.2)
|
7
13
|
minitest (>= 5.1)
|
14
|
+
mutex_m
|
15
|
+
securerandom (>= 0.3)
|
8
16
|
tzinfo (~> 2.0)
|
9
|
-
|
10
|
-
|
11
|
-
public_suffix (>= 2.0.2, < 6.0)
|
17
|
+
addressable (2.8.7)
|
18
|
+
public_suffix (>= 2.0.2, < 7.0)
|
12
19
|
avro (1.9.2)
|
13
20
|
multi_json
|
14
21
|
avro_turf (0.11.0)
|
15
22
|
avro (>= 1.7.7, < 1.10)
|
16
23
|
excon (~> 0.45)
|
17
|
-
|
18
|
-
|
19
|
-
|
24
|
+
base64 (0.2.0)
|
25
|
+
benchmark (0.4.0)
|
26
|
+
bigdecimal (3.1.9)
|
27
|
+
concurrent-ruby (1.3.5)
|
28
|
+
connection_pool (2.5.0)
|
20
29
|
crack (1.0.0)
|
21
30
|
bigdecimal
|
22
31
|
rexml
|
23
32
|
delivery_boy (1.2.0)
|
24
33
|
king_konf (~> 1.0)
|
25
34
|
ruby-kafka (~> 1.5)
|
26
|
-
digest-crc (0.
|
35
|
+
digest-crc (0.7.0)
|
27
36
|
rake (>= 12.0.0, < 14.0.0)
|
28
|
-
|
29
|
-
|
30
|
-
dry-core (~> 0.
|
31
|
-
|
37
|
+
drb (2.2.1)
|
38
|
+
dry-configurable (0.16.1)
|
39
|
+
dry-core (~> 0.6)
|
40
|
+
zeitwerk (~> 2.6)
|
41
|
+
dry-container (0.11.0)
|
32
42
|
concurrent-ruby (~> 1.0)
|
33
|
-
|
34
|
-
dry-core (0.6.0)
|
43
|
+
dry-core (0.9.1)
|
35
44
|
concurrent-ruby (~> 1.0)
|
36
|
-
|
37
|
-
dry-events (0.
|
45
|
+
zeitwerk (~> 2.6)
|
46
|
+
dry-events (0.4.0)
|
38
47
|
concurrent-ruby (~> 1.0)
|
39
|
-
dry-core (~> 0.
|
40
|
-
dry-inflector (0.
|
41
|
-
dry-initializer (3.
|
42
|
-
dry-logic (1.
|
48
|
+
dry-core (~> 0.9, >= 0.9)
|
49
|
+
dry-inflector (0.3.0)
|
50
|
+
dry-initializer (3.1.1)
|
51
|
+
dry-logic (1.3.0)
|
43
52
|
concurrent-ruby (~> 1.0)
|
44
|
-
dry-core (~> 0.
|
45
|
-
|
46
|
-
|
47
|
-
dry-
|
48
|
-
dry-
|
49
|
-
|
53
|
+
dry-core (~> 0.9, >= 0.9)
|
54
|
+
zeitwerk (~> 2.6)
|
55
|
+
dry-monitor (0.7.0)
|
56
|
+
dry-configurable (~> 0.16, >= 0.16.0)
|
57
|
+
dry-core (~> 0.9, >= 0.9)
|
58
|
+
dry-events (~> 0.4, >= 0.4.0)
|
59
|
+
dry-schema (1.11.3)
|
50
60
|
concurrent-ruby (~> 1.0)
|
51
|
-
dry-configurable (~> 0.
|
52
|
-
dry-core (~> 0.
|
61
|
+
dry-configurable (~> 0.16, >= 0.16)
|
62
|
+
dry-core (~> 0.9, >= 0.9)
|
53
63
|
dry-initializer (~> 3.0)
|
54
|
-
dry-logic (~> 1.
|
55
|
-
dry-types (~> 1.
|
56
|
-
|
64
|
+
dry-logic (~> 1.3)
|
65
|
+
dry-types (~> 1.6)
|
66
|
+
zeitwerk (~> 2.6)
|
67
|
+
dry-types (1.6.1)
|
57
68
|
concurrent-ruby (~> 1.0)
|
58
69
|
dry-container (~> 0.3)
|
59
|
-
dry-core (~> 0.
|
70
|
+
dry-core (~> 0.9, >= 0.9)
|
60
71
|
dry-inflector (~> 0.1, >= 0.1.2)
|
61
|
-
dry-logic (~> 1.
|
62
|
-
|
72
|
+
dry-logic (~> 1.3, >= 1.3)
|
73
|
+
zeitwerk (~> 2.6)
|
74
|
+
dry-validation (1.9.0)
|
63
75
|
concurrent-ruby (~> 1.0)
|
64
76
|
dry-container (~> 0.7, >= 0.7.1)
|
65
|
-
dry-core (~> 0.
|
66
|
-
dry-equalizer (~> 0.2)
|
77
|
+
dry-core (~> 0.9, >= 0.9)
|
67
78
|
dry-initializer (~> 3.0)
|
68
|
-
dry-schema (~> 1.
|
69
|
-
|
79
|
+
dry-schema (~> 1.11, >= 1.11.0)
|
80
|
+
zeitwerk (~> 2.6)
|
81
|
+
envlogic (1.1.5)
|
70
82
|
dry-inflector (~> 0.1)
|
71
|
-
excon (0.
|
72
|
-
hashdiff (1.1.
|
73
|
-
i18n (1.14.
|
83
|
+
excon (0.112.0)
|
84
|
+
hashdiff (1.1.2)
|
85
|
+
i18n (1.14.7)
|
74
86
|
concurrent-ruby (~> 1.0)
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
dry-
|
80
|
-
dry-
|
81
|
-
dry-monitor (~> 0.3)
|
82
|
-
dry-validation (~> 1.2)
|
87
|
+
karafka (1.4.14)
|
88
|
+
concurrent-ruby
|
89
|
+
dry-configurable (~> 0.16)
|
90
|
+
dry-inflector (~> 0.2)
|
91
|
+
dry-monitor (~> 0.5)
|
92
|
+
dry-validation (~> 1.7)
|
83
93
|
envlogic (~> 1.1)
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
zeitwerk (~> 2.1)
|
90
|
-
karafka-sidekiq-backend (1.4.1)
|
94
|
+
ruby-kafka (>= 1.3.0)
|
95
|
+
thor (>= 1.1)
|
96
|
+
waterdrop (~> 1.4)
|
97
|
+
zeitwerk (~> 2.6)
|
98
|
+
karafka-sidekiq-backend (1.4.9)
|
91
99
|
karafka (~> 1.4.0)
|
92
100
|
sidekiq (>= 4.2)
|
93
|
-
karafka-testing (1.4.
|
94
|
-
karafka (~> 1.4.0
|
101
|
+
karafka-testing (1.4.5)
|
102
|
+
karafka (~> 1.4.0)
|
95
103
|
king_konf (1.0.1)
|
96
|
-
|
104
|
+
logger (1.6.6)
|
105
|
+
minitest (5.25.4)
|
97
106
|
multi_json (1.15.0)
|
98
107
|
mustermann (2.0.2)
|
99
108
|
ruby2_keywords (~> 0.0.1)
|
100
|
-
|
101
|
-
|
109
|
+
mutex_m (0.3.0)
|
110
|
+
public_suffix (5.1.1)
|
111
|
+
rack (2.2.11)
|
102
112
|
rack-protection (2.2.4)
|
103
113
|
rack
|
104
114
|
rake (13.2.1)
|
105
|
-
redis (
|
106
|
-
|
107
|
-
io-console (~> 0.5)
|
115
|
+
redis-client (0.23.2)
|
116
|
+
connection_pool
|
108
117
|
retries (0.0.5)
|
109
|
-
rexml (3.
|
110
|
-
|
111
|
-
|
112
|
-
activesupport (>= 5.2)
|
118
|
+
rexml (3.4.1)
|
119
|
+
rimless (1.11.0)
|
120
|
+
activesupport (>= 6.1)
|
113
121
|
avro_turf (~> 0.11.0)
|
114
122
|
karafka (~> 1.4, < 1.4.15)
|
115
123
|
karafka-sidekiq-backend (~> 1.4)
|
116
124
|
karafka-testing (~> 1.4)
|
125
|
+
mutex_m (~> 0.3.0)
|
117
126
|
retries (>= 0.0.5)
|
118
127
|
sinatra (~> 2.2)
|
119
128
|
sparsify (~> 1.1)
|
120
129
|
waterdrop (~> 1.4)
|
121
130
|
webmock (~> 3.18)
|
131
|
+
zeitwerk (~> 2.6)
|
122
132
|
ruby-kafka (1.5.0)
|
123
133
|
digest-crc
|
124
134
|
ruby2_keywords (0.0.5)
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
135
|
+
securerandom (0.3.2)
|
136
|
+
sidekiq (7.3.9)
|
137
|
+
base64
|
138
|
+
connection_pool (>= 2.3.0)
|
139
|
+
logger
|
140
|
+
rack (>= 2.2.4)
|
141
|
+
redis-client (>= 0.22.2)
|
129
142
|
sinatra (2.2.4)
|
130
143
|
mustermann (~> 2.0)
|
131
144
|
rack (~> 2.2)
|
132
145
|
rack-protection (= 2.2.4)
|
133
146
|
tilt (~> 2.0)
|
134
147
|
sparsify (1.1.0)
|
135
|
-
|
136
|
-
|
137
|
-
tilt (2.3.0)
|
148
|
+
thor (1.3.2)
|
149
|
+
tilt (2.6.0)
|
138
150
|
tzinfo (2.0.6)
|
139
151
|
concurrent-ruby (~> 1.0)
|
140
|
-
waterdrop (1.4.
|
152
|
+
waterdrop (1.4.4)
|
141
153
|
delivery_boy (>= 0.2, < 2.x)
|
142
|
-
dry-configurable (~> 0.
|
143
|
-
dry-monitor (~> 0.
|
144
|
-
dry-validation (~> 1.
|
145
|
-
ruby-kafka (>=
|
146
|
-
zeitwerk (~> 2.
|
147
|
-
webmock (3.
|
154
|
+
dry-configurable (~> 0.13)
|
155
|
+
dry-monitor (~> 0.5)
|
156
|
+
dry-validation (~> 1.7)
|
157
|
+
ruby-kafka (>= 1.3.0)
|
158
|
+
zeitwerk (~> 2.4)
|
159
|
+
webmock (3.25.0)
|
148
160
|
addressable (>= 2.8.0)
|
149
161
|
crack (>= 0.3.2)
|
150
162
|
hashdiff (>= 0.4.0, < 2.0.0)
|
151
|
-
zeitwerk (2.6.
|
163
|
+
zeitwerk (2.6.18)
|
152
164
|
|
153
165
|
PLATFORMS
|
154
166
|
x86_64-linux
|
155
167
|
|
156
168
|
DEPENDENCIES
|
157
|
-
rimless (~> 1.
|
169
|
+
rimless (~> 1.11)
|
158
170
|
thor (~> 1.1)
|
159
171
|
|
160
172
|
BUNDLED WITH
|
161
|
-
2.
|
173
|
+
2.4.22
|
@@ -16,7 +16,9 @@ sudo sed -i 's/autostart=.*/autostart=false/g' /etc/supervisor/conf.d/*
|
|
16
16
|
sudo supervisord >/dev/null 2>&1 &
|
17
17
|
|
18
18
|
# Wait for supervisord
|
19
|
-
while ! supervisorctl status >/dev/null 2>&1; do
|
19
|
+
while ! (sudo supervisorctl status | grep avahi) >/dev/null 2>&1; do
|
20
|
+
sleep 1
|
21
|
+
done
|
20
22
|
|
21
23
|
# Boot the mDNS stack
|
22
24
|
echo '# Start the mDNS stack'
|
data/lib/rimless/avro_utils.rb
CHANGED
@@ -51,7 +51,7 @@ module Rimless
|
|
51
51
|
# @param dest [Pathname, File, IO] the file to check
|
52
52
|
# @raise [JSON::ParserError] when invalid
|
53
53
|
#
|
54
|
-
# rubocop:disable Security/JSONLoad because we wrote the file contents
|
54
|
+
# rubocop:disable Security/JSONLoad -- because we wrote the file contents
|
55
55
|
def validate_file(dest)
|
56
56
|
JSON.load(dest)
|
57
57
|
rescue JSON::ParserError => e
|
@@ -18,7 +18,7 @@ module Karafka
|
|
18
18
|
#
|
19
19
|
# @param cli_class [Karafka::Cli] the class to bind to
|
20
20
|
#
|
21
|
-
# rubocop:disable Metrics/MethodLength because of the
|
21
|
+
# rubocop:disable Metrics/MethodLength -- because of the
|
22
22
|
# monkey-patching logic
|
23
23
|
def bind_to(cli_class)
|
24
24
|
@aliases ||= []
|
@@ -3,9 +3,9 @@
|
|
3
3
|
module Rimless
|
4
4
|
# The top-level configuration handling.
|
5
5
|
#
|
6
|
-
# rubocop:disable Style/ClassVars because we split module code
|
7
|
-
# rubocop:disable Metrics/BlockLength because this is how
|
8
|
-
#
|
6
|
+
# rubocop:disable Style/ClassVars -- because we split module code
|
7
|
+
# rubocop:disable Metrics/BlockLength -- because this is how an
|
8
|
+
# +ActiveSupport::Concern+ looks like
|
9
9
|
module ConfigurationHandling
|
10
10
|
extend ActiveSupport::Concern
|
11
11
|
|
data/lib/rimless/consumer.rb
CHANGED
@@ -4,7 +4,7 @@ module Rimless
|
|
4
4
|
# The global rimless Apache Kafka consumer application based on
|
5
5
|
# the Karafka framework.
|
6
6
|
#
|
7
|
-
# rubocop:disable Style/ClassVars because we just work as a singleton
|
7
|
+
# rubocop:disable Style/ClassVars -- because we just work as a singleton
|
8
8
|
class ConsumerApp < ::Karafka::App
|
9
9
|
# We track our own initialization with this class variable
|
10
10
|
@@rimless_initialized = false
|
@@ -66,8 +66,8 @@ module Rimless
|
|
66
66
|
|
67
67
|
# Configure the pure basics on the Karafka application.
|
68
68
|
#
|
69
|
-
# rubocop:disable Metrics/MethodLength because of the various settings
|
70
|
-
# rubocop:disable Metrics/AbcSize dito
|
69
|
+
# rubocop:disable Metrics/MethodLength -- because of the various settings
|
70
|
+
# rubocop:disable Metrics/AbcSize -- dito
|
71
71
|
def initialize_karafka!
|
72
72
|
setup do |config|
|
73
73
|
mapper = Rimless::Karafka::PassthroughMapper.new
|
@@ -137,7 +137,7 @@ module Rimless
|
|
137
137
|
# @param topics [Hash{Hash => Class}] the topic to consumer mapping
|
138
138
|
# @yield the given block on the routing table
|
139
139
|
#
|
140
|
-
# rubocop:disable Metrics/MethodLength because of the Karafka DSL
|
140
|
+
# rubocop:disable Metrics/MethodLength -- because of the Karafka DSL
|
141
141
|
def topics(topics = [], &block)
|
142
142
|
consumer_groups.draw do
|
143
143
|
consumer_group(Rimless.configuration.client_id) do
|
data/lib/rimless/dependencies.rb
CHANGED
@@ -3,7 +3,8 @@
|
|
3
3
|
module Rimless
|
4
4
|
# The top-level dependencies helpers.
|
5
5
|
#
|
6
|
-
# rubocop:disable Metrics/BlockLength because its an Active Support
|
6
|
+
# rubocop:disable Metrics/BlockLength -- because its an Active Support
|
7
|
+
# concern
|
7
8
|
module Dependencies
|
8
9
|
extend ActiveSupport::Concern
|
9
10
|
|
@@ -18,7 +19,7 @@ module Rimless
|
|
18
19
|
|
19
20
|
# Set sensible defaults for the +WaterDrop+ gem.
|
20
21
|
#
|
21
|
-
# rubocop:disable Metrics/AbcSize because of the configuration mapping
|
22
|
+
# rubocop:disable Metrics/AbcSize -- because of the configuration mapping
|
22
23
|
def configure_waterdrop
|
23
24
|
# Skip WaterDrop configuration when no brokers/client id is available,
|
24
25
|
# because it will raise. Its fine to have none available for situations
|
@@ -5,7 +5,8 @@ module Rimless
|
|
5
5
|
module KafkaHelpers
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
|
8
|
-
# rubocop:disable Metrics/BlockLength because its an Active Support
|
8
|
+
# rubocop:disable Metrics/BlockLength -- because its an Active Support
|
9
|
+
# concern
|
9
10
|
class_methods do
|
10
11
|
# Generate a common topic name for Apache Kafka while taking care of
|
11
12
|
# configured prefixes.
|
@@ -22,10 +23,11 @@ module Rimless
|
|
22
23
|
# @example Full name - use as is
|
23
24
|
# Rimless.topic(full_name: 'my.custom.topic.name')
|
24
25
|
#
|
25
|
-
# rubocop:disable Metrics/MethodLength because of the usage
|
26
|
-
#
|
27
|
-
# rubocop:disable Metrics/
|
28
|
-
# rubocop:disable Metrics/
|
26
|
+
# rubocop:disable Metrics/MethodLength -- because of the usage
|
27
|
+
# flexibility
|
28
|
+
# rubocop:disable Metrics/AbcSize -- dito
|
29
|
+
# rubocop:disable Metrics/CyclomaticComplexity -- dito
|
30
|
+
# rubocop:disable Metrics/PerceivedComplexity -- dito
|
29
31
|
def topic(*args)
|
30
32
|
opts = args.last
|
31
33
|
name = args.first if [String, Symbol].member?(args.first.class)
|
@@ -5,7 +5,7 @@ module Rimless
|
|
5
5
|
# Allow the +karafka-sidekiq-backend+ gem to transfer binary Apache Kafka
|
6
6
|
# messages to the actual Sidekiq job.
|
7
7
|
#
|
8
|
-
# rubocop:disable Security/MarshalLoad because we encode/decode the
|
8
|
+
# rubocop:disable Security/MarshalLoad -- because we encode/decode the
|
9
9
|
# messages in our own controlled context
|
10
10
|
class Base64Interchanger < ::Karafka::Interchanger
|
11
11
|
# Encode a binary Apache Kafka message(s) so they can be passed to the
|
@@ -22,8 +22,9 @@ module Rimless
|
|
22
22
|
# topic (full as string, or parts via hash)
|
23
23
|
# @return [OpenStruct] the fake deserialized Kafka message
|
24
24
|
#
|
25
|
-
# rubocop:disable Metrics/MethodLength because of the various
|
26
|
-
#
|
25
|
+
# rubocop:disable Metrics/MethodLength -- because of the various
|
26
|
+
# properties
|
27
|
+
# rubocop:disable Style/OpenStructUse -- because existing specs may rely
|
27
28
|
# on this data type
|
28
29
|
def kafka_message(topic: nil, headers: {}, **payload)
|
29
30
|
OpenStruct.new(
|
@@ -7,7 +7,8 @@ module Rimless
|
|
7
7
|
module Matchers
|
8
8
|
# The Apache Kafka message expectation.
|
9
9
|
#
|
10
|
-
# rubocop:disable Metrics/ClassLength because its almost RSpec API
|
10
|
+
# rubocop:disable Metrics/ClassLength -- because its almost RSpec API
|
11
|
+
# code
|
11
12
|
class HaveSentKafkaMessage < ::RSpec::Matchers::BuiltIn::BaseMatcher
|
12
13
|
include ::RSpec::Mocks::ExampleMethods
|
13
14
|
|
@@ -215,7 +216,7 @@ module Rimless
|
|
215
216
|
|
216
217
|
# Setup the +WaterDrop+ spies and record each sent message.
|
217
218
|
# because of the message decoding
|
218
|
-
# rubocop:disable Metrics/MethodLength dito
|
219
|
+
# rubocop:disable Metrics/MethodLength -- dito
|
219
220
|
def listen_to_messages
|
220
221
|
decode = proc do |encoded|
|
221
222
|
{ encoded_data: encoded, data: Rimless.avro.decode(encoded) }
|
@@ -290,7 +291,7 @@ module Rimless
|
|
290
291
|
#
|
291
292
|
# @param schema [String, Symbol, nil] the Apache Avro schema to check
|
292
293
|
#
|
293
|
-
# rubocop:disable Naming/PredicateName because its a RSpec matcher
|
294
|
+
# rubocop:disable Naming/PredicateName -- because its a RSpec matcher
|
294
295
|
def have_sent_kafka_message(schema = nil)
|
295
296
|
HaveSentKafkaMessage.new(schema)
|
296
297
|
end
|
data/lib/rimless/rspec.rb
CHANGED
@@ -2,20 +2,29 @@
|
|
2
2
|
|
3
3
|
require 'webmock'
|
4
4
|
require 'webmock/rspec'
|
5
|
-
require 'avro_turf/test/fake_confluent_schema_registry_server'
|
6
5
|
require 'rimless'
|
7
6
|
require 'rimless/rspec/helpers'
|
8
7
|
require 'rimless/rspec/matchers'
|
9
8
|
require 'karafka/testing/rspec/helpers'
|
10
9
|
|
10
|
+
# This fake schema registry server uses Sinatra but the gem does not include
|
11
|
+
# this dependency as runtime, just as development. Therefore we added it.
|
12
|
+
require 'avro_turf/test/fake_confluent_schema_registry_server'
|
13
|
+
|
14
|
+
# Add a monkey patch to add propper Sinatra 4.x support
|
15
|
+
class FakeConfluentSchemaRegistryServer
|
16
|
+
# Allow any host name on tests
|
17
|
+
set :host_authorization, { permitted_hosts: [] }
|
18
|
+
end
|
19
|
+
|
11
20
|
# RSpec 1.x and 2.x compatibility
|
12
21
|
#
|
13
22
|
# @see http://bit.ly/2GbAYsU
|
14
23
|
raise 'No RSPEC_CONFIGURER is defined, webmock is missing?' \
|
15
24
|
unless defined?(RSPEC_CONFIGURER)
|
16
25
|
|
17
|
-
# rubocop:disable Metrics/BlockLength because we have to configure
|
18
|
-
#
|
26
|
+
# rubocop:disable Metrics/BlockLength -- because we have to configure RSpec
|
27
|
+
# properly
|
19
28
|
RSPEC_CONFIGURER.configure do |config|
|
20
29
|
config.include Rimless::RSpec::Helpers
|
21
30
|
config.include Rimless::RSpec::Matchers
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
namespace :rimless do
|
4
|
-
# rubocop:disable Rails/RakeEnvironment because this is just an command
|
4
|
+
# rubocop:disable Rails/RakeEnvironment -- because this is just an command
|
5
5
|
# proxy, no need for an application bootstrap
|
6
6
|
desc 'Start the Apache Kafka consumer'
|
7
7
|
task :consumer do
|
@@ -18,8 +18,8 @@ namespace :rimless do
|
|
18
18
|
FileUtils.copy(src, dest)
|
19
19
|
end
|
20
20
|
|
21
|
-
# rubocop:disable Rails/RakeEnvironment because this is just an
|
22
|
-
#
|
21
|
+
# rubocop:disable Rails/RakeEnvironment -- because this is just an helper
|
22
|
+
# command, no need for an application bootstrap
|
23
23
|
desc 'Install the Rimless consumer components'
|
24
24
|
task :install do
|
25
25
|
install_template('karafka.rb')
|
@@ -3,8 +3,8 @@
|
|
3
3
|
if defined?(Rails) && Rails.env.development?
|
4
4
|
require 'rspec/core/rake_task'
|
5
5
|
|
6
|
-
# rubocop:disable Rails/RakeEnvironment because this is just an
|
7
|
-
#
|
6
|
+
# rubocop:disable Rails/RakeEnvironment -- because this is just an helper
|
7
|
+
# command, no need for an application bootstrap
|
8
8
|
task :stats do
|
9
9
|
require 'rails/code_statistics'
|
10
10
|
|
data/lib/rimless/version.rb
CHANGED
data/lib/rimless.rb
CHANGED
data/rimless.gemspec
CHANGED
@@ -42,7 +42,7 @@ Gem::Specification.new do |spec|
|
|
42
42
|
spec.add_dependency 'karafka-testing', '~> 1.4'
|
43
43
|
spec.add_dependency 'mutex_m', '~> 0.3.0'
|
44
44
|
spec.add_dependency 'retries', '>= 0.0.5'
|
45
|
-
spec.add_dependency 'sinatra', '
|
45
|
+
spec.add_dependency 'sinatra', '>= 2.2'
|
46
46
|
spec.add_dependency 'sparsify', '~> 1.1'
|
47
47
|
spec.add_dependency 'waterdrop', '~> 1.4'
|
48
48
|
spec.add_dependency 'webmock', '~> 3.18'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rimless
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hermann Mayer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -118,14 +118,14 @@ dependencies:
|
|
118
118
|
name: sinatra
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
121
|
-
- - "
|
121
|
+
- - ">="
|
122
122
|
- !ruby/object:Gem::Version
|
123
123
|
version: '2.2'
|
124
124
|
type: :runtime
|
125
125
|
prerelease: false
|
126
126
|
version_requirements: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
|
-
- - "
|
128
|
+
- - ">="
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '2.2'
|
131
131
|
- !ruby/object:Gem::Dependency
|