active_job_log 0.2.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +104 -0
  3. data/.circleci/setup-rubygems.sh +3 -0
  4. data/.rubocop.yml +65 -600
  5. data/.ruby-version +1 -1
  6. data/CHANGELOG.md +25 -0
  7. data/Gemfile.lock +170 -154
  8. data/LICENSE.txt +1 -1
  9. data/README.md +29 -4
  10. data/active_job_log.gemspec +7 -5
  11. data/lib/active_job_log/engine.rb +1 -0
  12. data/lib/active_job_log/log_ext.rb +39 -20
  13. data/lib/active_job_log/loggeable.rb +75 -0
  14. data/lib/active_job_log/version.rb +1 -1
  15. data/lib/generators/active_job_log/install/install_generator.rb +4 -0
  16. data/lib/generators/active_job_log/install/templates/job_model.rb +5 -0
  17. data/spec/dummy/Rakefile +1 -1
  18. data/spec/dummy/app/assets/config/manifest.js +0 -2
  19. data/spec/dummy/app/controllers/application_controller.rb +0 -1
  20. data/spec/dummy/app/{assets/javascripts → javascript/packs}/application.js +2 -0
  21. data/spec/dummy/app/jobs/application_job.rb +5 -0
  22. data/spec/dummy/app/models/active_job_log/job.rb +5 -0
  23. data/spec/dummy/app/views/layouts/application.html.erb +3 -2
  24. data/spec/dummy/bin/rails +2 -2
  25. data/spec/dummy/bin/rake +2 -2
  26. data/spec/dummy/bin/setup +7 -12
  27. data/spec/dummy/config.ru +2 -1
  28. data/spec/dummy/config/application.rb +12 -17
  29. data/spec/dummy/config/boot.rb +1 -1
  30. data/spec/dummy/config/cable.yml +2 -2
  31. data/spec/dummy/config/database.yml +1 -1
  32. data/spec/dummy/config/environment.rb +1 -1
  33. data/spec/dummy/config/environments/development.rb +28 -6
  34. data/spec/dummy/config/environments/production.rb +45 -16
  35. data/spec/dummy/config/environments/test.rb +24 -7
  36. data/spec/dummy/config/initializers/assets.rb +0 -2
  37. data/spec/dummy/config/initializers/backtrace_silencers.rb +4 -3
  38. data/spec/dummy/config/initializers/content_security_policy.rb +28 -0
  39. data/spec/dummy/config/initializers/filter_parameter_logging.rb +3 -1
  40. data/spec/dummy/config/initializers/permissions_policy.rb +11 -0
  41. data/spec/dummy/config/locales/en.yml +1 -1
  42. data/spec/dummy/config/puma.rb +14 -27
  43. data/spec/dummy/config/storage.yml +34 -0
  44. data/spec/factories/active_job_log_jobs.rb +2 -2
  45. data/spec/lib/active_job_log/log_ext_spec.rb +53 -23
  46. metadata +54 -31
  47. data/.hound.yml +0 -4
  48. data/.travis.yml +0 -15
  49. data/Guardfile +0 -15
  50. data/app/models/active_job_log/job.rb +0 -72
  51. data/spec/dummy/app/assets/javascripts/cable.js +0 -13
  52. data/spec/dummy/bin/bundle +0 -3
  53. data/spec/dummy/bin/update +0 -29
  54. data/spec/dummy/bin/yarn +0 -11
  55. data/spec/dummy/config/secrets.yml +0 -32
  56. data/spec/dummy/config/spring.rb +0 -6
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.3
1
+ 2.7
data/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
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.1.0
6
+
7
+ #### Added
8
+
9
+ * Avoid logging using `disable_job_logs` class method.
10
+
11
+ ### v2.0.0
12
+
13
+ #### Changed
14
+
15
+ * Replace travis with circleci.
16
+ * Use Rails 6 on Dummy app.
17
+
18
+ ### v1.2.0
19
+
20
+ #### Changed
21
+
22
+ * Use update instead of deprecated update_attributes.
23
+
24
+ ### v1.0.0
25
+
26
+ #### Changed
27
+
28
+ * Copy Job model into app.
29
+
5
30
  ### v0.2.1
