[DOC] Move `exe_path` example to `Process` module document

Exchanged with `Kernel.spawn`, like as `Kernel.exec` and
`Kernel.system`.  This description should be common for these methods.
This commit is contained in:
Nobuyoshi Nakada 2024-01-21 19:14:41 +09:00
Родитель df5f2fab93
Коммит 828f3ecfcd
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 3582D74E1FEE4465
1 изменённых файлов: 22 добавлений и 20 удалений

Просмотреть файл

@ -4972,24 +4972,16 @@ rb_f_system(int argc, VALUE *argv, VALUE _)
*
* Argument +exe_path+ is one of the following:
*
* - The string path to an executable to be called:
* - The string path to an executable to be called.
* - A 2-element array containing the path to an executable to be called,
* and the string to be used as the name of the executing process.
*
* spawn('/usr/bin/date') # Path to date on Unix-style system.
* Process.wait
*
* Output:
*
* Thu Aug 31 10:06:48 AM CDT 2023
*
* - A 2-element array containing the path to an executable
* and the string to be used as the name of the executing process:
*
* pid = spawn(['sleep', 'Hello!'], '1') # 2-element array.
* p `ps -p #{pid} -o command=`
*
* Output:
*
* "Hello! 1\n"
* Mon Aug 28 11:43:10 AM CDT 2023
*
* Ruby invokes the executable directly.
* This form does not use the shell;
@ -8877,18 +8869,28 @@ proc_warmup(VALUE _)
*
* Argument +exe_path+ is one of the following:
*
* - The string path to an executable to be called.
* - A 2-element array containing the path to an executable to be called,
* and the string to be used as the name of the executing process.
* - The string path to an executable to be called:
*
* Example:
* Example:
*
* system('/usr/bin/date') # => true # Path to date on Unix-style system.
* system('foo') # => nil # Command failed.
* system('/usr/bin/date') # => true # Path to date on Unix-style system.
* system('foo') # => nil # Command execlution failed.
*
* Output:
* Output:
*
* Mon Aug 28 11:43:10 AM CDT 2023
* Thu Aug 31 10:06:48 AM CDT 2023
*
* - A 2-element array containing the path to an executable
* and the string to be used as the name of the executing process:
*
* Example:
*
* pid = spawn(['sleep', 'Hello!'], '1') # 2-element array.
* p `ps -p #{pid} -o command=`
*
* Output:
*
* "Hello! 1\n"
*
* === Execution Options
*