at_exit do
if $!.nil? || $!.is_a?(SystemExit) && $!.success?
print 'success'
else
code = $!.is_a?(SystemExit) ? $!.status : 1
print "failure with code #{code}"
end
end
I have a bunch of system calls in ruby such as the following and I want to check their exit codes simultaneously so that my script exits out if that command fails.
system("VBoxManage createvm --name test1")
system("ruby test.…
I'm using Pry with my Rails application. I set binding.pry inside a loop in my model to try and debug a problem. For example:
(1..100).each do |i|
binding.pry
puts i
end
When I type quit, it goes to …
The abort documentation says abort will
Terminate execution immediately, effectively by calling Kernel.exit(false).
What exactly does "immediately" mean? What is the difference between abort and exit with non-true status?