active_job_log 1.2.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) 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 +7 -0
  7. data/Gemfile.lock +165 -114
  8. data/LICENSE.txt +1 -1
  9. data/README.md +15 -4
  10. data/active_job_log.gemspec +7 -4
  11. data/lib/active_job_log/log_ext.rb +1 -1
  12. data/lib/active_job_log/loggeable.rb +5 -2
  13. data/lib/active_job_log/version.rb +1 -1
  14. data/spec/dummy/Rakefile +1 -1
  15. data/spec/dummy/app/assets/config/manifest.js +0 -2
  16. data/spec/dummy/app/controllers/application_controller.rb +0 -1
  17. data/spec/dummy/app/{assets/javascripts → javascript/packs}/application.js +2 -0
  18. data/spec/dummy/app/jobs/application_job.rb +5 -0
  19. data/spec/dummy/app/views/layouts/application.html.erb +3 -2
  20. data/spec/dummy/bin/rails +2 -2
  21. data/spec/dummy/bin/rake +2 -2
  22. data/spec/dummy/bin/setup +7 -12
  23. data/spec/dummy/config.ru +2 -1
  24. data/spec/dummy/config/application.rb +12 -17
  25. data/spec/dummy/config/boot.rb +1 -1
  26. data/spec/dummy/config/cable.yml +2 -2
  27. data/spec/dummy/config/database.yml +1 -1
  28. data/spec/dummy/config/environment.rb +1 -1
  29. data/spec/dummy/config/environments/development.rb +28 -6
  30. data/spec/dummy/config/environments/production.rb +45 -16
  31. data/spec/dummy/config/environments/test.rb +24 -7
  32. data/spec/dummy/config/initializers/assets.rb +0 -2
  33. data/spec/dummy/config/initializers/backtrace_silencers.rb +4 -3
  34. data/spec/dummy/config/initializers/content_security_policy.rb +28 -0
  35. data/spec/dummy/config/initializers/filter_parameter_logging.rb +3 -1
  36. data/spec/dummy/config/initializers/permissions_policy.rb +11 -0
  37. data/spec/dummy/config/locales/en.yml +1 -1
  38. data/spec/dummy/config/puma.rb +14 -27
  39. data/spec/dummy/config/storage.yml +34 -0
  40. data/spec/factories/active_job_log_jobs.rb +2 -2
  41. data/spec/lib/active_job_log/log_ext_spec.rb +3 -6
  42. metadata +97 -62
  43. data/.hound.yml +0 -4
  44. data/.travis.yml +0 -16
  45. data/Guardfile +0 -15
  46. data/spec/dummy/app/assets/javascripts/cable.js +0 -13
  47. data/spec/dummy/bin/bundle +0 -3
  48. data/spec/dummy/bin/update +0 -29
  49. data/spec/dummy/bin/yarn +0 -11
  50. data/spec/dummy/config/secrets.yml +0 -32
  51. 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,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 (1.2.0)
4
+ active_job_log (2.0.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)
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.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)
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.0.1)
93
+ i18n (1.8.10)
76
94
  concurrent-ruby (~> 1.0)
77
- json (2.1.0)
78
- loofah (2.2.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.3.3)
84
- mimemagic (~> 0.3.2)
85
- method_source (0.9.0)
86
- mimemagic (0.3.5)
87
- mini_mime (1.0.2)
88
- mini_portile2 (2.3.0)
89
- minitest (5.11.3)
90
- nio4r (2.5.2)
91
- nokogiri (1.8.2)
92
- mini_portile2 (~> 2.3.0)
93
- pry (0.11.3)
94
- coderay (~> 1.1.0)
95
- method_source (~> 0.9.0)
96
- 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)
97
117
  pry (>= 0.10.4)
98
- rack (2.0.5)
99
- rack-test (1.0.0)
118
+ racc (1.5.2)
119
+ rack (2.2.3)
120
+ rack-test (1.1.0)
100
121
  rack (>= 1.0, < 3)
101
- rails (5.2.0)
102
- actioncable (= 5.2.0)
103
- actionmailer (= 5.2.0)
104
- actionpack (= 5.2.0)
105
- actionview (= 5.2.0)
106
- activejob (= 5.2.0)
107
- activemodel (= 5.2.0)
108
- activerecord (= 5.2.0)
109
- activestorage (= 5.2.0)
110
- activesupport (= 5.2.0)
111
- bundler (>= 1.3.0)
112
- 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)
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.4)
118
- loofah (~> 2.2, >= 2.2.2)
119
- railties (5.2.0)
120
- actionpack (= 5.2.0)
121
- 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)
122
145
  method_source
123
146
  rake (>= 0.8.7)
124
- thor (>= 0.18.1, < 2.0)
125
- rake (12.3.1)
126
- rspec-core (3.7.1)
127
- rspec-support (~> 3.7.0)
128
- 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)
129
155
  diff-lcs (>= 1.2.0, < 2.0)
130
- rspec-support (~> 3.7.0)
131
- rspec-mocks (3.7.0)
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.7.0)
134
- rspec-rails (3.7.2)
135
- actionpack (>= 3.0)
136
- activesupport (>= 3.0)
137
- railties (>= 3.0)
138
- rspec-core (~> 3.7.0)
139
- rspec-expectations (~> 3.7.0)
140
- rspec-mocks (~> 3.7.0)
141
- rspec-support (~> 3.7.0)
142
- rspec-support (3.7.1)
143
- simplecov (0.14.1)
144
- 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)
145
189
  json (>= 1.8, < 3)
146
190
  simplecov-html (~> 0.10.0)
147
191
  simplecov-html (0.10.2)
148
- sprockets (3.7.2)
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.3.13)
156
- term-ansicolor (1.6.0)
199
+ sqlite3 (1.4.2)
200
+ sync (0.5.0)
201
+ term-ansicolor (1.7.1)
157
202
  tins (~> 1.0)
158
- thor (0.19.4)
159
- thread_safe (0.3.6)
160
- tins (1.16.3)
161
- tzinfo (1.2.5)
162
- thread_safe (~> 0.1)
163
- websocket-driver (0.7.3)
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
- ruby
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.1.4
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,9 @@ 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
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 © 2018 platanus, spa. It is free software and may be redistributed under the terms specified in the LICENSE file.
158
+ Active Job Log is © 2021 platanus, spa. It is free software and may be redistributed under the terms specified in the LICENSE file.
@@ -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", ">= 4.2.0"
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 "sqlite3"
29
+ s.add_development_dependency "rspec_junit_formatter"
28
30
  s.add_development_dependency "rspec-rails"
29
- s.add_development_dependency "factory_bot_rails"
30
- s.add_development_dependency "coveralls"
31
+ s.add_development_dependency "rubocop", "~> 1.9"
32
+ s.add_development_dependency "rubocop-rails"
33
+ s.add_development_dependency "sqlite3"
31
34
  end
@@ -40,4 +40,4 @@ module ActiveJobLog
40
40
  end
41
41
  end
42
42
 
43
- ActiveJob::Base.send(:include, ActiveJobLog::LogExt)
43
+ ActiveJob::Base.include ActiveJobLog::LogExt
@@ -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