Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Kernel#exit!
exit!(status = false)
Process.exit!(status = false)
process.c
View on GitHub ↗
static VALUE
rb_f_exit_bang(int argc, VALUE *argv, VALUE obj)
{
int istatus;
if (rb_check_arity(argc, 0, 1) == 1) {
istatus = exit_status_code(argv[0]);
}
else {
istatus = EXIT_FAILURE;
}
_exit(istatus);
UNREACHABLE_RETURN(Qnil);
}
Exits the process immediately; no exit handlers are called. Returns exit status status to the underlying operating system.
Example
Process.exit!(true)
Values true and false for argument status indicate, respectively, success and failure; The meanings of integer values are system-dependent.