Sha256: 851a56ec57e54723b6e53170749ceda7864f0c353089682c186cc5e25838e4bd

Contents?: true

Size: 843 Bytes

Versions: 9

Compression:

Stored size: 843 Bytes

Contents

# frozen_string_literal: true

require "mime/types/logger"

# The namespace for MIME applications, tools, and libraries.
module MIME
  ##
  class Types
    # Used to mark a method as deprecated in the mime-types interface.
    def self.deprecated(klass, sym, message = nil, &block) # :nodoc:
      level =
        case klass
        when Class, Module
          "."
        else
          klass = klass.class
          "#"
        end
      message =
        case message
        when :private, :protected
          "and will be #{message}"
        when nil
          "and will be removed"
        else
          message
        end
      MIME::Types.logger.debug <<-WARNING.chomp.strip
        #{caller(2..2).first}: #{klass}#{level}#{sym} is deprecated #{message}.
      WARNING

      return unless block
      block.call
    end
  end
end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
kinetic_sdk-5.0.27 gems/mime-types-3.5.2/lib/mime/types/deprecations.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/mime-types-3.5.2/lib/mime/types/deprecations.rb
kinetic_sdk-5.0.26 gems/mime-types-3.5.2/lib/mime/types/deprecations.rb
kinetic_sdk-5.0.25 gems/mime-types-3.5.2/lib/mime/types/deprecations.rb
kinetic_sdk-5.0.24 gems/mime-types-3.5.2/lib/mime/types/deprecations.rb
kinetic_sdk-5.0.23 gems/mime-types-3.5.2/lib/mime/types/deprecations.rb
mime-types-3.5.2 lib/mime/types/deprecations.rb
mime-types-3.5.1 lib/mime/types/deprecations.rb
mime-types-3.5.0 lib/mime/types/deprecations.rb