Top Level Namespace
Defined Under Namespace
Modules: Releaseable Classes: Logger, Sound
Instance Method Summary collapse
-
#sound_alarm(beeps = 3) ⇒ Object
Sound snippets from everywhere (JRuby-only!):.
-
#suppress_warnings ⇒ Object
Selectively silence verbose JRuby warnings.
Instance Method Details
#sound_alarm(beeps = 3) ⇒ Object
Sound snippets from everywhere (JRuby-only!):
5 6 7 8 9 10 |
# File 'lib/releaseable/sound.rb', line 5 def sound_alarm beeps = 3 beeps.times do java.awt.Toolkit.getDefaultToolkit.beep sleep 0.5 end end |
#suppress_warnings ⇒ Object
Selectively silence verbose JRuby warnings
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/releaseable/http.rb', line 8 def suppress_warnings old_verbose = $VERBOSE begin $VERBOSE = nil yield if block_given? ensure # always re-set to old value, even if block raises an exception $VERBOSE = old_verbose end end |