pub_sub_model_sync 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86dd60cd72d095630d44b3d1d6bb0004f0d7ce35326f5613127815047376530a
4
- data.tar.gz: ef7c8edd08a315adcbad4a4314a467e1564a8dcc2233764ef53d09985a41eaf3
3
+ metadata.gz: e02077ac63ab98c674a0071b440c77da2e269109d8768c738b82362379e2c921
4
+ data.tar.gz: 0d29b69fb65290be2a7a437b87b04d53e4c8a394c98775eb1c98e20d96936866
5
5
  SHA512:
6
- metadata.gz: 690ca42fe8d463cabdaa4e0e557ee1fa19ffa0e1c9a4ad19ee1a1195a7a78faab458ebcd0b0581c39b917ac73c9dc01f408bf1c9ae7f25445b7d20afba2592fe
7
- data.tar.gz: 72d3e0a10a8879f670e65a6f50dbc71e0351893ac1b57dc6fe1796373f7a38d55ecc7a6508c86eba7256dab03c903a42b59f9a0b7a881f6c4c28086b59584049
6
+ metadata.gz: 7e8877f20626a3404f8bb13a897d9e4d5fc28761a18e1cd88253d6210c323d25ac3c793c742ededb2ca11c5500b6997d5cf2c176300b444528ee206f6fdf3f0b
7
+ data.tar.gz: ae8f2610ee4778746b11781cd2f3b1e2bc97352989cc300cbc95b5884568b73f8f9f431d0d2c36d64f720fc777c21897e3f9e579d38e1b622da860dff8a2d75c
@@ -12,14 +12,20 @@ jobs:
12
12
  runs-on: ubuntu-latest
13
13
  strategy:
14
14
  matrix:
15
- ruby: [2.4, 2.5, 2.6]
15
+ ruby: [2.5, 2.6]
16
16
  rails: [4, 5, 6]
17
17
  include:
18
18
  - ruby: 2.7
19
19
  rails: 6
20
+ - ruby: '3.0'
21
+ rails: 6
22
+ - ruby: '3.0'
23
+ rails: 7
20
24
  exclude: # rails 6 requires ruby >= 2.5
21
25
  - ruby: 2.4
22
26
  rails: 6
27
+ - ruby: '3.0'
28
+ rails: 7
23
29
 
24
30
  steps:
25
31
  - uses: actions/checkout@v2
data/gemfiles/Gemfile_4 CHANGED
@@ -5,7 +5,6 @@ gem 'bunny' # rabbit-mq
5
5
  gem 'google-cloud-pubsub' # google pub/sub
6
6
  gem 'ruby-kafka' # kafka pub/sub
7
7
  gem 'rails', '~> 4'
8
- gem 'bundler'
9
8
  gem 'sqlite3', '1.3.13'
10
9
 
11
10
  group :test do
@@ -0,0 +1,14 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'rubocop'
4
+ gem 'bunny' # rabbit-mq
5
+ gem 'google-cloud-pubsub' # google pub/sub
6
+ gem 'ruby-kafka' # kafka pub/sub
7
+ gem 'rails', '~> 7'
8
+
9
+ group :test do
10
+ gem 'database_cleaner-active_record'
11
+ end
12
+
13
+ # Specify your gem's dependencies in pub_sub_model_sync.gemspec
14
+ gemspec
@@ -34,7 +34,7 @@ module PubSubModelSync
34
34
  # @param key (String, Nil)
35
35
  # @return (Transaction)
36
36
  def init_transaction(key, settings = {})
37
- new_transaction = PubSubModelSync::Transaction.new(key, settings)
37
+ new_transaction = PubSubModelSync::Transaction.new(key, **settings)
38
38
  if current_transaction
39
39
  current_transaction.add_transaction(new_transaction)
40
40
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PubSubModelSync
4
- VERSION = '1.2.1'
4
+ VERSION = '1.3.0'
5
5
  end
data/samples/README.md CHANGED
@@ -2,13 +2,27 @@
2
2
  This is a sample to sync information between rails applications using RabbitMQ
3
3
 
4
4
  ## Installation
5
- * Create manually the required network to share rabbitMQ (just if not exist):
5
+ 1. Create manually the required network to share rabbitMQ accross Rails applications (just if not exist):
6
6
  ```docker network create shared_app_services```
7
7
 
8
- * Start RabbitMQ server
8
+ 2. Start RabbitMQ server
9
9
  ```cd samples/app1 && docker-compose up pubsub```
10
10
 
11
- * In another tab access to App1 to publish notifications (Wait for step 2)
11
+ 3. In another tab access to App2 to listen notifications (Wait for step 2)
12
+ - Access to the folder
13
+ `cd samples/app2`
14
+
15
+ - Build docker and start listener (Received notifications will be printed here)
16
+ ```docker-compose run listener```
17
+
18
+ - Optional: Open another tab to access application to ensure synced data
19
+ ```docker-compose run listener bash -c "rails c```
20
+ ```ruby
21
+ user = User.last.inspect
22
+ user.posts.inspect
23
+ ```
24
+
25
+ 4. In another tab access to App1 to publish notifications (Wait for step 2)
12
26
  - Access to the application
13
27
  `cd samples/app1`
14
28
 
@@ -33,18 +47,4 @@ This is a sample to sync information between rails applications using RabbitMQ
33
47
  ```ruby
34
48
  user.destroy!
35
49
  ```
36
-
37
- * In another tab access to App2 to listen notifications (Wait for step 2)
38
- - Access to the folder
39
- `cd samples/app2`
40
-
41
- - Build docker and start listener (Received notifications will be printed here)
42
- ```docker-compose run listener```
43
50
 
44
- - Optional: Open another tab to access application to ensure synced data
45
- ```docker-compose run listener bash -c "rails c```
46
- ```ruby
47
- user = User.last.inspect
48
- user.posts.inspect
49
- ```
50
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pub_sub_model_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Owen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-28 00:00:00.000000000 Z
11
+ date: 2022-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -107,6 +107,7 @@ files:
107
107
  - gemfiles/Gemfile_4
108
108
  - gemfiles/Gemfile_5
109
109
  - gemfiles/Gemfile_6
110
+ - gemfiles/Gemfile_7
110
111
  - lib/pub_sub_model_sync.rb
111
112
  - lib/pub_sub_model_sync/base.rb
112
113
  - lib/pub_sub_model_sync/config.rb