Sha256: 4d15ee507b1c05927a939625288b7f7636b1d3a4e2ca623c923d3103fd4792a6

Contents?: true

Size: 1.44 KB

Versions: 46

Compression:

Stored size: 1.44 KB

Contents

module Datadog
  # TODO: Remove me!
  # Monkey was used for monkey-patching 3rd party libs.
  # It is now DEPRECATED. This API is no-op, and serves only to warn
  # of its deactivation.
  module Monkey
    @registry = Datadog.registry

    DEPRECATION_WARNING = %(
      Datadog::Monkey has been REMOVED as of version 0.11.1.
      All calls to Datadog::Monkey are no-ops.
      *Implementations using Monkey will no longer function*.
      Upgrade to the new configuration API using the migration guide here:
      https://github.com/DataDog/dd-trace-rb/releases/tag/v0.11.0).freeze

    module_function

    def registry
      log_deprecation_warning('Monkey#registry')
      @registry
    end

    def autopatch_modules
      log_deprecation_warning('Monkey#autopatch_modules')
      {}
    end

    def patch_all
      log_deprecation_warning('Monkey#patch_all')
    end

    def patch_module(m)
      log_deprecation_warning('Monkey#patch_module')
    end

    def patch(modules)
      log_deprecation_warning('Monkey#patch')
    end

    def get_patched_modules
      log_deprecation_warning('Monkey#get_patched_modules')
      {}
    end

    def without_warnings(&block)
      log_deprecation_warning('Monkey#without_warnings')
      Datadog::Patcher.without_warnings(&block)
    end

    def log_deprecation_warning(method)
      Datadog::Tracer.log.warn("#{method}:#{DEPRECATION_WARNING}")
    end

    class << self
      attr_writer :registry
    end
  end
end

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
ls-trace-0.1.2 lib/ddtrace/monkey.rb
ddtrace-0.30.1 lib/ddtrace/monkey.rb
ddtrace-0.30.0 lib/ddtrace/monkey.rb
ddtrace-0.29.1 lib/ddtrace/monkey.rb
ddtrace-0.26.1 lib/ddtrace/monkey.rb
ls-trace-0.1.1 lib/ddtrace/monkey.rb
ddtrace-0.29.0 lib/ddtrace/monkey.rb
ddtrace-0.28.0 lib/ddtrace/monkey.rb
ddtrace-0.27.0 lib/ddtrace/monkey.rb
ddtrace-0.26.0 lib/ddtrace/monkey.rb
ddtrace-0.25.1 lib/ddtrace/monkey.rb
ddtrace-0.25.0 lib/ddtrace/monkey.rb
ddtrace-0.24.0 lib/ddtrace/monkey.rb
ddtrace-0.23.3 lib/ddtrace/monkey.rb
ddtrace-0.23.2 lib/ddtrace/monkey.rb
ddtrace-0.23.1 lib/ddtrace/monkey.rb
ddtrace-0.23.0 lib/ddtrace/monkey.rb
ddtrace-0.22.0 lib/ddtrace/monkey.rb
ddtrace-0.21.2 lib/ddtrace/monkey.rb
ddtrace-0.21.1 lib/ddtrace/monkey.rb