external_services 0.4.4 → 0.5.0
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 +2 -3
- data/Gemfile.lock +128 -135
- data/Rakefile +1 -1
- data/app/jobs/external_services/api_job.rb +2 -0
- data/app/models/concerns/external_services/action.rb +1 -0
- data/app/models/external_services/api_action.rb +6 -0
- data/external_services.gemspec +3 -4
- 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
- metadata +21 -8
- 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: fc7fb0b9795b1584280ab2dd470abb7d218d2ed255d325ab1515962c2032cc3d
|
4
|
+
data.tar.gz: d4bd9ca17d6665f8a8021e41c405ad82337be76cd3bf979978f5ce58e4706994
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ac75d9614d0f0d5b2c02a3a606fef3f5b95757ecc44496d6b0e485f60fc20d955907b95821cc789798a7c24ae6de1b9004cc522890241cb3a4db8044c6e2d4e
|
7
|
+
data.tar.gz: 6626fc000d82796c195709418061fd97fa77ef8563c44753a8dcb9e7347f6e00bf029e3d3bac6e290be5057929778b1e41e333144c4c1c8b65bd69997504680c
|
@@ -0,0 +1,25 @@
|
|
1
|
+
name: Ruby Gem
|
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: Ruby
|
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]
|
23
|
+
ruby-version: ['2.6', '2.7', '3.0']
|
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,12 @@ 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'
|
13
12
|
|
14
13
|
gem 'pry-rails'
|
15
14
|
|
data/Gemfile.lock
CHANGED
@@ -1,178 +1,178 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
external_services (0.
|
5
|
-
faraday (>=
|
6
|
-
faraday_middleware (>= 0
|
4
|
+
external_services (0.5.0)
|
5
|
+
faraday (>= 1.4, < 2)
|
6
|
+
faraday_middleware (>= 1.0, < 2)
|
7
7
|
rails (>= 4.2.5, < 7)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
actioncable (6.1.
|
13
|
-
actionpack (= 6.1.
|
14
|
-
activesupport (= 6.1.
|
12
|
+
actioncable (6.1.5.1)
|
13
|
+
actionpack (= 6.1.5.1)
|
14
|
+
activesupport (= 6.1.5.1)
|
15
15
|
nio4r (~> 2.0)
|
16
16
|
websocket-driver (>= 0.6.1)
|
17
|
-
actionmailbox (6.1.
|
18
|
-
actionpack (= 6.1.
|
19
|
-
activejob (= 6.1.
|
20
|
-
activerecord (= 6.1.
|
21
|
-
activestorage (= 6.1.
|
22
|
-
activesupport (= 6.1.
|
17
|
+
actionmailbox (6.1.5.1)
|
18
|
+
actionpack (= 6.1.5.1)
|
19
|
+
activejob (= 6.1.5.1)
|
20
|
+
activerecord (= 6.1.5.1)
|
21
|
+
activestorage (= 6.1.5.1)
|
22
|
+
activesupport (= 6.1.5.1)
|
23
23
|
mail (>= 2.7.1)
|
24
|
-
actionmailer (6.1.
|
25
|
-
actionpack (= 6.1.
|
26
|
-
actionview (= 6.1.
|
27
|
-
activejob (= 6.1.
|
28
|
-
activesupport (= 6.1.
|
24
|
+
actionmailer (6.1.5.1)
|
25
|
+
actionpack (= 6.1.5.1)
|
26
|
+
actionview (= 6.1.5.1)
|
27
|
+
activejob (= 6.1.5.1)
|
28
|
+
activesupport (= 6.1.5.1)
|
29
29
|
mail (~> 2.5, >= 2.5.4)
|
30
30
|
rails-dom-testing (~> 2.0)
|
31
|
-
actionpack (6.1.
|
32
|
-
actionview (= 6.1.
|
33
|
-
activesupport (= 6.1.
|
31
|
+
actionpack (6.1.5.1)
|
32
|
+
actionview (= 6.1.5.1)
|
33
|
+
activesupport (= 6.1.5.1)
|
34
34
|
rack (~> 2.0, >= 2.0.9)
|
35
35
|
rack-test (>= 0.6.3)
|
36
36
|
rails-dom-testing (~> 2.0)
|
37
37
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
38
|
-
actiontext (6.1.
|
39
|
-
actionpack (= 6.1.
|
40
|
-
activerecord (= 6.1.
|
41
|
-
activestorage (= 6.1.
|
42
|
-
activesupport (= 6.1.
|
38
|
+
actiontext (6.1.5.1)
|
39
|
+
actionpack (= 6.1.5.1)
|
40
|
+
activerecord (= 6.1.5.1)
|
41
|
+
activestorage (= 6.1.5.1)
|
42
|
+
activesupport (= 6.1.5.1)
|
43
43
|
nokogiri (>= 1.8.5)
|
44
|
-
actionview (6.1.
|
45
|
-
activesupport (= 6.1.
|
44
|
+
actionview (6.1.5.1)
|
45
|
+
activesupport (= 6.1.5.1)
|
46
46
|
builder (~> 3.1)
|
47
47
|
erubi (~> 1.4)
|
48
48
|
rails-dom-testing (~> 2.0)
|
49
49
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
50
|
-
activejob (6.1.
|
51
|
-
activesupport (= 6.1.
|
50
|
+
activejob (6.1.5.1)
|
51
|
+
activesupport (= 6.1.5.1)
|
52
52
|
globalid (>= 0.3.6)
|
53
|
-
activemodel (6.1.
|
54
|
-
activesupport (= 6.1.
|
55
|
-
activerecord (6.1.
|
56
|
-
activemodel (= 6.1.
|
57
|
-
activesupport (= 6.1.
|
58
|
-
activestorage (6.1.
|
59
|
-
actionpack (= 6.1.
|
60
|
-
activejob (= 6.1.
|
61
|
-
activerecord (= 6.1.
|
62
|
-
activesupport (= 6.1.
|
63
|
-
marcel (~> 1.0
|
64
|
-
mini_mime (
|
65
|
-
activesupport (6.1.
|
53
|
+
activemodel (6.1.5.1)
|
54
|
+
activesupport (= 6.1.5.1)
|
55
|
+
activerecord (6.1.5.1)
|
56
|
+
activemodel (= 6.1.5.1)
|
57
|
+
activesupport (= 6.1.5.1)
|
58
|
+
activestorage (6.1.5.1)
|
59
|
+
actionpack (= 6.1.5.1)
|
60
|
+
activejob (= 6.1.5.1)
|
61
|
+
activerecord (= 6.1.5.1)
|
62
|
+
activesupport (= 6.1.5.1)
|
63
|
+
marcel (~> 1.0)
|
64
|
+
mini_mime (>= 1.1.0)
|
65
|
+
activesupport (6.1.5.1)
|
66
66
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
67
67
|
i18n (>= 1.6, < 2)
|
68
68
|
minitest (>= 5.1)
|
69
69
|
tzinfo (~> 2.0)
|
70
70
|
zeitwerk (~> 2.3)
|
71
|
-
|
72
|
-
ast (2.4.0)
|
73
|
-
backports (3.11.4)
|
71
|
+
ast (2.4.2)
|
74
72
|
builder (3.2.4)
|
75
73
|
childprocess (0.9.0)
|
76
74
|
ffi (~> 1.0, >= 1.0.11)
|
77
75
|
coderay (1.1.2)
|
78
|
-
concurrent-ruby (1.1.
|
76
|
+
concurrent-ruby (1.1.10)
|
79
77
|
crass (1.0.6)
|
80
78
|
diff-lcs (1.4.4)
|
81
79
|
erubi (1.10.0)
|
82
|
-
ethon (0.11.0)
|
83
|
-
ffi (>= 1.3.0)
|
84
80
|
factory_bot (4.11.1)
|
85
81
|
activesupport (>= 3.0.0)
|
86
82
|
factory_bot_rails (4.11.1)
|
87
83
|
factory_bot (~> 4.11.1)
|
88
84
|
railties (>= 3.0.0)
|
89
|
-
faraday (
|
85
|
+
faraday (1.10.0)
|
86
|
+
faraday-em_http (~> 1.0)
|
87
|
+
faraday-em_synchrony (~> 1.0)
|
88
|
+
faraday-excon (~> 1.1)
|
89
|
+
faraday-httpclient (~> 1.0)
|
90
|
+
faraday-multipart (~> 1.0)
|
91
|
+
faraday-net_http (~> 1.0)
|
92
|
+
faraday-net_http_persistent (~> 1.0)
|
93
|
+
faraday-patron (~> 1.0)
|
94
|
+
faraday-rack (~> 1.0)
|
95
|
+
faraday-retry (~> 1.0)
|
96
|
+
ruby2_keywords (>= 0.0.4)
|
97
|
+
faraday-em_http (1.0.0)
|
98
|
+
faraday-em_synchrony (1.0.0)
|
99
|
+
faraday-excon (1.1.0)
|
100
|
+
faraday-httpclient (1.0.1)
|
101
|
+
faraday-multipart (1.0.3)
|
90
102
|
multipart-post (>= 1.2, < 3)
|
91
|
-
|
92
|
-
|
103
|
+
faraday-net_http (1.0.1)
|
104
|
+
faraday-net_http_persistent (1.2.0)
|
105
|
+
faraday-patron (1.0.0)
|
106
|
+
faraday-rack (1.0.0)
|
107
|
+
faraday-retry (1.0.3)
|
108
|
+
faraday_middleware (1.2.0)
|
109
|
+
faraday (~> 1.0)
|
93
110
|
ffi (1.9.25)
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
faraday (~> 0.8)
|
98
|
-
multi_json (~> 1.0)
|
99
|
-
net-http-persistent (~> 2.9)
|
100
|
-
net-http-pipeline
|
101
|
-
globalid (0.4.2)
|
102
|
-
activesupport (>= 4.2.0)
|
103
|
-
highline (1.7.10)
|
104
|
-
i18n (1.8.10)
|
111
|
+
globalid (1.0.0)
|
112
|
+
activesupport (>= 5.0)
|
113
|
+
i18n (1.10.0)
|
105
114
|
concurrent-ruby (~> 1.0)
|
106
115
|
iniparse (1.4.4)
|
107
|
-
|
108
|
-
json (2.3.1)
|
109
|
-
launchy (2.4.3)
|
110
|
-
addressable (~> 2.3)
|
111
|
-
loofah (2.10.0)
|
116
|
+
loofah (2.16.0)
|
112
117
|
crass (~> 1.0.2)
|
113
118
|
nokogiri (>= 1.5.9)
|
114
119
|
mail (2.7.1)
|
115
120
|
mini_mime (>= 0.1.1)
|
116
|
-
marcel (1.0.
|
121
|
+
marcel (1.0.2)
|
117
122
|
method_source (0.9.2)
|
118
|
-
mini_mime (1.
|
119
|
-
mini_portile2 (2.
|
120
|
-
minitest (5.
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
nio4r (2.5.7)
|
126
|
-
nokogiri (1.11.7)
|
127
|
-
mini_portile2 (~> 2.5.0)
|
123
|
+
mini_mime (1.1.2)
|
124
|
+
mini_portile2 (2.8.0)
|
125
|
+
minitest (5.15.0)
|
126
|
+
multipart-post (2.1.1)
|
127
|
+
nio4r (2.5.8)
|
128
|
+
nokogiri (1.13.6)
|
129
|
+
mini_portile2 (~> 2.8.0)
|
128
130
|
racc (~> 1.4)
|
129
131
|
overcommit (0.46.0)
|
130
132
|
childprocess (~> 0.6, >= 0.6.3)
|
131
133
|
iniparse (~> 1.4)
|
132
|
-
parallel (1.
|
133
|
-
parser (
|
134
|
-
ast (~> 2.4.
|
135
|
-
powerpack (0.1.2)
|
134
|
+
parallel (1.22.1)
|
135
|
+
parser (3.1.2.0)
|
136
|
+
ast (~> 2.4.1)
|
136
137
|
pry (0.11.3)
|
137
138
|
coderay (~> 1.1.0)
|
138
139
|
method_source (~> 0.9.0)
|
139
140
|
pry-rails (0.3.6)
|
140
141
|
pry (>= 0.10.4)
|
141
|
-
|
142
|
-
json
|
143
|
-
websocket (~> 1.0)
|
144
|
-
racc (1.5.2)
|
142
|
+
racc (1.6.0)
|
145
143
|
rack (2.2.3)
|
146
144
|
rack-test (1.1.0)
|
147
145
|
rack (>= 1.0, < 3)
|
148
|
-
rails (6.1.
|
149
|
-
actioncable (= 6.1.
|
150
|
-
actionmailbox (= 6.1.
|
151
|
-
actionmailer (= 6.1.
|
152
|
-
actionpack (= 6.1.
|
153
|
-
actiontext (= 6.1.
|
154
|
-
actionview (= 6.1.
|
155
|
-
activejob (= 6.1.
|
156
|
-
activemodel (= 6.1.
|
157
|
-
activerecord (= 6.1.
|
158
|
-
activestorage (= 6.1.
|
159
|
-
activesupport (= 6.1.
|
146
|
+
rails (6.1.5.1)
|
147
|
+
actioncable (= 6.1.5.1)
|
148
|
+
actionmailbox (= 6.1.5.1)
|
149
|
+
actionmailer (= 6.1.5.1)
|
150
|
+
actionpack (= 6.1.5.1)
|
151
|
+
actiontext (= 6.1.5.1)
|
152
|
+
actionview (= 6.1.5.1)
|
153
|
+
activejob (= 6.1.5.1)
|
154
|
+
activemodel (= 6.1.5.1)
|
155
|
+
activerecord (= 6.1.5.1)
|
156
|
+
activestorage (= 6.1.5.1)
|
157
|
+
activesupport (= 6.1.5.1)
|
160
158
|
bundler (>= 1.15.0)
|
161
|
-
railties (= 6.1.
|
159
|
+
railties (= 6.1.5.1)
|
162
160
|
sprockets-rails (>= 2.0.0)
|
163
161
|
rails-dom-testing (2.0.3)
|
164
162
|
activesupport (>= 4.2.0)
|
165
163
|
nokogiri (>= 1.6)
|
166
|
-
rails-html-sanitizer (1.
|
164
|
+
rails-html-sanitizer (1.4.2)
|
167
165
|
loofah (~> 2.3)
|
168
|
-
railties (6.1.
|
169
|
-
actionpack (= 6.1.
|
170
|
-
activesupport (= 6.1.
|
166
|
+
railties (6.1.5.1)
|
167
|
+
actionpack (= 6.1.5.1)
|
168
|
+
activesupport (= 6.1.5.1)
|
171
169
|
method_source
|
172
|
-
rake (>=
|
170
|
+
rake (>= 12.2)
|
173
171
|
thor (~> 1.0)
|
174
|
-
rainbow (3.
|
172
|
+
rainbow (3.1.1)
|
175
173
|
rake (13.0.3)
|
174
|
+
regexp_parser (2.4.0)
|
175
|
+
rexml (3.2.5)
|
176
176
|
rspec-core (3.10.1)
|
177
177
|
rspec-support (~> 3.10.0)
|
178
178
|
rspec-expectations (3.10.1)
|
@@ -190,58 +190,51 @@ GEM
|
|
190
190
|
rspec-mocks (~> 3.10)
|
191
191
|
rspec-support (~> 3.10)
|
192
192
|
rspec-support (3.10.2)
|
193
|
-
rubocop (
|
194
|
-
jaro_winkler (~> 1.5.1)
|
193
|
+
rubocop (1.29.1)
|
195
194
|
parallel (~> 1.10)
|
196
|
-
parser (>=
|
197
|
-
powerpack (~> 0.1)
|
195
|
+
parser (>= 3.1.0.0)
|
198
196
|
rainbow (>= 2.2.2, < 4.0)
|
197
|
+
regexp_parser (>= 1.8, < 3.0)
|
198
|
+
rexml (>= 3.2.5, < 4.0)
|
199
|
+
rubocop-ast (>= 1.17.0, < 2.0)
|
199
200
|
ruby-progressbar (~> 1.7)
|
200
|
-
unicode-display_width (
|
201
|
-
|
202
|
-
|
201
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
202
|
+
rubocop-ast (1.18.0)
|
203
|
+
parser (>= 3.1.1.0)
|
204
|
+
rubocop-rspec (1.30.0)
|
205
|
+
rubocop (>= 0.58.0)
|
206
|
+
ruby-progressbar (1.11.0)
|
207
|
+
ruby2_keywords (0.0.5)
|
208
|
+
sprockets (4.0.3)
|
203
209
|
concurrent-ruby (~> 1.0)
|
204
210
|
rack (> 1, < 3)
|
205
|
-
sprockets-rails (3.
|
206
|
-
actionpack (>=
|
207
|
-
activesupport (>=
|
211
|
+
sprockets-rails (3.4.2)
|
212
|
+
actionpack (>= 5.2)
|
213
|
+
activesupport (>= 5.2)
|
208
214
|
sprockets (>= 3.0.0)
|
209
215
|
sqlite3 (1.4.2)
|
210
|
-
thor (1.1
|
211
|
-
travis (1.8.9)
|
212
|
-
backports
|
213
|
-
faraday (~> 0.9)
|
214
|
-
faraday_middleware (~> 0.9, >= 0.9.1)
|
215
|
-
gh (~> 0.13)
|
216
|
-
highline (~> 1.6)
|
217
|
-
launchy (~> 2.1)
|
218
|
-
pusher-client (~> 0.4)
|
219
|
-
typhoeus (~> 0.6, >= 0.6.8)
|
220
|
-
typhoeus (0.8.0)
|
221
|
-
ethon (>= 0.8.0)
|
216
|
+
thor (1.2.1)
|
222
217
|
tzinfo (2.0.4)
|
223
218
|
concurrent-ruby (~> 1.0)
|
224
|
-
unicode-display_width (1.
|
225
|
-
websocket (
|
226
|
-
websocket-driver (0.7.4)
|
219
|
+
unicode-display_width (2.1.0)
|
220
|
+
websocket-driver (0.7.5)
|
227
221
|
websocket-extensions (>= 0.1.0)
|
228
222
|
websocket-extensions (0.1.5)
|
229
|
-
zeitwerk (2.4
|
223
|
+
zeitwerk (2.5.4)
|
230
224
|
|
231
225
|
PLATFORMS
|
232
226
|
ruby
|
233
227
|
|
234
228
|
DEPENDENCIES
|
235
|
-
bundler (~> 1.12)
|
236
229
|
external_services!
|
237
230
|
factory_bot_rails
|
238
231
|
overcommit
|
239
232
|
pry-rails
|
240
233
|
rake (~> 13.0)
|
241
234
|
rspec-rails
|
242
|
-
rubocop (~> 0
|
235
|
+
rubocop (~> 1.0)
|
236
|
+
rubocop-rspec
|
243
237
|
sqlite3
|
244
|
-
travis (~> 1.8, >= 1.8.2)
|
245
238
|
|
246
239
|
BUNDLED WITH
|
247
|
-
|
240
|
+
2.3.14
|
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
|
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
|
25
|
+
spec.add_dependency 'faraday', '>= 1.4', '< 2'
|
26
|
+
spec.add_dependency 'faraday_middleware', '>= 1.0', '< 2'
|
28
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,
|
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.0
|
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-05-20 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
|
@@ -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
|