Module: Seth

Defined in:
lib/seth.rb

Overview

Module with some pretty crazy things. Seth is an egyption god of chaos and mischief. This code is a tribute to him. Some of the thigns here run at the very bassis of the Ruby language and change how standard things work. This is not for the faint of heart.

See Also:

Author:

Copyright:

License:

  • MIT

Title:

  • Geb

Class Method Summary collapse

Class Method Details

.suppress_warnings { ... } ⇒ void

This method returns an undefined value.

Suppress warnings within the block being executed. This is useful for testing.

Examples:

suppress_warnings do
  # code that generates warnings
end
# no warnings will be printed

Yields:



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/seth.rb', line 27

def suppress_warnings

  # save the original verbose setting
  original_verbose = $VERBOSE

  # suppress warnings
  $VERBOSE = nil

  # execute the block
  yield

ensure

  # restore the original verbose setting
  $VERBOSE = original_verbose

end