4件ヒット
[1-4件を表示]
(0.252秒)
モジュール
- Warning (1)
キーワード
-
report
_ on _ exception (1) -
report
_ on _ exception= (1) -
to
_ tty? (1) - warn (1)
検索結果
先頭4件
-
Exception
. to _ tty? -> bool (24106.0) -
$stderr が変更されておらず、$stderr.tty? が真の場合は true を返します。
$stderr が変更されておらず、$stderr.tty? が真の場合は true を返します。
@see Exception#full_message -
Thread
. report _ on _ exception -> bool (24076.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) (24076.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... -
Warning
. warn(message) -> nil (24076.0) -
引数 message を標準エラー出力 $stderr に出力します。
引数 message を標準エラー出力 $stderr に出力します。
本メソッドはRubyが出力する全ての警告に対して呼び出されます。
そのため本メソッドをオーバーライドすることで Ruby から出力される警告の動作を変更できます。
またオーバーライドしたメソッドからは super を呼び出すことで、デフォルトの動作である $stderr への出力ができます。
//emlist[][ruby]{
warn "hoge" # => hoge
module Warning
# 警告メッセージの末尾に !!! を追加する
def self.warn(message)
sup...