6
31
 
7
32
  #### Fixed
data/Gemfile.lock CHANGED
@@ -1,215 +1,231 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_job_log (0.2.1)
4
+ active_job_log (2.1.0)
5
5
  enumerize (>= 1.0)
6
- rails (>= 4.2.0)
6
+ rails (>= 6.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actioncable (5.2.0)
12
- actionpack (= 5.2.0)
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
- actionmailer (5.2.0)
16
- actionpack (= 5.2.0)
17
- actionview (= 5.2.0)
18
- activejob (= 5.2.0)
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 (5.2.0)
22
- actionview (= 5.2.0)
23
- activesupport (= 5.2.0)
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.2)
28
- actionview (5.2.0)
29
- activesupport (= 5.2.0)
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.0, >= 1.0.3)
34
- activejob (5.2.0)
35
- activesupport (= 5.2.0)
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 (5.2.0)
38
- activesupport (= 5.2.0)
39
- activerecord (5.2.0)
40
- activemodel (= 5.2.0)
41
- activesupport (= 5.2.0)
42
- arel (>= 9.0)
43
- activestorage (5.2.0)
44
- actionpack (= 5.2.0)
45
- activerecord (= 5.2.0)
46
- marcel (~> 0.3.1)
47
- activesupport (5.2.0)
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 (>= 0.7, < 2)
50
- minitest (~> 5.1)
51
- tzinfo (~> 1.1)
52
- arel (9.0.0)
53
- builder (3.2.3)
54
- coderay (1.1.2)
55
- concurrent-ruby (1.0.5)
56
- coveralls (0.8.21)
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.14.1)
76
+ simplecov (~> 0.16.1)
59
77
  term-ansicolor (~> 1.3)
60
- thor (~> 0.19.4)
78
+ thor (>= 0.19.4, < 2.0)
61
79
  tins (~> 1.6)
62
- crass (1.0.4)
63
- diff-lcs (1.3)
64
- docile (1.1.5)
65
- enumerize (2.2.2)
80
+ crass (1.0.6)
81
+ diff-lcs (1.4.4)
82
+ docile (1.4.0)
83
+ enumerize (2.4.0)
66
84
  activesupport (>= 3.2)
67
- erubi (1.7.1)
68
- factory_bot (4.8.2)
69
- activesupport (>= 3.0.0)
70
- factory_bot_rails (4.8.2)
71
- factory_bot (~> 4.8.2)
72
- railties (>= 3.0.0)
73
- ffi (1.9.23)
74
- formatador (0.2.5)
75
- globalid (0.4.1)
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)
91
+ globalid (0.4.2)
76
92
  activesupport (>= 4.2.0)
77
- guard (2.14.2)
78
- formatador (>= 0.2.4)
79
- listen (>= 2.7, < 4.0)
80
- lumberjack (>= 1.0.12, < 2.0)
81
- nenv (~> 0.1)
82
- notiffany (~> 0.0)
83
- pry (>= 0.9.12)
84
- shellany (~> 0.0)
85
- thor (>= 0.18.1)
86
- guard-compat (1.2.1)
87
- guard-rspec (4.7.3)
88
- guard (~> 2.1)
89
- guard-compat (~> 1.1)
90
- rspec (>= 2.99.0, < 4.0)
91
- i18n (1.0.1)
93
+ i18n (1.8.10)
92
94
  concurrent-ruby (~> 1.0)
93
- json (2.1.0)
94
- listen (3.1.5)
95
- rb-fsevent (~> 0.9, >= 0.9.4)
96
- rb-inotify (~> 0.9, >= 0.9.7)
97
- ruby_dep (~> 1.2)
98
- loofah (2.2.2)
95
+ json (2.5.1)
96
+ loofah (2.10.0)
99
97
  crass (~> 1.0.2)
100
98
  nokogiri (>= 1.5.9)
101
- lumberjack (1.0.13)
102
- mail (2.7.0)
99
+ mail (2.7.1)
103
100
  mini_mime (>= 0.1.1)
