Skip to content

Commit 828f3ec

Browse files
committed
[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.
1 parent df5f2fa commit 828f3ec

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

process.c

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4972,24 +4972,16 @@ rb_f_system(int argc, VALUE *argv, VALUE _)
49724972
*
49734973
* Argument +exe_path+ is one of the following:
49744974
*
4975-
* - The string path to an executable to be called:
4975+
* - The string path to an executable to be called.
4976+
* - A 2-element array containing the path to an executable to be called,
4977+
* and the string to be used as the name of the executing process.
49764978
*
49774979
* spawn('/usr/bin/date') # Path to date on Unix-style system.
49784980
* Process.wait
49794981
*
49804982
* Output:
49814983
*
4982-
* Thu Aug 31 10:06:48 AM CDT 2023
4983-
*
4984-
* - A 2-element array containing the path to an executable
4985-
* and the string to be used as the name of the executing process:
4986-
*
4987-
* pid = spawn(['sleep', 'Hello!'], '1') # 2-element array.
4988-
* p `ps -p #{pid} -o command=`
4989-
*
4990-
* Output:
4991-
*
4992-
* "Hello! 1\n"
4984+
* Mon Aug 28 11:43:10 AM CDT 2023
49934985
*
49944986
* Ruby invokes the executable directly.
49954987
* This form does not use the shell;
@@ -8877,18 +8869,28 @@ proc_warmup(VALUE _)
88778869
*
88788870
* Argument +exe_path+ is one of the following:
88798871
*
8880-
* - The string path to an executable to be called.
8881-
* - A 2-element array containing the path to an executable to be called,
8882-
* and the string to be used as the name of the executing process.
8872+
* - The string path to an executable to be called:
88838873
*
8884-
* Example:
8874+
* Example:
88858875
*
8886-
* system('/usr/bin/date') # => true # Path to date on Unix-style system.
8887-
* system('foo') # => nil # Command failed.
8876+
* system('/usr/bin/date') # => true # Path to date on Unix-style system.
8877+
* system('foo') # => nil # Command execlution failed.
88888878
*
8889-
* Output:
8879+
* Output:
8880+
*
8881+
* Thu Aug 31 10:06:48 AM CDT 2023
8882+
*
8883+
* - A 2-element array containing the path to an executable
8884+
* and the string to be used as the name of the executing process:
8885+
*
8886+
* Example:
8887+
*
8888+
* pid = spawn(['sleep', 'Hello!'], '1') # 2-element array.
8889+
* p `ps -p #{pid} -o command=`
8890+
*
8891+
* Output:
88908892
*
8891-
* Mon Aug 28 11:43:10 AM CDT 2023
8893+
* "Hello! 1\n"
88928894
*
88938895
* === Execution Options
88948896
*

0 commit comments

Comments
 (0)