[DOC] RDoc for Process (#8282)

This commit is contained in:
Burdette Lamar 2023-08-24 16:41:43 -05:00 committed by GitHub
parent ebb9034710
commit f9aea75747
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
Notes: git 2023-08-24 21:42:04 +00:00
Merged-By: peterzhu2118 <peter@peterzhu.ca>

View File

@ -4345,13 +4345,18 @@ exit_status_code(VALUE status)
NORETURN(static VALUE rb_f_exit_bang(int argc, VALUE *argv, VALUE obj)); NORETURN(static VALUE rb_f_exit_bang(int argc, VALUE *argv, VALUE obj));
/* /*
* call-seq: * call-seq:
* exit!(status = false)
* Process.exit!(status = false) * Process.exit!(status = false)
* *
* Exits the process immediately. No exit handlers are * Exits the process immediately; no exit handlers are called.
* run. <em>status</em> is returned to the underlying system as the * Returns exit status +status+ to the underlying operating system.
* exit status.
* *
* Process.exit!(true) * Process.exit!(true)
*
* Values +true+ and +false+ for argument +status+
* indicate, respectively, success and failure;
* The meanings of integer values are system-dependent.
*
*/ */
static VALUE static VALUE
@ -4403,42 +4408,46 @@ NORETURN(static VALUE f_exit(int c, const VALUE *a, VALUE _));
/* /*
* call-seq: * call-seq:
* exit(status = true) * exit(status = true)
* Kernel::exit(status=true) * Process.exit(status = true)
* Process::exit(status=true)
* *
* Initiates the termination of the Ruby script by raising the * Initiates termination of the Ruby script by raising SystemExit;
* SystemExit exception. This exception may be caught. The * the exception may be caught.
* optional parameter is used to return a status code to the invoking * Returns exit status +status+ to the underlying operating system.
* environment. *
* +true+ and +FALSE+ of _status_ means success and failure * Values +true+ and +false+ for argument +status+
* respectively. The interpretation of other integer values are * indicate, respectively, success and failure;
* system dependent. * The meanings of integer values are system-dependent.
*
* Example:
* *
* begin * begin
* exit * exit
* puts "never get here" * puts 'Never get here.'
* rescue SystemExit * rescue SystemExit
* puts "rescued a SystemExit exception" * puts 'Rescued a SystemExit exception.'
* end * end
* puts "after begin block" * puts 'After begin block.'
* *
* <em>produces:</em> * Output:
* *
* rescued a SystemExit exception * Rescued a SystemExit exception.
* after begin block * After begin block.
* *
* Just prior to termination, Ruby executes any <code>at_exit</code> * Just prior to final termination,
* functions (see Kernel::at_exit) and runs any object finalizers * Ruby executes any at-exit procedures (see Kernel::at_exit)
* (see ObjectSpace::define_finalizer). * and any object finalizers (see ObjectSpace::define_finalizer).
* *
* at_exit { puts "at_exit function" } * Example:
* ObjectSpace.define_finalizer("string", proc { puts "in finalizer" }) *
* at_exit { puts 'In at_exit function.' }
* ObjectSpace.define_finalizer('string', proc { puts 'In finalizer.' })
* exit * exit
* *
* <em>produces:</em> * Output:
*
* In at_exit function.
* In finalizer.
* *
* at_exit function
* in finalizer
*/ */
static VALUE static VALUE
@ -4478,13 +4487,15 @@ NORETURN(static VALUE f_abort(int c, const VALUE *a, VALUE _));
/* /*
* call-seq: * call-seq:
* abort * abort
* Kernel::abort([msg]) * Process.abort(msg = nil)
* Process.abort([msg])
* *
* Terminate execution immediately, effectively by calling * Terminates execution immediately, effectively by calling
* <code>Kernel.exit(false)</code>. If _msg_ is given, it is written * <tt>Kernel.exit(false)</tt>.
* to STDERR prior to terminating. Otherwise, if an exception was raised, *
* print its message and backtrace. * If string argument +msg+ is given,
* it is written to STDERR prior to termination;
* otherwise, if an exception was raised,
* prints its message and backtrace.
*/ */
static VALUE static VALUE