railway-ipc 0.1.6 → 0.1.7
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/CHANGELOG.MD +7 -0
- data/Gemfile.lock +2 -2
- data/README.md +1 -1
- data/lib/railway_ipc/publisher.rb +23 -0
- data/lib/railway_ipc/version.rb +1 -1
- metadata +7 -6
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 2d54b5628ec775d68214605d423ffaea0cd56296efce288d9f6d225a3fe5b68a
         | 
| 4 | 
            +
              data.tar.gz: b8fce8f52051eb667daa678b931ec24c3fa5de54783918849f618407e5b81863
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 68e7d82e728b4c3ace10b7c1926672c301bcd5090aa0bfc80b80485936c476fbf59c97493fe7d1eaaf7874620cf967b9b6ee2f95923cbeefff498248732c47e1
         | 
| 7 | 
            +
              data.tar.gz: 2780cc3cf0d29b4abfda4fecc2d28a119e08d5592a87b6cba3ebf3c868bdea208c9f3c00ddf4708f35aa6f6b9e21defbd25baf2708006c725c6aec164038563d
         | 
    
        data/CHANGELOG.MD
    ADDED
    
    
    
        data/Gemfile.lock
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            PATH
         | 
| 2 2 | 
             
              remote: .
         | 
| 3 3 | 
             
              specs:
         | 
| 4 | 
            -
                railway-ipc (0.1. | 
| 4 | 
            +
                railway-ipc (0.1.7)
         | 
| 5 5 | 
             
                  bunny (~> 2.2.0)
         | 
| 6 6 | 
             
                  sneakers (~> 2.3.5)
         | 
| 7 7 |  | 
| @@ -45,7 +45,7 @@ GEM | |
| 45 45 | 
             
                  i18n (>= 0.7, < 2)
         | 
| 46 46 | 
             
                  minitest (~> 5.1)
         | 
| 47 47 | 
             
                  tzinfo (~> 1.1)
         | 
| 48 | 
            -
                amq-protocol (2.3. | 
| 48 | 
            +
                amq-protocol (2.3.1)
         | 
| 49 49 | 
             
                arel (7.1.4)
         | 
| 50 50 | 
             
                builder (3.2.4)
         | 
| 51 51 | 
             
                bunny (2.2.2)
         | 
    
        data/README.md
    CHANGED
    
    | @@ -32,7 +32,7 @@ require "railway_ipc" | |
| 32 32 | 
             
            * Create RabbitMQ connection credentials for Railway and set the environment variable:
         | 
| 33 33 |  | 
| 34 34 | 
             
            ```
         | 
| 35 | 
            -
             | 
| 35 | 
            +
            RAILWAY_RABBITMQ_CONNECTION_URL=amqp://<railway_user>:<railway_password>@localhost:5672
         | 
| 36 36 | 
             
            ```
         | 
| 37 37 |  | 
| 38 38 | 
             
            * Load table migrations and migrate by executing:
         | 
| @@ -18,7 +18,10 @@ module RailwayIpc | |
| 18 18 | 
             
                end
         | 
| 19 19 |  | 
| 20 20 | 
             
                def publish(message, published_message_store=RailwayIpc::PublishedMessage)
         | 
| 21 | 
            +
                  ensure_message_uuid(message)
         | 
| 22 | 
            +
                  ensure_correlation_id(message)
         | 
| 21 23 | 
             
                  RailwayIpc.logger.info(message, 'Publishing message')
         | 
| 24 | 
            +
             | 
| 22 25 | 
             
                  result = super(RailwayIpc::Rabbitmq::Payload.encode(message))
         | 
| 23 26 | 
             
                  published_message_store.store_message(self.class.exchange_name, message)
         | 
| 24 27 | 
             
                  result
         | 
| @@ -26,5 +29,25 @@ module RailwayIpc | |
| 26 29 | 
             
                  RailwayIpc.logger.error(message, 'Invalid protobuf')
         | 
| 27 30 | 
             
                  raise e
         | 
| 28 31 | 
             
                end
         | 
| 32 | 
            +
             | 
| 33 | 
            +
                private
         | 
| 34 | 
            +
             | 
| 35 | 
            +
                def ensure_message_uuid(message)
         | 
| 36 | 
            +
                  if message.uuid.blank?
         | 
| 37 | 
            +
                    message.uuid = SecureRandom.uuid
         | 
| 38 | 
            +
                    message
         | 
| 39 | 
            +
                  else
         | 
| 40 | 
            +
                    message
         | 
| 41 | 
            +
                  end
         | 
| 42 | 
            +
                end
         | 
| 43 | 
            +
             | 
| 44 | 
            +
                def ensure_correlation_id(message)
         | 
| 45 | 
            +
                  if message.correlation_id.blank?
         | 
| 46 | 
            +
                    message.correlation_id = SecureRandom.uuid
         | 
| 47 | 
            +
                    message
         | 
| 48 | 
            +
                  else
         | 
| 49 | 
            +
                    message
         | 
| 50 | 
            +
                  end
         | 
| 51 | 
            +
                end
         | 
| 29 52 | 
             
              end
         | 
| 30 53 | 
             
            end
         | 
    
        data/lib/railway_ipc/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: railway-ipc
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.7
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - ''
         | 
| 8 | 
            -
            autorequire: | 
| 8 | 
            +
            autorequire:
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2020- | 
| 11 | 
            +
            date: 2020-06-29 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rake
         | 
| @@ -215,6 +215,7 @@ files: | |
| 215 215 | 
             
            - ".gitignore"
         | 
| 216 216 | 
             
            - ".rspec"
         | 
| 217 217 | 
             
            - ".travis.yml"
         | 
| 218 | 
            +
            - CHANGELOG.MD
         | 
| 218 219 | 
             
            - CODE_OF_CONDUCT.md
         | 
| 219 220 | 
             
            - Gemfile
         | 
| 220 221 | 
             
            - Gemfile.lock
         | 
| @@ -265,7 +266,7 @@ licenses: | |
| 265 266 | 
             
            - MIT
         | 
| 266 267 | 
             
            metadata:
         | 
| 267 268 | 
             
              allowed_push_host: https://rubygems.org/
         | 
| 268 | 
            -
            post_install_message: | 
| 269 | 
            +
            post_install_message:
         | 
| 269 270 | 
             
            rdoc_options: []
         | 
| 270 271 | 
             
            require_paths:
         | 
| 271 272 | 
             
            - lib
         | 
| @@ -280,8 +281,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 280 281 | 
             
                - !ruby/object:Gem::Version
         | 
| 281 282 | 
             
                  version: '0'
         | 
| 282 283 | 
             
            requirements: []
         | 
| 283 | 
            -
            rubygems_version: 3. | 
| 284 | 
            -
            signing_key: | 
| 284 | 
            +
            rubygems_version: 3.0.8
         | 
| 285 | 
            +
            signing_key:
         | 
| 285 286 | 
             
            specification_version: 4
         | 
| 286 287 | 
             
            summary: IPC components for Rails
         | 
| 287 288 | 
             
            test_files: []
         |