external_services 0.3.0 → 0.4.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/.travis.yml +3 -2
- data/Gemfile +1 -1
- data/Gemfile.lock +121 -103
- data/app/models/concerns/external_services/action.rb +17 -3
- data/app/models/external_services/api_action.rb +6 -2
- data/app/models/external_services/service.rb +1 -1
- data/external_services.gemspec +6 -1
- data/lib/external_services/active_record.rb +1 -1
- data/lib/external_services/api.rb +6 -0
- data/lib/external_services/version.rb +1 -1
- data/lib/generators/install_generator.rb +7 -1
- data/lib/generators/templates/migrations/create_external_services.rb +1 -1
- data/lib/generators/templates/migrations/create_external_services_api_actions.rb +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6938fe87148bdc3e5c98d4daa7b690e4d91ad9716fff2df713538d18b52deee7
|
|
4
|
+
data.tar.gz: 51a0ea8c848fff9378699c8c636562e9df8f5dc9bb4d22b2aa3e40b2f463871a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2c20e20632ff2eb4e1c66123d0d1497ecab6b8f016a4db63013383c2bcd134c460a4f328e7e5885b1bd638993fc8752e2b5392d5094537e87c0655fe4ebcd969
|
|
7
|
+
data.tar.gz: 0d3a5973de76cafe378ded0b37ccbb34a347f6943103ffa394def739bead110a3fa55900c90bb74a488102ccee3a3eff9838d03c89cb2795523f209e7f544109
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,79 +1,92 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
external_services (0.3
|
|
4
|
+
external_services (0.4.3)
|
|
5
5
|
faraday (>= 0.9)
|
|
6
6
|
faraday_middleware (>= 0.10)
|
|
7
|
-
rails (>= 4.2.5, < 6.
|
|
7
|
+
rails (>= 4.2.5, < 6.1)
|
|
8
8
|
|
|
9
9
|
GEM
|
|
10
10
|
remote: https://rubygems.org/
|
|
11
11
|
specs:
|
|
12
|
-
actioncable (
|
|
13
|
-
actionpack (=
|
|
12
|
+
actioncable (6.0.3.4)
|
|
13
|
+
actionpack (= 6.0.3.4)
|
|
14
14
|
nio4r (~> 2.0)
|
|
15
15
|
websocket-driver (>= 0.6.1)
|
|
16
|
-
|
|
17
|
-
actionpack (=
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
actionmailbox (6.0.3.4)
|
|
17
|
+
actionpack (= 6.0.3.4)
|
|
18
|
+
activejob (= 6.0.3.4)
|
|
19
|
+
activerecord (= 6.0.3.4)
|
|
20
|
+
activestorage (= 6.0.3.4)
|
|
21
|
+
activesupport (= 6.0.3.4)
|
|
22
|
+
mail (>= 2.7.1)
|
|
23
|
+
actionmailer (6.0.3.4)
|
|
24
|
+
actionpack (= 6.0.3.4)
|
|
25
|
+
actionview (= 6.0.3.4)
|
|
26
|
+
activejob (= 6.0.3.4)
|
|
20
27
|
mail (~> 2.5, >= 2.5.4)
|
|
21
28
|
rails-dom-testing (~> 2.0)
|
|
22
|
-
actionpack (
|
|
23
|
-
actionview (=
|
|
24
|
-
activesupport (=
|
|
25
|
-
rack (~> 2.0)
|
|
29
|
+
actionpack (6.0.3.4)
|
|
30
|
+
actionview (= 6.0.3.4)
|
|
31
|
+
activesupport (= 6.0.3.4)
|
|
32
|
+
rack (~> 2.0, >= 2.0.8)
|
|
26
33
|
rack-test (>= 0.6.3)
|
|
27
34
|
rails-dom-testing (~> 2.0)
|
|
28
|
-
rails-html-sanitizer (~> 1.0, >= 1.0
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
|
36
|
+
actiontext (6.0.3.4)
|
|
37
|
+
actionpack (= 6.0.3.4)
|
|
38
|
+
activerecord (= 6.0.3.4)
|
|
39
|
+
activestorage (= 6.0.3.4)
|
|
40
|
+
activesupport (= 6.0.3.4)
|
|
41
|
+
nokogiri (>= 1.8.5)
|
|
42
|
+
actionview (6.0.3.4)
|
|
43
|
+
activesupport (= 6.0.3.4)
|
|
31
44
|
builder (~> 3.1)
|
|
32
45
|
erubi (~> 1.4)
|
|
33
46
|
rails-dom-testing (~> 2.0)
|
|
34
|
-
rails-html-sanitizer (~> 1.
|
|
35
|
-
activejob (
|
|
36
|
-
activesupport (=
|
|
47
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
|
48
|
+
activejob (6.0.3.4)
|
|
49
|
+
activesupport (= 6.0.3.4)
|
|
37
50
|
globalid (>= 0.3.6)
|
|
38
|
-
activemodel (
|
|
39
|
-
activesupport (=
|
|
40
|
-
activerecord (
|
|
41
|
-
activemodel (=
|
|
42
|
-
activesupport (=
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
activerecord (=
|
|
51
|
+
activemodel (6.0.3.4)
|
|
52
|
+
activesupport (= 6.0.3.4)
|
|
53
|
+
activerecord (6.0.3.4)
|
|
54
|
+
activemodel (= 6.0.3.4)
|
|
55
|
+
activesupport (= 6.0.3.4)
|
|
56
|
+
activestorage (6.0.3.4)
|
|
57
|
+
actionpack (= 6.0.3.4)
|
|
58
|
+
activejob (= 6.0.3.4)
|
|
59
|
+
activerecord (= 6.0.3.4)
|
|
47
60
|
marcel (~> 0.3.1)
|
|
48
|
-
activesupport (
|
|
61
|
+
activesupport (6.0.3.4)
|
|
49
62
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
50
63
|
i18n (>= 0.7, < 2)
|
|
51
64
|
minitest (~> 5.1)
|
|
52
65
|
tzinfo (~> 1.1)
|
|
66
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
|
53
67
|
addressable (2.4.0)
|
|
54
|
-
arel (9.0.0)
|
|
55
68
|
ast (2.4.0)
|
|
56
|
-
backports (3.11.
|
|
57
|
-
builder (3.2.
|
|
69
|
+
backports (3.11.4)
|
|
70
|
+
builder (3.2.4)
|
|
58
71
|
childprocess (0.9.0)
|
|
59
72
|
ffi (~> 1.0, >= 1.0.11)
|
|
60
73
|
coderay (1.1.2)
|
|
61
|
-
concurrent-ruby (1.
|
|
62
|
-
crass (1.0.
|
|
74
|
+
concurrent-ruby (1.1.7)
|
|
75
|
+
crass (1.0.6)
|
|
63
76
|
diff-lcs (1.3)
|
|
64
|
-
erubi (1.
|
|
77
|
+
erubi (1.10.0)
|
|
65
78
|
ethon (0.11.0)
|
|
66
79
|
ffi (>= 1.3.0)
|
|
67
|
-
factory_bot (4.
|
|
80
|
+
factory_bot (4.11.1)
|
|
68
81
|
activesupport (>= 3.0.0)
|
|
69
|
-
factory_bot_rails (4.
|
|
70
|
-
factory_bot (~> 4.
|
|
82
|
+
factory_bot_rails (4.11.1)
|
|
83
|
+
factory_bot (~> 4.11.1)
|
|
71
84
|
railties (>= 3.0.0)
|
|
72
|
-
faraday (0.15.
|
|
85
|
+
faraday (0.15.3)
|
|
73
86
|
multipart-post (>= 1.2, < 3)
|
|
74
87
|
faraday_middleware (0.12.2)
|
|
75
88
|
faraday (>= 0.7.4, < 1.0)
|
|
76
|
-
ffi (1.9.
|
|
89
|
+
ffi (1.9.25)
|
|
77
90
|
gh (0.15.1)
|
|
78
91
|
addressable (~> 2.4.0)
|
|
79
92
|
backports
|
|
@@ -81,41 +94,42 @@ GEM
|
|
|
81
94
|
multi_json (~> 1.0)
|
|
82
95
|
net-http-persistent (~> 2.9)
|
|
83
96
|
net-http-pipeline
|
|
84
|
-
globalid (0.4.
|
|
97
|
+
globalid (0.4.2)
|
|
85
98
|
activesupport (>= 4.2.0)
|
|
86
99
|
highline (1.7.10)
|
|
87
|
-
i18n (1.
|
|
100
|
+
i18n (1.8.5)
|
|
88
101
|
concurrent-ruby (~> 1.0)
|
|
89
102
|
iniparse (1.4.4)
|
|
90
|
-
|
|
103
|
+
jaro_winkler (1.5.1)
|
|
104
|
+
json (2.3.1)
|
|
91
105
|
launchy (2.4.3)
|
|
92
106
|
addressable (~> 2.3)
|
|
93
|
-
loofah (2.
|
|
107
|
+
loofah (2.7.0)
|
|
94
108
|
crass (~> 1.0.2)
|
|
95
109
|
nokogiri (>= 1.5.9)
|
|
96
|
-
mail (2.7.
|
|
110
|
+
mail (2.7.1)
|
|
97
111
|
mini_mime (>= 0.1.1)
|
|
98
|
-
marcel (0.3.
|
|
112
|
+
marcel (0.3.3)
|
|
99
113
|
mimemagic (~> 0.3.2)
|
|
100
|
-
method_source (0.9.
|
|
101
|
-
mimemagic (0.3.
|
|
102
|
-
mini_mime (1.0.
|
|
103
|
-
mini_portile2 (2.
|
|
104
|
-
minitest (5.
|
|
114
|
+
method_source (0.9.2)
|
|
115
|
+
mimemagic (0.3.5)
|
|
116
|
+
mini_mime (1.0.2)
|
|
117
|
+
mini_portile2 (2.4.0)
|
|
118
|
+
minitest (5.14.2)
|
|
105
119
|
multi_json (1.13.1)
|
|
106
120
|
multipart-post (2.0.0)
|
|
107
121
|
net-http-persistent (2.9.4)
|
|
108
122
|
net-http-pipeline (1.0.1)
|
|
109
|
-
nio4r (2.
|
|
110
|
-
nokogiri (1.
|
|
111
|
-
mini_portile2 (~> 2.
|
|
112
|
-
overcommit (0.
|
|
123
|
+
nio4r (2.5.4)
|
|
124
|
+
nokogiri (1.10.10)
|
|
125
|
+
mini_portile2 (~> 2.4.0)
|
|
126
|
+
overcommit (0.46.0)
|
|
113
127
|
childprocess (~> 0.6, >= 0.6.3)
|
|
114
128
|
iniparse (~> 1.4)
|
|
115
129
|
parallel (1.12.1)
|
|
116
|
-
parser (2.5.1.
|
|
130
|
+
parser (2.5.1.2)
|
|
117
131
|
ast (~> 2.4.0)
|
|
118
|
-
powerpack (0.1.
|
|
132
|
+
powerpack (0.1.2)
|
|
119
133
|
pry (0.11.3)
|
|
120
134
|
coderay (~> 1.1.0)
|
|
121
135
|
method_source (~> 0.9.0)
|
|
@@ -124,71 +138,74 @@ GEM
|
|
|
124
138
|
pusher-client (0.6.2)
|
|
125
139
|
json
|
|
126
140
|
websocket (~> 1.0)
|
|
127
|
-
rack (2.
|
|
128
|
-
rack-test (1.
|
|
141
|
+
rack (2.2.3)
|
|
142
|
+
rack-test (1.1.0)
|
|
129
143
|
rack (>= 1.0, < 3)
|
|
130
|
-
rails (
|
|
131
|
-
actioncable (=
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
144
|
+
rails (6.0.3.4)
|
|
145
|
+
actioncable (= 6.0.3.4)
|
|
146
|
+
actionmailbox (= 6.0.3.4)
|
|
147
|
+
actionmailer (= 6.0.3.4)
|
|
148
|
+
actionpack (= 6.0.3.4)
|
|
149
|
+
actiontext (= 6.0.3.4)
|
|
150
|
+
actionview (= 6.0.3.4)
|
|
151
|
+
activejob (= 6.0.3.4)
|
|
152
|
+
activemodel (= 6.0.3.4)
|
|
153
|
+
activerecord (= 6.0.3.4)
|
|
154
|
+
activestorage (= 6.0.3.4)
|
|
155
|
+
activesupport (= 6.0.3.4)
|
|
140
156
|
bundler (>= 1.3.0)
|
|
141
|
-
railties (=
|
|
157
|
+
railties (= 6.0.3.4)
|
|
142
158
|
sprockets-rails (>= 2.0.0)
|
|
143
159
|
rails-dom-testing (2.0.3)
|
|
144
160
|
activesupport (>= 4.2.0)
|
|
145
161
|
nokogiri (>= 1.6)
|
|
146
|
-
rails-html-sanitizer (1.0
|
|
147
|
-
loofah (~> 2.
|
|
148
|
-
railties (
|
|
149
|
-
actionpack (=
|
|
150
|
-
activesupport (=
|
|
162
|
+
rails-html-sanitizer (1.3.0)
|
|
163
|
+
loofah (~> 2.3)
|
|
164
|
+
railties (6.0.3.4)
|
|
165
|
+
actionpack (= 6.0.3.4)
|
|
166
|
+
activesupport (= 6.0.3.4)
|
|
151
167
|
method_source
|
|
152
168
|
rake (>= 0.8.7)
|
|
153
|
-
thor (>= 0.
|
|
169
|
+
thor (>= 0.20.3, < 2.0)
|
|
154
170
|
rainbow (3.0.0)
|
|
155
|
-
rake (
|
|
156
|
-
rspec-core (3.
|
|
157
|
-
rspec-support (~> 3.
|
|
158
|
-
rspec-expectations (3.
|
|
171
|
+
rake (13.0.1)
|
|
172
|
+
rspec-core (3.8.0)
|
|
173
|
+
rspec-support (~> 3.8.0)
|
|
174
|
+
rspec-expectations (3.8.2)
|
|
159
175
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
160
|
-
rspec-support (~> 3.
|
|
161
|
-
rspec-mocks (3.
|
|
176
|
+
rspec-support (~> 3.8.0)
|
|
177
|
+
rspec-mocks (3.8.0)
|
|
162
178
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
163
|
-
rspec-support (~> 3.
|
|
164
|
-
rspec-rails (3.
|
|
179
|
+
rspec-support (~> 3.8.0)
|
|
180
|
+
rspec-rails (3.8.0)
|
|
165
181
|
actionpack (>= 3.0)
|
|
166
182
|
activesupport (>= 3.0)
|
|
167
183
|
railties (>= 3.0)
|
|
168
|
-
rspec-core (~> 3.
|
|
169
|
-
rspec-expectations (~> 3.
|
|
170
|
-
rspec-mocks (~> 3.
|
|
171
|
-
rspec-support (~> 3.
|
|
172
|
-
rspec-support (3.
|
|
173
|
-
rubocop (0.
|
|
184
|
+
rspec-core (~> 3.8.0)
|
|
185
|
+
rspec-expectations (~> 3.8.0)
|
|
186
|
+
rspec-mocks (~> 3.8.0)
|
|
187
|
+
rspec-support (~> 3.8.0)
|
|
188
|
+
rspec-support (3.8.0)
|
|
189
|
+
rubocop (0.59.2)
|
|
190
|
+
jaro_winkler (~> 1.5.1)
|
|
174
191
|
parallel (~> 1.10)
|
|
175
|
-
parser (>= 2.5)
|
|
192
|
+
parser (>= 2.5, != 2.5.1.1)
|
|
176
193
|
powerpack (~> 0.1)
|
|
177
194
|
rainbow (>= 2.2.2, < 4.0)
|
|
178
195
|
ruby-progressbar (~> 1.7)
|
|
179
196
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
|
180
|
-
ruby-progressbar (1.
|
|
181
|
-
sprockets (
|
|
197
|
+
ruby-progressbar (1.10.0)
|
|
198
|
+
sprockets (4.0.2)
|
|
182
199
|
concurrent-ruby (~> 1.0)
|
|
183
200
|
rack (> 1, < 3)
|
|
184
|
-
sprockets-rails (3.2.
|
|
201
|
+
sprockets-rails (3.2.2)
|
|
185
202
|
actionpack (>= 4.0)
|
|
186
203
|
activesupport (>= 4.0)
|
|
187
204
|
sprockets (>= 3.0.0)
|
|
188
|
-
sqlite3 (1.
|
|
189
|
-
thor (0.
|
|
205
|
+
sqlite3 (1.4.2)
|
|
206
|
+
thor (1.0.1)
|
|
190
207
|
thread_safe (0.3.6)
|
|
191
|
-
travis (1.8.
|
|
208
|
+
travis (1.8.9)
|
|
192
209
|
backports
|
|
193
210
|
faraday (~> 0.9)
|
|
194
211
|
faraday_middleware (~> 0.9, >= 0.9.1)
|
|
@@ -199,13 +216,14 @@ GEM
|
|
|
199
216
|
typhoeus (~> 0.6, >= 0.6.8)
|
|
200
217
|
typhoeus (0.8.0)
|
|
201
218
|
ethon (>= 0.8.0)
|
|
202
|
-
tzinfo (1.2.
|
|
219
|
+
tzinfo (1.2.8)
|
|
203
220
|
thread_safe (~> 0.1)
|
|
204
|
-
unicode-display_width (1.
|
|
205
|
-
websocket (1.2.
|
|
206
|
-
websocket-driver (0.7.
|
|
221
|
+
unicode-display_width (1.4.0)
|
|
222
|
+
websocket (1.2.8)
|
|
223
|
+
websocket-driver (0.7.3)
|
|
207
224
|
websocket-extensions (>= 0.1.0)
|
|
208
|
-
websocket-extensions (0.1.
|
|
225
|
+
websocket-extensions (0.1.5)
|
|
226
|
+
zeitwerk (2.4.1)
|
|
209
227
|
|
|
210
228
|
PLATFORMS
|
|
211
229
|
ruby
|
|
@@ -216,11 +234,11 @@ DEPENDENCIES
|
|
|
216
234
|
factory_bot_rails
|
|
217
235
|
overcommit
|
|
218
236
|
pry-rails
|
|
219
|
-
rake (~>
|
|
237
|
+
rake (~> 13.0)
|
|
220
238
|
rspec-rails
|
|
221
239
|
rubocop (~> 0.48)
|
|
222
240
|
sqlite3
|
|
223
241
|
travis (~> 1.8, >= 1.8.2)
|
|
224
242
|
|
|
225
243
|
BUNDLED WITH
|
|
226
|
-
1.
|
|
244
|
+
1.17.3
|
|
@@ -2,8 +2,10 @@ module ExternalServices
|
|
|
2
2
|
module Action
|
|
3
3
|
extend ActiveSupport::Concern
|
|
4
4
|
|
|
5
|
+
QUEUE_PREFIX = 'external_services'
|
|
6
|
+
|
|
5
7
|
included do
|
|
6
|
-
scope :processed,
|
|
8
|
+
scope :processed, -> { where.not(processed_at: nil) }
|
|
7
9
|
scope :unprocessed, -> { where(processed_at: nil) }
|
|
8
10
|
|
|
9
11
|
after_commit :kick_active_job
|
|
@@ -22,12 +24,24 @@ module ExternalServices
|
|
|
22
24
|
end
|
|
23
25
|
|
|
24
26
|
def kick_active_job
|
|
25
|
-
return if processed? || api_disabled?
|
|
27
|
+
# return if processed? || api_disabled?
|
|
28
|
+
|
|
29
|
+
job_class.set(queue: prefixed_queue).perform_later(id)
|
|
30
|
+
end
|
|
26
31
|
|
|
27
|
-
|
|
32
|
+
def prefixed_queue
|
|
33
|
+
[QUEUE_PREFIX, queue].join('__')
|
|
28
34
|
end
|
|
29
35
|
|
|
30
36
|
module ClassMethods
|
|
37
|
+
def clear_sidekiq_queues
|
|
38
|
+
Sidekiq.redis do |conn|
|
|
39
|
+
conn.keys.select { |k| k.include?(QUEUE_PREFIX) }.each do |k|
|
|
40
|
+
conn.del k
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
31
45
|
def perform_unprocessed
|
|
32
46
|
Rails.logger.info "Running unprocessed #{self.class.name.demodulize} api actions..."
|
|
33
47
|
|
|
@@ -2,6 +2,8 @@ module ExternalServices
|
|
|
2
2
|
class ApiAction < ::ActiveRecord::Base
|
|
3
3
|
include ExternalServices::Action
|
|
4
4
|
|
|
5
|
+
MAX_ACTION_AGE = ENV.fetch('EXTERNAL_SERVICES_MAX_ACTION_AGE') { '90' }.to_i.days
|
|
6
|
+
|
|
5
7
|
attr_accessor :async
|
|
6
8
|
|
|
7
9
|
self.table_name = :external_services_api_actions
|
|
@@ -14,15 +16,17 @@ module ExternalServices
|
|
|
14
16
|
serialize :data, JSON
|
|
15
17
|
serialize :options, JSON
|
|
16
18
|
|
|
17
|
-
scope :unprocessed, -> { where(processed_at: nil) }
|
|
18
19
|
scope :to_create, ->(obj) { where(initiator: obj, method: :post) }
|
|
19
20
|
|
|
20
21
|
before_validation :assign_queue
|
|
21
22
|
before_validation :process_data
|
|
22
|
-
after_commit :kick_active_job
|
|
23
23
|
|
|
24
24
|
before_create :calculate_signature
|
|
25
25
|
|
|
26
|
+
def self.delete_old_processed
|
|
27
|
+
processed.where(arel_table[:created_at].lt(MAX_ACTION_AGE.ago)).delete_all
|
|
28
|
+
end
|
|
29
|
+
|
|
26
30
|
def initiator_class
|
|
27
31
|
# Need to use initiator object for STI in polymorphic.. But still will be bugs with deleted STI object and
|
|
28
32
|
# non-STI inheritance
|
|
@@ -7,7 +7,7 @@ module ExternalServices
|
|
|
7
7
|
|
|
8
8
|
after_update :on_first_sync, if: proc { # Rails 5.1+ support
|
|
9
9
|
(respond_to?(:saved_change_to_external_id?) ? saved_change_to_external_id? : external_id_changed? ) &&
|
|
10
|
-
(respond_to?(:external_id_before_last_save) ? external_id_before_last_save
|
|
10
|
+
(respond_to?(:external_id_before_last_save) ? external_id_before_last_save : external_id_was).nil?
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
def self.to_sym
|
data/external_services.gemspec
CHANGED
|
@@ -18,7 +18,12 @@ Gem::Specification.new do |spec|
|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
19
19
|
spec.require_paths = ['lib']
|
|
20
20
|
|
|
21
|
+
spec.post_install_message = <<-MSG
|
|
22
|
+
WARNING: since v0.4 active_job queues are prefixed, so you should check sidekiq config.
|
|
23
|
+
And there is a sidekiq queue clean function, you should use it on Sidekiq start instead of cleaning all Redis db.
|
|
24
|
+
MSG
|
|
25
|
+
|
|
21
26
|
spec.add_dependency 'faraday', '>= 0.9'
|
|
22
27
|
spec.add_dependency 'faraday_middleware', '>= 0.10'
|
|
23
|
-
spec.add_dependency 'rails', ['>= 4.2.5', '< 6.
|
|
28
|
+
spec.add_dependency 'rails', ['>= 4.2.5', '< 6.1']
|
|
24
29
|
end
|
|
@@ -11,6 +11,12 @@ module ExternalServices
|
|
|
11
11
|
|
|
12
12
|
desc 'Generates migrations and directories.'
|
|
13
13
|
|
|
14
|
+
def migration_version
|
|
15
|
+
return unless Rails::VERSION::MAJOR >= 5
|
|
16
|
+
|
|
17
|
+
"[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
|
|
18
|
+
end
|
|
19
|
+
|
|
14
20
|
def create_migration_files
|
|
15
21
|
add_migration('create_external_services')
|
|
16
22
|
add_migration('create_external_services_api_actions')
|
|
@@ -39,7 +45,7 @@ module ExternalServices
|
|
|
39
45
|
if self.class.migration_exists?(migration_dir, template)
|
|
40
46
|
::Kernel.warn "Migration already exists: #{template}"
|
|
41
47
|
else
|
|
42
|
-
migration_template "migrations/#{template}.rb", "db/migrate/#{template}.rb"
|
|
48
|
+
migration_template "migrations/#{template}.rb", "db/migrate/#{template}.rb", migration_version: migration_version
|
|
43
49
|
end
|
|
44
50
|
end
|
|
45
51
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class CreateExternalServicesApiActions < ActiveRecord::Migration
|
|
1
|
+
class CreateExternalServicesApiActions < ActiveRecord::Migration<%= migration_version %>
|
|
2
2
|
def change
|
|
3
3
|
create_table :external_services_api_actions do |t|
|
|
4
4
|
t.references :initiator, null: false, polymorphic: true, index: { name: 'esaa_on_initiator_type_and_initiator_id' }
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: external_services
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3
|
|
4
|
+
version: 0.4.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sergey Gnuskov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2020-11-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -47,7 +47,7 @@ dependencies:
|
|
|
47
47
|
version: 4.2.5
|
|
48
48
|
- - "<"
|
|
49
49
|
- !ruby/object:Gem::Version
|
|
50
|
-
version: '6.
|
|
50
|
+
version: '6.1'
|
|
51
51
|
type: :runtime
|
|
52
52
|
prerelease: false
|
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -57,7 +57,7 @@ dependencies:
|
|
|
57
57
|
version: 4.2.5
|
|
58
58
|
- - "<"
|
|
59
59
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: '6.
|
|
60
|
+
version: '6.1'
|
|
61
61
|
description:
|
|
62
62
|
email:
|
|
63
63
|
- sergey.gnuskov@flant.com
|
|
@@ -102,7 +102,9 @@ homepage: https://github.com/flant/external_services
|
|
|
102
102
|
licenses:
|
|
103
103
|
- MIT
|
|
104
104
|
metadata: {}
|
|
105
|
-
post_install_message:
|
|
105
|
+
post_install_message: |2
|
|
106
|
+
WARNING: since v0.4 active_job queues are prefixed, so you should check sidekiq config.
|
|
107
|
+
And there is a sidekiq queue clean function, you should use it on Sidekiq start instead of cleaning all Redis db.
|
|
106
108
|
rdoc_options: []
|
|
107
109
|
require_paths:
|
|
108
110
|
- lib
|
|
@@ -117,8 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
117
119
|
- !ruby/object:Gem::Version
|
|
118
120
|
version: '0'
|
|
119
121
|
requirements: []
|
|
120
|
-
|
|
121
|
-
rubygems_version: 2.7.6
|
|
122
|
+
rubygems_version: 3.0.8
|
|
122
123
|
signing_key:
|
|
123
124
|
specification_version: 4
|
|
124
125
|
summary: Gem helps syncronizing objects to different external services like Gitlab,
|