104
- marcel (0.3.3)
105
- mimemagic (~> 0.3.2)
106
- method_source (0.9.0)
107
- mimemagic (0.3.2)
108
- mini_mime (1.0.1)
109
- mini_portile2 (2.3.0)
110
- minitest (5.11.3)
111
- nenv (0.3.0)
112
- nio4r (2.3.1)
113
- nokogiri (1.8.2)
114
- mini_portile2 (~> 2.3.0)
115
- notiffany (0.1.1)
116
- nenv (~> 0.1)
117
- shellany (~> 0.0)
118
- pry (0.11.3)
119
- coderay (~> 1.1.0)
120
- method_source (~> 0.9.0)
121
- pry-rails (0.3.6)
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)
122
117
  pry (>= 0.10.4)
123
- rack (2.0.5)
124
- rack-test (1.0.0)
118
+ racc (1.5.2)
119
+ rack (2.2.3)
120
+ rack-test (1.1.0)
125
121
  rack (>= 1.0, < 3)
126
- rails (5.2.0)
127
- actioncable (= 5.2.0)
128
- actionmailer (= 5.2.0)
129
- actionpack (= 5.2.0)
130
- actionview (= 5.2.0)
131
- activejob (= 5.2.0)
132
- activemodel (= 5.2.0)
133
- activerecord (= 5.2.0)
134
- activestorage (= 5.2.0)
135
- activesupport (= 5.2.0)
136
- bundler (>= 1.3.0)
137
- railties (= 5.2.0)
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)
138
136
  sprockets-rails (>= 2.0.0)
139
137
  rails-dom-testing (2.0.3)
140
138
  activesupport (>= 4.2.0)
141
139
  nokogiri (>= 1.6)
142
- rails-html-sanitizer (1.0.4)
143
- loofah (~> 2.2, >= 2.2.2)
144
- railties (5.2.0)
145
- actionpack (= 5.2.0)
146
- activesupport (= 5.2.0)
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)
147
145
  method_source
148
146
  rake (>= 0.8.7)
149
- thor (>= 0.18.1, < 2.0)
150
- rake (12.3.1)
151
- rb-fsevent (0.10.3)
152
- rb-inotify (0.9.10)
153
- ffi (>= 0.5.0, < 2)
154
- rspec (3.7.0)
155
- rspec-core (~> 3.7.0)
156
- rspec-expectations (~> 3.7.0)
157
- rspec-mocks (~> 3.7.0)
158
- rspec-core (3.7.1)
159
- rspec-support (~> 3.7.0)
160
- rspec-expectations (3.7.0)
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)
161
155
  diff-lcs (>= 1.2.0, < 2.0)
162
- rspec-support (~> 3.7.0)
163
- rspec-mocks (3.7.0)
156
+ rspec-support (~> 3.10.0)
157
+ rspec-mocks (3.10.2)
164
158
  diff-lcs (>= 1.2.0, < 2.0)
165
- rspec-support (~> 3.7.0)
166
- rspec-rails (3.7.2)
167
- actionpack (>= 3.0)
168
- activesupport (>= 3.0)
169
- railties (>= 3.0)
170
- rspec-core (~> 3.7.0)
171
- rspec-expectations (~> 3.7.0)
172
- rspec-mocks (~> 3.7.0)
173
- rspec-support (~> 3.7.0)
174
- rspec-support (3.7.1)
175
- ruby_dep (1.5.0)
176
- shellany (0.0.1)
177
- simplecov (0.14.1)
178
- docile (~> 1.1.0)
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)
179
189
  json (>= 1.8, < 3)
180
190
  simplecov-html (~> 0.10.0)
181
191
  simplecov-html (0.10.2)
182
- sprockets (3.7.2)
192
+ sprockets (4.0.2)
183
193
  concurrent-ruby (~> 1.0)
184
194
  rack (> 1, < 3)
185
- sprockets-rails (3.2.1)
195
+ sprockets-rails (3.2.2)
186
196
  actionpack (>= 4.0)
