Sha256: 7ffaf1e8714b2dc599e06ac3ec1a8df4575f74e558ae4adb1b1702f506ad4720

Contents?: true

Size: 1 KB

Versions: 40

Compression:

Stored size: 1 KB

Contents

require 'active_support/core_ext/kernel/singleton_class'
require 'active_support/core_ext/module/delegation'

module ActiveSupport
  class Deprecation
    module InstanceDelegator # :nodoc:
      def self.included(base)
        base.extend(ClassMethods)
        base.singleton_class.prepend(OverrideDelegators)
        base.public_class_method :new
      end

      module ClassMethods # :nodoc:
        def include(included_module)
          included_module.instance_methods.each { |m| method_added(m) }
          super
        end

        def method_added(method_name)
          singleton_class.delegate(method_name, to: :instance)
        end
      end

      module OverrideDelegators # :nodoc:
        def warn(message = nil, callstack = nil)
          callstack ||= caller_locations(2)
          super
        end

        def deprecation_warning(deprecated_method_name, message = nil, caller_backtrace = nil)
          caller_backtrace ||= caller_locations(2)
          super
        end
      end
    end
  end
end

Version data entries

40 entries across 39 versions & 7 rubygems

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/deprecation/instance_delegator.rb
activesupport-5.0.7.2 lib/active_support/deprecation/instance_delegator.rb
activesupport-5.0.7.1 lib/active_support/deprecation/instance_delegator.rb
activesupport-5.0.7 lib/active_support/deprecation/instance_delegator.rb
activesupport-5.0.6 lib/active_support/deprecation/instance_delegator.rb
activesupport-5.0.6.rc1 lib/active_support/deprecation/instance_delegator.rb
activesupport-5.0.5 lib/active_support/deprecation/instance_delegator.rb
activesupport-5.0.5.rc2 lib/active_support/deprecation/instance_delegator.rb
activesupport-5.0.5.rc1 lib/active_support/deprecation/instance_delegator.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/activesupport-5.0.2/lib/active_support/deprecation/instance_delegator.rb
tdiary-5.0.5 vendor/bundle/gems/activesupport-5.0.2/lib/active_support/deprecation/instance_delegator.rb
activesupport-5.0.4 lib/active_support/deprecation/instance_delegator.rb
activesupport-5.0.4.rc1 lib/active_support/deprecation/instance_delegator.rb
activesupport-5.0.3 lib/active_support/deprecation/instance_delegator.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/activesupport-5.0.2/lib/active_support/deprecation/instance_delegator.rb
lazy_record-0.2.1 vendor/bundle/gems/activesupport-5.0.2/lib/active_support/deprecation/instance_delegator.rb
lazy_record-0.2.0 vendor/bundle/gems/activesupport-5.0.2/lib/active_support/deprecation/instance_delegator.rb
lazy_record-0.1.9 vendor/bundle/gems/activesupport-5.0.2/lib/active_support/deprecation/instance_delegator.rb
lazy_record-0.1.8 vendor/bundle/gems/activesupport-5.0.2/lib/active_support/deprecation/instance_delegator.rb
lazy_record-0.1.7 vendor/bundle/gems/activesupport-5.0.2/lib/active_support/deprecation/instance_delegator.rb