るりまサーチ

最速Rubyリファレンスマニュアル検索!
14件ヒット [1-14件を表示] (0.046秒)
トップページ > ライブラリ:ビルトイン[x] > クエリ:@[x] > クエリ:tty?[x] > クラス:Exception[x]

別のキーワード

  1. csv tty?
  2. stringio tty?
  3. etc sc_tty_name_max
  4. io tty?
  5. _builtin tty?

検索結果

Exception.to_tty? -> bool (6126.0)

$stderr が変更されておらず、$stderr.tty? が真の場合は true を返します。

...$stderr が変更されておらず、$stderr.tty? が真の場合は true を返します。

[注意] 2.5.1 で追加されたメソッドです。

@
see Exception#full_message...
...$stderr が変更されておらず、$stderr.tty? が真の場合は true を返します。


@
see Exception#full_message...

Exception#full_message(highlight: true, order: :bottom) -> String (27.0)

例外の整形された文字列を返します。

...ー出力に出力するときと
同じ形式です。
そのため、メソッド呼び出し時に $stderr が変更されておらず、$stderr.tty? が真の場合は
エスケープシーケンスによる文字装飾がついています。

[注意] このメソッドは実験的な機能と...
...と order は 2.5.1 で追加されました。

@
param highlight エスケープシーケンスによる文字装飾をつけるかどうかを指定します。
デフォルト値は Exception.to_tty? の返り値と同じです。

@
param order :top か :bottom で指定する必...
...ックトレースの一番奥がエラーメッセージの上(top)か下(bottom)かを指定します。
デフォルト値は Exception.to_tty? が真なら :bottom で偽なら :top です。

//emlist[例][ruby]{
begin
raise "test"
rescue => e
p e.full_message # => "\e[1mTrac...
...ず、$stderr.tty? が真の場合は
エスケープシーケンスによる文字装飾がついています。


@
param highlight エスケープシーケンスによる文字装飾をつけるかどうかを指定します。
デフォルト値は Exception.to_tty? の返り値...
...と同じです。

@
param order :top か :bottom で指定する必要があります。
バックトレースの一番奥がエラーメッセージの上(top)か下(bottom)かを指定します。
デフォルト値は Exception.to_tty? が真なら :bottom で偽なら...
...e[1m)\n\e[m"
$stderr = $stdout
p e.full_message # => "test.rb:2:in `<main>': test (RuntimeError)\n"
$stderr = STDERR
p e.full_message # => "\e[1mTraceback \e[m(most recent call last):\ntest.rb:2:in `<main>': \e[1mtest (\e[4;1mRuntimeError\e[m\e[1m)\n\e[m"
end
//}

@
see Exception.to_tty?...