plain_apm 0.9.4 → 0.9.6
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 +4 -4
- data/lib/plain_apm/helpers.rb +7 -4
- data/lib/plain_apm/hooks/action_view.rb +2 -5
- data/lib/plain_apm/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: c04ad1d3800e79ca5956ab34d933a7d22a978c339c38a101dbc372cdea8cb34b
         | 
| 4 | 
            +
              data.tar.gz: c69b2e6c160f7143ccbc8c4bc6e85f80af2e1fcb327e446bc68d92ce1ab03a23
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 1294d748d9cedc00e5433dd8a520f5a69a6458ab749a314115565bdac63bebaaeaf4c533432d04db8c55a3a1eee07612ae633e205a5c79fed488b3baba1105a3
         | 
| 7 | 
            +
              data.tar.gz: 95a27cb67aeb768088ceb852ad6be44adce0c81ba40f1e54f9dac65f874dc6d01e70ce14b9d2b09e8af6a9bee865d377e512253cabe604c2d2d495cb1235d55a
         | 
    
        data/lib/plain_apm/helpers.rb
    CHANGED
    
    | @@ -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 | 
            -
                   | 
| 10 | 
            -
             | 
| 11 | 
            -
             | 
| 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
         | 
| @@ -45,11 +45,8 @@ module PlainApm | |
| 45 45 |  | 
| 46 46 | 
             
                  # strip rails root
         | 
| 47 47 | 
             
                  def identifier(id)
         | 
| 48 | 
            -
                    return id  | 
| 49 | 
            -
             | 
| 50 | 
            -
                    root = Rails.root.to_s
         | 
| 51 | 
            -
             | 
| 52 | 
            -
                    id.start_with?(root) ? id[root.size + 1..-1] : id # standard:disable Style/SlicingWithRange
         | 
| 48 | 
            +
                    return id if self.class.rails_root.nil? || id.nil?
         | 
| 49 | 
            +
                    id.start_with?(self.class.rails_root) ? id[self.class.rails_root.length + 1..-1] : id # standard:disable Style/SlicingWithRange
         | 
| 53 50 | 
             
                  end
         | 
| 54 51 | 
             
                end
         | 
| 55 52 | 
             
              end
         | 
    
        data/lib/plain_apm/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: plain_apm
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.9. | 
| 4 | 
            +
              version: 0.9.6
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - PlainAPM Team
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2024-03- | 
| 11 | 
            +
            date: 2024-03-16 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: minitest
         |