Sha256: 5ae139e4ff42f3fef1ea763608f072886ca719977c6fa8d66456533a9b8f3cf7

Contents?: true

Size: 654 Bytes

Versions: 2

Compression:

Stored size: 654 Bytes

Contents

# frozen_string_literal: true

module Minitest
  extend self

  def plugin_deprecation_toolkit_options(opts, options)
    opts.on("-r", "--record-deprecations", "Record deprecations") do
      options[:record_deprecations] = true
    end
  end

  def plugin_deprecation_toolkit_init(options)
    return unless using_bundler?

    require 'deprecation_toolkit'
    if options[:record_deprecations]
      DeprecationToolkit::Configuration.behavior = DeprecationToolkit::Behaviors::Record
    end

    DeprecationToolkit.add_notify_behavior
    DeprecationToolkit.attach_subscriber
  end

  private

  def using_bundler?
    ENV['BUNDLE_GEMFILE']
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
deprecation_toolkit-1.5.1 lib/minitest/deprecation_toolkit_plugin.rb
deprecation_toolkit-1.5.0 lib/minitest/deprecation_toolkit_plugin.rb