rimless 2.0.0 → 2.1.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: d60741a8100159c3924d5e27ccd2d8b5c6f6fc8594bd1b26e9ee722073bf8b53
4
- data.tar.gz: 651bb8b591272452e2c6a044008d31b7885bbac63af472a2abca9976c069716e
3
+ metadata.gz: dfed89b34243fa4fd3232152dfd848d95bafc3b4d4a8190708b2d1679e052457
4
+ data.tar.gz: 4d2186084e65445e3ebc300ecdf229afe35d602c91e39422ee6010ce43a8ead3
5
5
  SHA512:
6
- metadata.gz: bd2f29e6219fe3afdfa3eaa86478dcd3216c0aacfcd536660d573eae17c4020e21a8cebdb2418108c1767f28f156b4c266042d1fb41485d3bfad9fcf11a69559
7
- data.tar.gz: acdea15705ea5b79cec433d6f10a2ba577ca87b9cce29da42ca531cb1b1d2a1ec8d58e876a2e4c4233471db759495d8d8bc3a84f6365a682ed63b41e93d19c63
6
+ metadata.gz: 2c15140a5b0f189dce414dd00e40a678c7f345dc3d91ccf9fbde5476aa4075569ff0edbadbfcc5d0f6bbc1f6a5141b9df1f54ff609638038e60272775f65ffbf
7
+ data.tar.gz: 54b265581fbacbdd6486212d1867946f472295af8002e8a60f63a21a73f784fc2684c6502ac5369edb69fd3b0148473c17ea340f8dded94577ed7e71f0fbb7dc
@@ -16,7 +16,7 @@ jobs:
16
16
  docs:
17
17
  name: Release the gem
18
18
  runs-on: ubuntu-22.04
19
- timeout-minutes: 5
19
+ timeout-minutes: 10
20
20
  steps:
21
21
  - uses: actions/checkout@v4
22
22
 
@@ -19,7 +19,7 @@ jobs:
19
19
  fail-fast: false
20
20
  matrix:
21
21
  ruby: ['3.2', '3.3', '3.4']
22
- rails: ['7.1', '7.2', '8.0']
22
+ rails: ['7.1', '7.2', '8.0', '8.1']
23
23
  env:
24
24
  BUNDLE_GEMFILE: 'gemfiles/rails_${{ matrix.rails }}.gemfile'
25
25
  steps:
data/.rubocop.yml CHANGED
@@ -13,7 +13,7 @@ AllCops:
13
13
  SuggestExtensions: false
14
14
  DisplayCopNames: true
15
15
  TargetRubyVersion: 3.2
16
- TargetRailsVersion: 6.1
16
+ TargetRailsVersion: 7.1
17
17
  Exclude:
18
18
  - bin/**/*
19
19
  - vendor/**/*
data/Appraisals CHANGED
@@ -14,3 +14,8 @@ appraise 'rails-8.0' do
14
14
  gem 'activesupport', '~> 8.0.0'
15
15
  gem 'railties', '~> 8.0.0'
16
16
  end
17
+
18
+ appraise 'rails-8.1' do
19
+ gem 'activesupport', '~> 8.1.0'
20
+ gem 'railties', '~> 8.1.0'
21
+ end
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  * TODO: Replace this bullet point with an actual description of a change.
4
4
 
