Sha256: f35574967f75938e7cff05ee6700c194de1de29bf32354d0b2fb0c1d88f015f7

Contents?: true

Size: 1.17 KB

Versions: 2

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true

module DeprecationToolkit
  autoload :DeprecationSubscriber,     "deprecation_toolkit/deprecation_subscriber"
  autoload :Configuration,             "deprecation_toolkit/configuration"
  autoload :Collector,                 "deprecation_toolkit/collector"
  autoload :ReadWriteHelper,           "deprecation_toolkit/read_write_helper"

  module Behaviors
    autoload :Disabled,                "deprecation_toolkit/behaviors/disabled"
    autoload :Raise,                   "deprecation_toolkit/behaviors/raise"
    autoload :Record,                  "deprecation_toolkit/behaviors/record"
  end

  def self.add_notify_behavior
    notify = ActiveSupport::Deprecation::DEFAULT_BEHAVIORS[:notify]
    behaviors = ActiveSupport::Deprecation.behavior

    unless behaviors.find { |behavior| behavior == notify }
      ActiveSupport::Deprecation.behavior = behaviors << notify
    end
  end

  def self.attach_subscriber
    return if DeprecationSubscriber.already_attached?

    Configuration.attach_to.each do |gem_name|
      DeprecationSubscriber.attach_to gem_name
    end
  end
end

require "deprecation_toolkit/minitest_hook"
require "deprecation_toolkit/warning"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
deprecation_toolkit-1.2.0 lib/deprecation_toolkit.rb
deprecation_toolkit-1.1.0 lib/deprecation_toolkit.rb