Sha256: 45568e17e924b1a4fee0b462064166b9e1ee60b5b96d22665a0ca34673569385

Contents?: true

Size: 1.22 KB

Versions: 5

Compression:

Stored size: 1.22 KB

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
      def warn_with_internals_exclusion(message = nil, callstack = caller)
        warn_without_internals_exclusion(message, callstack.reject {|line| line =~  /\/roxml(-[\d\.]+)?\/lib\// })
      end
      alias_method_chain :warn, :internals_exclusion

      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

5 entries across 5 versions & 2 rubygems

Version Path
Empact-roxml-2.5.1 lib/roxml/extensions/deprecation.rb
roxml-2.5.1 lib/roxml/extensions/deprecation.rb
roxml-2.5.0 lib/roxml/extensions/deprecation.rb
roxml-2.5.3 lib/roxml/extensions/deprecation.rb
roxml-2.5.2 lib/roxml/extensions/deprecation.rb