Method: Hanami::Utils::IO.silence_warnings
- Defined in:
- lib/hanami/utils/io.rb
permalink .silence_warnings { ... } ⇒ void
This method returns an undefined value.
Decreases the level of verbosity, during the execution of the given block.
Revised version of ActiveSupport’s ‘Kernel.with_warnings` implementation
30 31 32 33 34 35 36 |
# File 'lib/hanami/utils/io.rb', line 30 def self.silence_warnings old_verbose = $VERBOSE $VERBOSE = nil yield ensure $VERBOSE = old_verbose end |