rimless 3.2.0 → 3.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e998d6e028c6cfc1661ede44cbe302ad1389a21d1300f1e0380f78e65df27d2a
4
- data.tar.gz: 8e101b0dc4deecfe313bd7804cac304ecc1386b0b17c1db8898db1517d5dd502
3
+ metadata.gz: 5d7d34c4154cca4456eb5e21e165bdcc3206ad9746aba7f6bc2c363e3292a692
4
+ data.tar.gz: fad1418db344e29e77e2dc7f20d468f31eb2a34d4fe5260e7b18a0120242cd8e
5
5
  SHA512:
6
- metadata.gz: d07a588b59a74984adcfe0d0c31e7c417fc7ee7817d8970a95e1b3d17b8e9e99225e0824793b650cd8828fd31048710f742305064cb01e2ae7750741d86e7e90
7
- data.tar.gz: 68e2ea87932e37f8a03de78a1725800b77991709a900d03d7b2681aaed93269f7dbe02b93cadbceaade7ddb278b71ecacc975e307a51500b5e79448f18ef934f
6
+ metadata.gz: 3b0619589bb1b8d4c6df09340f6de6956b387858d0d5199f984378ba83cf04520b28d1bc17daa750fe127967c7b40d9ad824a6bbcda15459e0c77d18c7328be9
7
+ data.tar.gz: dc90562a7a290f6175fe2adae8b07d01b89978c885355f70ff924b21222c23cd5ab62c5e50a9bd86553c92750b4d046a446c6822651c84f72d4cd1e766b04dc2
@@ -26,12 +26,12 @@ jobs:
26
26
  settings: '${{ github.repository }}'
27
27
  target: ci/gem-test
28
28
 
29
- - name: Install Ruby 3.3
29
+ - name: Install Ruby 4.0
30
30
  uses: ruby/setup-ruby@v1
31
31
  with:
32
- ruby-version: 3.3
32
+ ruby-version: 4.0
33
33
  bundler-cache: true
34
- rubygems: '3.7.2'
34
+ rubygems: '4.0.11'
35
35
 
36
36
  - name: Switch to SSH remotes for the Git repository
37
37
  run: git-ssh-remotes
@@ -18,8 +18,8 @@ jobs:
18
18
  strategy:
19
19
  fail-fast: false
20
20
  matrix:
21
- ruby: ['3.3', '3.4', '4.0']
22
- rails: ['8.0', '8.1']
21
+ ruby: ['4.0']
22
+ rails: ['8.1']
23
23
  env:
24
24
  BUNDLE_GEMFILE: 'gemfiles/rails_${{ matrix.rails }}.gemfile'
25
25
  steps:
@@ -36,7 +36,7 @@ jobs:
36
36
  with:
37
37
  ruby-version: ${{ matrix.ruby }}
38
38
  bundler-cache: true
39
- rubygems: '3.7.2'
39
+ rubygems: '4.0.11'
40
40
 
41
41
  - name: Run the gem tests
42
42
  run: make test
data/.rubocop.yml CHANGED
@@ -17,8 +17,8 @@ AllCops:
17
17
  NewCops: enable
18
18
  SuggestExtensions: false
19
19
  DisplayCopNames: true
20
- TargetRubyVersion: 3.3
21
- TargetRailsVersion: 8.0
20
+ TargetRubyVersion: 4.0
21
+ TargetRailsVersion: 8.1
22
22
  Exclude:
23
23
  - bin/**/*
24
24
  - vendor/**/*
data/Appraisals CHANGED
@@ -1,10 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- appraise 'rails-8.0' do
4
- gem 'activejob', '~> 8.0.0'
5
- gem 'activesupport', '~> 8.0.0'
6
- end
7
-
8
3
  appraise 'rails-8.1' do
9
4
  gem 'activejob', '~> 8.1.0'
10
5
  gem 'activesupport', '~> 8.1.0'
data/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  * TODO: Replace this bullet point with an actual description of a change.
4
4
 
