alacrity-rails 0.13.1 → 0.13.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a1acab121cd8bc00a7bcb8a89c5926357e477790
4
- data.tar.gz: 44cc21695599f2feb5469baf48587c4656b09d78
3
+ metadata.gz: aac46ddf96125262a6c18cdfe6c5d98c9ea0c611
4
+ data.tar.gz: d4d6fcb935ce1ae1b677f7879d85bc9135cbcd88
5
5
  SHA512:
6
- metadata.gz: 00d9a3fa40d0294b50d8a87c5371f41e08e502a6cc3a2f377a4a18786bc58caaf092eb9cb782d8c4d7c938533b06b7ab0428aac62617a9418b5159f47be2f5e7
7
- data.tar.gz: acb3b0d407b1579008ab4fb3f75d8a4e3e51cd42ae21d3eb9d7e420329642222b86a85464dccf7e44ba541177028187aa60c186562e0f12324d3b99b0c20ad8f
6
+ metadata.gz: bf07291ea8b7035784631c09f51a2d110bb6dd0591cc92bf78e11bff90b9663651b0c65690f251988d985e24a5eca3c467eebaad31bc7c0e7fe6301993c725bd
7
+ data.tar.gz: 2a84243b0b3aaef92b17028c5e714b2b91ad210703d461b358e9bb8e666dd0031adb3b3327dcc3da0fb9f574bd21d0d584987c970d5cfbb5a03d7fe9006ec9e6
@@ -2,6 +2,8 @@ module AlacrityRails
2
2
  module Probe
3
3
  class ActiveJob
4
4
  def self.activate
5
+ return unless defined?(::ActiveJob)
6
+
5
7
  ActiveSupport::Notifications.subscribe 'enqueue.active_job' do |name, started, finished, unique_id, data|
6
8
  AlacrityRails::Client.store_timeline_event(
7
9
  name: 'Job Queued',
@@ -12,26 +14,30 @@ module AlacrityRails
12
14
  detail: data[:job].class.to_s
13
15
  )
14
16
  end
17
+
18
+ ::ActiveJob::Base.include(ActiveJobMixin)
15
19
  end
16
20
  end
17
- end
18
- end
19
21
 
20
- if defined?(ActiveJob)
21
- class ::ActiveJob::Base
22
- around_perform :alacrity_instrumentor
22
+ module ActiveJobMixin
23
+ extend ActiveSupport::Concern
24
+
25
+ included do
26
+ around_perform :alacrity_instrumentor
23
27
 
24
- private
28
+ private
25
29
 
26
- def alacrity_instrumentor
27
- AlacrityRails::Instrumentor.instrument(
28
- type: AlacrityRails::Transaction::Job,
29
- data: {
30
- worker_class: self.class.to_s,
31
- args: @arguments
32
- }
33
- ) do
34
- yield
30
+ def alacrity_instrumentor
31
+ AlacrityRails::Instrumentor.instrument(
32
+ type: AlacrityRails::Transaction::Job,
33
+ data: {
34
+ worker_class: self.class.to_s,
35
+ args: @arguments
36
+ }
37
+ ) do
38
+ yield
39
+ end
40
+ end
35
41
  end
36
42
  end
37
43
  end
@@ -1,3 +1,3 @@
1
1
  module AlacrityRails
2
- VERSION = '0.13.1'
2
+ VERSION = '0.13.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alacrity-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.1
4
+ version: 0.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alacrity, LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-20 00:00:00.000000000 Z
11
+ date: 2018-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails