Sha256: a9cb8894257deac9f1bdcb9630735e239d063a7f1b245f69b76f97c2a5d5e8ec
Contents?: true
Size: 469 Bytes
Versions: 50
Compression:
Stored size: 469 Bytes
Contents
module Kernel def silence_warnings with_warnings(nil) { yield } end def silence_stream(stream) old_stream = stream.dup stream.reopen(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL:' : '/dev/null') stream.sync = true yield ensure stream.reopen(old_stream) end def with_warnings(flag) old_verbose, $VERBOSE = $VERBOSE, flag yield ensure $VERBOSE = old_verbose end end unless Kernel.respond_to? :silence_warnings
Version data entries
50 entries across 50 versions & 2 rubygems