Module: Kernel

Defined in:
lib/zookeeper/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#silence_warningsObject


4
5
6
# File 'lib/zookeeper/core_ext.rb', line 4

def silence_warnings
  with_warnings(nil) { yield }
end

#with_warnings(flag) ⇒ Object


10
11
12
13
14
15
# File 'lib/zookeeper/core_ext.rb', line 10

def with_warnings(flag)
  old_verbose, $VERBOSE = $VERBOSE, flag
  yield
ensure
  $VERBOSE = old_verbose
end