job_notifier 1.5.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +104 -0
- data/.circleci/setup-rubygems.sh +3 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +65 -594
- data/.ruby-version +1 -1
- data/CHANGELOG.md +17 -0
- data/Gemfile.lock +219 -133
- data/README.md +10 -1
- data/app/models/job_notifier/job.rb +3 -2
- data/job_notifier.gemspec +9 -5
- data/lib/job_notifier/engine.rb +0 -4
- data/lib/job_notifier/notifier.rb +5 -5
- data/lib/job_notifier/version.rb +1 -1
- data/spec/dummy/Rakefile +1 -1
- data/spec/dummy/app/assets/config/manifest.js +3 -0
- data/spec/dummy/app/assets/stylesheets/application.css +3 -3
- data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +0 -3
- data/spec/dummy/app/javascript/packs/application.js +15 -0
- data/spec/dummy/app/jobs/application_job.rb +7 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +10 -9
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/bin/rails +3 -3
- data/spec/dummy/bin/rake +2 -2
- data/spec/dummy/bin/setup +18 -14
- data/spec/dummy/config/application.rb +12 -21
- data/spec/dummy/config/boot.rb +3 -3
- data/spec/dummy/config/cable.yml +10 -0
- data/spec/dummy/config/database.yml +2 -2
- data/spec/dummy/config/environment.rb +1 -1
- data/spec/dummy/config/environments/development.rb +49 -14
- data/spec/dummy/config/environments/production.rb +63 -22
- data/spec/dummy/config/environments/test.rb +29 -12
- data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +4 -3
- data/spec/dummy/config/initializers/content_security_policy.rb +28 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +2 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +3 -1
- data/spec/dummy/config/initializers/permissions_policy.rb +11 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +2 -2
- data/spec/dummy/config/locales/en.yml +11 -1
- data/spec/dummy/config/puma.rb +43 -0
- data/spec/dummy/config/routes.rb +0 -1
- data/spec/dummy/config/storage.yml +34 -0
- data/spec/dummy/config.ru +3 -1
- data/spec/dummy/public/404.html +6 -6
- data/spec/dummy/public/422.html +6 -6
- data/spec/dummy/public/500.html +6 -6
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/factories/job_notifier_jobs.rb +3 -3
- data/spec/lib/job_notifier/notifier_spec.rb +8 -8
- data/spec/models/job_notifier/job_spec.rb +0 -2
- data/spec/spec_helper.rb +2 -0
- metadata +95 -21
- data/.travis.yml +0 -14
- data/spec/dummy/config/initializers/assets.rb +0 -11
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2
|
1
|
+
3.2
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,23 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
+
### v3.0.0
|
6
|
+
|
7
|
+
##### Added
|
8
|
+
|
9
|
+
* Add Ruby 3.1 and 3.2 support
|
10
|
+
|
11
|
+
##### Removed
|
12
|
+
|
13
|
+
* Remove Ruby 2.5 and 2.6 support
|
14
|
+
|
15
|
+
### v2.0.0
|
16
|
+
|
17
|
+
##### Changed
|
18
|
+
|
19
|
+
- Replace travis with CircleCI.
|
20
|
+
- Update Dependencies to play nice with Rails 6.
|
21
|
+
|
5
22
|
### v1.5.0
|
6
23
|
|
7
24
|
##### Added
|
data/Gemfile.lock
CHANGED
@@ -1,169 +1,255 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
job_notifier (
|
4
|
+
job_notifier (3.0.0)
|
5
5
|
colorize (>= 0.7.7)
|
6
6
|
enumerize (>= 1.0)
|
7
|
-
rails (>=
|
7
|
+
rails (>= 6.0)
|
8
8
|
silencer (= 1.0.0.rc3)
|
9
9
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
|
14
|
-
actionpack (=
|
15
|
-
|
16
|
-
|
13
|
+
actioncable (7.0.6)
|
14
|
+
actionpack (= 7.0.6)
|
15
|
+
activesupport (= 7.0.6)
|
16
|
+
nio4r (~> 2.0)
|
17
|
+
websocket-driver (>= 0.6.1)
|
18
|
+
actionmailbox (7.0.6)
|
19
|
+
actionpack (= 7.0.6)
|
20
|
+
activejob (= 7.0.6)
|
21
|
+
activerecord (= 7.0.6)
|
22
|
+
activestorage (= 7.0.6)
|
23
|
+
activesupport (= 7.0.6)
|
24
|
+
mail (>= 2.7.1)
|
25
|
+
net-imap
|
26
|
+
net-pop
|
27
|
+
net-smtp
|
28
|
+
actionmailer (7.0.6)
|
29
|
+
actionpack (= 7.0.6)
|
30
|
+
actionview (= 7.0.6)
|
31
|
+
activejob (= 7.0.6)
|
32
|
+
activesupport (= 7.0.6)
|
17
33
|
mail (~> 2.5, >= 2.5.4)
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
34
|
+
net-imap
|
35
|
+
net-pop
|
36
|
+
net-smtp
|
37
|
+
rails-dom-testing (~> 2.0)
|
38
|
+
actionpack (7.0.6)
|
39
|
+
actionview (= 7.0.6)
|
40
|
+
activesupport (= 7.0.6)
|
41
|
+
rack (~> 2.0, >= 2.2.4)
|
42
|
+
rack-test (>= 0.6.3)
|
43
|
+
rails-dom-testing (~> 2.0)
|
44
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
45
|
+
actiontext (7.0.6)
|
46
|
+
actionpack (= 7.0.6)
|
47
|
+
activerecord (= 7.0.6)
|
48
|
+
activestorage (= 7.0.6)
|
49
|
+
activesupport (= 7.0.6)
|
50
|
+
globalid (>= 0.6.0)
|
51
|
+
nokogiri (>= 1.8.5)
|
52
|
+
actionview (7.0.6)
|
53
|
+
activesupport (= 7.0.6)
|
28
54
|
builder (~> 3.1)
|
29
|
-
|
30
|
-
rails-dom-testing (~>
|
31
|
-
rails-html-sanitizer (~> 1.
|
32
|
-
activejob (
|
33
|
-
activesupport (=
|
34
|
-
globalid (>= 0.3.
|
35
|
-
activemodel (
|
36
|
-
activesupport (=
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
55
|
+
erubi (~> 1.4)
|
56
|
+
rails-dom-testing (~> 2.0)
|
57
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
58
|
+
activejob (7.0.6)
|
59
|
+
activesupport (= 7.0.6)
|
60
|
+
globalid (>= 0.3.6)
|
61
|
+
activemodel (7.0.6)
|
62
|
+
activesupport (= 7.0.6)
|
63
|
+
activerecord (7.0.6)
|
64
|
+
activemodel (= 7.0.6)
|
65
|
+
activesupport (= 7.0.6)
|
66
|
+
activestorage (7.0.6)
|
67
|
+
actionpack (= 7.0.6)
|
68
|
+
activejob (= 7.0.6)
|
69
|
+
activerecord (= 7.0.6)
|
70
|
+
activesupport (= 7.0.6)
|
71
|
+
marcel (~> 1.0)
|
72
|
+
mini_mime (>= 1.1.0)
|
73
|
+
activesupport (7.0.6)
|
74
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
75
|
+
i18n (>= 1.6, < 2)
|
76
|
+
minitest (>= 5.1)
|
77
|
+
tzinfo (~> 2.0)
|
78
|
+
ast (2.4.2)
|
79
|
+
builder (3.2.4)
|
80
|
+
coderay (1.1.3)
|
81
|
+
colorize (1.1.0)
|
82
|
+
concurrent-ruby (1.2.2)
|
83
|
+
coveralls (0.8.23)
|
53
84
|
json (>= 1.8, < 3)
|
54
|
-
simplecov (~> 0.
|
85
|
+
simplecov (~> 0.16.1)
|
55
86
|
term-ansicolor (~> 1.3)
|
56
|
-
thor (
|
87
|
+
thor (>= 0.19.4, < 2.0)
|
57
88
|
tins (~> 1.6)
|
58
|
-
crass (1.0.
|
59
|
-
|
60
|
-
|
61
|
-
|
89
|
+
crass (1.0.6)
|
90
|
+
date (3.3.3)
|
91
|
+
diff-lcs (1.5.0)
|
92
|
+
docile (1.4.0)
|
93
|
+
enumerize (2.6.1)
|
62
94
|
activesupport (>= 3.2)
|
63
|
-
|
64
|
-
factory_bot (
|
65
|
-
activesupport (>=
|
66
|
-
factory_bot_rails (
|
67
|
-
factory_bot (~>
|
68
|
-
railties (>=
|
69
|
-
globalid (
|
70
|
-
activesupport (>=
|
71
|
-
i18n (
|
95
|
+
erubi (1.12.0)
|
96
|
+
factory_bot (6.2.1)
|
97
|
+
activesupport (>= 5.0.0)
|
98
|
+
factory_bot_rails (6.2.0)
|
99
|
+
factory_bot (~> 6.2.0)
|
100
|
+
railties (>= 5.0.0)
|
101
|
+
globalid (1.1.0)
|
102
|
+
activesupport (>= 5.0)
|
103
|
+
i18n (1.14.1)
|
72
104
|
concurrent-ruby (~> 1.0)
|
73
|
-
json (2.
|
74
|
-
|
105
|
+
json (2.6.3)
|
106
|
+
language_server-protocol (3.17.0.3)
|
107
|
+
loofah (2.21.3)
|
75
108
|
crass (~> 1.0.2)
|
76
|
-
nokogiri (>= 1.
|
77
|
-
mail (2.
|
109
|
+
nokogiri (>= 1.12.0)
|
110
|
+
mail (2.8.1)
|
78
111
|
mini_mime (>= 0.1.1)
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
112
|
+
net-imap
|
113
|
+
net-pop
|
114
|
+
net-smtp
|
115
|
+
marcel (1.0.2)
|
116
|
+
method_source (1.0.0)
|
117
|
+
mini_mime (1.1.2)
|
118
|
+
minitest (5.18.1)
|
119
|
+
net-imap (0.3.6)
|
120
|
+
date
|
121
|
+
net-protocol
|
122
|
+
net-pop (0.1.2)
|
123
|
+
net-protocol
|
124
|
+
net-protocol (0.2.1)
|
125
|
+
timeout
|
126
|
+
net-smtp (0.3.3)
|
127
|
+
net-protocol
|
128
|
+
nio4r (2.5.9)
|
129
|
+
nokogiri (1.15.2-arm64-darwin)
|
130
|
+
racc (~> 1.4)
|
131
|
+
nokogiri (1.15.2-x86_64-darwin)
|
132
|
+
racc (~> 1.4)
|
133
|
+
nokogiri (1.15.2-x86_64-linux)
|
134
|
+
racc (~> 1.4)
|
135
|
+
parallel (1.23.0)
|
136
|
+
parser (3.2.2.3)
|
137
|
+
ast (~> 2.4.1)
|
138
|
+
racc
|
139
|
+
pry (0.14.2)
|
140
|
+
coderay (~> 1.1)
|
141
|
+
method_source (~> 1.0)
|
142
|
+
racc (1.7.1)
|
143
|
+
rack (2.2.7)
|
144
|
+
rack-test (2.1.0)
|
145
|
+
rack (>= 1.3)
|
146
|
+
rails (7.0.6)
|
147
|
+
actioncable (= 7.0.6)
|
148
|
+
actionmailbox (= 7.0.6)
|
149
|
+
actionmailer (= 7.0.6)
|
150
|
+
actionpack (= 7.0.6)
|
151
|
+
actiontext (= 7.0.6)
|
152
|
+
actionview (= 7.0.6)
|
153
|
+
activejob (= 7.0.6)
|
154
|
+
activemodel (= 7.0.6)
|
155
|
+
activerecord (= 7.0.6)
|
156
|
+
activestorage (= 7.0.6)
|
157
|
+
activesupport (= 7.0.6)
|
158
|
+
bundler (>= 1.15.0)
|
159
|
+
railties (= 7.0.6)
|
160
|
+
rails-dom-testing (2.0.3)
|
161
|
+
activesupport (>= 4.2.0)
|
162
|
+
nokogiri (>= 1.6)
|
163
|
+
rails-html-sanitizer (1.6.0)
|
164
|
+
loofah (~> 2.21)
|
165
|
+
nokogiri (~> 1.14)
|
166
|
+
railties (7.0.6)
|
167
|
+
actionpack (= 7.0.6)
|
168
|
+
activesupport (= 7.0.6)
|
169
|
+
method_source
|
170
|
+
rake (>= 12.2)
|
171
|
+
thor (~> 1.0)
|
172
|
+
zeitwerk (~> 2.5)
|
173
|
+
rainbow (3.1.1)
|
174
|
+
rake (13.0.6)
|
175
|
+
regexp_parser (2.8.1)
|
176
|
+
rexml (3.2.5)
|
177
|
+
rspec-core (3.12.2)
|
178
|
+
rspec-support (~> 3.12.0)
|
179
|
+
rspec-expectations (3.12.3)
|
120
180
|
diff-lcs (>= 1.2.0, < 2.0)
|
121
|
-
rspec-support (~> 3.
|
122
|
-
rspec-mocks (3.
|
181
|
+
rspec-support (~> 3.12.0)
|
182
|
+
rspec-mocks (3.12.5)
|
123
183
|
diff-lcs (>= 1.2.0, < 2.0)
|
124
|
-
rspec-support (~> 3.
|
125
|
-
rspec-rails (
|
126
|
-
actionpack (>=
|
127
|
-
activesupport (>=
|
128
|
-
railties (>=
|
129
|
-
rspec-core (~> 3.
|
130
|
-
rspec-expectations (~> 3.
|
131
|
-
rspec-mocks (~> 3.
|
132
|
-
rspec-support (~> 3.
|
133
|
-
rspec-support (3.
|
184
|
+
rspec-support (~> 3.12.0)
|
185
|
+
rspec-rails (6.0.3)
|
186
|
+
actionpack (>= 6.1)
|
187
|
+
activesupport (>= 6.1)
|
188
|
+
railties (>= 6.1)
|
189
|
+
rspec-core (~> 3.12)
|
190
|
+
rspec-expectations (~> 3.12)
|
191
|
+
rspec-mocks (~> 3.12)
|
192
|
+
rspec-support (~> 3.12)
|
193
|
+
rspec-support (3.12.1)
|
194
|
+
rspec_junit_formatter (0.6.0)
|
195
|
+
rspec-core (>= 2, < 4, != 2.12.0)
|
196
|
+
rubocop (1.53.1)
|
197
|
+
json (~> 2.3)
|
198
|
+
language_server-protocol (>= 3.17.0)
|
199
|
+
parallel (~> 1.10)
|
200
|
+
parser (>= 3.2.2.3)
|
201
|
+
rainbow (>= 2.2.2, < 4.0)
|
202
|
+
regexp_parser (>= 1.8, < 3.0)
|
203
|
+
rexml (>= 3.2.5, < 4.0)
|
204
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
205
|
+
ruby-progressbar (~> 1.7)
|
206
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
207
|
+
rubocop-ast (1.29.0)
|
208
|
+
parser (>= 3.2.1.0)
|
209
|
+
rubocop-rails (2.20.2)
|
210
|
+
activesupport (>= 4.2.0)
|
211
|
+
rack (>= 1.1)
|
212
|
+
rubocop (>= 1.33.0, < 2.0)
|
213
|
+
ruby-progressbar (1.13.0)
|
134
214
|
silencer (1.0.0.rc3)
|
135
|
-
simplecov (0.
|
136
|
-
docile (~> 1.1
|
215
|
+
simplecov (0.16.1)
|
216
|
+
docile (~> 1.1)
|
137
217
|
json (>= 1.8, < 3)
|
138
218
|
simplecov-html (~> 0.10.0)
|
139
|
-
simplecov-html (0.10.
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
actionpack (>= 4.0)
|
146
|
-
activesupport (>= 4.0)
|
147
|
-
sprockets (>= 3.0.0)
|
148
|
-
sqlite3 (1.3.13)
|
149
|
-
term-ansicolor (1.4.1)
|
219
|
+
simplecov-html (0.10.2)
|
220
|
+
sqlite3 (1.6.3-arm64-darwin)
|
221
|
+
sqlite3 (1.6.3-x86_64-darwin)
|
222
|
+
sqlite3 (1.6.3-x86_64-linux)
|
223
|
+
sync (0.5.0)
|
224
|
+
term-ansicolor (1.7.1)
|
150
225
|
tins (~> 1.0)
|
151
|
-
thor (
|
152
|
-
|
153
|
-
tins (1.
|
154
|
-
|
155
|
-
|
226
|
+
thor (1.2.2)
|
227
|
+
timeout (0.4.0)
|
228
|
+
tins (1.32.1)
|
229
|
+
sync
|
230
|
+
tzinfo (2.0.6)
|
231
|
+
concurrent-ruby (~> 1.0)
|
232
|
+
unicode-display_width (2.4.2)
|
233
|
+
websocket-driver (0.7.5)
|
234
|
+
websocket-extensions (>= 0.1.0)
|
235
|
+
websocket-extensions (0.1.5)
|
236
|
+
zeitwerk (2.6.8)
|
156
237
|
|
157
238
|
PLATFORMS
|
158
|
-
|
239
|
+
arm64-darwin-22
|
240
|
+
x86_64-darwin-20
|
241
|
+
x86_64-linux
|
159
242
|
|
160
243
|
DEPENDENCIES
|
161
244
|
coveralls
|
162
245
|
factory_bot_rails
|
163
246
|
job_notifier!
|
164
247
|
pry
|
165
|
-
rspec-rails
|
248
|
+
rspec-rails
|
249
|
+
rspec_junit_formatter
|
250
|
+
rubocop (~> 1.9)
|
251
|
+
rubocop-rails
|
166
252
|
sqlite3
|
167
253
|
|
168
254
|
BUNDLED WITH
|
169
|
-
|
255
|
+
2.2.15
|
data/README.md
CHANGED
@@ -96,7 +96,7 @@ JobNotifier.onNotify = function(data) {
|
|
96
96
|
Now, you are be able to get feedback of your jobs but, you don't have any! so, the **Third** step is to define a job.
|
97
97
|
|
98
98
|
```ruby
|
99
|
-
class MyJob <
|
99
|
+
class MyJob < ApplicationJob
|
100
100
|
def perform_with_feedback(param1, param2)
|
101
101
|
MyService.run(param1, param2)
|
102
102
|
end
|
@@ -147,6 +147,15 @@ If you are building an API or your client app is not part of the project you hav
|
|
147
147
|
You can get the identifier executing in server side something like this: `@current_user.job_identifier` (Remember, I'm assuming you have a `@current_user` instance of `User` class that includes the `JobNotifier::Identifier` mixin).
|
148
148
|
|
149
149
|
The root url is your server url (where Job Notifier gem was installed).
|
150
|
+
## Publishing
|
151
|
+
|
152
|
+
On master/main branch...
|
153
|
+
|
154
|
+
1. Change `VERSION` in `lib/job_notifier/version.rb`.
|
155
|
+
2. Change `Unreleased` title to current version in `CHANGELOG.md`.
|
156
|
+
3. Commit new release. For example: `Releasing v0.1.0`.
|
157
|
+
4. Create tag. For example: `git tag v0.1.0`.
|
158
|
+
5. Push tag. For example: `git push origin v0.1.0`.
|
150
159
|
|
151
160
|
## Contributing
|
152
161
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module JobNotifier
|
2
|
-
class Job <
|
2
|
+
class Job < ApplicationRecord
|
3
3
|
extend Enumerize
|
4
4
|
|
5
5
|
STATUSES = [:pending, :finished, :failed]
|
@@ -9,7 +9,8 @@ module JobNotifier
|
|
9
9
|
def self.update_feedback(job_id, data, status)
|
10
10
|
job = JobNotifier::Job.find_by(job_id: job_id)
|
11
11
|
return unless job
|
12
|
-
|
12
|
+
|
13
|
+
job.update(result: data.to_s, status: status, notified: false)
|
13
14
|
end
|
14
15
|
|
15
16
|
def self.unnotified_by_identifier(encoded_identifier)
|
data/job_notifier.gemspec
CHANGED
@@ -17,14 +17,18 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.files = `git ls-files`.split($/).reject { |fn| fn.start_with? "spec" }
|
18
18
|
s.test_files = Dir["spec/**/*"]
|
19
19
|
|
20
|
-
s.add_dependency "rails", ">=
|
21
|
-
|
20
|
+
s.add_dependency "rails", ">= 6.0"
|
21
|
+
|
22
22
|
s.add_dependency "colorize", ">= 0.7.7"
|
23
|
+
s.add_dependency "enumerize", ">= 1.0"
|
23
24
|
s.add_dependency "silencer", "1.0.0.rc3"
|
24
25
|
|
26
|
+
s.add_development_dependency "coveralls"
|
27
|
+
s.add_development_dependency "factory_bot_rails"
|
25
28
|
s.add_development_dependency "pry"
|
29
|
+
s.add_development_dependency "rspec_junit_formatter"
|
30
|
+
s.add_development_dependency "rspec-rails"
|
31
|
+
s.add_development_dependency "rubocop", "~> 1.9"
|
32
|
+
s.add_development_dependency "rubocop-rails"
|
26
33
|
s.add_development_dependency "sqlite3"
|
27
|
-
s.add_development_dependency "rspec-rails", "~> 3.4.0"
|
28
|
-
s.add_development_dependency "factory_bot_rails"
|
29
|
-
s.add_development_dependency "coveralls"
|
30
34
|
end
|
data/lib/job_notifier/engine.rb
CHANGED
@@ -16,10 +16,6 @@ module JobNotifier
|
|
16
16
|
require_relative "./adapters"
|
17
17
|
require_relative "./logger"
|
18
18
|
|
19
|
-
ActiveSupport.on_load :action_controller do
|
20
|
-
helper(JobNotifier::ApplicationHelper)
|
21
|
-
end
|
22
|
-
|
23
19
|
if JobNotifier.silenced_log
|
24
20
|
Rails.application.middleware.swap(
|
25
21
|
Rails::Rack::Logger,
|
@@ -6,11 +6,11 @@ module JobNotifier
|
|
6
6
|
def perform(*args)
|
7
7
|
result = perform_with_feedback(*args)
|
8
8
|
save_success_feedback(result)
|
9
|
-
rescue JobNotifier::Error::Validation =>
|
10
|
-
save_error_feedback(
|
11
|
-
rescue StandardError =>
|
9
|
+
rescue JobNotifier::Error::Validation => e
|
10
|
+
save_error_feedback(e.error)
|
11
|
+
rescue StandardError => e
|
12
12
|
save_error_feedback("unknown")
|
13
|
-
raise
|
13
|
+
raise e
|
14
14
|
end
|
15
15
|
|
16
16
|
def save_error_feedback(error)
|
@@ -37,4 +37,4 @@ module JobNotifier
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
ActiveJob::Base.
|
40
|
+
ActiveJob::Base.include(JobNotifier::Notifier)
|
data/lib/job_notifier/version.rb
CHANGED
data/spec/dummy/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
2
|
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
3
|
|
4
|
-
|
4
|
+
require_relative "config/application"
|
5
5
|
|
6
6
|
Rails.application.load_tasks
|
@@ -6,9 +6,9 @@
|
|
6
6
|
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
7
|
*
|
8
8
|
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any
|
10
|
-
*
|
11
|
-
* file per style scope.
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
12
|
*
|
13
13
|
*= require_tree .
|
14
14
|
*= require_self
|
@@ -0,0 +1,15 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require rails-ujs
|
14
|
+
//= require activestorage
|
15
|
+
//= require_tree .
|
@@ -0,0 +1,7 @@
|
|
1
|
+
class ApplicationJob < ActiveJob::Base
|
2
|
+
# Automatically retry jobs that encountered a deadlock
|
3
|
+
# retry_on ActiveRecord::Deadlocked
|
4
|
+
|
5
|
+
# Most jobs are safe to ignore if the underlying records are no longer available
|
6
|
+
# discard_on ActiveJob::DeserializationError
|
7
|
+
end
|
@@ -1,14 +1,15 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html>
|
3
|
-
<head>
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
</head>
|
9
|
-
<body <%= job_identifier_for(@current_user) %>>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<%= csrf_meta_tags %>
|
7
|
+
<%= csp_meta_tag %>
|
10
8
|
|
11
|
-
<%=
|
9
|
+
<%= stylesheet_link_tag 'application', media: 'all' %>
|
10
|
+
</head>
|
12
11
|
|
13
|
-
|
12
|
+
<body>
|
13
|
+
<%= yield %>
|
14
|
+
</body>
|
14
15
|
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|