abort(p1)
public
Terminate execution immediately, effectively by calling Kernel.exit(false).
If msg is given, it is written to STDERR prior to terminating.
Show source
VALUE
rb_f_abort(int argc, VALUE *argv)
{
rb_secure(4);
if (argc == 0) {
if (!NIL_P(GET_THREAD()->errinfo)) {
ruby_error_print();
}
rb_exit(EXIT_FAILURE);
}
else {
VALUE args[2];
rb_scan_args(argc, argv, "1", &args[1]);
StringValue(argv[0]);
rb_io_puts(argc, argv, rb_stderr);
args[0] = INT2NUM(EXIT_FAILURE);
rb_exc_raise(rb_class_new_instance(2, args, rb_eSystemExit));
}
return Qnil; /* not reached */
}