Sha256: 07165842347e328081249af83472d6dbfd0353234012a71df1ee5b4e49a6fe5f

Contents?: true

Size: 640 Bytes

Versions: 20

Compression:

Stored size: 640 Bytes

Contents

# frozen_string_literal: true

module ElasticAPM
  # @api private
  module Deprecations
    def deprecate(name, replacement = nil)
      alias_name = "#{name.to_s.chomp('=')}__deprecated_"
      alias_name += '=' if name.to_s.end_with?('=')

      class_eval <<-RUBY, __FILE__, __LINE__ + 1
        alias :"#{alias_name}" :"#{name}"

        def #{name}(*args, &block)
          warn "[ElasticAPM] [DEPRECATED] `#{name}' is being removed. " \
               "#{replacement && "See `#{replacement}'."}" \
               "\nCalled from \#{caller.first}"
          send("#{alias_name}", *args, &block)
        end
      RUBY
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
elastic-apm-3.6.0 lib/elastic_apm/deprecations.rb
elastic-apm-3.5.0 lib/elastic_apm/deprecations.rb
elastic-apm-3.4.0 lib/elastic_apm/deprecations.rb
elastic-apm-3.3.0 lib/elastic_apm/deprecations.rb
elastic-apm-3.2.0 lib/elastic_apm/deprecations.rb
elastic-apm-3.1.0 lib/elastic_apm/deprecations.rb
elastic-apm-3.0.0 lib/elastic_apm/deprecations.rb
elastic-apm-2.12.0 lib/elastic_apm/deprecations.rb
elastic-apm-2.11.0 lib/elastic_apm/deprecations.rb
elastic-apm-2.10.1 lib/elastic_apm/deprecations.rb
elastic-apm-2.10.0 lib/elastic_apm/deprecations.rb
elastic-apm-2.9.1 lib/elastic_apm/deprecations.rb
elastic-apm-2.9.0 lib/elastic_apm/deprecations.rb
elastic-apm-2.8.1 lib/elastic_apm/deprecations.rb
elastic-apm-2.8.0 lib/elastic_apm/deprecations.rb
elastic-apm-2.7.0 lib/elastic_apm/deprecations.rb
elastic-apm-2.6.1 lib/elastic_apm/deprecations.rb
elastic-apm-2.6.0 lib/elastic_apm/deprecations.rb
elastic-apm-2.5.0 lib/elastic_apm/deprecations.rb
elastic-apm-2.4.0 lib/elastic_apm/deprecations.rb