187
197
  activesupport (>= 4.0)
188
198
  sprockets (>= 3.0.0)
189
- sqlite3 (1.3.13)
190
- term-ansicolor (1.6.0)
199
+ sqlite3 (1.4.2)
200
+ sync (0.5.0)
201
+ term-ansicolor (1.7.1)
191
202
  tins (~> 1.0)
192
- thor (0.19.4)
193
- thread_safe (0.3.6)
194
- tins (1.16.3)
195
- tzinfo (1.2.5)
196
- thread_safe (~> 0.1)
197
- websocket-driver (0.7.0)
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)
198
210
  websocket-extensions (>= 0.1.0)
199
- websocket-extensions (0.1.3)
211
+ websocket-extensions (0.1.5)
212
+ zeitwerk (2.4.2)
200
213
 
201
214
  PLATFORMS
202
- ruby
215
+ x86_64-darwin-20
216
+ x86_64-linux
203
217
 
204
218
  DEPENDENCIES
205
219
  active_job_log!
206
220
  coveralls
207
221
  factory_bot_rails
208
- guard-rspec
209
222
  pry
210
223
  pry-rails
211
224
  rspec-rails
225
+ rspec_junit_formatter
226
+ rubocop (~> 1.9)
227
+ rubocop-rails
212
228
  sqlite3
213
229
 
214
230
  BUNDLED WITH
215
- 1.16.3
231
+ 2.2.15
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright 2018 Platanus
3
+ Copyright 2021 Platanus
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Active Job Log
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/active_job_log.svg)](https://badge.fury.io/rb/active_job_log)
4
- [![Build Status](https://travis-ci.org/platanus/active_job_log.svg?branch=master)](https://travis-ci.org/platanus/active_job_log)
4
+ [![CircleCI](https://circleci.com/gh/platanus/active_job_log.svg?style=shield)](https://app.circleci.com/pipelines/github/platanus/active_job_log)
5
5
  [![Coverage Status](https://coveralls.io/repos/github/platanus/active_job_log/badge.svg?branch=master)](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,23 @@ queued pending finished failed
95
95
 
96
96
  - `total_duration`: queued_duration + execution_duration.
97
97
 
98
- - `queue_name `: job's queue name.
98
+ - `queue_name`: job's queue name.
99
99
 
100
- - `executions `: number of times this job has been executed (which increments on every retry, like after an exception.
100
+ - `executions`: number of times this job has been executed (which increments on every retry, like after an exception.
101
+
102
+ ### Disable logging
103
+
104
+ If you want to avoid logging a specific job you have to add `disable_job_logs` config option on that job. For example:
105
+
106
+ ```ruby
107
+ class MyJob < ActiveJob::Base
108
+ disable_job_logs
109
+
110
+ def perform(param1, param2)
111
+ # ...
112
+ end
113
+ end
114
+ ```
101
115
 
102
116
  ### Important
103
117
 
@@ -126,6 +140,17 @@ bundle exec guard
126
140
 
127
141
  You need to put **all your tests** in the `/active_job_log/spec/dummy/spec/` directory.
128
142
 
143
+ ## Publishing
144
+
145
+ On master/main branch...
146
+
147
+ 1. Change `VERSION` in `lib/gemaker/version.rb`.
148
+ 2. Change `Unreleased` title to current version in `CHANGELOG.md`.
149
+ 3. Run `bundle install`.
150
+ 4. Commit new release. For example: `Releasing v0.1.0`.
151
+ 5. Create tag. For example: `git tag v0.1.0`.
152
+ 6. Push tag. For example: `git push origin v0.1.0`.
153
+
129
154
  ## Contributing
130
155
 
131
156
  1. Fork it
@@ -144,4 +169,4 @@ Active Job Log is maintained by [platanus](http://platan.us).
144
169
 
145
170
  ## License
146
171
 
147
- Active Job Log is © 2018 platanus, spa. It is free software and may be redistributed under the terms specified in the LICENSE file.
172
+ Active Job Log is © 2021 platanus, spa. It is free software and may be redistributed under the terms specified in the LICENSE file.