5
+ ### 2.1.0 (23 October 2025)
6
+
7
+ * Added support for Rails 8.1 ([#60](https://github.com/hausgold/rimless/pull/60))
8
+ * Switched from `ActiveSupport::Configurable` to a custom implementation based
9
+ on `ActiveSupport::OrderedOptions` ([#61](https://github.com/hausgold/rimless/pull/61))
10
+
5
11
  ### 2.0.0 (28 June 2025)
6
12
 
7
13
  * Corrected some RuboCop glitches ([#58](https://github.com/hausgold/rimless/pull/58))
data/Gemfile CHANGED
@@ -10,7 +10,7 @@ gemspec
10
10
  # Development dependencies
11
11
  gem 'appraisal', '~> 2.4'
12
12
  gem 'bundler', '~> 2.6'
13
- gem 'countless', '~> 2.0'
13
+ gem 'countless', '~> 2.2'
14
14
  gem 'factory_bot', '~> 6.2'
15
15
  gem 'guard-rspec', '~> 4.7'
16
16
  gem 'railties', '>= 7.1'
@@ -4,7 +4,7 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal", "~> 2.4"
6
6
  gem "bundler", "~> 2.6"
7
- gem "countless", "~> 2.0"
7
+ gem "countless", "~> 2.2"
8
8
  gem "factory_bot", "~> 6.2"
9
9
  gem "guard-rspec", "~> 4.7"
10
10
  gem "railties", "~> 7.1.0"
@@ -4,7 +4,7 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal", "~> 2.4"
6
6
  gem "bundler", "~> 2.6"
7
- gem "countless", "~> 2.0"
7
+ gem "countless", "~> 2.2"
8
8
  gem "factory_bot", "~> 6.2"
9
9
  gem "guard-rspec", "~> 4.7"
10
10
  gem "railties", "~> 7.2.0"
@@ -4,7 +4,7 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "appraisal", "~> 2.4"
6
6
  gem "bundler", "~> 2.6"
7
- gem "countless", "~> 2.0"
7
+ gem "countless", "~> 2.2"
8
8
  gem "factory_bot", "~> 6.2"
9
9
  gem "guard-rspec", "~> 4.7"
10
10
  gem "railties", "~> 8.0.0"
@@ -0,0 +1,24 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal", "~> 2.4"
6
+ gem "bundler", "~> 2.6"
7
+ gem "countless", "~> 2.2"
8
+ gem "factory_bot", "~> 6.2"
9
+ gem "guard-rspec", "~> 4.7"
10
+ gem "railties", "~> 8.1.0"
11
+ gem "rake", "~> 13.0"
12
+ gem "redcarpet", "~> 3.5"
13
+ gem "rspec", "~> 3.12"
14
+ gem "rubocop"
15
+ gem "rubocop-rails"
16
+ gem "rubocop-rspec"
17
+ gem "simplecov", ">= 0.22"
18
+ gem "timecop", ">= 0.9.6"
19
+ gem "vcr", "~> 6.0"
20
+ gem "yard", ">= 0.9.28"
21
+ gem "yard-activesupport-concern", ">= 0.0.1"
22
+ gem "activesupport", "~> 8.1.0"
23
+
24
+ gemspec path: "../"
@@ -2,8 +2,46 @@
2
2
 
3
3
  module Rimless
4
4
  # The configuration for the rimless gem.
5
- class Configuration
6
- include ActiveSupport::Configurable
5
+ class Configuration < ActiveSupport::OrderedOptions
6
+ # Track our configurations settings (+Symbol+ keys) and their defaults as
7
+ # lazy-loaded +Proc+'s values
8
+ class_attribute :defaults,
9
+ instance_reader: true,
10
+ instance_writer: false,
11
+ instance_predicate: false,
12
+ default: {}
13
+
14
+ # Create a new +Configuration+ instance with all settings populated with
15
+ # their respective defaults.
16
+ #
17
+ # @param args [Hash{Symbol => Mixed}] additional settings which
18
+ # overwrite the defaults
19
+ # @return [Configuration] the new configuration instance
20
+ def initialize(**args)
21
+ super()
22
+ defaults.each { |key, default| self[key] = instance_exec(&default) }
23
+ merge!(**args)
24
+ end
25
+
26
+ # A simple DSL method to define new configuration accessors/settings with
27
+ # their defaults. The defaults can be retrieved with
28
+ # +Configuration.defaults+ or +Configuration.new.defaults+.
29
+ #
30
+ # @param name [Symbol, String] the name of the configuration
31
+ # accessor/setting
32
+ # @param default [Mixed, nil] a non-lazy-loaded static value, serving as a
33
+ # default value for the setting
34
+ # @param block [Proc] when given, the default value will be lazy-loaded
35
+ # (result of the Proc)
36
+ def self.config_accessor(name, default = nil, &block)
37
+ # Save the given configuration accessor default value
38
+ defaults[name.to_sym] = block || -> { default }
39
+
40
+ # Compile reader/writer methods so we don't have to go through
41
+ # +ActiveSupport::OrderedOptions#method_missing+.
42
+ define_method(name) { self[name] }
43
+ define_method("#{name}=") { |value| self[name] = value }
44
+ end
7
45
 
8
46
  # Used to identity this client on the user agent header
9
47
  config_accessor(:app_name) { Rimless.local_app_name }
@@ -67,7 +105,7 @@ module Rimless
67
105
  #
68
106
  # @param val [String, Symbol] the new job queue name
69
107
  def consumer_job_queue=(val)
70
- config.consumer_job_queue = val.to_sym
108
+ self[:consumer_job_queue] = val.to_sym
71
109
  # Refresh the consumer job queue
72
110
  Rimless::ConsumerJob.sidekiq_options(
73
111
  queue: Rimless.configuration.consumer_job_queue
@@ -165,9 +165,6 @@ module Rimless
165
165
  # Perform the result set checking of recorded message which were sent.
166
166
  #
167
167
  # @return [Boolean] the answer
168
- #
169
- # rubocop:disable Naming/PredicateMethod -- because this method performs
170
- # an action, not a predicate check (bool is for error signaling)
171
168
  def check
172
169
  @matching, @unmatching = @messages.partition do |message|
173
170
  schema_match?(message) && arguments_match?(message) &&
@@ -182,7 +179,6 @@ module Rimless
182
179
  when :at_least then @expected_number <= @matching_count
183
180
  end
184
181
  end
185
- # rubocop:enable Naming/PredicateMethod
186
182
 
187
183
  # Check for the expected schema on the given message.
188
184
  #
@@ -3,7 +3,7 @@
3
3
  # The gem version details.
4
4
  module Rimless
5
5
  # The version of the +rimless+ gem
6
- VERSION = '2.0.0'
6
+ VERSION = '2.1.0'
7
7
 
8
8
  class << self
9
9
  # Returns the version of gem as a string.
data/lib/rimless.rb CHANGED
@@ -4,9 +4,10 @@ require 'zeitwerk'
4
4
  require 'logger'
5
5
  require 'active_support'
6
6
  require 'active_support/concern'
7
- require 'active_support/configurable'
7
+ require 'active_support/ordered_options'
8
8
  require 'active_support/time'
9
9
  require 'active_support/time_with_zone'
10
+ require 'active_support/core_ext/class/attribute'
10
11
  require 'active_support/core_ext/object'
11
12
  require 'active_support/core_ext/module'
12
13
  require 'active_support/core_ext/hash'
data/rimless.gemspec CHANGED
@@ -40,7 +40,7 @@ Gem::Specification.new do |spec|
40
40
  spec.add_dependency 'karafka', '~> 1.4', '< 1.4.15'
41
41
  spec.add_dependency 'karafka-sidekiq-backend', '~> 1.4'
42
42
  spec.add_dependency 'karafka-testing', '~> 1.4'
43
- spec.add_dependency 'mutex_m', '~> 0.3.0'
43
+ spec.add_dependency 'mutex_m', '>= 0.3'
44
44
  spec.add_dependency 'retries', '>= 0.0.5'
45
45
  spec.add_dependency 'sinatra', '>= 2.2'
46
46
  spec.add_dependency 'sparsify', '~> 1.1'
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: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hermann Mayer
@@ -89,16 +89,16 @@ dependencies:
89
89
  name: mutex_m
90
90
  requirement: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - "~>"
92
+ - - ">="
93
93
  - !ruby/object:Gem::Version
94
- version: 0.3.0
94
+ version: '0.3'
95
95
  type: :runtime
96
96
  prerelease: false
97
97
  version_requirements: !ruby/object:Gem::Requirement
98
98
  requirements:
99
- - - "~>"
99
+ - - ">="
100
100
  - !ruby/object:Gem::Version
101
- version: 0.3.0
101
+ version: '0.3'
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: retries
104
104
  requirement: !ruby/object:Gem::Requirement
@@ -245,6 +245,7 @@ files:
245
245
  - gemfiles/rails_7.1.gemfile
246
246
  - gemfiles/rails_7.2.gemfile
247
247
  - gemfiles/rails_8.0.gemfile
248
+ - gemfiles/rails_8.1.gemfile
248
249
  - lib/rimless.rb
249
250
  - lib/rimless/avro_helpers.rb
250
251
  - lib/rimless/avro_utils.rb