Tbpgr Blog

Employee Experience Engineer tbpgr(てぃーびー) のブログ

Ruby | Kernel | exit

概要

Kernel#exit(status = true) -> ()

詳細

Rubyプログラムの実行を終了します。status として整 数が与えられた場合、その値を Ruby コマンドの終了ステータスとします。
status が true の場合 正常終了、 false の場合 異常終了となります。

サンプルコード
$ ruby -e 'exit';echo $?
0

$ ruby -e 'exit(false)';echo $?
1