Sha256: ef47334fcf8fa77c418e0e2fa3e5f37bd782e36bcba09465c43f5f9082b5b836

Contents?: true

Size: 995 Bytes

Versions: 3

Compression:

Stored size: 995 Bytes

Contents

require 'active_support/core_ext/kernel/reporting'
require 'active_support/core_ext/module/attribute_accessors'
require 'active_support/deprecation'
require 'active_support/version'

module ActiveSupport # :nodoc:all
  module Deprecation
    class << self
      if VERSION::MAJOR <= 2 && VERSION::MINOR <= 1
        def deprecation_message(callstack, message = nil)
          message ||= "You are using deprecated behavior which will be removed from the next major or minor release."
          "DEPRECATION WARNING: #{message}. #{deprecation_caller_message(callstack)}"
        end
      end
    end

    module ClassMethods
      def deprecated_method_warning(method_name, message=nil)
        warning = "#{method_name} is deprecated and will be removed from the next major or minor release."
        case message
          when Symbol then "#{warning} (use #{message} instead)"
          when String then "#{warning} (#{message})"
          else warning
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
Empact-roxml-2.3.0 lib/roxml/extensions/deprecation.rb
Empact-roxml-2.3.1 lib/roxml/extensions/deprecation.rb
roxml-2.3.2 lib/roxml/extensions/deprecation.rb