Sha256: 0b8b54499a3d32741cefe70fc820e572de119d08c4a10dd53494d5628f6a6458

Contents?: true

Size: 1.04 KB

Versions: 331

Compression:

Stored size: 1.04 KB

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 if strip > 0
        klass       = if Module === self
                        self
                      else
                        self.class
                      end
        message     = if strip > 0
                        format("[DEPRECATED] %s\ncalled on: %s", message, caller_line)
                      else
                        format('[DEPRECATED] %s', message)
                      end
        log WARN, klass.to_s, message
      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

      extend self
    end
  end
end

Version data entries

331 entries across 301 versions & 59 rubygems

Version Path
fluent-plugin-nuopenlineage-light-0.1.0 vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/concern/deprecation.rb
fluent-plugin-openlineage-light-0.1.4 vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/concern/deprecation.rb
fluent-plugin-openlineage-light-0.1.3 vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/concern/deprecation.rb
concurrent-ruby-1.3.4 lib/concurrent-ruby/concurrent/concern/deprecation.rb
fluent-plugin-openlineage-0.1.0 vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/concern/deprecation.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/concern/deprecation.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/concern/deprecation.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/concern/deprecation.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/concern/deprecation.rb
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/concern/deprecation.rb
concurrent-ruby-1.3.3 lib/concurrent-ruby/concurrent/concern/deprecation.rb
concurrent-ruby-1.3.2 lib/concurrent-ruby/concurrent/concern/deprecation.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.1/lib/concurrent-ruby/concurrent/concern/deprecation.rb
concurrent-ruby-1.3.1 lib/concurrent-ruby/concurrent/concern/deprecation.rb
concurrent-ruby-1.3.1.pre lib/concurrent-ruby/concurrent/concern/deprecation.rb
harbr-2.8.1 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/concern/deprecation.rb
mlh-rubocop-config-1.0.3 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.3/lib/concurrent-ruby/concurrent/concern/deprecation.rb
concurrent-ruby-1.2.3 lib/concurrent-ruby/concurrent/concern/deprecation.rb
harbr-0.2.10 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/concern/deprecation.rb
harbr-0.2.9 vendor/bundle/ruby/3.2.0/gems/concurrent-ruby-1.2.2/lib/concurrent-ruby/concurrent/concern/deprecation.rb