259件ヒット
[201-259件を表示]
(0.253秒)
種類
- インスタンスメソッド (160)
- モジュール関数 (66)
- 定数 (11)
- クラス (11)
- 特異メソッド (11)
クラス
- Binding (78)
- Object (11)
- Proc (11)
-
RubyVM
:: InstructionSequence (11) - Thread (49)
- TracePoint (22)
モジュール
- Kernel (44)
- ObjectSpace (22)
キーワード
-
TOPLEVEL
_ BINDING (11) -
add
_ trace _ func (11) - backtrace (11)
- binding (33)
-
define
_ finalizer (22) - eval (33)
- irb (8)
-
local
_ variable _ defined? (11) -
local
_ variable _ get (11) -
local
_ variable _ set (11) -
local
_ variables (10) - of (11)
- receiver (10)
-
report
_ on _ exception (8) -
report
_ on _ exception= (8) - self (11)
-
set
_ trace _ func (22) -
source
_ location (6)
検索結果
先頭5件
-
ObjectSpace
. # define _ finalizer(obj) {|id| . . . } -> Array (8008.0) -
obj が解放されるときに実行されるファイナライザ proc を 登録します。同じオブジェクトについて複数回呼ばれたときは置き換えで はなく追加登録されます。固定値 0 と proc を配列にして返します。
...いでしょう。
//emlist[例][ruby]{
class Baz
def initialize
ObjectSpace.define_finalizer self, eval(%q{
proc {
raise "baz" rescue puts $!
raise "baz2"
puts "baz3"
}
}, TOPLEVEL_BINDING)
end
end
Baz.new
GC.start
# => baz
//}
@see spec/rubycmd... -
ObjectSpace
. # define _ finalizer(obj , proc) -> Array (8008.0) -
obj が解放されるときに実行されるファイナライザ proc を 登録します。同じオブジェクトについて複数回呼ばれたときは置き換えで はなく追加登録されます。固定値 0 と proc を配列にして返します。
...いでしょう。
//emlist[例][ruby]{
class Baz
def initialize
ObjectSpace.define_finalizer self, eval(%q{
proc {
raise "baz" rescue puts $!
raise "baz2"
puts "baz3"
}
}, TOPLEVEL_BINDING)
end
end
Baz.new
GC.start
# => baz
//}
@see spec/rubycmd... -
RubyVM
:: InstructionSequence . of(body) -> RubyVM :: InstructionSequence (8008.0) -
引数 body で指定した Proc、Method オブジェクトを元に RubyVM::InstructionSequence オブジェクトを作成して返します。
...実行した場合
# proc
> p = proc { num = 1 + 2 }
> RubyVM::InstructionSequence.of(p)
> # => <RubyVM::InstructionSequence:block in irb_binding@(irb)>
# method
> def foo(bar); puts bar; end
> RubyVM::InstructionSequence.of(method(:foo))
> # => <RubyVM::InstructionSequence:foo@(ir... -
Thread
# backtrace -> [String] | nil (8008.0) -
スレッドの現在のバックトレースを返します。
...def m1
sleep 5
end
def m2
m1
end
end
th = Thread.new {C1.new.m2; Thread.stop}
th.backtrace
# => [
# [0] "(irb):3:in `sleep'",
# [1] "(irb):3:in `m1'",
# [2] "(irb):6:in `m2'",
# [3] "(irb):10:in `block in irb_binding'"
# ]
th.kill
th.backtrace # => nil
//}... -
Thread
# report _ on _ exception -> bool (8008.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...8c7908@(irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent call last):
# (irb):1:in `block in irb_binding': unhandled exception
# #<Thread:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }
b.report_on_exception = false
b.run #... -
Thread
# report _ on _ exception=(newstate) (8008.0) -
真の場合、そのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...8c7908@(irb):1 run> terminated with exception (report_on_exception is true):
# Traceback (most recent call last):
# (irb):1:in `block in irb_binding': unhandled exception
# #<Thread:0x00007fc3f48c7908@(irb):1 dead>
b = Thread.new{ Thread.stop; raise }
b.report_on_exception = false
b.run #...