Sha256: 6a252e148944bf111e09fc80cf5444f678c3def055a034a3afb9a636ede6c06e

Contents?: true

Size: 1.01 KB

Versions: 5

Compression:

Stored size: 1.01 KB

Contents

# typed: false
require 'ddtrace/contrib/integration'
require 'ddtrace/contrib/httprb/configuration/settings'
require 'ddtrace/contrib/configuration/resolvers/pattern_resolver'
require 'ddtrace/contrib/httprb/patcher'

module Datadog
  module Contrib
    module Httprb
      # Description of Httprb integration
      class Integration
        include Contrib::Integration

        MINIMUM_VERSION = Gem::Version.new('2.0.0')

        register_as :httprb

        def self.version
          Gem.loaded_specs['http'] && Gem.loaded_specs['http'].version
        end

        def self.loaded?
          !defined?(::HTTP).nil? && !defined?(::HTTP::Client).nil?
        end

        def self.compatible?
          super && version >= MINIMUM_VERSION
        end

        def default_configuration
          Configuration::Settings.new
        end

        def patcher
          Patcher
        end

        def resolver
          @resolver ||= Contrib::Configuration::Resolvers::PatternResolver.new
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ddtrace-0.54.2 lib/ddtrace/contrib/httprb/integration.rb
ddtrace-0.54.1 lib/ddtrace/contrib/httprb/integration.rb
ddtrace-0.54.0 lib/ddtrace/contrib/httprb/integration.rb
ddtrace-0.53.0 lib/ddtrace/contrib/httprb/integration.rb
ddtrace-0.52.0 lib/ddtrace/contrib/httprb/integration.rb