Sha256: daa5c62a78b07082b4a7e894c23d4f0e3ed9fb9f82003aff2be713b029b9cc4b

Contents?: true

Size: 1.39 KB

Versions: 3

Compression:

Stored size: 1.39 KB

Contents

# frozen_string_literal: true

load('tasks/ci_recorder.rake')

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"
  autoload :TestTriggerer,             "deprecation_toolkit/test_triggerer"

  module Behaviors
    autoload :Disabled,                "deprecation_toolkit/behaviors/disabled"
    autoload :Raise,                   "deprecation_toolkit/behaviors/raise"
    autoload :Record,                  "deprecation_toolkit/behaviors/record"
    autoload :CIRecordHelper,          "deprecation_toolkit/behaviors/ci_record_helper"
  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

unless defined?(RSpec)
  require "deprecation_toolkit/minitest_hook"
end

require "deprecation_toolkit/warning"

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
deprecation_toolkit-1.5.1 lib/deprecation_toolkit.rb
deprecation_toolkit-1.5.0 lib/deprecation_toolkit.rb
deprecation_toolkit-1.4.0 lib/deprecation_toolkit.rb