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