active_job_log 0.1.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 +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +9 -0
- data/.hound.yml +4 -0
- data/.rspec +3 -0
- data/.rubocop.yml +1038 -0
- data/.ruby-version +1 -0
- data/.travis.yml +15 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +215 -0
- data/Guardfile +15 -0
- data/LICENSE.txt +21 -0
- data/README.md +143 -0
- data/Rakefile +10 -0
- data/active_job_log.gemspec +32 -0
- data/app/assets/config/active_job_log_manifest.js +2 -0
- data/app/assets/images/active_job_log/.keep +0 -0
- data/app/assets/javascripts/active_job_log/application.js +13 -0
- data/app/assets/stylesheets/active_job_log/application.css +15 -0
- data/app/controllers/active_job_log/application_controller.rb +5 -0
- data/app/helpers/active_job_log/application_helper.rb +4 -0
- data/app/jobs/active_job_log/application_job.rb +4 -0
- data/app/mailers/active_job_log/application_mailer.rb +6 -0
- data/app/models/active_job_log/application_record.rb +5 -0
- data/app/models/active_job_log/job.rb +68 -0
- data/app/views/layouts/active_job_log/application.html.erb +14 -0
- data/bin/rails +14 -0
- data/config/routes.rb +2 -0
- data/db/migrate/20180511184635_create_active_job_log_jobs.rb +22 -0
- data/lib/active_job_log.rb +26 -0
- data/lib/active_job_log/engine.rb +14 -0
- data/lib/active_job_log/log_ext.rb +43 -0
- data/lib/active_job_log/version.rb +3 -0
- data/lib/generators/active_job_log/install/USAGE +5 -0
- data/lib/generators/active_job_log/install/install_generator.rb +19 -0
- data/lib/generators/active_job_log/install/templates/initializer.rb +2 -0
- data/lib/tasks/active_job_log_tasks.rake +4 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/config/manifest.js +5 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/javascripts/cable.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- 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 +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/jobs/application_job.rb +2 -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 +14 -0
- 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/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +38 -0
- data/spec/dummy/bin/update +29 -0
- data/spec/dummy/bin/yarn +11 -0
- data/spec/dummy/config.ru +5 -0
- data/spec/dummy/config/application.rb +27 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/cable.yml +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +54 -0
- data/spec/dummy/config/environments/production.rb +91 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/dummy/config/initializers/assets.rb +14 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +33 -0
- data/spec/dummy/config/puma.rb +56 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config/secrets.yml +32 -0
- data/spec/dummy/config/spring.rb +6 -0
- data/spec/dummy/db/schema.rb +33 -0
- data/spec/dummy/package.json +5 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/spec/assets/image.png +0 -0
- data/spec/dummy/spec/assets/video.mp4 +0 -0
- data/spec/dummy/spec/support/test_helpers.rb +5 -0
- data/spec/factories/active_job_log_jobs.rb +7 -0
- data/spec/lib/active_job_log/log_ext_spec.rb +84 -0
- data/spec/models/active_job_log/job_spec.rb +187 -0
- data/spec/rails_helper.rb +48 -0
- data/spec/spec_helper.rb +9 -0
- metadata +328 -0
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.3
|
data/.travis.yml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
sudo: false
|
|
2
|
+
language: ruby
|
|
3
|
+
rvm:
|
|
4
|
+
- 2.3.1
|
|
5
|
+
script:
|
|
6
|
+
- RAILS_ENV=test bundle exec rake db:create db:migrate
|
|
7
|
+
- bundle exec rspec spec
|
|
8
|
+
deploy:
|
|
9
|
+
provider: rubygems
|
|
10
|
+
api_key:
|
|
11
|
+
secure: jdniKr5kUszQJ1fATVM/1ChmvMMlYQovbPlrUZwxrKxV856qD6pvajhRCT7hJF9KIK7UIi5VEdFdjNKZhsztBIwpYwzmt4IsxiSOgXjDar2kH7Qer213Jx3tgWnu3NsbjBQy2l+QgefLnaxJEtxg3EFNNnD2/XInPhWrV8SRgn5YFPsyRNCXwLYAIMrZgeummKcpp3MeGXLt385sAJzgmQLaZjg2yyC7fbQ1Hh0ib/oU+6amfJV4aDRREWOdboxH+/c/FvNhT/P5lcZvNi/EGbkkG9OLWUguwcchE/vRBDosKWhx2mUqaBYwDet0eEbyNYfYMcaFB5/SjWLI+u0+ZKZ3oKQ+DKwQrWTPVBV6rPPpDrOOeEwQ0CnSpuoTCPJTCGPZCd0kk9O9k509+xQ479+Zo3BdkCREpk4fMKiH/2nNqU1o+lpzYNnnzeWjC5SLuJhxuUxuGEAhHyYK3rX3lL/ldxUp3TrcDfQ0fXMi5y7GM9QjYG6Z6gWP2S2e2J8tbjN3JfJM2iy3oHgFnoIHduu+phZYRsfMuN4vzFVJ8MN+Y651He6FHXq/pX9JXIbR/lZMPPITi+Tk2Rsmn+KFSYRpd1Ne2g8ZwGYPKeQt5xGcitGwpKPpLQlINpbqwDDaFo22tO68gVCBdiVboELz0pvexvzPOllKsPFDh4JhFhg=
|
|
12
|
+
gem: active_job_log
|
|
13
|
+
on:
|
|
14
|
+
tags: true
|
|
15
|
+
repo: platanus/active_job_log
|
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
# Declare your gem's dependencies in active_job_log.gemspec.
|
|
4
|
+
# Bundler will treat runtime dependencies like base dependencies, and
|
|
5
|
+
# development dependencies will be added by default to the :development group.
|
|
6
|
+
gemspec
|
|
7
|
+
|
|
8
|
+
# Declare any dependencies that are still in development here instead of in
|
|
9
|
+
# your gemspec. These might include edge Rails or gems from your path or
|
|
10
|
+
# Git. Remember to move these dependencies to your gemspec before releasing
|
|
11
|
+
# your gem to rubygems.org.
|
|
12
|
+
|
|
13
|
+
# To use a debugger
|
|
14
|
+
# gem 'byebug', group: [:development, :test]
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
active_job_log (0.1.0)
|
|
5
|
+
enumerize (>= 1.0)
|
|
6
|
+
rails (>= 4.2.0)
|
|
7
|
+
|
|
8
|
+
GEM
|
|
9
|
+
remote: https://rubygems.org/
|
|
10
|
+
specs:
|
|
11
|
+
actioncable (5.2.0)
|
|
12
|
+
actionpack (= 5.2.0)
|
|
13
|
+
nio4r (~> 2.0)
|
|
14
|
+
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)
|
|
19
|
+
mail (~> 2.5, >= 2.5.4)
|
|
20
|
+
rails-dom-testing (~> 2.0)
|
|
21
|
+
actionpack (5.2.0)
|
|
22
|
+
actionview (= 5.2.0)
|
|
23
|
+
activesupport (= 5.2.0)
|
|
24
|
+
rack (~> 2.0)
|
|
25
|
+
rack-test (>= 0.6.3)
|
|
26
|
+
rails-dom-testing (~> 2.0)
|
|
27
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
|
28
|
+
actionview (5.2.0)
|
|
29
|
+
activesupport (= 5.2.0)
|
|
30
|
+
builder (~> 3.1)
|
|
31
|
+
erubi (~> 1.4)
|
|
32
|
+
rails-dom-testing (~> 2.0)
|
|
33
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
|
34
|
+
activejob (5.2.0)
|
|
35
|
+
activesupport (= 5.2.0)
|
|
36
|
+
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)
|
|
48
|
+
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)
|
|
57
|
+
json (>= 1.8, < 3)
|
|
58
|
+
simplecov (~> 0.14.1)
|
|
59
|
+
term-ansicolor (~> 1.3)
|
|
60
|
+
thor (~> 0.19.4)
|
|
61
|
+
tins (~> 1.6)
|
|
62
|
+
crass (1.0.4)
|
|
63
|
+
diff-lcs (1.3)
|
|
64
|
+
docile (1.1.5)
|
|
65
|
+
enumerize (2.2.2)
|
|
66
|
+
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)
|
|
76
|
+
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)
|
|
92
|
+
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)
|
|
99
|
+
crass (~> 1.0.2)
|
|
100
|
+
nokogiri (>= 1.5.9)
|
|
101
|
+
lumberjack (1.0.13)
|
|
102
|
+
mail (2.7.0)
|
|
103
|
+
mini_mime (>= 0.1.1)
|
|
104
|
+
marcel (0.3.2)
|
|
105
|
+
mimemagic (~> 0.3.2)
|
|
106
|
+
method_source (0.9.0)
|
|
107
|
+
mimemagic (0.3.2)
|
|
108
|
+
mini_mime (1.0.0)
|
|
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)
|
|
122
|
+
pry (>= 0.10.4)
|
|
123
|
+
rack (2.0.5)
|
|
124
|
+
rack-test (1.0.0)
|
|
125
|
+
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)
|
|
138
|
+
sprockets-rails (>= 2.0.0)
|
|
139
|
+
rails-dom-testing (2.0.3)
|
|
140
|
+
activesupport (>= 4.2.0)
|
|
141
|
+
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)
|
|
147
|
+
method_source
|
|
148
|
+
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)
|
|
161
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
162
|
+
rspec-support (~> 3.7.0)
|
|
163
|
+
rspec-mocks (3.7.0)
|
|
164
|
+
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)
|
|
179
|
+
json (>= 1.8, < 3)
|
|
180
|
+
simplecov-html (~> 0.10.0)
|
|
181
|
+
simplecov-html (0.10.2)
|
|
182
|
+
sprockets (3.7.1)
|
|
183
|
+
concurrent-ruby (~> 1.0)
|
|
184
|
+
rack (> 1, < 3)
|
|
185
|
+
sprockets-rails (3.2.1)
|
|
186
|
+
actionpack (>= 4.0)
|
|
187
|
+
activesupport (>= 4.0)
|
|
188
|
+
sprockets (>= 3.0.0)
|
|
189
|
+
sqlite3 (1.3.13)
|
|
190
|
+
term-ansicolor (1.6.0)
|
|
191
|
+
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)
|
|
198
|
+
websocket-extensions (>= 0.1.0)
|
|
199
|
+
websocket-extensions (0.1.3)
|
|
200
|
+
|
|
201
|
+
PLATFORMS
|
|
202
|
+
ruby
|
|
203
|
+
|
|
204
|
+
DEPENDENCIES
|
|
205
|
+
active_job_log!
|
|
206
|
+
coveralls
|
|
207
|
+
factory_bot_rails
|
|
208
|
+
guard-rspec
|
|
209
|
+
pry
|
|
210
|
+
pry-rails
|
|
211
|
+
rspec-rails
|
|
212
|
+
sqlite3
|
|
213
|
+
|
|
214
|
+
BUNDLED WITH
|
|
215
|
+
1.16.1
|
data/Guardfile
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
guard :rspec, cmd: "bundle exec rspec" do
|
|
2
|
+
spec_dic = "spec/dummy/spec"
|
|
3
|
+
# RSpec files
|
|
4
|
+
watch("spec/spec_helper.rb") { spec_dic }
|
|
5
|
+
watch("spec/rails_helper.rb") { spec_dic }
|
|
6
|
+
watch(%r{^spec\/dummy\/spec\/support\/(.+)\.rb$}) { spec_dic }
|
|
7
|
+
watch(%r{^spec\/dummy\/spec\/.+_spec\.rb$})
|
|
8
|
+
# Engine files
|
|
9
|
+
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/dummy/spec/lib/#{m[1]}_spec.rb" }
|
|
10
|
+
watch(%r{^app/(.+)\.rb$}) { |m| "spec/dummy/spec/#{m[1]}_spec.rb" }
|
|
11
|
+
watch(%r{^app/(.*)(\.erb)$}) { |m| "spec/dummy/spec/#{m[1]}#{m[2]}_spec.rb" }
|
|
12
|
+
# Dummy app files
|
|
13
|
+
watch(%r{^spec\/dummy\/app/(.+)\.rb$}) { |m| "spec/dummy/spec/#{m[1]}_spec.rb" }
|
|
14
|
+
watch(%r{^spec\/dummy\/app/(.*)(\.erb)$}) { |m| "spec/dummy/spec/#{m[1]}#{m[2]}_spec.rb" }
|
|
15
|
+
end
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright 2018 Platanus
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# Active Job Log
|
|
2
|
+
|
|
3
|
+
Rails engine to register jobs history, adding: job state, error feedback, duration, etc.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add to your Gemfile:
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
gem "active_job_log"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
bundle install
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Then, run the installer:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
rails generate active_job_log:install
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
Suppose you have defined the following job:
|
|
26
|
+
|
|
27
|
+
```ruby
|
|
28
|
+
class MyJob < ActiveJob::Base
|
|
29
|
+
def perform(param1, param2)
|
|
30
|
+
# ...
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Installing this gem, after executing the job, if you execute like this:
|
|
36
|
+
|
|
37
|
+
```ruby
|
|
38
|
+
MyJob.perform_later("p1", "p2")
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
you will get:
|
|
42
|
+
|
|
43
|
+
```ruby
|
|
44
|
+
job = ActiveJobLog::Job.last
|
|
45
|
+
job.job_id #=> "0ca5075e-c601-45a1-9bbe-147b4d3d5391"
|
|
46
|
+
job.params #=> ["p1", "p2"]
|
|
47
|
+
job.status #=> "finished"
|
|
48
|
+
job.job_class #=> "MyJob"
|
|
49
|
+
job.error #=> nil
|
|
50
|
+
job.stack_trace #=> nil
|
|
51
|
+
job.queued_at #=> Sat, 12 May 2018 20:25:00 UTC +00:00
|
|
52
|
+
job.started_at #=> Sat, 12 May 2018 20:30:00 UTC +00:00
|
|
53
|
+
job.ended_at #=> Sat, 12 May 2018 20:30:00 UTC +00:00
|
|
54
|
+
job.queued_duration #=> 5
|
|
55
|
+
job.execution_duration #=> 10
|
|
56
|
+
job.total_duration #=> 15
|
|
57
|
+
job.queue_name #=> "default"
|
|
58
|
+
job.executions #=> 0
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Attributes
|
|
62
|
+
|
|
63
|
+
- `job_id`: ActiveJob's job_id.
|
|
64
|
+
|
|
65
|
+
- `params`: parameters used to call your job.
|
|
66
|
+
|
|
67
|
+
queued pending finished failed
|
|
68
|
+
|
|
69
|
+
- `status`:
|
|
70
|
+
- `queued`: the job is queued but not executed yet.
|
|
71
|
+
- `pending`: the job is being executed.
|
|
72
|
+
- `finished`: the job ended satisfactorily.
|
|
73
|
+
- `failed`: the job ended with errors.
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
- `job_class`: a string containing your job class name.
|
|
77
|
+
|
|
78
|
+
- `error`: the exception message if your job ends with errors.
|
|
79
|
+
|
|
80
|
+
- `stack_trace`: the exception backtrace if your job ends with errors.
|
|
81
|
+
|
|
82
|
+
- `queued_at`: datetime when job was queued.
|
|
83
|
+
|
|
84
|
+
- `started_at`: datetime when job was executed.
|
|
85
|
+
|
|
86
|
+
- `ended_at`: datetime when job finished regardless of whether it ended or not with errors.
|
|
87
|
+
|
|
88
|
+
- `queued_duration`: seconds that lasted in queue (not registered if it is executed with `perform_now`).
|
|
89
|
+
|
|
90
|
+
- `execution_duration`: seconds that the execution lasted.
|
|
91
|
+
|
|
92
|
+
- `total_duration`: queued_duration + execution_duration.
|
|
93
|
+
|
|
94
|
+
- `queue_name `: job's queue name.
|
|
95
|
+
|
|
96
|
+
- `executions `: number of times this job has been executed (which increments on every retry, like after an exception.
|
|
97
|
+
|
|
98
|
+
### Important
|
|
99
|
+
|
|
100
|
+
If your job calls the `rescue_from` method, you will need to call the `fail_job` method explicitly to log the job completion. For example:
|
|
101
|
+
|
|
102
|
+
```ruby
|
|
103
|
+
class MyJob < ActiveJob::Base
|
|
104
|
+
def perform(param1, param2)
|
|
105
|
+
# ...
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
rescue_from(Exception) do |exception|
|
|
109
|
+
# ...
|
|
110
|
+
fail_job(exception) #=> you need to call this method.
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Testing
|
|
116
|
+
|
|
117
|
+
To run the specs you need to execute, **in the root path of the gem**, the following command:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
bundle exec guard
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
You need to put **all your tests** in the `/active_job_log/spec/dummy/spec/` directory.
|
|
124
|
+
|
|
125
|
+
## Contributing
|
|
126
|
+
|
|
127
|
+
1. Fork it
|
|
128
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
129
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
130
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
131
|
+
5. Create new Pull Request
|
|
132
|
+
|
|
133
|
+
## Credits
|
|
134
|
+
|
|
135
|
+
Thank you [contributors](https://github.com/platanus/active_job_log/graphs/contributors)!
|
|
136
|
+
|
|
137
|
+
<img src="http://platan.us/gravatar_with_text.png" alt="Platanus" width="250"/>
|
|
138
|
+
|
|
139
|
+
Active Job Log is maintained by [platanus](http://platan.us).
|
|
140
|
+
|
|
141
|
+
## License
|
|
142
|
+
|
|
143
|
+
Active Job Log is © 2018 platanus, spa. It is free software and may be redistributed under the terms specified in the LICENSE file.
|
data/Rakefile
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
begin
|
|
2
|
+
require "bundler/setup"
|
|
3
|
+
rescue LoadError
|
|
4
|
+
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
|
8
|
+
load "rails/tasks/engine.rake"
|
|
9
|
+
load "rails/tasks/statistics.rake"
|
|
10
|
+
Bundler::GemHelper.install_tasks
|