5
+ ### 3.4.0 (4 May 2026)
6
+
7
+ * Dropped Ruby 3.x and Rails <8.1 support ([#77](https://github.com/hausgold/rimless/pull/77))
8
+
9
+ ### 3.3.0 (16 April 2026)
10
+
11
+ * Added a new configuration (`avro_deserializer_parse_datetimes`) which allows
12
+ to configure the default Apache Avro deserializer to automatically parse
13
+ date/time/datetime's from deeply nested strings (disabled by default for
14
+ compatibility) ([#76](https://github.com/hausgold/rimless/pull/76))
15
+
5
16
  ### 3.2.0 (7 April 2026)
6
17
 
7
18
  * Restored non-buffered (`$stdout.sync = true`) logging to stdout ([#75](https://github.com/hausgold/rimless/pull/75))
data/Dockerfile CHANGED
@@ -1,8 +1,8 @@
1
- FROM hausgold/ruby:3.3
1
+ FROM hausgold/ruby:4.0
2
2
  LABEL org.opencontainers.image.authors="containers@hausgold.de"
3
3
 
4
4
  # Update system gem
5
- RUN gem update --system '3.7.2'
5
+ RUN gem update --system '4.0.11'
6
6
 
7
7
  # Install system packages and the latest bundler
8
8
  RUN apt-get update -yqqq && \
@@ -11,7 +11,7 @@ RUN apt-get update -yqqq && \
11
11
  ca-certificates \
12
12
  bash-completion inotify-tools && \
13
13
  echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && /usr/sbin/locale-gen && \
14
- gem install bundler -v '~> 2.7.2' --no-document --no-prerelease
14
+ gem install bundler -v '~> 4.0.11' --no-document --no-prerelease
15
15
 
16
16
  # Add new web user
17
17
  RUN mkdir /app && \
data/Makefile CHANGED
@@ -118,7 +118,7 @@ test-style: \
118
118
  test-style-ruby:
119
119
  # Run the static code analyzer (rubocop)
120
120
  @$(call run-shell,$(BUNDLE) exec $(RUBOCOP) -a \
121
- || ($(TEST) $$($(RUBY_VERSION)) != '3.3' && true))
121
+ || ($(TEST) $$($(RUBY_VERSION)) != '4.0' && true))
122
122
 
123
123
  clean:
124
124
  # Clean the dependencies
data/README.md CHANGED
@@ -322,13 +322,13 @@ architecture looks like this:
322
322
  |
323
323
  v
324
324
  +-----------------------------+
325
- | Karafka/Rimless Consumer | +--------------------------------------+
326
- | Shares a single consumer |--->| ActiveJob |
327
- | group, multiple processes | | Runs the consumer class (children |
328
- +-----------------------------+ | of Rimless::BaseConsumer) for each |
329
- | message (Rimless::ConsumerJob), |
330
- | one message per job |
331
- +--------------------------------------+
325
+ | Karafka/Rimless Consumer | +----------------------------------------+
326
+ | Shares a single consumer |--->| ActiveJob |
327
+ | group, multiple processes | | Runs the consumer class (children |
328
+ +-----------------------------+ | of Rimless::Consumer::Base) for each |
329
+ | message (Rimless::Consumer::Job), |
330
+ | one message per job |
331
+ +----------------------------------------+
332
332
  ```
333
333
 
334
334
  This architecture allows the consumer process to run mostly non-blocking and
@@ -2,7 +2,7 @@ FROM hausgold/ruby:4.0
2
2
  LABEL org.opencontainers.image.authors="containers@hausgold.de"
3
3
 
4
4
  # Update system gem
5
- RUN gem update --system '4.0.9'
5
+ RUN gem update --system '4.0.11'
6
6
 
7
7
  # Install nodejs 25
8
8
  RUN curl -sL https://deb.nodesource.com/setup_25.x | bash -
@@ -14,7 +14,7 @@ RUN apt-get update -yqqq && \
14
14
  ca-certificates jq curl cmake \
15
15
  bash-completion inotify-tools && \
16
16
  echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && /usr/sbin/locale-gen && \
17
- gem install bundler -v '~> 4.0.9' --no-document --no-prerelease
17
+ gem install bundler -v '~> 4.0.11' --no-document --no-prerelease
18
18
 
19
19
  # Install kcat (formerly known as kafkacat)
20
20
  RUN curl -sL -o - \
@@ -211,4 +211,4 @@ CHECKSUMS
211
211
  zeitwerk (2.7.5) sha256=d8da92128c09ea6ec62c949011b00ed4a20242b255293dd66bf41545398f73dd
212
212
 
213
213
  BUNDLED WITH
214
- 4.0.9
214
+ 4.0.11
@@ -134,6 +134,11 @@ module Rimless
134
134
  Rimless::Consumer::AvroDeserializer
135
135
  end
136
136
 
137
+ # This configuration allows to configure the default Apache Avro
138
+ # deserializer to automatically parse date/time/datetime's from deeply
139
+ # nested strings.
140
+ config_accessor(:avro_deserializer_parse_datetimes) { false }
141
+
137
142
  # The ActiveJob job queue to use for consuming jobs
138
143
  config_accessor(:consumer_job_queue) do
139
144
  ENV.fetch(
@@ -118,10 +118,10 @@ module Rimless
118
118
  # @param topics [Hash{Hash => Class, Proc}] the topic to consumer mapping
119
119
  # @yield the given block on the routing table
120
120
  # @return [Rimless::Consumer::App] the application instance for chaining
121
- def topics(topics = [], &block)
121
+ def topics(topics = [], &)
122
122
  routes.draw do
123
123
  consumer_group(Rimless.configuration.client_id) do
124
- instance_exec(&block) if block_given?
124
+ instance_exec(&) if block_given?
125
125
 
126
126
  topics.each do |topic_parts, dest_consumer|
127
127
  Rimless.consumer.topic_names(topic_parts).each do |topic_name|
@@ -4,6 +4,12 @@ module Rimless
4
4
  module Consumer
5
5
  # A custom Apache Avro compatible message deserializer.
6
6
  class AvroDeserializer
7
+ # The ISO8601 date/time format
8
+ ISO_TIME_FORMAT = /\A\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?/m
9
+
10
+ # The ISO8601 date format
11
+ ISO_DATE_FORMAT = /\A\d{4}-\d{2}-\d{2}\Z/m
12
+
7
13
  # Deserialize an Apache Avro encoded Apache Kafka message.
8
14
  #
9
15
  # @param message [Karafka::Messages::Message] the Karafka message to
@@ -25,6 +31,36 @@ module Rimless
25
31
  .then { |data| data.transform_keys { |key| key.delete('\\') } }
26
32
  .then { |data| Unsparsify(data, sparse_array: true) }
27
33
  .deep_symbolize_keys
34
+ .then do |obj|
35
+ # When the configuration says we should not parse datetimes,
36
+ # we skip further processing
37
+ next obj \
38
+ unless Rimless.configuration.avro_deserializer_parse_datetimes
39
+
40
+ # Otherwise we parse them
41
+ parse_timestamps!(obj)
42
+ end
43
+ end
44
+
45
+ # Search recursively through the given object for ISO date/time string
46
+ # values and replace them with their parsed date representation. This
47
+ # works on hashes, arrays, and combinations of this.
48
+ #
49
+ # @param value [Mixed] the input to process
50
+ # @return [Mixed] the processed input
51
+ def parse_timestamps!(obj)
52
+ case obj
53
+ when Hash
54
+ obj.each { |key, val| obj[key] = parse_timestamps!(val) }
55
+ when Array
56
+ obj.each_with_index { |cur, idx| obj[idx] = parse_timestamps!(cur) }
57
+ when ISO_TIME_FORMAT
58
+ Time.zone.parse(obj)
59
+ when ISO_DATE_FORMAT
60
+ Date.parse(obj)
61
+ else
62
+ obj
63
+ end
28
64
  end
29
65
  end
30
66
  end
@@ -23,7 +23,7 @@ module Rimless
23
23
  # @param schema [String, Symbol] name of the schema that should be used
24
24
  # @param opts [Hash{Symbol => Mixed}] additional options
25
25
  # @return [String] the Apache Avro blob
26
- def avro_encode(data, schema:, **opts)
26
+ def avro_encode(data, schema:, **)
27
27
  data = avro_sanitize(data)
28
28
 
29
29
  # When the deep-relative form (+.deep.deep[..]+) is present, we add
@@ -31,7 +31,7 @@ module Rimless
31
31
  schema = avro_utils.namespace + schema.to_s \
32
32
  if schema.to_s.start_with? '.'
33
33
 
34
- avro.encode(data, schema_name: schema.to_s, **opts)
34
+ avro.encode(data, schema_name: schema.to_s, **)
35
35
  end
36
36
  alias_method :encode, :avro_encode
37
37
 
@@ -40,8 +40,8 @@ module Rimless
40
40
  # @param data [String] the Apache Avro blob
41
41
  # @param opts [Hash{Symbol => Mixed}] additional options
42
42
  # @return [Mixed] the decoded data structure
43
- def avro_decode(data, **opts)
44
- avro.decode(data, **opts).deep_symbolize_keys!
43
+ def avro_decode(data, **)
44
+ avro.decode(data, **).deep_symbolize_keys!
45
45
  end
46
46
  alias_method :decode, :avro_decode
47
47
 
@@ -49,7 +49,7 @@ module Rimless
49
49
  # for situations like Rails asset precompilations, etc. - on runtime
50
50
  # the settings should be available, otherwise the message producing
51
51
  # just fails/raise.
52
- return if Rimless.configuration.kafka_brokers.empty? \
52
+ return if Rimless.configuration.kafka_brokers.empty?
53
53
  || Rimless.configuration.client_id.blank?
54
54
 
55
55
  # Register a global waterdrop producer instance
@@ -4,8 +4,8 @@
4
4
  module Rimless
5
5
  # The version of the +rimless+ gem
6
6
  # TODO: Change back before release.
7
- # VERSION = '3.2.0'
8
- VERSION = '3.2.0'
7
+ # VERSION = '3.4.0'
8
+ VERSION = '3.4.0'
9
9
 
10
10
  class << self
11
11
  # Returns the version of gem as a string.
data/rimless.gemspec CHANGED
@@ -33,10 +33,10 @@ Gem::Specification.new do |spec|
33
33
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
34
34
  spec.require_paths = ['lib']
35
35
 
36
- spec.required_ruby_version = '>= 3.3'
36
+ spec.required_ruby_version = '>= 4.0'
37
37
 
38
- spec.add_dependency 'activejob', '>= 8.0'
39
- spec.add_dependency 'activesupport', '>= 8.0'
38
+ spec.add_dependency 'activejob', '>= 8.1'
39
+ spec.add_dependency 'activesupport', '>= 8.1'
40
40
  spec.add_dependency 'avro_turf', '~> 1.20'
41
41
  spec.add_dependency 'karafka', '~> 2.5'
42
42
  spec.add_dependency 'karafka-testing', '~> 2.5'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rimless
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hermann Mayer
@@ -15,28 +15,28 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '8.0'
18
+ version: '8.1'
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: '8.0'
25
+ version: '8.1'
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: activesupport
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: '8.0'
32
+ version: '8.1'
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '8.0'
39
+ version: '8.1'
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: avro_turf
42
42
  requirement: !ruby/object:Gem::Requirement
@@ -228,7 +228,6 @@ files:
228
228
  - doc/upgrade-guide-sources/dep-karafka-2.0.md
229
229
  - doc/upgrade-guide-sources/dep-waterdrop-2.8.md
230
230
  - docker-compose.yml
231
- - gemfiles/rails_8.0.gemfile
232
231
  - gemfiles/rails_8.1.gemfile
233
232
  - lib/rimless.rb
234
233
  - lib/rimless/avro_utils.rb
@@ -273,14 +272,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
273
272
  requirements:
274
273
  - - ">="
275
274
  - !ruby/object:Gem::Version
276
- version: '3.3'
275
+ version: '4.0'
277
276
  required_rubygems_version: !ruby/object:Gem::Requirement
278
277
  requirements:
279
278
  - - ">="
280
279
  - !ruby/object:Gem::Version
281
280
  version: '0'
282
281
  requirements: []
283
- rubygems_version: 3.7.2
282
+ rubygems_version: 4.0.11
284
283
  specification_version: 4
285
284
  summary: A bundle of opinionated Apache Kafka / Confluent Schema Registry helpers.
286
285
  test_files: []
@@ -1,24 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "appraisal", "~> 2.4"
6
- gem "bundler", ">= 2.6", "< 5"
7
- gem "countless", "~> 2.2"
8
- gem "factory_bot", "~> 6.2"
9
- gem "guard-rspec", "~> 4.7"
10
- gem "rake", "~> 13.0"
11
- gem "redcarpet", "~> 3.5"
12
- gem "rspec", "~> 3.12"
13
- gem "rubocop"
14
- gem "rubocop-rails"
15
- gem "rubocop-rspec"
16
- gem "simplecov", ">= 0.22"
17
- gem "timecop", ">= 0.9.6"
18
- gem "vcr", "~> 6.0"
19
- gem "yard", ">= 0.9.28"
20
- gem "yard-activesupport-concern", ">= 0.0.1"
21
- gem "activejob", "~> 8.0.0"
22
- gem "activesupport", "~> 8.0.0"
23
-
24
- gemspec path: "../"