Sha256: f48c95356457314fea83ed64b8c30320dc9ddc5c917aa9ea66e9282afe33179d

Contents?: true

Size: 1011 Bytes

Versions: 3

Compression:

Stored size: 1011 Bytes

Contents

require 'deprecation/behaviors'
require 'deprecation/reporting'
require 'deprecation/method_wrappers'
require 'active_support/concern'
require 'deprecation/core_ext/module/deprecation'
require 'deprecation/rspec'

module Deprecation
  extend ActiveSupport::Concern

  def deprecation_horizon= horizon
    @deprecation_horizon = horizon
  end

  def deprecation_horizon
    @deprecation_horizon
  end

  def silenced
    @silenced
  end

  alias_method :silenced?, :silenced

  def silenced= bool
    @silenced = bool
  end

  def debug
    @debug
  end
  alias_method :debug?, :debug

  def debug= bool
    @debug = bool
  end

  def self.logger
    @logger ||= if defined?(Rails) && Rails.logger
      Rails.logger
    else
      require 'active_support/logger'
      ActiveSupport::Logger.new($stderr)
    end
  end

  def self.logger= value
    @logger = value
  end

  included do
    # By default, warnings are not silenced and debugging is off.
    self.silenced = false
    self.debug = false
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/deprecation-1.1.0/lib/deprecation.rb
deprecation-1.1.0 lib/deprecation.rb
deprecation-0.99.0 lib/deprecation.rb