diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2012-06-22 22:15:27 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2012-06-22 22:15:27 +0530 |
commit | 35ee8fa3d8b3ad49179f86af2bec2e53af335ac9 (patch) | |
tree | 5929e772a461c683c54c1fd66b303516e5d0df33 /activesupport/lib/active_support/deprecation/reporting.rb | |
parent | fb8cf55868d555b7f06215db5976c8aaf083d30b (diff) | |
parent | 6285675db1cf983ba6c15442aedb457c8041f5ee (diff) | |
download | rails-35ee8fa3d8b3ad49179f86af2bec2e53af335ac9.tar.gz rails-35ee8fa3d8b3ad49179f86af2bec2e53af335ac9.tar.bz2 rails-35ee8fa3d8b3ad49179f86af2bec2e53af335ac9.zip |
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'activesupport/lib/active_support/deprecation/reporting.rb')
-rw-r--r-- | activesupport/lib/active_support/deprecation/reporting.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/deprecation/reporting.rb b/activesupport/lib/active_support/deprecation/reporting.rb index 5d7e241d1a..a1e9618084 100644 --- a/activesupport/lib/active_support/deprecation/reporting.rb +++ b/activesupport/lib/active_support/deprecation/reporting.rb @@ -3,7 +3,8 @@ module ActiveSupport class << self attr_accessor :silenced - # Outputs a deprecation warning to the output configured by <tt>ActiveSupport::Deprecation.behavior</tt> + # 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)" @@ -15,6 +16,14 @@ module ActiveSupport end # Silence deprecation warnings within the block. + # + # ActiveSupport::Deprecation.warn("something broke!") + # # => "DEPRECATION WARNING: something broke! (called from your_code.rb:1)" + # + # ActiveSupport::Deprecation.silence do + # ActiveSupport::Deprecation.warn("something broke!") + # end + # # => nil def silence old_silenced, @silenced = @silenced, true yield |