active_outbox 0.0.3 → 0.0.4
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/lib/active_outbox/outboxable.rb +2 -2
- data/lib/active_outbox.rb +8 -1
- metadata +16 -3
- data/lib/active_outbox/configuration.rb +0 -28
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 1b6c2d51498f61533b935cb0d210cbed4c6159eeee4ae9d142e08564c43a7362
         | 
| 4 | 
            +
              data.tar.gz: f12ce116296edaf0100e39e927b3a264fac24cc8c66f778a49a7b5ebe2b008fe
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 5b0583688cda8d0a641e3ff22624d6ae11976bd664a35ff393bd6fa5b1afe4206acda7bb1f9e6cd66b6c0cd6bde77d5ab57920c5ce07be40425f652571ea9fc1
         | 
| 7 | 
            +
              data.tar.gz: 252a0cea22365fdb05527ce7fbe9dd59c63e8560cb6d655d07b81e26f4b95af25b424e8d0f28fe5ae9611731a30c980d44c11145450f8501479b96a82ae3c225
         | 
| @@ -71,11 +71,11 @@ module ActiveOutbox | |
| 71 71 | 
             
                def namespace_outbox_mapping
         | 
| 72 72 | 
             
                  namespace = self.class.name.split('/').first
         | 
| 73 73 |  | 
| 74 | 
            -
                  ActiveOutbox. | 
| 74 | 
            +
                  ActiveOutbox.config.outbox_mapping[namespace&.underscore]
         | 
| 75 75 | 
             
                end
         | 
| 76 76 |  | 
| 77 77 | 
             
                def default_outbox_mapping
         | 
| 78 | 
            -
                  ActiveOutbox. | 
| 78 | 
            +
                  ActiveOutbox.config.outbox_mapping['default']
         | 
| 79 79 | 
             
                end
         | 
| 80 80 |  | 
| 81 81 | 
             
                def handle_outbox_errors(outbox)
         | 
    
        data/lib/active_outbox.rb
    CHANGED
    
    | @@ -1,8 +1,15 @@ | |
| 1 1 | 
             
            # frozen_string_literal: true
         | 
| 2 2 |  | 
| 3 3 | 
             
            require 'active_outbox/adapter_helper'
         | 
| 4 | 
            -
            require 'active_outbox/configuration'
         | 
| 5 4 | 
             
            require 'active_outbox/errors'
         | 
| 6 5 | 
             
            require 'active_outbox/generators/active_outbox_generator'
         | 
| 7 6 | 
             
            require 'active_outbox/outboxable'
         | 
| 8 7 | 
             
            require 'active_outbox/railtie' if defined?(Rails::Railtie)
         | 
| 8 | 
            +
            require 'dry-configurable'
         | 
| 9 | 
            +
             | 
| 10 | 
            +
            module ActiveOutbox
         | 
| 11 | 
            +
              extend Dry::Configurable
         | 
| 12 | 
            +
             | 
| 13 | 
            +
              setting :adapter, default: :sqlite
         | 
| 14 | 
            +
              setting :outbox_mapping, default: {}
         | 
| 15 | 
            +
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,15 +1,29 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: active_outbox
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.4
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Guillermo Aguirre
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2023-10- | 
| 11 | 
            +
            date: 2023-10-23 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 14 | 
            +
              name: dry-configurable
         | 
| 15 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 16 | 
            +
                requirements:
         | 
| 17 | 
            +
                - - "~>"
         | 
| 18 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            +
                    version: '1.0'
         | 
| 20 | 
            +
              type: :runtime
         | 
| 21 | 
            +
              prerelease: false
         | 
| 22 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 | 
            +
                requirements:
         | 
| 24 | 
            +
                - - "~>"
         | 
| 25 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            +
                    version: '1.0'
         | 
| 13 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 28 | 
             
              name: rails
         | 
| 15 29 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -35,7 +49,6 @@ files: | |
| 35 49 | 
             
            - bin/outbox
         | 
| 36 50 | 
             
            - lib/active_outbox.rb
         | 
| 37 51 | 
             
            - lib/active_outbox/adapter_helper.rb
         | 
| 38 | 
            -
            - lib/active_outbox/configuration.rb
         | 
| 39 52 | 
             
            - lib/active_outbox/errors.rb
         | 
| 40 53 | 
             
            - lib/active_outbox/generators/active_outbox_generator.rb
         | 
| 41 54 | 
             
            - lib/active_outbox/generators/templates/migration.rb
         | 
| @@ -1,28 +0,0 @@ | |
| 1 | 
            -
            # frozen_string_literal: true
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            module ActiveOutbox
         | 
| 4 | 
            -
              class << self
         | 
| 5 | 
            -
                attr_accessor :configuration
         | 
| 6 | 
            -
             | 
| 7 | 
            -
                def configuration
         | 
| 8 | 
            -
                  @configuration ||= ActiveOutbox::Configuration.new
         | 
| 9 | 
            -
                end
         | 
| 10 | 
            -
             | 
| 11 | 
            -
                def reset
         | 
| 12 | 
            -
                  @configuration = ActiveOutbox::Configuration.new
         | 
| 13 | 
            -
                end
         | 
| 14 | 
            -
             | 
| 15 | 
            -
                def configure
         | 
| 16 | 
            -
                  yield(configuration)
         | 
| 17 | 
            -
                end
         | 
| 18 | 
            -
              end
         | 
| 19 | 
            -
             | 
| 20 | 
            -
              class Configuration
         | 
| 21 | 
            -
                attr_accessor :adapter, :outbox_mapping
         | 
| 22 | 
            -
             | 
| 23 | 
            -
                def initialize
         | 
| 24 | 
            -
                  @adapter = :sqlite
         | 
| 25 | 
            -
                  @outbox_mapping = {}
         | 
| 26 | 
            -
                end
         | 
| 27 | 
            -
              end
         | 
| 28 | 
            -
            end
         |