active_job_log 1.2.0 → 2.0.0
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/.circleci/config.yml +104 -0
- data/.circleci/setup-rubygems.sh +3 -0
- data/.rubocop.yml +65 -600
- data/.ruby-version +1 -1
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +165 -114
- data/LICENSE.txt +1 -1
- data/README.md +15 -4
- data/active_job_log.gemspec +7 -4
- data/lib/active_job_log/log_ext.rb +1 -1
- data/lib/active_job_log/loggeable.rb +5 -2
- data/lib/active_job_log/version.rb +1 -1
- data/spec/dummy/Rakefile +1 -1
- data/spec/dummy/app/assets/config/manifest.js +0 -2
- data/spec/dummy/app/controllers/application_controller.rb +0 -1
- data/spec/dummy/app/{assets/javascripts → javascript/packs}/application.js +2 -0
- data/spec/dummy/app/jobs/application_job.rb +5 -0
- data/spec/dummy/app/views/layouts/application.html.erb +3 -2
- data/spec/dummy/bin/rails +2 -2
- data/spec/dummy/bin/rake +2 -2
- data/spec/dummy/bin/setup +7 -12
- data/spec/dummy/config.ru +2 -1
- data/spec/dummy/config/application.rb +12 -17
- data/spec/dummy/config/boot.rb +1 -1
- data/spec/dummy/config/cable.yml +2 -2
- data/spec/dummy/config/database.yml +1 -1
- data/spec/dummy/config/environment.rb +1 -1
- data/spec/dummy/config/environments/development.rb +28 -6
- data/spec/dummy/config/environments/production.rb +45 -16
- data/spec/dummy/config/environments/test.rb +24 -7
- data/spec/dummy/config/initializers/assets.rb +0 -2
- 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/filter_parameter_logging.rb +3 -1
- data/spec/dummy/config/initializers/permissions_policy.rb +11 -0
- data/spec/dummy/config/locales/en.yml +1 -1
- data/spec/dummy/config/puma.rb +14 -27
- data/spec/dummy/config/storage.yml +34 -0
- data/spec/factories/active_job_log_jobs.rb +2 -2
- data/spec/lib/active_job_log/log_ext_spec.rb +3 -6
- metadata +97 -62
- data/.hound.yml +0 -4
- data/.travis.yml +0 -16
- data/Guardfile +0 -15
- data/spec/dummy/app/assets/javascripts/cable.js +0 -13
- data/spec/dummy/bin/bundle +0 -3
- data/spec/dummy/bin/update +0 -29
- data/spec/dummy/bin/yarn +0 -11
- data/spec/dummy/config/secrets.yml +0 -32
- data/spec/dummy/config/spring.rb +0 -6
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,13 @@
|
|
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
|
+
### v2.0.0
|
6
|
+
|
7
|
+
#### Changed
|
8
|
+
|
9
|
+
* Replace travis with circleci.
|
10
|
+
* Use Rails 6 on Dummy app.
|
11
|
+
|
5
12
|
### v1.2.0
|
6
13
|
|
7
14
|
#### Changed
|
data/Gemfile.lock
CHANGED
@@ -1,171 +1,219 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
active_job_log (
|
4
|
+
active_job_log (2.0.0)
|
5
5
|
enumerize (>= 1.0)
|
6
|
-
rails (>=
|
6
|
+
rails (>= 6.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actioncable (
|
12
|
-
actionpack (=
|
11
|
+
actioncable (6.1.3.2)
|
12
|
+
actionpack (= 6.1.3.2)
|
13
|
+
activesupport (= 6.1.3.2)
|
13
14
|
nio4r (~> 2.0)
|
14
15
|
websocket-driver (>= 0.6.1)
|
15
|
-
|
16
|
-
actionpack (=
|
17
|
-
|
18
|
-
|
16
|
+
actionmailbox (6.1.3.2)
|
17
|
+
actionpack (= 6.1.3.2)
|
18
|
+
activejob (= 6.1.3.2)
|
19
|
+
activerecord (= 6.1.3.2)
|
20
|
+
activestorage (= 6.1.3.2)
|
21
|
+
activesupport (= 6.1.3.2)
|
22
|
+
mail (>= 2.7.1)
|
23
|
+
actionmailer (6.1.3.2)
|
24
|
+
actionpack (= 6.1.3.2)
|
25
|
+
actionview (= 6.1.3.2)
|
26
|
+
activejob (= 6.1.3.2)
|
27
|
+
activesupport (= 6.1.3.2)
|
19
28
|
mail (~> 2.5, >= 2.5.4)
|
20
29
|
rails-dom-testing (~> 2.0)
|
21
|
-
actionpack (
|
22
|
-
actionview (=
|
23
|
-
activesupport (=
|
24
|
-
rack (~> 2.0)
|
30
|
+
actionpack (6.1.3.2)
|
31
|
+
actionview (= 6.1.3.2)
|
32
|
+
activesupport (= 6.1.3.2)
|
33
|
+
rack (~> 2.0, >= 2.0.9)
|
25
34
|
rack-test (>= 0.6.3)
|
26
35
|
rails-dom-testing (~> 2.0)
|
27
|
-
rails-html-sanitizer (~> 1.0, >= 1.0
|
28
|
-
|
29
|
-
|
36
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
37
|
+
actiontext (6.1.3.2)
|
38
|
+
actionpack (= 6.1.3.2)
|
39
|
+
activerecord (= 6.1.3.2)
|
40
|
+
activestorage (= 6.1.3.2)
|
41
|
+
activesupport (= 6.1.3.2)
|
42
|
+
nokogiri (>= 1.8.5)
|
43
|
+
actionview (6.1.3.2)
|
44
|
+
activesupport (= 6.1.3.2)
|
30
45
|
builder (~> 3.1)
|
31
46
|
erubi (~> 1.4)
|
32
47
|
rails-dom-testing (~> 2.0)
|
33
|
-
rails-html-sanitizer (~> 1.
|
34
|
-
activejob (
|
35
|
-
activesupport (=
|
48
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
49
|
+
activejob (6.1.3.2)
|
50
|
+
activesupport (= 6.1.3.2)
|
36
51
|
globalid (>= 0.3.6)
|
37
|
-
activemodel (
|
38
|
-
activesupport (=
|
39
|
-
activerecord (
|
40
|
-
activemodel (=
|
41
|
-
activesupport (=
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
activerecord (=
|
46
|
-
|
47
|
-
|
52
|
+
activemodel (6.1.3.2)
|
53
|
+
activesupport (= 6.1.3.2)
|
54
|
+
activerecord (6.1.3.2)
|
55
|
+
activemodel (= 6.1.3.2)
|
56
|
+
activesupport (= 6.1.3.2)
|
57
|
+
activestorage (6.1.3.2)
|
58
|
+
actionpack (= 6.1.3.2)
|
59
|
+
activejob (= 6.1.3.2)
|
60
|
+
activerecord (= 6.1.3.2)
|
61
|
+
activesupport (= 6.1.3.2)
|
62
|
+
marcel (~> 1.0.0)
|
63
|
+
mini_mime (~> 1.0.2)
|
64
|
+
activesupport (6.1.3.2)
|
48
65
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
49
|
-
i18n (>=
|
50
|
-
minitest (
|
51
|
-
tzinfo (~>
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
66
|
+
i18n (>= 1.6, < 2)
|
67
|
+
minitest (>= 5.1)
|
68
|
+
tzinfo (~> 2.0)
|
69
|
+
zeitwerk (~> 2.3)
|
70
|
+
ast (2.4.2)
|
71
|
+
builder (3.2.4)
|
72
|
+
coderay (1.1.3)
|
73
|
+
concurrent-ruby (1.1.9)
|
74
|
+
coveralls (0.8.23)
|
57
75
|
json (>= 1.8, < 3)
|
58
|
-
simplecov (~> 0.
|
76
|
+
simplecov (~> 0.16.1)
|
59
77
|
term-ansicolor (~> 1.3)
|
60
|
-
thor (
|
78
|
+
thor (>= 0.19.4, < 2.0)
|
61
79
|
tins (~> 1.6)
|
62
|
-
crass (1.0.
|
63
|
-
diff-lcs (1.
|
64
|
-
docile (1.
|
80
|
+
crass (1.0.6)
|
81
|
+
diff-lcs (1.4.4)
|
82
|
+
docile (1.4.0)
|
65
83
|
enumerize (2.4.0)
|
66
84
|
activesupport (>= 3.2)
|
67
|
-
erubi (1.
|
68
|
-
factory_bot (
|
69
|
-
activesupport (>=
|
70
|
-
factory_bot_rails (
|
71
|
-
factory_bot (~>
|
72
|
-
railties (>=
|
85
|
+
erubi (1.10.0)
|
86
|
+
factory_bot (6.2.0)
|
87
|
+
activesupport (>= 5.0.0)
|
88
|
+
factory_bot_rails (6.2.0)
|
89
|
+
factory_bot (~> 6.2.0)
|
90
|
+
railties (>= 5.0.0)
|
73
91
|
globalid (0.4.2)
|
74
92
|
activesupport (>= 4.2.0)
|
75
|
-
i18n (1.
|
93
|
+
i18n (1.8.10)
|
76
94
|
concurrent-ruby (~> 1.0)
|
77
|
-
json (2.1
|
78
|
-
loofah (2.
|
95
|
+
json (2.5.1)
|
96
|
+
loofah (2.10.0)
|
79
97
|
crass (~> 1.0.2)
|
80
98
|
nokogiri (>= 1.5.9)
|
81
99
|
mail (2.7.1)
|
82
100
|
mini_mime (>= 0.1.1)
|
83
|
-
marcel (0.
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
101
|
+
marcel (1.0.1)
|
102
|
+
method_source (1.0.0)
|
103
|
+
mini_mime (1.0.3)
|
104
|
+
minitest (5.14.4)
|
105
|
+
nio4r (2.5.7)
|
106
|
+
nokogiri (1.11.7-x86_64-darwin)
|
107
|
+
racc (~> 1.4)
|
108
|
+
nokogiri (1.11.7-x86_64-linux)
|
109
|
+
racc (~> 1.4)
|
110
|
+
parallel (1.20.1)
|
111
|
+
parser (3.0.1.1)
|
112
|
+
ast (~> 2.4.1)
|
113
|
+
pry (0.14.1)
|
114
|
+
coderay (~> 1.1)
|
115
|
+
method_source (~> 1.0)
|
116
|
+
pry-rails (0.3.9)
|
97
117
|
pry (>= 0.10.4)
|
98
|
-
|
99
|
-
rack
|
118
|
+
racc (1.5.2)
|
119
|
+
rack (2.2.3)
|
120
|
+
rack-test (1.1.0)
|
100
121
|
rack (>= 1.0, < 3)
|
101
|
-
rails (
|
102
|
-
actioncable (=
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
122
|
+
rails (6.1.3.2)
|
123
|
+
actioncable (= 6.1.3.2)
|
124
|
+
actionmailbox (= 6.1.3.2)
|
125
|
+
actionmailer (= 6.1.3.2)
|
126
|
+
actionpack (= 6.1.3.2)
|
127
|
+
actiontext (= 6.1.3.2)
|
128
|
+
actionview (= 6.1.3.2)
|
129
|
+
activejob (= 6.1.3.2)
|
130
|
+
activemodel (= 6.1.3.2)
|
131
|
+
activerecord (= 6.1.3.2)
|
132
|
+
activestorage (= 6.1.3.2)
|
133
|
+
activesupport (= 6.1.3.2)
|
134
|
+
bundler (>= 1.15.0)
|
135
|
+
railties (= 6.1.3.2)
|
113
136
|
sprockets-rails (>= 2.0.0)
|
114
137
|
rails-dom-testing (2.0.3)
|
115
138
|
activesupport (>= 4.2.0)
|
116
139
|
nokogiri (>= 1.6)
|
117
|
-
rails-html-sanitizer (1.0
|
118
|
-
loofah (~> 2.
|
119
|
-
railties (
|
120
|
-
actionpack (=
|
121
|
-
activesupport (=
|
140
|
+
rails-html-sanitizer (1.3.0)
|
141
|
+
loofah (~> 2.3)
|
142
|
+
railties (6.1.3.2)
|
143
|
+
actionpack (= 6.1.3.2)
|
144
|
+
activesupport (= 6.1.3.2)
|
122
145
|
method_source
|
123
146
|
rake (>= 0.8.7)
|
124
|
-
thor (
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
147
|
+
thor (~> 1.0)
|
148
|
+
rainbow (3.0.0)
|
149
|
+
rake (13.0.3)
|
150
|
+
regexp_parser (2.1.1)
|
151
|
+
rexml (3.2.5)
|
152
|
+
rspec-core (3.10.1)
|
153
|
+
rspec-support (~> 3.10.0)
|
154
|
+
rspec-expectations (3.10.1)
|
129
155
|
diff-lcs (>= 1.2.0, < 2.0)
|
130
|
-
rspec-support (~> 3.
|
131
|
-
rspec-mocks (3.
|
156
|
+
rspec-support (~> 3.10.0)
|
157
|
+
rspec-mocks (3.10.2)
|
132
158
|
diff-lcs (>= 1.2.0, < 2.0)
|
133
|
-
rspec-support (~> 3.
|
134
|
-
rspec-rails (
|
135
|
-
actionpack (>=
|
136
|
-
activesupport (>=
|
137
|
-
railties (>=
|
138
|
-
rspec-core (~> 3.
|
139
|
-
rspec-expectations (~> 3.
|
140
|
-
rspec-mocks (~> 3.
|
141
|
-
rspec-support (~> 3.
|
142
|
-
rspec-support (3.
|
143
|
-
|
144
|
-
|
159
|
+
rspec-support (~> 3.10.0)
|
160
|
+
rspec-rails (5.0.1)
|
161
|
+
actionpack (>= 5.2)
|
162
|
+
activesupport (>= 5.2)
|
163
|
+
railties (>= 5.2)
|
164
|
+
rspec-core (~> 3.10)
|
165
|
+
rspec-expectations (~> 3.10)
|
166
|
+
rspec-mocks (~> 3.10)
|
167
|
+
rspec-support (~> 3.10)
|
168
|
+
rspec-support (3.10.2)
|
169
|
+
rspec_junit_formatter (0.4.1)
|
170
|
+
rspec-core (>= 2, < 4, != 2.12.0)
|
171
|
+
rubocop (1.17.0)
|
172
|
+
parallel (~> 1.10)
|
173
|
+
parser (>= 3.0.0.0)
|
174
|
+
rainbow (>= 2.2.2, < 4.0)
|
175
|
+
regexp_parser (>= 1.8, < 3.0)
|
176
|
+
rexml
|
177
|
+
rubocop-ast (>= 1.7.0, < 2.0)
|
178
|
+
ruby-progressbar (~> 1.7)
|
179
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
180
|
+
rubocop-ast (1.7.0)
|
181
|
+
parser (>= 3.0.1.1)
|
182
|
+
rubocop-rails (2.10.1)
|
183
|
+
activesupport (>= 4.2.0)
|
184
|
+
rack (>= 1.1)
|
185
|
+
rubocop (>= 1.7.0, < 2.0)
|
186
|
+
ruby-progressbar (1.11.0)
|
187
|
+
simplecov (0.16.1)
|
188
|
+
docile (~> 1.1)
|
145
189
|
json (>= 1.8, < 3)
|
146
190
|
simplecov-html (~> 0.10.0)
|
147
191
|
simplecov-html (0.10.2)
|
148
|
-
sprockets (
|
192
|
+
sprockets (4.0.2)
|
149
193
|
concurrent-ruby (~> 1.0)
|
150
194
|
rack (> 1, < 3)
|
151
195
|
sprockets-rails (3.2.2)
|
152
196
|
actionpack (>= 4.0)
|
153
197
|
activesupport (>= 4.0)
|
154
198
|
sprockets (>= 3.0.0)
|
155
|
-
sqlite3 (1.
|
156
|
-
|
199
|
+
sqlite3 (1.4.2)
|
200
|
+
sync (0.5.0)
|
201
|
+
term-ansicolor (1.7.1)
|
157
202
|
tins (~> 1.0)
|
158
|
-
thor (
|
159
|
-
|
160
|
-
|
161
|
-
tzinfo (
|
162
|
-
|
163
|
-
|
203
|
+
thor (1.1.0)
|
204
|
+
tins (1.29.1)
|
205
|
+
sync
|
206
|
+
tzinfo (2.0.4)
|
207
|
+
concurrent-ruby (~> 1.0)
|
208
|
+
unicode-display_width (2.0.0)
|
209
|
+
websocket-driver (0.7.5)
|
164
210
|
websocket-extensions (>= 0.1.0)
|
165
211
|
websocket-extensions (0.1.5)
|
212
|
+
zeitwerk (2.4.2)
|
166
213
|
|
167
214
|
PLATFORMS
|
168
|
-
|
215
|
+
x86_64-darwin-20
|
216
|
+
x86_64-linux
|
169
217
|
|
170
218
|
DEPENDENCIES
|
171
219
|
active_job_log!
|
@@ -174,7 +222,10 @@ DEPENDENCIES
|
|
174
222
|
pry
|
175
223
|
pry-rails
|
176
224
|
rspec-rails
|
225
|
+
rspec_junit_formatter
|
226
|
+
rubocop (~> 1.9)
|
227
|
+
rubocop-rails
|
177
228
|
sqlite3
|
178
229
|
|
179
230
|
BUNDLED WITH
|
180
|
-
2.
|
231
|
+
2.2.15
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Active Job Log
|
2
2
|
|
3
3
|
[](https://badge.fury.io/rb/active_job_log)
|
4
|
-
[](https://app.circleci.com/pipelines/github/platanus/active_job_log)
|
5
5
|
[](https://coveralls.io/github/platanus/active_job_log?branch=master)
|
6
6
|
|
7
7
|
Rails engine to register jobs history, adding: job state, error feedback, duration, etc.
|
@@ -95,9 +95,9 @@ queued pending finished failed
|
|
95
95
|
|
96
96
|
- `total_duration`: queued_duration + execution_duration.
|
97
97
|
|
98
|
-
- `queue_name
|
98
|
+
- `queue_name`: job's queue name.
|
99
99
|
|
100
|
-
- `executions
|
100
|
+
- `executions`: number of times this job has been executed (which increments on every retry, like after an exception.
|
101
101
|
|
102
102
|
### Important
|
103
103
|
|
@@ -126,6 +126,17 @@ bundle exec guard
|
|
126
126
|
|
127
127
|
You need to put **all your tests** in the `/active_job_log/spec/dummy/spec/` directory.
|
128
128
|
|
129
|
+
## Publishing
|
130
|
+
|
131
|
+
On master/main branch...
|
132
|
+
|
133
|
+
1. Change `VERSION` in `lib/gemaker/version.rb`.
|
134
|
+
2. Change `Unreleased` title to current version in `CHANGELOG.md`.
|
135
|
+
3. Run `bundle install`.
|
136
|
+
4. Commit new release. For example: `Releasing v0.1.0`.
|
137
|
+
5. Create tag. For example: `git tag v0.1.0`.
|
138
|
+
6. Push tag. For example: `git push origin v0.1.0`.
|
139
|
+
|
129
140
|
## Contributing
|
130
141
|
|
131
142
|
1. Fork it
|
@@ -144,4 +155,4 @@ Active Job Log is maintained by [platanus](http://platan.us).
|
|
144
155
|
|
145
156
|
## License
|
146
157
|
|
147
|
-
Active Job Log is ©
|
158
|
+
Active Job Log is © 2021 platanus, spa. It is free software and may be redistributed under the terms specified in the LICENSE file.
|
data/active_job_log.gemspec
CHANGED
@@ -19,13 +19,16 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
s.test_files = Dir["spec/**/*"]
|
21
21
|
|
22
|
-
s.add_dependency "rails", ">=
|
22
|
+
s.add_dependency "rails", ">= 6.0"
|
23
23
|
s.add_dependency "enumerize", ">= 1.0"
|
24
24
|
|
25
|
+
s.add_development_dependency "coveralls"
|
26
|
+
s.add_development_dependency "factory_bot_rails"
|
25
27
|
s.add_development_dependency "pry"
|
26
28
|
s.add_development_dependency "pry-rails"
|
27
|
-
s.add_development_dependency "
|
29
|
+
s.add_development_dependency "rspec_junit_formatter"
|
28
30
|
s.add_development_dependency "rspec-rails"
|
29
|
-
s.add_development_dependency "
|
30
|
-
s.add_development_dependency "
|
31
|
+
s.add_development_dependency "rubocop", "~> 1.9"
|
32
|
+
s.add_development_dependency "rubocop-rails"
|
33
|
+
s.add_development_dependency "sqlite3"
|
31
34
|
end
|
@@ -2,11 +2,11 @@ module ActiveJobLog
|
|
2
2
|
module Loggeable
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
|
+
STATUSES = %i{queued pending finished failed}
|
6
|
+
|
5
7
|
included do
|
6
8
|
extend Enumerize
|
7
9
|
|
8
|
-
STATUSES = %i{queued pending finished failed}
|
9
|
-
|
10
10
|
validates :job_id, presence: true
|
11
11
|
|
12
12
|
enumerize :status, in: STATUSES, scope: true
|
@@ -20,17 +20,20 @@ module ActiveJobLog
|
|
20
20
|
|
21
21
|
def set_queued_duration
|
22
22
|
return if queued_at.blank? || started_at.blank?
|
23
|
+
|
23
24
|
self.queued_duration = (started_at.to_f - queued_at.to_f).to_i
|
24
25
|
end
|
25
26
|
|
26
27
|
def set_execution_duration
|
27
28
|
return if started_at.blank? || ended_at.blank?
|
29
|
+
|
28
30
|
self.execution_duration = (ended_at.to_f - started_at.to_f).to_i
|
29
31
|
end
|
30
32
|
|
31
33
|
def set_total_duration
|
32
34
|
from = queued_at || started_at
|
33
35
|
return if from.blank? || ended_at.blank?
|
36
|
+
|
34
37
|
self.total_duration = (ended_at.to_f - from.to_f).to_i
|
35
38
|
end
|
36
39
|
end
|