Skip to content

Commit 7b8e549

Browse files
authored
Merge pull request #2075 from kateinoigakukun/katei/add-system-exception
Add `exception` keyword argument to `Kernel#system`
2 parents 6bbd274 + 4031068 commit 7b8e549

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

core/kernel.rbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2056,8 +2056,8 @@ module Kernel : BasicObject
20562056
#
20572057
# Raises an exception if the new process could not execute.
20582058
#
2059-
def self?.system: (String command, *String args, ?unsetenv_others: boolish, ?pgroup: true | Integer, ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: boolish, ?chdir: String) -> (NilClass | FalseClass | TrueClass)
2060-
| (Hash[string, string?] env, String command, *String args, ?unsetenv_others: boolish, ?pgroup: true | Integer, ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: boolish, ?chdir: String) -> (NilClass | FalseClass | TrueClass)
2059+
def self?.system: (String command, *String args, ?unsetenv_others: boolish, ?pgroup: true | Integer, ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: boolish, ?chdir: String, ?exception: bool) -> (NilClass | FalseClass | TrueClass)
2060+
| (Hash[string, string?] env, String command, *String args, ?unsetenv_others: boolish, ?pgroup: true | Integer, ?umask: Integer, ?in: redirect_fd, ?out: redirect_fd, ?err: redirect_fd, ?close_others: boolish, ?chdir: String, ?exception: bool) -> (NilClass | FalseClass | TrueClass)
20612061

20622062
# <!--
20632063
# rdoc-file=object.c

test/stdlib/Kernel_test.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,4 +523,11 @@ def test_initialize_dup
523523
assert_send_type '(KernelInstanceTest::JustKernel) -> KernelInstanceTest::JustKernel',
524524
JustKernel.allocate, :initialize_dup, OBJ
525525
end
526+
527+
def test_system
528+
with_bool do |exception|
529+
assert_send_type '(String, exception: bool) -> bool',
530+
Kernel, :system, ":", exception: exception
531+
end
532+
end
526533
end

0 commit comments

Comments
 (0)