68件ヒット
[1-68件を表示]
(0.063秒)
種類
- モジュール関数 (24)
- インスタンスメソッド (22)
- クラス (11)
- 特異メソッド (11)
ライブラリ
- ビルトイン (68)
クラス
- SystemExit (33)
モジュール
- Kernel (24)
キーワード
- SystemExit (11)
- new (11)
- status (11)
- success? (11)
検索結果
先頭5件
-
Kernel
. # system(command , options={}) -> bool | nil (26160.0) -
引数を外部コマンドとして実行して、成功した時に真を返します。
...由でコマンドを実行][ruby]{
system("echo *") # => true
# fileA fileB fileC ...
//}
//emlist[exceptionオプションを指定][ruby]{
system("sad", exception: true) # => Errno::ENOENT (No such file or directory - sad)
system('ruby -e "exit(false)"', exception: true) # => R......untimeError (Command failed with exit 1: ruby -e "exit(false)")
system('ruby -e "exit(true)"', exception: true) # => true
//}
@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)... -
Kernel
. # system(env , command , options={}) -> bool | nil (26160.0) -
引数を外部コマンドとして実行して、成功した時に真を返します。
...由でコマンドを実行][ruby]{
system("echo *") # => true
# fileA fileB fileC ...
//}
//emlist[exceptionオプションを指定][ruby]{
system("sad", exception: true) # => Errno::ENOENT (No such file or directory - sad)
system('ruby -e "exit(false)"', exception: true) # => R......untimeError (Command failed with exit 1: ruby -e "exit(false)")
system('ruby -e "exit(true)"', exception: true) # => true
//}
@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)... -
Kernel
. # system(env , program , *args , options={}) -> bool | nil (26125.0) -
引数を外部コマンドとして実行して、成功した時に真を返します。
...se RuntimeError exception: true が指定されていて、コマンドの終了ステータスが 0 以外のときに発生します。
//emlist[インタプリタから直接コマンドを実行][ruby]{
system("echo", "*") # => true
# *
//}
@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)... -
Kernel
. # system(program , *args , options={}) -> bool | nil (26125.0) -
引数を外部コマンドとして実行して、成功した時に真を返します。
...se RuntimeError exception: true が指定されていて、コマンドの終了ステータスが 0 以外のときに発生します。
//emlist[インタプリタから直接コマンドを実行][ruby]{
system("echo", "*") # => true
# *
//}
@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)... -
SystemExit (20000.0)
-
Ruby インタプリタを終了させるときに発生します。
Ruby インタプリタを終了させるときに発生します。 -
SystemExit
. new(status = 0 , error _ message = "") -> SystemExit (14200.0) -
SystemExit オブジェクトを生成して返します。
...
SystemExit オブジェクトを生成して返します。
@param status 終了ステータスを整数で指定します。
@param error_message エラーメッセージを文字列で指定します。
例:
ex = SystemExit.new(1)
p ex.status # => 1... -
SystemExit
# status -> Integer (14018.0) -
例外オブジェクトに保存された終了ステータスを返します。
...します。
終了ステータスは Kernel.#exit や SystemExit.new などで設定されます。
例:
begin
exit 1
rescue SystemExit => err
p err.status # => 1
end
begin
raise SystemExit.new(1, "dummy exit")
rescue SystemExit => err
p err.status # => 1
end... -
SystemExit
# success? -> bool (14012.0) -
終了ステータスが正常終了を示す値ならば true を返します。
...値ならば true を返します。
大半のシステムでは、ステータス 0 が正常終了を表します。
例:
begin
exit true
rescue SystemExit => err
p err.success? # => true
end
begin
exit false
rescue SystemExit => err
p err.success? # => false
end...