aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorVipul A M <vipulnsward@gmail.com>2015-01-17 22:22:37 +0530
committerVipul A M <vipulnsward@gmail.com>2015-01-17 22:22:37 +0530
commite0badb4a062d62cd51df6a905a5bcb148d575295 (patch)
tree52d52a6a8474eb665b604adef5c53b84e36072d1 /guides
parentb7dc096c9975088b8d7c12eb90bea499fc69b371 (diff)
downloadrails-e0badb4a062d62cd51df6a905a5bcb148d575295.tar.gz
rails-e0badb4a062d62cd51df6a905a5bcb148d575295.tar.bz2
rails-e0badb4a062d62cd51df6a905a5bcb148d575295.zip
Removed documentation of deprecated removed methods [ci skip]
Diffstat (limited to 'guides')
-rw-r--r--guides/source/active_support_core_extensions.md20
1 files changed, 2 insertions, 18 deletions
diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md
index 080cc41e87..d817885169 100644
--- a/guides/source/active_support_core_extensions.md
+++ b/guides/source/active_support_core_extensions.md
@@ -467,7 +467,7 @@ C.new(0, 1).instance_variable_names # => ["@x", "@y"]
NOTE: Defined in `active_support/core_ext/object/instance_variables.rb`.
-### Silencing Warnings, Streams, and Exceptions
+### Silencing Warnings and Exceptions
The methods `silence_warnings` and `enable_warnings` change the value of `$VERBOSE` accordingly for the duration of their block, and reset it afterwards:
@@ -475,26 +475,10 @@ The methods `silence_warnings` and `enable_warnings` change the value of `$VERBO
silence_warnings { Object.const_set "RAILS_DEFAULT_LOGGER", logger }
```
-You can silence any stream while a block runs with `silence_stream`:
-
-```ruby
-silence_stream(STDOUT) do
- # STDOUT is silent here
-end
-```
-
-The `quietly` method addresses the common use case where you want to silence STDOUT and STDERR, even in subprocesses:
-
-```ruby
-quietly { system 'bundle install' }
-```
-
-For example, the railties test suite uses that one in a few places to prevent command messages from being echoed intermixed with the progress status.
-
Silencing exceptions is also possible with `suppress`. This method receives an arbitrary number of exception classes. If an exception is raised during the execution of the block and is `kind_of?` any of the arguments, `suppress` captures it and returns silently. Otherwise the exception is reraised:
```ruby
-# If the user is locked the increment is lost, no big deal.
+# If the user is locked, the increment is lost, no big deal.
suppress(ActiveRecord::StaleObjectError) do
current_user.increment! :visits
end