diff options
author | Tom Meier <tom@venombytes.com> | 2013-12-19 13:26:47 +1100 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-07-15 16:36:31 -0300 |
commit | af2ffa8c79e69f99f6eec0aac76737a050bbd06e (patch) | |
tree | 235872630e6549c970017a2ee579911ca6873b09 /activesupport | |
parent | 1fbb5c1873a18e1d175099c92180cabfcbec7751 (diff) | |
download | rails-af2ffa8c79e69f99f6eec0aac76737a050bbd06e.tar.gz rails-af2ffa8c79e69f99f6eec0aac76737a050bbd06e.tar.bz2 rails-af2ffa8c79e69f99f6eec0aac76737a050bbd06e.zip |
Deprecate reporting methods for silencing output as they aren't thread safe
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/kernel/reporting.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/kernel/reporting.rb b/activesupport/lib/active_support/core_ext/kernel/reporting.rb index f3f8416905..80c531b694 100644 --- a/activesupport/lib/active_support/core_ext/kernel/reporting.rb +++ b/activesupport/lib/active_support/core_ext/kernel/reporting.rb @@ -31,9 +31,13 @@ module Kernel # For compatibility def silence_stderr #:nodoc: + ActiveSupport::Deprecation.warn( + "#silence_stderr is deprecated and will be removed in the next release" + ) #not thread-safe silence_stream(STDERR) { yield } end + # Deprecated : this method is not thread safe # Silences any stream for the duration of the block. # # silence_stream(STDOUT) do @@ -82,6 +86,9 @@ module Kernel # stream = capture(:stderr) { system('echo error 1>&2') } # stream # => "error\n" def capture(stream) + ActiveSupport::Deprecation.warn( + "#capture(stream) is deprecated and will be removed in the next release" + ) #not thread-safe stream = stream.to_s captured_stream = Tempfile.new(stream) stream_io = eval("$#{stream}") @@ -105,6 +112,9 @@ module Kernel # # This method is not thread-safe. def quietly + ActiveSupport::Deprecation.warn( + "#quietly is deprecated and will be removed in the next release" + ) #not thread-safe silence_stream(STDOUT) do silence_stream(STDERR) do yield |