plain_apm 0.9.4 → 0.9.5

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
  SHA256:
3
- metadata.gz: bbc80ac73a8d6b499ba00f4ec728d83359225be1563dc81f61599b7c9dbdab9d
4
- data.tar.gz: a885c23479749c60b4aa62df8e199bedfafd22190ab4578d5ee42cf2664b3cce
3
+ metadata.gz: 8700716a8232dd006ee1f152ff706b110e183180f31b174dad707073d56191cd
4
+ data.tar.gz: cab9abf563da3173c75448eaf1ab4a30d385d12190b64adb6c2a13bf9c154c3f
5
5
  SHA512:
6
- metadata.gz: f02c96c5f98ca5a2d8d36ba0c4c5e8454799572e0dcc455d940f5b73151346de21c767cdf6b20b1bc0f25140d404f535c71e40f7bdc296963b23020bc7b7f1c5
7
- data.tar.gz: 2ed255c00a300a1b6f8de0a64947e354462fab28a254847bd86eed49f89632cf49a8e0d1935b71196b061dc8bef009b0153a1aa5a09cd634dd078e8fd2bdd343
6
+ metadata.gz: 25ab862df530c784896f3b0de84fb53fc9838a6551fdbb774cef2927566abe920458f6669425a1204407d849d4be5bf7c2055523f6cade5fffceffc8bdfe68b6
7
+ data.tar.gz: 948fe60ffebd3fee6897145343c2c89dce907639bd7b4b584569b43108301b2be789908838cc97142f7a01f54d51d7f9f6fbb231873e83940b82a06050299f2d
@@ -1,14 +1,17 @@
1
1
  module PlainApm
2
2
  module Helpers
3
3
  def plain_apm_context(context = {})
4
- return unless PlainApm.agent.enabled?
4
+ return context unless PlainApm.agent.enabled?
5
5
  PlainApm::Extensions::Context.context.merge!(context)
6
6
  end
7
7
 
8
8
  def plain_apm_instrument(name, context = {}, &block)
9
- return unless PlainApm.agent.enabled? && defined?(ActiveSupport::Notifications)
10
- sanitized_name = name.gsub(/\W/, "_").gsub(/(?!^)([A-Z])/) { |m| "_#{m}" }.squeeze("_").downcase
11
- ActiveSupport::Notifications.instrument("#{sanitized_name}.manual_plain_apm", **context, &block)
9
+ if PlainApm.agent.enabled? && defined?(ActiveSupport::Notifications)
10
+ sanitized_name = name.gsub(/\W/, "_").gsub(/(?!^)([A-Z])/) { |m| "_#{m}" }.squeeze("_").downcase
11
+ ActiveSupport::Notifications.instrument("#{sanitized_name}.manual_plain_apm", **context, &block)
12
+ else
13
+ yield if block
14
+ end
12
15
  end
13
16
  end
14
17
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PlainApm
4
- VERSION = "0.9.4"
4
+ VERSION = "0.9.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plain_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - PlainAPM Team