別のキーワード
種類
- 文書 (41)
- インスタンスメソッド (11)
- 特異メソッド (11)
- クラス (11)
ライブラリ
- ビルトイン (33)
クラス
- TracePoint (22)
キーワード
-
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 6 . 0 (6) - new (11)
-
raised
_ exception (11)
検索結果
先頭5件
-
TracePoint (38054.0)
-
Kernel.#set_trace_func と同様の機能をオブジェクト指向的な API で 提供するクラスです。
...集する][ruby]{
trace = TracePoint.new(:raise) do |tp|
p [tp.lineno, tp.event, tp.raised_exception]
end
# => #<TracePoint:0x007f786a452448>
trace.enable
# => false
0 / 0
# => [5, :raise, #<ZeroDivisionError: divided by 0>]
//}
TracePoint.new または、TracePoint.trace で指定したブロ......トの詳細については、TracePoint.new を参照してくださ
い。
=== 参考
* Ruby VM アドベントカレンダー #12 TracePoint の紹介 (1): https://www.atdot.net/~ko1/diary/201212.html#d12
* Ruby VM アドベントカレンダー #13 TracePoint の紹介 (2): https://www.atdot.......net/~ko1/diary/201212.html#d13
* Ruby VM アドベントカレンダー #14 TracePoint の紹介 (3): https://www.atdot.net/~ko1/diary/201212.html#d14... -
TracePoint
# raised _ exception -> Exception (27214.0) -
発生した例外を返します。
...eError :raise イベントのためのイベントフックの外側で実行し
た場合に発生します。
//emlist[例][ruby]{
trace = TracePoint.new(:raise) do |tp|
tp.raised_exception # => #<ZeroDivisionError: divided by 0>
end
trace.enable
begin
0/0
rescue
end
//}... -
TracePoint
. new(*events) {|obj| . . . } -> TracePoint (21181.0) -
新しい TracePoint オブジェクトを作成して返します。トレースを有効 にするには TracePoint#enable を実行してください。
...新しい TracePoint オブジェクトを作成して返します。トレースを有効
にするには TracePoint#enable を実行してください。
//emlist[例:irb で実行した場合][ruby]{
trace = TracePoint.new(:call) do |tp|
p [tp.lineno, tp.defined_class, tp.method_id, tp.even......t]
end
# => #<TracePoint:0x007f17372cdb20>
trace.enable
# => false
puts "Hello, TracePoint!"
# ...
# [69, IRB::Notifier::AbstractNotifier, :printf, :call]
# ...
//}
トレースを無効にするには TracePoint#disable を実行してください。
//emlist[][ruby]{
trace.disable
//}
@param......るメソッドを実行した場合には
RuntimeError が発生します。
//emlist[例][ruby]{
TracePoint.trace(:line) do |tp|
p tp.raised_exception
end
# => RuntimeError: 'raised_exception' not supported by this event
//}
イベントフックの外側で、発生したイベントに関... -
NEWS for Ruby 2
. 6 . 0 (78.0) -
NEWS for Ruby 2.6.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ser| cond(user) }
//}
* 例外が捕捉されず、バックトレースとエラーメッセージが表示されるときに、
例外の Exception#cause も表示されるようになりました。 8257
* フリップフロップが非推奨になりました。 5400
=== 組み込み......け取り、環境変数名と値のペアを新しいキーと値に変換できるようになりました。 15143
* Exception
* 新規オプション
* Exception#full_message が :highlight と :order を受け付けるようになりました。 14324
* Hash
* 変更され......ンを維持します。 14850
* TracePoint
* 新機能
* "script_compiled" イベントがサポートされました。 15287
* 新規メソッド
* TracePoint#parameters 14694
* TracePoint#instruction_sequence 15287
* TracePoint#eval_script 15287
* 変更さ... -
NEWS for Ruby 2
. 1 . 0 (30.0) -
NEWS for Ruby 2.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ble_defined?
* Enumerable
* 追加: Enumerable#to_h キーと値のペアのリストをハッシュに変換します。
* Exception
* 追加: Exception#cause 一つ前の例外を新しい例外を返します。
例外を rescue して raise しなおしたときに元の例......: IO#read_nonblock シンボルを返すためにキーワード引数 `exception: false` を受け付けるようになりました
* 拡張: IO#write_nonblock シンボルを返すためにキーワード引数 `exception: false` を受け付けるようになりました
* Kernel
* 追......ックのプロファイルのために現在のRubyのスタックに
低コストでアクセスする機能を提供します。
* rb_tracepoint_new() C言語からアクセス可能な新しい内部的なイベントをサポートしました:
* RUBY_INTERNAL_EVENT_NEWOBJ
* RUBY... -
NEWS for Ruby 2
. 5 . 0 (30.0) -
NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...* 非推奨になりました。C拡張のベースクラスでしたが、Rubyレベルに公開するのをやめました。3072
* Exception
* Exception#full_message を追加 14141 [実験的]
例外の文字列表現を取得します。その文字列は捕捉されない例外......を追加。$? と同じです 14043
* Range
* Range.new no longer hides exceptions when comparing begin and
end with #<=> and raise a "bad value for range" ArgumentError
but instead lets the exception from the #<=> call go through.
7688
* Regexp
* Onigmo 6.1.3-669a......c allocation というテクニックでブロックをメソッドの引数として渡したときの性能が向上しました
14045
* TracePointのためにtrace命令の変わりに命令の動的書き換えを使用するようにしました
14104
* ERB がテンプレート... -
NEWS for Ruby 2
. 3 . 0 (24.0) -
NEWS for Ruby 2.3.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...追加されました
9098
=== 組み込みクラスの更新
* ARGF
* ARGF.read_nonblock は IO#read_nonblock と同じように `exception: false' オプションをサポートします
11358
* Array
* Array#bsearch_index を追加
10730
* Array#dig を追加......oc#call ( Proc#[] , Proc#===, Proc#yield) は最適化されました。
Backtrace doesn't show each method (show block lines directly).
TracePoint also ignores these calls.
11569
* Queue (Thread::Queue)
* 終了を通知するために Queue#close(Thread::Queue#close) を......internal_super_of を追加。
* OpenSSL
* OpenSSL::SSL::SSLSocket#accept_nonblock と
OpenSSL::SSL::SSLSocket#connect_nonblock は `exception: false` オプションをサポートするようになりました。
10532
* Pathname
* Pathname#descend と Pathname#ascend は... -
NEWS for Ruby 2
. 4 . 0 (24.0) -
NEWS for Ruby 2.4.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ての Unicode に対して動作するようになりました。10085
* Thread
* Thread#report_on_exception, Thread.report_on_exception を追加 6647
* TracePoint
* TracePoint#callee_id を追加 12747
* Warning
* Warningという名前のモジュールを導入しました...