8件ヒット
[1-8件を表示]
(0.045秒)
別のキーワード
種類
- インスタンスメソッド (4)
- 特異メソッド (3)
- 変数 (1)
モジュール
- Kernel (1)
キーワード
- pid (1)
-
report
_ on _ exception (2) -
report
_ on _ exception= (2) -
to
_ tty? (1)
検索結果
先頭5件
-
IO
# pid -> Integer | nil (63157.0) -
自身が IO.popen で作られたIOポートなら、子プロセスのプロセス ID を 返します。それ以外は nil を返します。
自身が IO.popen で作られたIOポートなら、子プロセスのプロセス ID を
返します。それ以外は nil を返します。
@raise IOError 既に close されている場合に発生します。
//emlist[例][ruby]{
IO.popen("-") do |pipe|
if pipe
$stderr.puts "In parent, child pid is #{pipe.pid}" # => In parent, child pid is 16013
else
$stderr.puts "In child, pid is #{$$}" ... -
Kernel
$ $ stderr -> object (54544.0) -
標準エラー出力です。
標準エラー出力です。
Ruby インタプリタが出力するエラーメッセージや
警告メッセージ、Kernel.#warn の出力先となります。
初期値は Object::STDERR です。
$stderr に代入するオブジェクトには
write という名前のメソッドが定義されていなければいけません。
自プロセスの標準エラー出力をリダイレクトしたいときには、
$stderr に代入すれば十分です。
//emlist[例][ruby]{
# 標準エラー出力の出力先を /tmp/foo に変更
$stderr = File.open("/tmp/foo", "w")
puts "foo" ... -
Thread
. report _ on _ exception -> bool (18373.0) -
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
デフォルトは true です。
Thread.new { 1.times { raise } }
は $stderr に以下のように出力します:
#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block in <main>'
1: fro... -
Thread
. report _ on _ exception=(newstate) (18373.0) -
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
デフォルトは true です。
Thread.new { 1.times { raise } }
は $stderr に以下のように出力します:
#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block in <main>'
1: fro... -
Thread
# report _ on _ exception -> bool (18355.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
デフォルトはスレッド作成時の Thread.report_on_exception です。
@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。
//emlist[例][ruby]{
a = Thread.new{ Thread.stop; raise }
a.report_on_exception = true
a.report_on_exception # => true
a.run
# => #<Th... -
Thread
# report _ on _ exception=(newstate) (18355.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
デフォルトはスレッド作成時の Thread.report_on_exception です。
@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。
//emlist[例][ruby]{
a = Thread.new{ Thread.stop; raise }
a.report_on_exception = true
a.report_on_exception # => true
a.run
# => #<Th... -
Exception
# full _ message(highlight: true , order: :bottom) -> String (9061.0) -
例外の整形された文字列を返します。
例外の整形された文字列を返します。
返される文字列は Ruby が捕捉されなかった例外を標準エラー出力に出力するときと
同じ形式です。
そのため、メソッド呼び出し時に $stderr が変更されておらず、$stderr.tty? が真の場合は
エスケープシーケンスによる文字装飾がついています。
@param highlight エスケープシーケンスによる文字装飾をつけるかどうかを指定します。
デフォルト値は Exception.to_tty? の返り値と同じです。
@param order :top か :bottom で指定する必要があります。
... -
Exception
. to _ tty? -> bool (9055.0) -
$stderr が変更されておらず、$stderr.tty? が真の場合は true を返します。
$stderr が変更されておらず、$stderr.tty? が真の場合は true を返します。
@see Exception#full_message