external_services 0.4.3 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/gem-push.yml +25 -0
- data/.github/workflows/ruby.yml +37 -0
- data/.gitignore +2 -0
- data/Gemfile +3 -3
- data/Gemfile.lock +170 -165
- data/README.md +5 -1
- data/Rakefile +1 -1
- data/app/jobs/external_services/api_job.rb +2 -0
- data/app/models/concerns/external_services/action.rb +4 -5
- data/app/models/external_services/api_action.rb +6 -0
- data/external_services.gemspec +4 -5
- data/lib/external_services/active_record.rb +2 -2
- data/lib/external_services/api.rb +2 -2
- data/lib/external_services/version.rb +1 -1
- data/lib/generators/install_generator.rb +3 -3
- data/lib/generators/service_generator.rb +1 -1
- data/lib/rspec/helpers.rb +1 -1
- metadata +23 -10
- data/.travis.yml +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 696239dd2a5f6a780daf507059a77dc5542b41bb51d6a9b761694fd8decee742
|
4
|
+
data.tar.gz: c38e40e9575e4a1a0ffa2ee6f9b3a9996a5ea29876ce9fa1f5ac7d2d669653f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f9a225769174988072d1853afa51332ec96e75ec8cb8d0c6269d113efeeb7c20d55c68b5fe5b8fcd29b405d697568d708fae4c91ac0bc54b9d8b9da718eb2ce
|
7
|
+
data.tar.gz: bca745948cf48325cba15d5edf9e5635346e06af0bfe62e0050a665f2c7128c69bc5256807573b7256b03cf3d98a59d5a8682635a32049de202f9131f7549010
|
@@ -0,0 +1,25 @@
|
|
1
|
+
name: Build + publish
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags: [ v* ]
|
6
|
+
jobs:
|
7
|
+
build:
|
8
|
+
name: Build + Publish
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v1
|
12
|
+
|
13
|
+
- name: Release Gem
|
14
|
+
if: contains(github.ref, 'refs/tags/v')
|
15
|
+
uses: cadwallion/publish-rubygems-action@master
|
16
|
+
env:
|
17
|
+
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
|
18
|
+
RELEASE_COMMAND: bundle exec rake release
|
19
|
+
# steps:
|
20
|
+
# - uses: actions/checkout@v3
|
21
|
+
# - name: Set up Ruby
|
22
|
+
# uses: ruby/setup-ruby@v1
|
23
|
+
# with:
|
24
|
+
# ruby-version: .ruby-version
|
25
|
+
# bundler-cache: true
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Test
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ '*' ]
|
13
|
+
|
14
|
+
permissions:
|
15
|
+
contents: read
|
16
|
+
|
17
|
+
jobs:
|
18
|
+
test:
|
19
|
+
runs-on: ${{ matrix.os }}-latest
|
20
|
+
strategy:
|
21
|
+
matrix:
|
22
|
+
os: [ubuntu, macos]
|
23
|
+
ruby-version: ['2.6', '2.7', '3.0', '3.1']
|
24
|
+
|
25
|
+
steps:
|
26
|
+
- uses: actions/checkout@v3
|
27
|
+
- name: Set up Ruby
|
28
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
29
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
30
|
+
uses: ruby/setup-ruby@v1
|
31
|
+
with:
|
32
|
+
ruby-version: ${{ matrix.ruby-version }}
|
33
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
34
|
+
- name: Prepare DB
|
35
|
+
run: bundle exec rake db:create --trace && bundle exec rake db:migrate --trace
|
36
|
+
- name: Run tests
|
37
|
+
run: bundle exec rake
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
@@ -3,13 +3,13 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in external_services.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
gem 'bundler', '~> 1.12'
|
7
6
|
gem 'rake', '~> 13.0'
|
8
7
|
gem 'sqlite3'
|
9
|
-
gem 'travis', '~> 1.8', '>= 1.8.2'
|
10
8
|
|
11
9
|
gem 'overcommit'
|
12
|
-
gem 'rubocop', '~> 0
|
10
|
+
gem 'rubocop', '~> 1.0', require: false
|
11
|
+
gem 'rubocop-rspec'
|
12
|
+
gem 'net-smtp', require: false # hack for pre 7.0.1 rails and 3.1 ruby
|
13
13
|
|
14
14
|
gem 'pry-rails'
|
15
15
|
|
data/Gemfile.lock
CHANGED
@@ -1,244 +1,249 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
external_services (0.
|
5
|
-
faraday (>=
|
6
|
-
faraday_middleware (>= 0
|
7
|
-
rails (>= 4.2.5, <
|
4
|
+
external_services (0.5.1)
|
5
|
+
faraday (>= 1.4, < 2)
|
6
|
+
faraday_middleware (>= 1.0, < 2)
|
7
|
+
rails (>= 4.2.5, < 7)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
actioncable (6.
|
13
|
-
actionpack (= 6.
|
12
|
+
actioncable (6.1.6.1)
|
13
|
+
actionpack (= 6.1.6.1)
|
14
|
+
activesupport (= 6.1.6.1)
|
14
15
|
nio4r (~> 2.0)
|
15
16
|
websocket-driver (>= 0.6.1)
|
16
|
-
actionmailbox (6.
|
17
|
-
actionpack (= 6.
|
18
|
-
activejob (= 6.
|
19
|
-
activerecord (= 6.
|
20
|
-
activestorage (= 6.
|
21
|
-
activesupport (= 6.
|
17
|
+
actionmailbox (6.1.6.1)
|
18
|
+
actionpack (= 6.1.6.1)
|
19
|
+
activejob (= 6.1.6.1)
|
20
|
+
activerecord (= 6.1.6.1)
|
21
|
+
activestorage (= 6.1.6.1)
|
22
|
+
activesupport (= 6.1.6.1)
|
22
23
|
mail (>= 2.7.1)
|
23
|
-
actionmailer (6.
|
24
|
-
actionpack (= 6.
|
25
|
-
actionview (= 6.
|
26
|
-
activejob (= 6.
|
24
|
+
actionmailer (6.1.6.1)
|
25
|
+
actionpack (= 6.1.6.1)
|
26
|
+
actionview (= 6.1.6.1)
|
27
|
+
activejob (= 6.1.6.1)
|
28
|
+
activesupport (= 6.1.6.1)
|
27
29
|
mail (~> 2.5, >= 2.5.4)
|
28
30
|
rails-dom-testing (~> 2.0)
|
29
|
-
actionpack (6.
|
30
|
-
actionview (= 6.
|
31
|
-
activesupport (= 6.
|
32
|
-
rack (~> 2.0, >= 2.0.
|
31
|
+
actionpack (6.1.6.1)
|
32
|
+
actionview (= 6.1.6.1)
|
33
|
+
activesupport (= 6.1.6.1)
|
34
|
+
rack (~> 2.0, >= 2.0.9)
|
33
35
|
rack-test (>= 0.6.3)
|
34
36
|
rails-dom-testing (~> 2.0)
|
35
37
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
36
|
-
actiontext (6.
|
37
|
-
actionpack (= 6.
|
38
|
-
activerecord (= 6.
|
39
|
-
activestorage (= 6.
|
40
|
-
activesupport (= 6.
|
38
|
+
actiontext (6.1.6.1)
|
39
|
+
actionpack (= 6.1.6.1)
|
40
|
+
activerecord (= 6.1.6.1)
|
41
|
+
activestorage (= 6.1.6.1)
|
42
|
+
activesupport (= 6.1.6.1)
|
41
43
|
nokogiri (>= 1.8.5)
|
42
|
-
actionview (6.
|
43
|
-
activesupport (= 6.
|
44
|
+
actionview (6.1.6.1)
|
45
|
+
activesupport (= 6.1.6.1)
|
44
46
|
builder (~> 3.1)
|
45
47
|
erubi (~> 1.4)
|
46
48
|
rails-dom-testing (~> 2.0)
|
47
49
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
48
|
-
activejob (6.
|
49
|
-
activesupport (= 6.
|
50
|
+
activejob (6.1.6.1)
|
51
|
+
activesupport (= 6.1.6.1)
|
50
52
|
globalid (>= 0.3.6)
|
51
|
-
activemodel (6.
|
52
|
-
activesupport (= 6.
|
53
|
-
activerecord (6.
|
54
|
-
activemodel (= 6.
|
55
|
-
activesupport (= 6.
|
56
|
-
activestorage (6.
|
57
|
-
actionpack (= 6.
|
58
|
-
activejob (= 6.
|
59
|
-
activerecord (= 6.
|
60
|
-
|
61
|
-
|
53
|
+
activemodel (6.1.6.1)
|
54
|
+
activesupport (= 6.1.6.1)
|
55
|
+
activerecord (6.1.6.1)
|
56
|
+
activemodel (= 6.1.6.1)
|
57
|
+
activesupport (= 6.1.6.1)
|
58
|
+
activestorage (6.1.6.1)
|
59
|
+
actionpack (= 6.1.6.1)
|
60
|
+
activejob (= 6.1.6.1)
|
61
|
+
activerecord (= 6.1.6.1)
|
62
|
+
activesupport (= 6.1.6.1)
|
63
|
+
marcel (~> 1.0)
|
64
|
+
mini_mime (>= 1.1.0)
|
65
|
+
activesupport (6.1.6.1)
|
62
66
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
63
|
-
i18n (>=
|
64
|
-
minitest (
|
65
|
-
tzinfo (~>
|
66
|
-
zeitwerk (~> 2.
|
67
|
-
|
68
|
-
ast (2.4.0)
|
69
|
-
backports (3.11.4)
|
67
|
+
i18n (>= 1.6, < 2)
|
68
|
+
minitest (>= 5.1)
|
69
|
+
tzinfo (~> 2.0)
|
70
|
+
zeitwerk (~> 2.3)
|
71
|
+
ast (2.4.2)
|
70
72
|
builder (3.2.4)
|
71
73
|
childprocess (0.9.0)
|
72
74
|
ffi (~> 1.0, >= 1.0.11)
|
73
75
|
coderay (1.1.2)
|
74
|
-
concurrent-ruby (1.1.
|
76
|
+
concurrent-ruby (1.1.10)
|
75
77
|
crass (1.0.6)
|
76
|
-
diff-lcs (1.
|
78
|
+
diff-lcs (1.4.4)
|
79
|
+
digest (3.1.0)
|
77
80
|
erubi (1.10.0)
|
78
|
-
ethon (0.11.0)
|
79
|
-
ffi (>= 1.3.0)
|
80
81
|
factory_bot (4.11.1)
|
81
82
|
activesupport (>= 3.0.0)
|
82
83
|
factory_bot_rails (4.11.1)
|
83
84
|
factory_bot (~> 4.11.1)
|
84
85
|
railties (>= 3.0.0)
|
85
|
-
faraday (
|
86
|
-
|
87
|
-
|
88
|
-
faraday (
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
faraday (~> 0
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
86
|
+
faraday (1.10.2)
|
87
|
+
faraday-em_http (~> 1.0)
|
88
|
+
faraday-em_synchrony (~> 1.0)
|
89
|
+
faraday-excon (~> 1.1)
|
90
|
+
faraday-httpclient (~> 1.0)
|
91
|
+
faraday-multipart (~> 1.0)
|
92
|
+
faraday-net_http (~> 1.0)
|
93
|
+
faraday-net_http_persistent (~> 1.0)
|
94
|
+
faraday-patron (~> 1.0)
|
95
|
+
faraday-rack (~> 1.0)
|
96
|
+
faraday-retry (~> 1.0)
|
97
|
+
ruby2_keywords (>= 0.0.4)
|
98
|
+
faraday-em_http (1.0.0)
|
99
|
+
faraday-em_synchrony (1.0.0)
|
100
|
+
faraday-excon (1.1.0)
|
101
|
+
faraday-httpclient (1.0.1)
|
102
|
+
faraday-multipart (1.0.4)
|
103
|
+
multipart-post (~> 2)
|
104
|
+
faraday-net_http (1.0.1)
|
105
|
+
faraday-net_http_persistent (1.2.0)
|
106
|
+
faraday-patron (1.0.0)
|
107
|
+
faraday-rack (1.0.0)
|
108
|
+
faraday-retry (1.0.3)
|
109
|
+
faraday_middleware (1.2.0)
|
110
|
+
faraday (~> 1.0)
|
111
|
+
ffi (1.15.5)
|
112
|
+
globalid (1.0.0)
|
113
|
+
activesupport (>= 5.0)
|
114
|
+
i18n (1.11.0)
|
101
115
|
concurrent-ruby (~> 1.0)
|
102
116
|
iniparse (1.4.4)
|
103
|
-
|
104
|
-
json (2.3.1)
|
105
|
-
launchy (2.4.3)
|
106
|
-
addressable (~> 2.3)
|
107
|
-
loofah (2.7.0)
|
117
|
+
loofah (2.18.0)
|
108
118
|
crass (~> 1.0.2)
|
109
119
|
nokogiri (>= 1.5.9)
|
110
120
|
mail (2.7.1)
|
111
121
|
mini_mime (>= 0.1.1)
|
112
|
-
marcel (0.
|
113
|
-
mimemagic (~> 0.3.2)
|
122
|
+
marcel (1.0.2)
|
114
123
|
method_source (0.9.2)
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
net-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
124
|
+
mini_mime (1.1.2)
|
125
|
+
mini_portile2 (2.8.0)
|
126
|
+
minitest (5.16.2)
|
127
|
+
multipart-post (2.2.3)
|
128
|
+
net-protocol (0.1.3)
|
129
|
+
timeout
|
130
|
+
net-smtp (0.3.1)
|
131
|
+
digest
|
132
|
+
net-protocol
|
133
|
+
timeout
|
134
|
+
nio4r (2.5.8)
|
135
|
+
nokogiri (1.13.7)
|
136
|
+
mini_portile2 (~> 2.8.0)
|
137
|
+
racc (~> 1.4)
|
126
138
|
overcommit (0.46.0)
|
127
139
|
childprocess (~> 0.6, >= 0.6.3)
|
128
140
|
iniparse (~> 1.4)
|
129
|
-
parallel (1.
|
130
|
-
parser (
|
131
|
-
ast (~> 2.4.
|
132
|
-
powerpack (0.1.2)
|
141
|
+
parallel (1.22.1)
|
142
|
+
parser (3.1.2.0)
|
143
|
+
ast (~> 2.4.1)
|
133
144
|
pry (0.11.3)
|
134
145
|
coderay (~> 1.1.0)
|
135
146
|
method_source (~> 0.9.0)
|
136
147
|
pry-rails (0.3.6)
|
137
148
|
pry (>= 0.10.4)
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
bundler (>= 1.3.0)
|
157
|
-
railties (= 6.0.3.4)
|
149
|
+
racc (1.6.0)
|
150
|
+
rack (2.2.4)
|
151
|
+
rack-test (2.0.2)
|
152
|
+
rack (>= 1.3)
|
153
|
+
rails (6.1.6.1)
|
154
|
+
actioncable (= 6.1.6.1)
|
155
|
+
actionmailbox (= 6.1.6.1)
|
156
|
+
actionmailer (= 6.1.6.1)
|
157
|
+
actionpack (= 6.1.6.1)
|
158
|
+
actiontext (= 6.1.6.1)
|
159
|
+
actionview (= 6.1.6.1)
|
160
|
+
activejob (= 6.1.6.1)
|
161
|
+
activemodel (= 6.1.6.1)
|
162
|
+
activerecord (= 6.1.6.1)
|
163
|
+
activestorage (= 6.1.6.1)
|
164
|
+
activesupport (= 6.1.6.1)
|
165
|
+
bundler (>= 1.15.0)
|
166
|
+
railties (= 6.1.6.1)
|
158
167
|
sprockets-rails (>= 2.0.0)
|
159
168
|
rails-dom-testing (2.0.3)
|
160
169
|
activesupport (>= 4.2.0)
|
161
170
|
nokogiri (>= 1.6)
|
162
|
-
rails-html-sanitizer (1.3
|
171
|
+
rails-html-sanitizer (1.4.3)
|
163
172
|
loofah (~> 2.3)
|
164
|
-
railties (6.
|
165
|
-
actionpack (= 6.
|
166
|
-
activesupport (= 6.
|
173
|
+
railties (6.1.6.1)
|
174
|
+
actionpack (= 6.1.6.1)
|
175
|
+
activesupport (= 6.1.6.1)
|
167
176
|
method_source
|
168
|
-
rake (>=
|
169
|
-
thor (
|
170
|
-
rainbow (3.
|
171
|
-
rake (13.0.
|
172
|
-
|
173
|
-
|
174
|
-
rspec-
|
177
|
+
rake (>= 12.2)
|
178
|
+
thor (~> 1.0)
|
179
|
+
rainbow (3.1.1)
|
180
|
+
rake (13.0.3)
|
181
|
+
regexp_parser (2.4.0)
|
182
|
+
rexml (3.2.5)
|
183
|
+
rspec-core (3.10.1)
|
184
|
+
rspec-support (~> 3.10.0)
|
185
|
+
rspec-expectations (3.10.1)
|
175
186
|
diff-lcs (>= 1.2.0, < 2.0)
|
176
|
-
rspec-support (~> 3.
|
177
|
-
rspec-mocks (3.
|
187
|
+
rspec-support (~> 3.10.0)
|
188
|
+
rspec-mocks (3.10.2)
|
178
189
|
diff-lcs (>= 1.2.0, < 2.0)
|
179
|
-
rspec-support (~> 3.
|
180
|
-
rspec-rails (
|
181
|
-
actionpack (>=
|
182
|
-
activesupport (>=
|
183
|
-
railties (>=
|
184
|
-
rspec-core (~> 3.
|
185
|
-
rspec-expectations (~> 3.
|
186
|
-
rspec-mocks (~> 3.
|
187
|
-
rspec-support (~> 3.
|
188
|
-
rspec-support (3.
|
189
|
-
rubocop (
|
190
|
-
jaro_winkler (~> 1.5.1)
|
190
|
+
rspec-support (~> 3.10.0)
|
191
|
+
rspec-rails (5.0.1)
|
192
|
+
actionpack (>= 5.2)
|
193
|
+
activesupport (>= 5.2)
|
194
|
+
railties (>= 5.2)
|
195
|
+
rspec-core (~> 3.10)
|
196
|
+
rspec-expectations (~> 3.10)
|
197
|
+
rspec-mocks (~> 3.10)
|
198
|
+
rspec-support (~> 3.10)
|
199
|
+
rspec-support (3.10.2)
|
200
|
+
rubocop (1.29.1)
|
191
201
|
parallel (~> 1.10)
|
192
|
-
parser (>=
|
193
|
-
powerpack (~> 0.1)
|
202
|
+
parser (>= 3.1.0.0)
|
194
203
|
rainbow (>= 2.2.2, < 4.0)
|
204
|
+
regexp_parser (>= 1.8, < 3.0)
|
205
|
+
rexml (>= 3.2.5, < 4.0)
|
206
|
+
rubocop-ast (>= 1.17.0, < 2.0)
|
195
207
|
ruby-progressbar (~> 1.7)
|
196
|
-
unicode-display_width (
|
197
|
-
|
198
|
-
|
208
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
209
|
+
rubocop-ast (1.18.0)
|
210
|
+
parser (>= 3.1.1.0)
|
211
|
+
rubocop-rspec (1.30.0)
|
212
|
+
rubocop (>= 0.58.0)
|
213
|
+
ruby-progressbar (1.11.0)
|
214
|
+
ruby2_keywords (0.0.5)
|
215
|
+
sprockets (4.1.1)
|
199
216
|
concurrent-ruby (~> 1.0)
|
200
217
|
rack (> 1, < 3)
|
201
|
-
sprockets-rails (3.
|
202
|
-
actionpack (>=
|
203
|
-
activesupport (>=
|
218
|
+
sprockets-rails (3.4.2)
|
219
|
+
actionpack (>= 5.2)
|
220
|
+
activesupport (>= 5.2)
|
204
221
|
sprockets (>= 3.0.0)
|
205
222
|
sqlite3 (1.4.2)
|
206
|
-
thor (1.
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
gh (~> 0.13)
|
213
|
-
highline (~> 1.6)
|
214
|
-
launchy (~> 2.1)
|
215
|
-
pusher-client (~> 0.4)
|
216
|
-
typhoeus (~> 0.6, >= 0.6.8)
|
217
|
-
typhoeus (0.8.0)
|
218
|
-
ethon (>= 0.8.0)
|
219
|
-
tzinfo (1.2.8)
|
220
|
-
thread_safe (~> 0.1)
|
221
|
-
unicode-display_width (1.4.0)
|
222
|
-
websocket (1.2.8)
|
223
|
-
websocket-driver (0.7.3)
|
223
|
+
thor (1.2.1)
|
224
|
+
timeout (0.2.0)
|
225
|
+
tzinfo (2.0.4)
|
226
|
+
concurrent-ruby (~> 1.0)
|
227
|
+
unicode-display_width (2.1.0)
|
228
|
+
websocket-driver (0.7.5)
|
224
229
|
websocket-extensions (>= 0.1.0)
|
225
230
|
websocket-extensions (0.1.5)
|
226
|
-
zeitwerk (2.
|
231
|
+
zeitwerk (2.6.0)
|
227
232
|
|
228
233
|
PLATFORMS
|
229
234
|
ruby
|
230
235
|
|
231
236
|
DEPENDENCIES
|
232
|
-
bundler (~> 1.12)
|
233
237
|
external_services!
|
234
238
|
factory_bot_rails
|
239
|
+
net-smtp
|
235
240
|
overcommit
|
236
241
|
pry-rails
|
237
242
|
rake (~> 13.0)
|
238
243
|
rspec-rails
|
239
|
-
rubocop (~> 0
|
244
|
+
rubocop (~> 1.0)
|
245
|
+
rubocop-rspec
|
240
246
|
sqlite3
|
241
|
-
travis (~> 1.8, >= 1.8.2)
|
242
247
|
|
243
248
|
BUNDLED WITH
|
244
|
-
|
249
|
+
2.3.14
|
data/README.md
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
-
# ExternalServices
|
1
|
+
# ExternalServices
|
2
|
+
|
3
|
+
[![Test](https://github.com/flant/external_services/actions/workflows/ruby.yml/badge.svg)](https://github.com/flant/external_services/actions/workflows/ruby.yml) [![Gem Version](https://badge.fury.io/rb/external_services.svg)](https://badge.fury.io/rb/external_services)
|
4
|
+
|
2
5
|
|
3
6
|
Gem helps syncronizing objects to different external services like Gitlab, Redmine and any other.
|
4
7
|
|
8
|
+
|
5
9
|
## Installation
|
6
10
|
|
7
11
|
Add this line to your application's Gemfile:
|
data/Rakefile
CHANGED
@@ -14,7 +14,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
14
14
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
15
|
end
|
16
16
|
|
17
|
-
APP_RAKEFILE = File.expand_path('
|
17
|
+
APP_RAKEFILE = File.expand_path('spec/dummy/Rakefile', __dir__)
|
18
18
|
|
19
19
|
load 'rails/tasks/engine.rake'
|
20
20
|
|
@@ -2,6 +2,8 @@ module ExternalServices
|
|
2
2
|
class ApiJob < ActiveJob::Base
|
3
3
|
queue_as :default
|
4
4
|
|
5
|
+
retry_on ExternalServices::Api::Error, attempts: 5, wait: ->(executions) { (Math.gamma(executions) * 60).seconds } # (n-1)! * 60
|
6
|
+
|
5
7
|
def action_class
|
6
8
|
"ExternalServices::ApiActions::#{self.class.to_s.demodulize.gsub(/ApiJob/, '')}".constantize
|
7
9
|
end
|
@@ -16,7 +16,7 @@ module ExternalServices
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def set_processed!
|
19
|
-
|
19
|
+
update! processed_at: Time.now
|
20
20
|
end
|
21
21
|
|
22
22
|
def execute!
|
@@ -25,6 +25,7 @@ module ExternalServices
|
|
25
25
|
|
26
26
|
def kick_active_job
|
27
27
|
# return if processed? || api_disabled?
|
28
|
+
return if saved_changes.size == 1 && saved_change_to_options.present?
|
28
29
|
|
29
30
|
job_class.set(queue: prefixed_queue).perform_later(id)
|
30
31
|
end
|
@@ -35,10 +36,8 @@ module ExternalServices
|
|
35
36
|
|
36
37
|
module ClassMethods
|
37
38
|
def clear_sidekiq_queues
|
38
|
-
Sidekiq.
|
39
|
-
|
40
|
-
conn.del k
|
41
|
-
end
|
39
|
+
Sidekiq::Queue.all.each do |queue|
|
40
|
+
queue.clear if queue.name.include?(QUEUE_PREFIX)
|
42
41
|
end
|
43
42
|
end
|
44
43
|
|
data/external_services.gemspec
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require 'external_services/version'
|
5
4
|
|
@@ -23,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
23
22
|
And there is a sidekiq queue clean function, you should use it on Sidekiq start instead of cleaning all Redis db.
|
24
23
|
MSG
|
25
24
|
|
26
|
-
spec.add_dependency 'faraday', '>=
|
27
|
-
spec.add_dependency 'faraday_middleware', '>= 0
|
28
|
-
spec.add_dependency 'rails', ['>= 4.2.5', '<
|
25
|
+
spec.add_dependency 'faraday', '>= 1.4', '< 2'
|
26
|
+
spec.add_dependency 'faraday_middleware', '>= 1.0', '< 2'
|
27
|
+
spec.add_dependency 'rails', ['>= 4.2.5', '< 7']
|
29
28
|
end
|
@@ -110,7 +110,7 @@ module ExternalServices
|
|
110
110
|
respond_to?(:saved_change_to_id?) ? saved_change_to_id? : id_changed?
|
111
111
|
}
|
112
112
|
|
113
|
-
after_save
|
113
|
+
after_save :"#{name}_on_update", if: proc { # Rails 5.1+ support
|
114
114
|
!(respond_to?(:saved_change_to_id?) ? saved_change_to_id? : id_changed?)
|
115
115
|
}
|
116
116
|
|
@@ -142,7 +142,7 @@ module ExternalServices
|
|
142
142
|
end
|
143
143
|
end
|
144
144
|
end
|
145
|
-
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength, Metrics/
|
145
|
+
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength, Metrics/PerceivedComplexity
|
146
146
|
|
147
147
|
include callbacks_module
|
148
148
|
end
|
@@ -7,14 +7,14 @@ module ExternalServices
|
|
7
7
|
class InstallGenerator < ::Rails::Generators::Base
|
8
8
|
include ::Rails::Generators::Migration
|
9
9
|
|
10
|
-
source_root File.expand_path('
|
10
|
+
source_root File.expand_path('templates', __dir__)
|
11
11
|
|
12
12
|
desc 'Generates migrations and directories.'
|
13
13
|
|
14
14
|
def migration_version
|
15
|
-
|
15
|
+
return unless Rails::VERSION::MAJOR >= 5
|
16
16
|
|
17
|
-
|
17
|
+
"[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
|
18
18
|
end
|
19
19
|
|
20
20
|
def create_migration_files
|
@@ -5,7 +5,7 @@ module ExternalServices
|
|
5
5
|
module Generators
|
6
6
|
# Installs ExternalServices in a rails app.
|
7
7
|
class ServiceGenerator < ::Rails::Generators::NamedBase
|
8
|
-
source_root File.expand_path('
|
8
|
+
source_root File.expand_path('templates/services', __dir__)
|
9
9
|
|
10
10
|
class_option(
|
11
11
|
:only_api_actions,
|
data/lib/rspec/helpers.rb
CHANGED
@@ -76,7 +76,7 @@ module ExternalServices
|
|
76
76
|
|
77
77
|
if kwargs[:descendants_identifier_check]
|
78
78
|
it 'create actions for all descendants on identifier change' do
|
79
|
-
@api_object.
|
79
|
+
@api_object.update! identifier: "#{@api_object.identifier}1"
|
80
80
|
|
81
81
|
@api_object.descendants.each do |c|
|
82
82
|
expect_api_action_on_update(c)
|
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.
|
4
|
+
version: 0.5.1
|
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: 2022-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -16,28 +16,40 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.4'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '2'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
29
|
+
version: '1.4'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: faraday_middleware
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - ">="
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0
|
39
|
+
version: '1.0'
|
40
|
+
- - "<"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '2'
|
34
43
|
type: :runtime
|
35
44
|
prerelease: false
|
36
45
|
version_requirements: !ruby/object:Gem::Requirement
|
37
46
|
requirements:
|
38
47
|
- - ">="
|
39
48
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0
|
49
|
+
version: '1.0'
|
50
|
+
- - "<"
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '2'
|
41
53
|
- !ruby/object:Gem::Dependency
|
42
54
|
name: rails
|
43
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -47,7 +59,7 @@ dependencies:
|
|
47
59
|
version: 4.2.5
|
48
60
|
- - "<"
|
49
61
|
- !ruby/object:Gem::Version
|
50
|
-
version: '
|
62
|
+
version: '7'
|
51
63
|
type: :runtime
|
52
64
|
prerelease: false
|
53
65
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -57,7 +69,7 @@ dependencies:
|
|
57
69
|
version: 4.2.5
|
58
70
|
- - "<"
|
59
71
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
72
|
+
version: '7'
|
61
73
|
description:
|
62
74
|
email:
|
63
75
|
- sergey.gnuskov@flant.com
|
@@ -65,11 +77,12 @@ executables: []
|
|
65
77
|
extensions: []
|
66
78
|
extra_rdoc_files: []
|
67
79
|
files:
|
80
|
+
- ".github/workflows/gem-push.yml"
|
81
|
+
- ".github/workflows/ruby.yml"
|
68
82
|
- ".gitignore"
|
69
83
|
- ".overcommit.yml"
|
70
84
|
- ".rspec"
|
71
85
|
- ".rubocop.yml"
|
72
|
-
- ".travis.yml"
|
73
86
|
- Gemfile
|
74
87
|
- Gemfile.lock
|
75
88
|
- LICENSE.txt
|
@@ -119,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
132
|
- !ruby/object:Gem::Version
|
120
133
|
version: '0'
|
121
134
|
requirements: []
|
122
|
-
rubygems_version: 3.
|
135
|
+
rubygems_version: 3.3.7
|
123
136
|
signing_key:
|
124
137
|
specification_version: 4
|
125
138
|
summary: Gem helps syncronizing objects to different external services like Gitlab,
|
data/.travis.yml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
language: ruby
|
3
|
-
rvm:
|
4
|
-
- 2.5.1
|
5
|
-
- 2.7.1
|
6
|
-
before_install: gem install bundler -v 1.17.3
|
7
|
-
env:
|
8
|
-
- RAILS_ENV=test
|
9
|
-
script:
|
10
|
-
- bundle exec rake db:create --trace
|
11
|
-
- bundle exec rake db:migrate --trace
|
12
|
-
- bundle exec rake
|
13
|
-
deploy:
|
14
|
-
provider: rubygems
|
15
|
-
api_key:
|
16
|
-
secure: rgni1lDjNhUTL8NUdJA4oSYu+vzB1Fp8TJ5wVhJfW8E0NUD5YItodmc52RLv3Hwt2501Dqx4pt4WaIP3E71OAG3KzsPUY1NPoCqP4KpXo6c7T1qqFieKztDa8aGOCqjkQ/1to9yt6qdKg6PtjsSWtKu8f3ROhLpBmd4r2phnb1GucKRnH5yaQQtcoNb8AmnE0VBEF2wzALsMg2QdZRk/1qJInbgUldc10FG/33DW71h5IKR8/n2L0Ggm+/ZYe2Rg0aGUE3VHHSkHJFvoHIjwfYaNHu7FrUjYywM4XfZBdl+bdL3a6Op8p+2VRAPMb4Wdb6K0O+f5vGQyvntvR3pMuqFVLC0mL9mkz8RYK7VXVxBfxZk3LQvA15oN52uvN523iKTjM+VvzmEIhZ1+oozN5W9XxT6VSqZTo7rj4lQto0g6+9Ev4kVP92JGMT0GlJcPcZ8PlW7j9phvEXgy89IvLLvF63nVlWw7xAY4pZUlTd185sfSWWPFSyqX4W/djqHq963MB0H8k6lGNnwLf+xFCMScaM52hZ+TEvtapX7nCn7dzgWv8s6kwYqWPa9J0Tegxr364RL7pq0mXEf7JwNivAYv7aAR8PHAg7y15Qw/MXRzoUWG5G5AfZii+GY6cp0Cyo2am0ut05OudYcuohifP4DWkn0wlwDT/QYLv8bMhaE=
|
17
|
-
gem: external_services
|
18
|
-
on:
|
19
|
-
tags: true
|
20
|
-
repo: flant/external_services
|