159件ヒット
[1-100件を表示]
(0.023秒)
種類
- 文書 (48)
- モジュール関数 (33)
- インスタンスメソッド (33)
- 特異メソッド (23)
- 変数 (22)
クラス
- SystemExit (11)
モジュール
- FileUtils (22)
- Kernel (55)
- Process (22)
-
Test
:: Unit (1)
キーワード
-
$ ? (11) -
$ CHILD _ STATUS (11) -
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 5 . 0 (7) - ` (11)
- exit (22)
- exit! (22)
- ruby (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 4 feature (11) -
setup
_ argv (1) - sh (11)
検索結果
先頭5件
-
SystemExit
# status -> Integer (18119.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... -
Kernel
$ $ CHILD _ STATUS -> Process :: Status | nil (15208.0) -
$? の別名
...$? の別名
require "English"
out = `wget https://www.ruby-lang.org/en/about/license.txt -O - 2>/dev/null`
if $CHILD_STATUS.to_i == 0
print "wget success\n"
out.split(/\n/).each { |line|
printf "%s\n", line
}
else
print "wget failed\n"
end... -
Kernel
. # exit!(status = false) -> () (9159.0) -
Rubyプログラムの実行を即座に終了します。 status として整数が与えられた場合、その値を Ruby コマンドの終了ステータスとします。 デフォルトの終了ステータスは 1 です。
...Rubyプログラムの実行を即座に終了します。
status として整数が与えられた場合、その値を Ruby コマンドの終了ステータスとします。
デフォルトの終了ステータスは 1 です。
status が true の場合 0、 false の場合 1 を引数に指......存です。
exit! は exit とは違って、例外処理などは一切行ないませ
ん。 Kernel.#fork の後、子プロセスを終了させる時などに用
いられます。
@param status 終了ステータスを整数か true または false で与えます。
//emlist[例][ruby]{
ST......T.sync = true #表示前に終了しないようにする
puts 'start'
begin
puts 'start1...'
exit!
ensure
puts 'end1...' #実行されない
end
puts 'end' #実行されない
#=> start
# start1...
#終了ステータス:1
//}
@see Kernel.#exit,Kernel.#abort,Kernel.#at_exit,Kernel.#fork... -
Kernel
. # exit(status = true) -> () (9141.0) -
Rubyプログラムの実行を終了します。status として整 数が与えられた場合、その値を Ruby コマンドの終了ステータスとします。 デフォルトの終了ステータスは 0(正常終了)です。
...Rubyプログラムの実行を終了します。status として整
数が与えられた場合、その値を Ruby コマンドの終了ステータスとします。
デフォルトの終了ステータスは 0(正常終了)です。
status が true の場合 0、 false の場合 1 を引数に......とによってプログラムの実行を終了させますので、
必要に応じて begin 節で捕捉することができます。
@param status 終了ステータスを整数か true または false で与えます。
//emlist[例][ruby]{
puts 'start'
begin
puts 'start1...'
exit
rescue......puts "end1 with #{err.inspect}"
end
begin
puts 'start2...'
exit
ensure
puts 'end2...'
end
puts 'end' #実行されない
#=> start
# start1...
# end1 with #<SystemExit: exit>
# start2...
# end2...
#終了ステータス:0
//}
@see Kernel.#exit!,Kernel.#abort, d:spec/control#begin... -
Kernel
$ $ ? -> Process :: Status | nil (9119.0) -
このスレッドで最後に終了した子プロセスのステータスです。
...スレッドで最後に終了した子プロセスのステータスです。
Process::Status オブジェクトが入っています。
子プロセスの終了時ステータスは Process::Status#exitstatus で得られます。
この変数はスレッドローカルで読み取り専用で......のステータスです。
Process::Status オブジェクトが入っています。
子プロセスの終了時ステータスは Process::Status#exitstatus で得られます。
この変数はスレッドローカルで読み取り専用です。
@see Process.#wait
@see Process.last_status... -
Kernel
. # `(command) -> String (9030.0) -
command を外部コマンドとして実行し、その標準出力を文字列として 返します。このメソッドは `command` の形式で呼ばれます。
...タスを得るには、$? を参照します。
コマンドの出力を得る必要がなく、単にコマンドを実行したいだけなら
Kernel.#system を使います。特に端末を制御するコマンドでは
`command` は失敗するかもしれません。
d:spec/literal#command......Errno::EXXX コマンドを実行できないときや失敗した場合に発生します。
//emlist[例][ruby]{
puts `ruby -v` #=> ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
puts $?.inspect #=> #<Process::Status: pid=3580,exited(0)>
//}
@see Kernel.#system,Kernel.#exec,Kernel.#spawn... -
FileUtils
# sh(*cmd) {|result , status| . . . } (131.0) -
与えられたコマンドを実行します。
...は Kernel.#exec を参照してください。
例:
sh %{ls -ltr}
sh 'ls', 'file with spaces'
# check exit status after command runs
sh %{grep pattern file} do |ok, res|
if ! ok
puts "pattern not found (status = #{res.exitstatus})"
end
end
@see Kernel.#exe... -
Process
. exit!(status = false) -> () (123.0) -
関数 Kernel.#exit! と同じです。
...関数 Kernel.#exit! と同じです。
@param status 終了ステータスを boolean か整数で指定します。true の場合は成功を、false は失敗を意味します。
@see _exit(2)... -
Process
. exit(status = true) -> () (123.0) -
プロセスを終了します。関数 Kernel.#exit と同じです。
...プロセスを終了します。関数 Kernel.#exit と同じです。
@param status 終了ステータスを boolean か整数で指定します。true の場合は成功を、false は失敗を意味します。
@see exit(3)... -
FileUtils
# ruby(*args) {|result , status| . . . } (107.0) -
与えられた引数で Ruby インタプリタを実行します。
...与えられた引数で Ruby インタプリタを実行します。
@param args Ruby インタプリタに与える引数を指定します。
例:
ruby %{-pe '$_.upcase!' <README}
@see Kernel.#sh...