Skip to content

Commit

Permalink
Fix code example in Process::Status#exit_code docs (#15381)
Browse files Browse the repository at this point in the history
(cherry picked from commit 2b544f1)

Co-authored-by: Billy.Zheng <vil963@gmail.com>
  • Loading branch information
github-actions[bot] and zw963 authored Jan 28, 2025
1 parent ea98639 commit 0ba7a4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/process/status.cr
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class Process::Status
# Raises `RuntimeError` if the status describes an abnormal exit.
#
# ```
# Process.run("true").exit_code # => 1
# Process.run("true").exit_code # => 0
# Process.run("exit 123", shell: true).exit_code # => 123
# Process.new("sleep", ["10"]).tap(&.terminate).wait.exit_code # RuntimeError: Abnormal exit has no exit code
# ```
Expand All @@ -258,7 +258,7 @@ class Process::Status
# Returns `nil` if the status describes an abnormal exit.
#
# ```
# Process.run("true").exit_code? # => 1
# Process.run("true").exit_code? # => 0
# Process.run("exit 123", shell: true).exit_code? # => 123
# Process.new("sleep", ["10"]).tap(&.terminate).wait.exit_code? # => nil
# ```
Expand Down

0 comments on commit 0ba7a4d

Please sign in to comment.