lib/active_support/deprecation/reporting.rb in activesupport-3.0.20 vs lib/active_support/deprecation/reporting.rb in activesupport-3.1.0.beta1
- old
+ new
@@ -1,9 +1,13 @@
module ActiveSupport
module Deprecation
class << self
attr_accessor :silenced
+ # Outputs a deprecation warning to the output configured by <tt>ActiveSupport::Deprecation.behavior</tt>
+ #
+ # ActiveSupport::Deprecation.warn("something broke!")
+ # # => "DEPRECATION WARNING: something broke! (called from your_code.rb:1)"
def warn(message = nil, callstack = caller)
return if silenced
deprecation_message(callstack, message).tap do |m|
behavior.each { |b| b.call(m, callstack) }
end