Module: Kernel

Defined in:
lib/sauce.rb

Instance Method Summary collapse

Instance Method Details

#at_exit(&block) ⇒ Object


25
26
27
28
29
30
31
# File 'lib/sauce.rb', line 25

def at_exit(&block)
  existing_at_exit do
    exit_status = $!.status if $!.is_a?(SystemExit)
    block.call
    exit exit_status if exit_status
  end
end

#existing_at_exitObject


24
# File 'lib/sauce.rb', line 24

alias :existing_at_exit :at_exit