pub_sub_model_sync 1.9.1 → 1.9.3
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/ruby.yml +14 -1
- data/Dockerfile +1 -1
- data/Gemfile +2 -1
- data/Gemfile.lock +197 -151
- data/README.md +2 -2
- data/gemfiles/Gemfile_5 +1 -0
- data/gemfiles/Gemfile_6 +1 -0
- data/gemfiles/Gemfile_6_2.6 +15 -0
- data/gemfiles/Gemfile_7 +1 -0
- data/lib/pub_sub_model_sync/mock_google_service.rb +4 -0
- data/lib/pub_sub_model_sync/service_google.rb +17 -9
- data/lib/pub_sub_model_sync/version.rb +1 -1
- data/pub_sub_model_sync.gemspec +0 -1
- metadata +3 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8e6bbfad5a574a8c16a43354f112ce1ecf4c08e500aab68419870d9e5a9070a8
|
|
4
|
+
data.tar.gz: 8e0b394bf8cf6d4eaf7877e34cd8b81d48f6b5ad699355f14109a5ac31ba10ae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 89f8fe49ae4477647043a0ff5d50ec3bb3459dc093c19f861687757c750c32bb48e5ae3e54624725c421f6710c86290adf6f112e36630cfb8c75765356af8495
|
|
7
|
+
data.tar.gz: 29b0d90022cf9611cf469303fc92925bc79e6f9d58d01f104e150dd4bfb1e95500de64bb2bef6cfc8a65015507bfd08c2e8234fe818a8e980b8312c3f553229d
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -10,6 +10,7 @@ jobs:
|
|
|
10
10
|
build:
|
|
11
11
|
name: Tests and Code Style
|
|
12
12
|
runs-on: ubuntu-latest
|
|
13
|
+
#continue-on-error: ${{ matrix.ruby == '2.6' && matrix.rails == '6' }}
|
|
13
14
|
strategy:
|
|
14
15
|
matrix:
|
|
15
16
|
ruby: [2.6]
|
|
@@ -21,6 +22,10 @@ jobs:
|
|
|
21
22
|
rails: 6
|
|
22
23
|
- ruby: '3.0'
|
|
23
24
|
rails: 7
|
|
25
|
+
- ruby: '3.1'
|
|
26
|
+
rails: 7
|
|
27
|
+
- ruby: '2.6'
|
|
28
|
+
rails: 6
|
|
24
29
|
exclude: # rails 6 requires ruby >= 2.5
|
|
25
30
|
- ruby: 2.4
|
|
26
31
|
rails: 6
|
|
@@ -37,10 +42,18 @@ jobs:
|
|
|
37
42
|
- name: Install bundler
|
|
38
43
|
env:
|
|
39
44
|
GEMFILE_PATH: gemfiles/Gemfile_${{ matrix.rails }}
|
|
45
|
+
GEMFILE_PATH_RUBY: gemfiles/Gemfile_${{ matrix.rails }}_${{matrix.ruby}}
|
|
40
46
|
RAILS_V: ${{ matrix.rails }}
|
|
41
47
|
run: |
|
|
42
48
|
rm -f Gemfile.lock && rm -f Gemfile
|
|
43
|
-
|
|
49
|
+
echo "...Looking for $GEMFILE_PATH_RUBY"
|
|
50
|
+
if [ -f "$GEMFILE_PATH_RUBY" ]; then
|
|
51
|
+
echo "......using Gemfile $GEMFILE_PATH_RUBY"
|
|
52
|
+
cp $GEMFILE_PATH_RUBY ./Gemfile
|
|
53
|
+
else
|
|
54
|
+
echo "......using Gemfile $GEMFILE_PATH"
|
|
55
|
+
cp $GEMFILE_PATH ./Gemfile
|
|
56
|
+
fi
|
|
44
57
|
bundler_v='2.1.4'
|
|
45
58
|
if [ $RAILS_V = "4" ]; then bundler_v="1.16.6"; fi
|
|
46
59
|
gem install bundler -v "~> $bundler_v"
|
data/Dockerfile
CHANGED
data/Gemfile
CHANGED
|
@@ -2,11 +2,12 @@ source "https://rubygems.org"
|
|
|
2
2
|
|
|
3
3
|
gem 'rubocop', '~> 1.6.0', require: false
|
|
4
4
|
gem 'bunny' # rabbit-mq
|
|
5
|
-
gem 'google-cloud-pubsub', '
|
|
5
|
+
gem 'google-cloud-pubsub', '>= 1.9.2' # google pub/sub
|
|
6
6
|
gem 'ruby-kafka' # kafka pub/sub
|
|
7
7
|
|
|
8
8
|
group :test do
|
|
9
9
|
gem 'database_cleaner-active_record'
|
|
10
|
+
gem 'sqlite3', '~> 1.4'
|
|
10
11
|
end
|
|
11
12
|
|
|
12
13
|
# Specify your gem's dependencies in pub_sub_model_sync.gemspec
|
data/Gemfile.lock
CHANGED
|
@@ -1,215 +1,255 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
pub_sub_model_sync (1.9.
|
|
4
|
+
pub_sub_model_sync (1.9.2)
|
|
5
5
|
rails
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
actioncable (6.1.
|
|
11
|
-
actionpack (= 6.1.
|
|
12
|
-
activesupport (= 6.1.
|
|
10
|
+
actioncable (6.1.7)
|
|
11
|
+
actionpack (= 6.1.7)
|
|
12
|
+
activesupport (= 6.1.7)
|
|
13
13
|
nio4r (~> 2.0)
|
|
14
14
|
websocket-driver (>= 0.6.1)
|
|
15
|
-
actionmailbox (6.1.
|
|
16
|
-
actionpack (= 6.1.
|
|
17
|
-
activejob (= 6.1.
|
|
18
|
-
activerecord (= 6.1.
|
|
19
|
-
activestorage (= 6.1.
|
|
20
|
-
activesupport (= 6.1.
|
|
15
|
+
actionmailbox (6.1.7)
|
|
16
|
+
actionpack (= 6.1.7)
|
|
17
|
+
activejob (= 6.1.7)
|
|
18
|
+
activerecord (= 6.1.7)
|
|
19
|
+
activestorage (= 6.1.7)
|
|
20
|
+
activesupport (= 6.1.7)
|
|
21
21
|
mail (>= 2.7.1)
|
|
22
|
-
actionmailer (6.1.
|
|
23
|
-
actionpack (= 6.1.
|
|
24
|
-
actionview (= 6.1.
|
|
25
|
-
activejob (= 6.1.
|
|
26
|
-
activesupport (= 6.1.
|
|
22
|
+
actionmailer (6.1.7)
|
|
23
|
+
actionpack (= 6.1.7)
|
|
24
|
+
actionview (= 6.1.7)
|
|
25
|
+
activejob (= 6.1.7)
|
|
26
|
+
activesupport (= 6.1.7)
|
|
27
27
|
mail (~> 2.5, >= 2.5.4)
|
|
28
28
|
rails-dom-testing (~> 2.0)
|
|
29
|
-
actionpack (6.1.
|
|
30
|
-
actionview (= 6.1.
|
|
31
|
-
activesupport (= 6.1.
|
|
29
|
+
actionpack (6.1.7)
|
|
30
|
+
actionview (= 6.1.7)
|
|
31
|
+
activesupport (= 6.1.7)
|
|
32
32
|
rack (~> 2.0, >= 2.0.9)
|
|
33
33
|
rack-test (>= 0.6.3)
|
|
34
34
|
rails-dom-testing (~> 2.0)
|
|
35
35
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
|
36
|
-
actiontext (6.1.
|
|
37
|
-
actionpack (= 6.1.
|
|
38
|
-
activerecord (= 6.1.
|
|
39
|
-
activestorage (= 6.1.
|
|
40
|
-
activesupport (= 6.1.
|
|
36
|
+
actiontext (6.1.7)
|
|
37
|
+
actionpack (= 6.1.7)
|
|
38
|
+
activerecord (= 6.1.7)
|
|
39
|
+
activestorage (= 6.1.7)
|
|
40
|
+
activesupport (= 6.1.7)
|
|
41
41
|
nokogiri (>= 1.8.5)
|
|
42
|
-
actionview (6.1.
|
|
43
|
-
activesupport (= 6.1.
|
|
42
|
+
actionview (6.1.7)
|
|
43
|
+
activesupport (= 6.1.7)
|
|
44
44
|
builder (~> 3.1)
|
|
45
45
|
erubi (~> 1.4)
|
|
46
46
|
rails-dom-testing (~> 2.0)
|
|
47
47
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
|
48
|
-
activejob (6.1.
|
|
49
|
-
activesupport (= 6.1.
|
|
48
|
+
activejob (6.1.7)
|
|
49
|
+
activesupport (= 6.1.7)
|
|
50
50
|
globalid (>= 0.3.6)
|
|
51
|
-
activemodel (6.1.
|
|
52
|
-
activesupport (= 6.1.
|
|
53
|
-
activerecord (6.1.
|
|
54
|
-
activemodel (= 6.1.
|
|
55
|
-
activesupport (= 6.1.
|
|
56
|
-
activestorage (6.1.
|
|
57
|
-
actionpack (= 6.1.
|
|
58
|
-
activejob (= 6.1.
|
|
59
|
-
activerecord (= 6.1.
|
|
60
|
-
activesupport (= 6.1.
|
|
61
|
-
marcel (~> 1.0
|
|
62
|
-
mini_mime (
|
|
63
|
-
activesupport (6.1.
|
|
51
|
+
activemodel (6.1.7)
|
|
52
|
+
activesupport (= 6.1.7)
|
|
53
|
+
activerecord (6.1.7)
|
|
54
|
+
activemodel (= 6.1.7)
|
|
55
|
+
activesupport (= 6.1.7)
|
|
56
|
+
activestorage (6.1.7)
|
|
57
|
+
actionpack (= 6.1.7)
|
|
58
|
+
activejob (= 6.1.7)
|
|
59
|
+
activerecord (= 6.1.7)
|
|
60
|
+
activesupport (= 6.1.7)
|
|
61
|
+
marcel (~> 1.0)
|
|
62
|
+
mini_mime (>= 1.1.0)
|
|
63
|
+
activesupport (6.1.7)
|
|
64
64
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
65
65
|
i18n (>= 1.6, < 2)
|
|
66
66
|
minitest (>= 5.1)
|
|
67
67
|
tzinfo (~> 2.0)
|
|
68
68
|
zeitwerk (~> 2.3)
|
|
69
|
-
addressable (2.
|
|
70
|
-
public_suffix (>= 2.0.2, <
|
|
69
|
+
addressable (2.8.1)
|
|
70
|
+
public_suffix (>= 2.0.2, < 6.0)
|
|
71
71
|
amq-protocol (2.3.2)
|
|
72
72
|
ast (2.4.2)
|
|
73
73
|
builder (3.2.4)
|
|
74
|
-
bunny (2.
|
|
74
|
+
bunny (2.20.2)
|
|
75
75
|
amq-protocol (~> 2.3, >= 2.3.1)
|
|
76
|
-
|
|
76
|
+
sorted_set (~> 1, >= 1.0.2)
|
|
77
|
+
concurrent-ruby (1.1.10)
|
|
77
78
|
crass (1.0.6)
|
|
78
79
|
database_cleaner-active_record (2.0.1)
|
|
79
80
|
activerecord (>= 5.a)
|
|
80
81
|
database_cleaner-core (~> 2.0.0)
|
|
81
82
|
database_cleaner-core (2.0.1)
|
|
82
|
-
diff-lcs (1.
|
|
83
|
-
digest
|
|
83
|
+
diff-lcs (1.5.0)
|
|
84
|
+
digest (3.1.1)
|
|
85
|
+
digest-crc (0.6.4)
|
|
84
86
|
rake (>= 12.0.0, < 14.0.0)
|
|
85
|
-
erubi (1.
|
|
86
|
-
faraday (1.
|
|
87
|
+
erubi (1.12.0)
|
|
88
|
+
faraday (1.10.2)
|
|
89
|
+
faraday-em_http (~> 1.0)
|
|
90
|
+
faraday-em_synchrony (~> 1.0)
|
|
87
91
|
faraday-excon (~> 1.1)
|
|
92
|
+
faraday-httpclient (~> 1.0)
|
|
93
|
+
faraday-multipart (~> 1.0)
|
|
88
94
|
faraday-net_http (~> 1.0)
|
|
89
|
-
faraday-net_http_persistent (~> 1.
|
|
90
|
-
|
|
95
|
+
faraday-net_http_persistent (~> 1.0)
|
|
96
|
+
faraday-patron (~> 1.0)
|
|
97
|
+
faraday-rack (~> 1.0)
|
|
98
|
+
faraday-retry (~> 1.0)
|
|
91
99
|
ruby2_keywords (>= 0.0.4)
|
|
100
|
+
faraday-em_http (1.0.0)
|
|
101
|
+
faraday-em_synchrony (1.0.0)
|
|
92
102
|
faraday-excon (1.1.0)
|
|
103
|
+
faraday-httpclient (1.0.1)
|
|
104
|
+
faraday-multipart (1.0.4)
|
|
105
|
+
multipart-post (~> 2)
|
|
93
106
|
faraday-net_http (1.0.1)
|
|
94
|
-
faraday-net_http_persistent (1.
|
|
95
|
-
|
|
107
|
+
faraday-net_http_persistent (1.2.0)
|
|
108
|
+
faraday-patron (1.0.0)
|
|
109
|
+
faraday-rack (1.0.0)
|
|
110
|
+
faraday-retry (1.0.3)
|
|
111
|
+
gapic-common (0.9.0)
|
|
96
112
|
faraday (~> 1.3)
|
|
97
|
-
google-protobuf (~> 3.
|
|
98
|
-
googleapis-common-protos (>= 1.3.11, < 2.
|
|
99
|
-
googleapis-common-protos-types (>= 1.0.6, < 2.
|
|
100
|
-
googleauth (
|
|
113
|
+
google-protobuf (~> 3.14)
|
|
114
|
+
googleapis-common-protos (>= 1.3.11, < 2.a)
|
|
115
|
+
googleapis-common-protos-types (>= 1.0.6, < 2.a)
|
|
116
|
+
googleauth (>= 0.17.0, < 2.a)
|
|
101
117
|
grpc (~> 1.36)
|
|
102
|
-
globalid (0.
|
|
103
|
-
activesupport (>=
|
|
118
|
+
globalid (1.0.0)
|
|
119
|
+
activesupport (>= 5.0)
|
|
104
120
|
google-cloud-core (1.6.0)
|
|
105
121
|
google-cloud-env (~> 1.0)
|
|
106
122
|
google-cloud-errors (~> 1.0)
|
|
107
|
-
google-cloud-env (1.
|
|
108
|
-
faraday (>= 0.17.3, <
|
|
109
|
-
google-cloud-errors (1.
|
|
110
|
-
google-cloud-pubsub (2.
|
|
123
|
+
google-cloud-env (1.6.0)
|
|
124
|
+
faraday (>= 0.17.3, < 3.0)
|
|
125
|
+
google-cloud-errors (1.3.0)
|
|
126
|
+
google-cloud-pubsub (2.14.0)
|
|
111
127
|
concurrent-ruby (~> 1.1)
|
|
112
128
|
google-cloud-core (~> 1.5)
|
|
113
|
-
google-cloud-pubsub-v1 (~> 0.
|
|
114
|
-
|
|
115
|
-
|
|
129
|
+
google-cloud-pubsub-v1 (~> 0.8)
|
|
130
|
+
retriable (~> 3.1)
|
|
131
|
+
google-cloud-pubsub-v1 (0.10.0)
|
|
132
|
+
gapic-common (>= 0.7, < 2.a)
|
|
116
133
|
google-cloud-errors (~> 1.0)
|
|
117
|
-
grpc-google-iam-v1 (
|
|
118
|
-
google-protobuf (3.
|
|
119
|
-
google-protobuf (3.
|
|
120
|
-
googleapis-common-protos (1.3.
|
|
134
|
+
grpc-google-iam-v1 (~> 1.1)
|
|
135
|
+
google-protobuf (3.21.12)
|
|
136
|
+
google-protobuf (3.21.12-x86_64-linux)
|
|
137
|
+
googleapis-common-protos (1.3.12)
|
|
121
138
|
google-protobuf (~> 3.14)
|
|
122
|
-
googleapis-common-protos-types (
|
|
139
|
+
googleapis-common-protos-types (~> 1.2)
|
|
123
140
|
grpc (~> 1.27)
|
|
124
|
-
googleapis-common-protos-types (1.
|
|
141
|
+
googleapis-common-protos-types (1.3.2)
|
|
125
142
|
google-protobuf (~> 3.14)
|
|
126
|
-
googleauth (
|
|
127
|
-
faraday (>= 0.17.3, <
|
|
143
|
+
googleauth (1.1.3)
|
|
144
|
+
faraday (>= 0.17.3, < 3.a)
|
|
128
145
|
jwt (>= 1.4, < 3.0)
|
|
129
146
|
memoist (~> 0.16)
|
|
130
147
|
multi_json (~> 1.11)
|
|
131
148
|
os (>= 0.9, < 2.0)
|
|
132
|
-
signet (
|
|
133
|
-
grpc (1.
|
|
134
|
-
google-protobuf (~> 3.
|
|
149
|
+
signet (>= 0.16, < 2.a)
|
|
150
|
+
grpc (1.50.0)
|
|
151
|
+
google-protobuf (~> 3.21)
|
|
135
152
|
googleapis-common-protos-types (~> 1.0)
|
|
136
|
-
grpc (1.
|
|
137
|
-
google-protobuf (~> 3.
|
|
153
|
+
grpc (1.50.0-x86_64-linux)
|
|
154
|
+
google-protobuf (~> 3.21)
|
|
138
155
|
googleapis-common-protos-types (~> 1.0)
|
|
139
|
-
grpc-google-iam-v1 (
|
|
156
|
+
grpc-google-iam-v1 (1.1.1)
|
|
140
157
|
google-protobuf (~> 3.14)
|
|
141
|
-
googleapis-common-protos (>= 1.3.
|
|
158
|
+
googleapis-common-protos (>= 1.3.12, < 2.0)
|
|
142
159
|
grpc (~> 1.27)
|
|
143
|
-
i18n (1.
|
|
160
|
+
i18n (1.12.0)
|
|
144
161
|
concurrent-ruby (~> 1.0)
|
|
145
|
-
|
|
146
|
-
|
|
162
|
+
io-wait (0.3.0)
|
|
163
|
+
jwt (2.6.0)
|
|
164
|
+
loofah (2.19.1)
|
|
147
165
|
crass (~> 1.0.2)
|
|
148
166
|
nokogiri (>= 1.5.9)
|
|
149
|
-
mail (2.
|
|
167
|
+
mail (2.8.0.1)
|
|
150
168
|
mini_mime (>= 0.1.1)
|
|
151
|
-
|
|
169
|
+
net-imap
|
|
170
|
+
net-pop
|
|
171
|
+
net-smtp
|
|
172
|
+
marcel (1.0.2)
|
|
152
173
|
memoist (0.16.2)
|
|
153
174
|
method_source (1.0.0)
|
|
154
|
-
mini_mime (1.
|
|
155
|
-
|
|
175
|
+
mini_mime (1.1.2)
|
|
176
|
+
mini_portile2 (2.6.1)
|
|
177
|
+
minitest (5.15.0)
|
|
156
178
|
multi_json (1.15.0)
|
|
157
|
-
multipart-post (2.
|
|
179
|
+
multipart-post (2.2.3)
|
|
180
|
+
net-imap (0.2.2)
|
|
181
|
+
digest
|
|
182
|
+
net-protocol
|
|
183
|
+
strscan
|
|
184
|
+
net-pop (0.1.2)
|
|
185
|
+
net-protocol
|
|
186
|
+
net-protocol (0.1.2)
|
|
187
|
+
io-wait
|
|
188
|
+
timeout
|
|
189
|
+
net-smtp (0.3.0)
|
|
190
|
+
digest
|
|
191
|
+
net-protocol
|
|
192
|
+
timeout
|
|
158
193
|
nio4r (2.5.8)
|
|
159
|
-
nokogiri (1.
|
|
194
|
+
nokogiri (1.12.5)
|
|
195
|
+
mini_portile2 (~> 2.6.1)
|
|
196
|
+
racc (~> 1.4)
|
|
197
|
+
nokogiri (1.12.5-x86_64-linux)
|
|
160
198
|
racc (~> 1.4)
|
|
161
|
-
os (1.1.
|
|
162
|
-
parallel (1.
|
|
163
|
-
parser (3.0.
|
|
199
|
+
os (1.1.4)
|
|
200
|
+
parallel (1.22.1)
|
|
201
|
+
parser (3.2.0.0)
|
|
164
202
|
ast (~> 2.4.1)
|
|
165
|
-
public_suffix (4.0.
|
|
166
|
-
racc (1.6.
|
|
167
|
-
rack (2.2.
|
|
168
|
-
rack-test (
|
|
169
|
-
rack (>= 1.
|
|
170
|
-
rails (6.1.
|
|
171
|
-
actioncable (= 6.1.
|
|
172
|
-
actionmailbox (= 6.1.
|
|
173
|
-
actionmailer (= 6.1.
|
|
174
|
-
actionpack (= 6.1.
|
|
175
|
-
actiontext (= 6.1.
|
|
176
|
-
actionview (= 6.1.
|
|
177
|
-
activejob (= 6.1.
|
|
178
|
-
activemodel (= 6.1.
|
|
179
|
-
activerecord (= 6.1.
|
|
180
|
-
activestorage (= 6.1.
|
|
181
|
-
activesupport (= 6.1.
|
|
203
|
+
public_suffix (4.0.7)
|
|
204
|
+
racc (1.6.2)
|
|
205
|
+
rack (2.2.6)
|
|
206
|
+
rack-test (2.0.2)
|
|
207
|
+
rack (>= 1.3)
|
|
208
|
+
rails (6.1.7)
|
|
209
|
+
actioncable (= 6.1.7)
|
|
210
|
+
actionmailbox (= 6.1.7)
|
|
211
|
+
actionmailer (= 6.1.7)
|
|
212
|
+
actionpack (= 6.1.7)
|
|
213
|
+
actiontext (= 6.1.7)
|
|
214
|
+
actionview (= 6.1.7)
|
|
215
|
+
activejob (= 6.1.7)
|
|
216
|
+
activemodel (= 6.1.7)
|
|
217
|
+
activerecord (= 6.1.7)
|
|
218
|
+
activestorage (= 6.1.7)
|
|
219
|
+
activesupport (= 6.1.7)
|
|
182
220
|
bundler (>= 1.15.0)
|
|
183
|
-
railties (= 6.1.
|
|
221
|
+
railties (= 6.1.7)
|
|
184
222
|
sprockets-rails (>= 2.0.0)
|
|
185
223
|
rails-dom-testing (2.0.3)
|
|
186
224
|
activesupport (>= 4.2.0)
|
|
187
225
|
nokogiri (>= 1.6)
|
|
188
|
-
rails-html-sanitizer (1.
|
|
189
|
-
loofah (~> 2.
|
|
190
|
-
railties (6.1.
|
|
191
|
-
actionpack (= 6.1.
|
|
192
|
-
activesupport (= 6.1.
|
|
226
|
+
rails-html-sanitizer (1.4.4)
|
|
227
|
+
loofah (~> 2.19, >= 2.19.1)
|
|
228
|
+
railties (6.1.7)
|
|
229
|
+
actionpack (= 6.1.7)
|
|
230
|
+
activesupport (= 6.1.7)
|
|
193
231
|
method_source
|
|
194
|
-
rake (>=
|
|
232
|
+
rake (>= 12.2)
|
|
195
233
|
thor (~> 1.0)
|
|
196
|
-
rainbow (3.
|
|
197
|
-
rake (13.0.
|
|
198
|
-
|
|
234
|
+
rainbow (3.1.1)
|
|
235
|
+
rake (13.0.6)
|
|
236
|
+
rbtree (0.4.6)
|
|
237
|
+
regexp_parser (2.6.1)
|
|
238
|
+
retriable (3.1.2)
|
|
199
239
|
rexml (3.2.5)
|
|
200
|
-
rspec (3.
|
|
201
|
-
rspec-core (~> 3.
|
|
202
|
-
rspec-expectations (~> 3.
|
|
203
|
-
rspec-mocks (~> 3.
|
|
204
|
-
rspec-core (3.
|
|
205
|
-
rspec-support (~> 3.
|
|
206
|
-
rspec-expectations (3.
|
|
240
|
+
rspec (3.12.0)
|
|
241
|
+
rspec-core (~> 3.12.0)
|
|
242
|
+
rspec-expectations (~> 3.12.0)
|
|
243
|
+
rspec-mocks (~> 3.12.0)
|
|
244
|
+
rspec-core (3.12.0)
|
|
245
|
+
rspec-support (~> 3.12.0)
|
|
246
|
+
rspec-expectations (3.12.2)
|
|
207
247
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
208
|
-
rspec-support (~> 3.
|
|
209
|
-
rspec-mocks (3.
|
|
248
|
+
rspec-support (~> 3.12.0)
|
|
249
|
+
rspec-mocks (3.12.3)
|
|
210
250
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
211
|
-
rspec-support (~> 3.
|
|
212
|
-
rspec-support (3.
|
|
251
|
+
rspec-support (~> 3.12.0)
|
|
252
|
+
rspec-support (3.12.0)
|
|
213
253
|
rubocop (1.6.1)
|
|
214
254
|
parallel (~> 1.10)
|
|
215
255
|
parser (>= 2.7.1.5)
|
|
@@ -219,33 +259,39 @@ GEM
|
|
|
219
259
|
rubocop-ast (>= 1.2.0, < 2.0)
|
|
220
260
|
ruby-progressbar (~> 1.7)
|
|
221
261
|
unicode-display_width (>= 1.4.0, < 2.0)
|
|
222
|
-
rubocop-ast (1.
|
|
223
|
-
parser (>= 3.
|
|
224
|
-
ruby-kafka (1.
|
|
262
|
+
rubocop-ast (1.17.0)
|
|
263
|
+
parser (>= 3.1.1.0)
|
|
264
|
+
ruby-kafka (1.5.0)
|
|
225
265
|
digest-crc
|
|
226
266
|
ruby-progressbar (1.11.0)
|
|
227
|
-
ruby2_keywords (0.0.
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
267
|
+
ruby2_keywords (0.0.5)
|
|
268
|
+
set (1.0.3)
|
|
269
|
+
signet (0.16.1)
|
|
270
|
+
addressable (~> 2.8)
|
|
271
|
+
faraday (>= 0.17.5, < 3.0)
|
|
231
272
|
jwt (>= 1.5, < 3.0)
|
|
232
273
|
multi_json (~> 1.10)
|
|
233
|
-
|
|
274
|
+
sorted_set (1.0.3)
|
|
275
|
+
rbtree
|
|
276
|
+
set (~> 1.0)
|
|
277
|
+
sprockets (4.2.0)
|
|
234
278
|
concurrent-ruby (~> 1.0)
|
|
235
|
-
rack (
|
|
236
|
-
sprockets-rails (3.
|
|
237
|
-
actionpack (>=
|
|
238
|
-
activesupport (>=
|
|
279
|
+
rack (>= 2.2.4, < 4)
|
|
280
|
+
sprockets-rails (3.4.2)
|
|
281
|
+
actionpack (>= 5.2)
|
|
282
|
+
activesupport (>= 5.2)
|
|
239
283
|
sprockets (>= 3.0.0)
|
|
240
|
-
sqlite3 (1.4.
|
|
241
|
-
|
|
242
|
-
|
|
284
|
+
sqlite3 (1.4.4)
|
|
285
|
+
strscan (3.0.5)
|
|
286
|
+
thor (1.2.1)
|
|
287
|
+
timeout (0.3.1)
|
|
288
|
+
tzinfo (2.0.5)
|
|
243
289
|
concurrent-ruby (~> 1.0)
|
|
244
|
-
unicode-display_width (1.
|
|
245
|
-
websocket-driver (0.7.
|
|
290
|
+
unicode-display_width (1.8.0)
|
|
291
|
+
websocket-driver (0.7.5)
|
|
246
292
|
websocket-extensions (>= 0.1.0)
|
|
247
293
|
websocket-extensions (0.1.5)
|
|
248
|
-
zeitwerk (2.
|
|
294
|
+
zeitwerk (2.6.6)
|
|
249
295
|
|
|
250
296
|
PLATFORMS
|
|
251
297
|
ruby
|
|
@@ -255,13 +301,13 @@ DEPENDENCIES
|
|
|
255
301
|
bundler
|
|
256
302
|
bunny
|
|
257
303
|
database_cleaner-active_record
|
|
258
|
-
google-cloud-pubsub (
|
|
304
|
+
google-cloud-pubsub (>= 1.9.2)
|
|
259
305
|
pub_sub_model_sync!
|
|
260
306
|
rake
|
|
261
307
|
rspec
|
|
262
308
|
rubocop (~> 1.6.0)
|
|
263
309
|
ruby-kafka
|
|
264
|
-
sqlite3
|
|
310
|
+
sqlite3 (~> 1.4)
|
|
265
311
|
|
|
266
312
|
BUNDLED WITH
|
|
267
|
-
2.
|
|
313
|
+
2.4.5
|
data/README.md
CHANGED
|
@@ -46,7 +46,7 @@ Add this line to your application's Gemfile:
|
|
|
46
46
|
```ruby
|
|
47
47
|
gem 'pub_sub_model_sync'
|
|
48
48
|
|
|
49
|
-
gem 'google-cloud-pubsub', '>=
|
|
49
|
+
gem 'google-cloud-pubsub', '>= 2.14.0' # to use google pub/sub service. For old rails apps ('>= 1.9', '<= 2.9.2')
|
|
50
50
|
gem 'bunny' # to use rabbit-mq pub/sub service
|
|
51
51
|
gem 'ruby-kafka' # to use apache kafka pub/sub service
|
|
52
52
|
```
|
|
@@ -85,7 +85,7 @@ And then execute: $ bundle install
|
|
|
85
85
|
```
|
|
86
86
|
See details here: https://github.com/zendesk/ruby-kafka
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
*Important: The `topic_name` must be the same for all applications, so that, the apps connect to the same topic*
|
|
89
89
|
|
|
90
90
|
- Add publishers/subscribers to your models (See examples below)
|
|
91
91
|
|
data/gemfiles/Gemfile_5
CHANGED
data/gemfiles/Gemfile_6
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
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', '~> 6'
|
|
8
|
+
gem 'sqlite3', '~> 1.4.4'
|
|
9
|
+
|
|
10
|
+
group :test do
|
|
11
|
+
gem 'database_cleaner-active_record'
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Specify your gem's dependencies in pub_sub_model_sync.gemspec
|
|
15
|
+
gemspec
|
data/gemfiles/Gemfile_7
CHANGED
|
@@ -54,7 +54,7 @@ module PubSubModelSync
|
|
|
54
54
|
|
|
55
55
|
def publish_to_topic(topic, payload)
|
|
56
56
|
retries ||= 0
|
|
57
|
-
|
|
57
|
+
publish_message(topic, payload)
|
|
58
58
|
rescue Google::Cloud::PubSub::OrderingKeyError => e
|
|
59
59
|
raise if (retries += 1) > 1
|
|
60
60
|
|
|
@@ -63,16 +63,23 @@ module PubSubModelSync
|
|
|
63
63
|
retry
|
|
64
64
|
end
|
|
65
65
|
|
|
66
|
-
def
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
end
|
|
66
|
+
def publish_message(topic, payload)
|
|
67
|
+
settings = { ordering_key: payload.ordering_key }
|
|
68
|
+
if config.sync_mode
|
|
69
|
+
topic.publish(*message_params(payload), **settings)
|
|
70
|
+
else
|
|
71
|
+
topic.publish_async(*message_params(payload), **settings) { |result| check_async_result(result, payload) }
|
|
73
72
|
end
|
|
74
73
|
end
|
|
75
74
|
|
|
75
|
+
def check_async_result(result, payload)
|
|
76
|
+
log "Published message: #{payload.uuid} (via async)" if result.succeeded? && config.debug
|
|
77
|
+
return if result.succeeded?
|
|
78
|
+
|
|
79
|
+
log("Error publishing: #{[payload, result.error]} (via async)", :error)
|
|
80
|
+
config.on_error_publish.call(StandardError.new(result.error), { payload: payload })
|
|
81
|
+
end
|
|
82
|
+
|
|
76
83
|
# @param only_publish (Boolean): if false is used to listen and publish messages
|
|
77
84
|
# @return (Topic): returns created or loaded topic
|
|
78
85
|
def init_topic(topic_name, only_publish: false)
|
|
@@ -91,7 +98,7 @@ module PubSubModelSync
|
|
|
91
98
|
def message_params(payload)
|
|
92
99
|
[
|
|
93
100
|
encode_payload(payload),
|
|
94
|
-
{
|
|
101
|
+
{ SERVICE_KEY => true }.merge(PUBLISH_SETTINGS)
|
|
95
102
|
]
|
|
96
103
|
end
|
|
97
104
|
|
|
@@ -101,6 +108,7 @@ module PubSubModelSync
|
|
|
101
108
|
subs_name = "#{config.subscription_key}_#{key}"
|
|
102
109
|
subscription = topic.subscription(subs_name) || topic.subscribe(subs_name, **SUBSCRIPTION_SETTINGS)
|
|
103
110
|
subscriber = subscription.listen(**LISTEN_SETTINGS, &method(:process_message))
|
|
111
|
+
subscriber.on_error { |error| log("Subscriber error: #{error.class} #{error.message}", :error) }
|
|
104
112
|
subscriber.start
|
|
105
113
|
log("Subscribed to topic: #{topic.name} as: #{subs_name}")
|
|
106
114
|
subscriber
|
data/pub_sub_model_sync.gemspec
CHANGED
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.9.
|
|
4
|
+
version: 1.9.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Owen
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-01-
|
|
11
|
+
date: 2023-01-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -66,20 +66,6 @@ dependencies:
|
|
|
66
66
|
- - ">="
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '0'
|
|
69
|
-
- !ruby/object:Gem::Dependency
|
|
70
|
-
name: sqlite3
|
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
|
72
|
-
requirements:
|
|
73
|
-
- - ">="
|
|
74
|
-
- !ruby/object:Gem::Version
|
|
75
|
-
version: '0'
|
|
76
|
-
type: :development
|
|
77
|
-
prerelease: false
|
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
-
requirements:
|
|
80
|
-
- - ">="
|
|
81
|
-
- !ruby/object:Gem::Version
|
|
82
|
-
version: '0'
|
|
83
69
|
description: This gem permits to sync automatically models and custom data between
|
|
84
70
|
multiple Rails applications by publishing notifications via pubsub (Google PubSub,
|
|
85
71
|
RabbitMQ, or Apache Kafka) and automatically processed by all connected applications.
|
|
@@ -111,6 +97,7 @@ files:
|
|
|
111
97
|
- gemfiles/Gemfile_4
|
|
112
98
|
- gemfiles/Gemfile_5
|
|
113
99
|
- gemfiles/Gemfile_6
|
|
100
|
+
- gemfiles/Gemfile_6_2.6
|
|
114
101
|
- gemfiles/Gemfile_7
|
|
115
102
|
- lib/pub_sub_model_sync.rb
|
|
116
103
|
- lib/pub_sub_model_sync/base.rb
|