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 +4 -4
- data/.github/workflows/release.yml +1 -1
- data/.github/workflows/test.yml +1 -1
- data/.rubocop.yml +1 -1
- data/Appraisals +5 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +1 -1
- data/gemfiles/rails_7.1.gemfile +1 -1
- data/gemfiles/rails_7.2.gemfile +1 -1
- data/gemfiles/rails_8.0.gemfile +1 -1
- data/gemfiles/rails_8.1.gemfile +24 -0
- data/lib/rimless/configuration.rb +41 -3
- data/lib/rimless/rspec/matchers.rb +0 -4
- data/lib/rimless/version.rb +1 -1
- data/lib/rimless.rb +2 -1
- data/rimless.gemspec +1 -1
- metadata +6 -5
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: dfed89b34243fa4fd3232152dfd848d95bafc3b4d4a8190708b2d1679e052457
         | 
| 4 | 
            +
              data.tar.gz: 4d2186084e65445e3ebc300ecdf229afe35d602c91e39422ee6010ce43a8ead3
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 2c15140a5b0f189dce414dd00e40a678c7f345dc3d91ccf9fbde5476aa4075569ff0edbadbfcc5d0f6bbc1f6a5141b9df1f54ff609638038e60272775f65ffbf
         | 
| 7 | 
            +
              data.tar.gz: 54b265581fbacbdd6486212d1867946f472295af8002e8a60f63a21a73f784fc2684c6502ac5369edb69fd3b0148473c17ea340f8dded94577ed7e71f0fbb7dc
         | 
    
        data/.github/workflows/test.yml
    CHANGED
    
    
    
        data/.rubocop.yml
    CHANGED
    
    
    
        data/Appraisals
    CHANGED
    
    
    
        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
    
    
    
        data/gemfiles/rails_7.1.gemfile
    CHANGED
    
    
    
        data/gemfiles/rails_7.2.gemfile
    CHANGED
    
    
    
        data/gemfiles/rails_8.0.gemfile
    CHANGED
    
    
| @@ -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 | 
            -
                 | 
| 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 | 
            -
                   | 
| 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 | 
             
                    #
         | 
    
        data/lib/rimless/version.rb
    CHANGED
    
    
    
        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/ | 
| 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', ' | 
| 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. | 
| 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 | 
| 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 | 
| 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
         |