0.04
Low commit activity in last 3 years
There's a lot of open issues
A long-lived project that still receives updates
Stand-alone deprecation library borrowed from ActiveSupport::Deprecation
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
 Dependencies

Development

>= 1.0.14
>= 0
>= 2.14

Runtime

 Project Readme

Deprecation

Provide deprecation warnings for code

Add warnings

class DeprecatedModule
  extend Deprecation
  self.deprecation_horizon = 'my_gem version 3.0.0'

  def asdf

  end
  deprecation_deprecate :asdf

  def custom_deprecation *args
    Deprecation.warn(DeprecatedModule, "don't do that!") if args.length < 15
  end

end

DeprecatedModule.new.asdf
DEPRECATION WARNING: asdf is deprecated and will be removed from my_gem version 3.0.0. (called from irb_binding at (irb):18)
=> nil

Silence warnings

  def silence_asdf_warning
     Deprecation.silence(DeprecationModule) do
       asdf
     end
  end

Reporting

Deprecation.default_deprecation_behavior = :stderr # the default

Deprecation.default_deprecation_behavior = :log # put deprecation warnings into the Rails / ActiveSupport log

DeprecationModule.debug = true # put the full callstack in the logged message

Deprecation.default_deprecation_behavior = :notify # use ActiveSupport::Notifications to log the message

Deprecation.default_deprecation_behavior = :raise # Raise an exception when using deprecated behavior

Deprecation.default_deprecation_behavior = :silence # ignore all deprecations