Sha256: 8da31630dd738009dcca0d8b6675eeb5a27de2fd77391b7df8d834760f109623

Contents?: true

Size: 853 Bytes

Versions: 4

Compression:

Stored size: 853 Bytes

Contents

require 'concurrent/concern/logging'

module Concurrent
  module Concern

    # @!visibility private
    # @!macro internal_implementation_note
    module Deprecation
      # TODO require additional parameter: a version. Display when it'll be removed based on that. Error if not removed.
      include Concern::Logging

      def deprecated(message, strip = 2)
        caller_line = caller(strip).first
        klass       = if Class === self
                        self
                      else
                        self.class
                      end
        log WARN, klass.to_s, format("[DEPRECATED] %s\ncalled on: %s", message, caller_line)
      end

      def deprecated_method(old_name, new_name)
        deprecated "`#{old_name}` is deprecated and it'll removed in next release, use `#{new_name}` instead", 3
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
concurrent-ruby-0.9.0.pre3-java lib/concurrent/concern/deprecation.rb
concurrent-ruby-0.9.0.pre3 lib/concurrent/concern/deprecation.rb
concurrent-ruby-0.9.0.pre2 lib/concurrent/concern/deprecation.rb
concurrent-ruby-0.9.0.pre2-java lib/concurrent/concern/deprecation.rb