別のキーワード
ライブラリ
- English (11)
- ビルトイン (279)
-
minitest
/ unit (2) - optparse (22)
- rake (22)
-
rubygems
/ commands / which _ command (11) -
rubygems
/ config _ file (33) -
webrick
/ httpresponse (11)
クラス
- Exception (44)
- Fiber (15)
-
Gem
:: ConfigFile (33) -
OptionParser
:: ParseError (22) -
Rake
:: Application (11) - Thread (33)
-
Thread
:: Backtrace :: Location (77) -
WEBrick
:: HTTPResponse (11)
モジュール
- Kernel (110)
- MiniTest (1)
-
MiniTest
:: Assertions (1) - Rake (11)
キーワード
-
$ @ (11) -
$ ERROR _ INFO (11) - == (11)
-
DEFAULT
_ BACKTRACE (11) - Location (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - Rubyの起動 (3)
- Ruby用語集 (11)
- WhichCommand (11)
-
absolute
_ path (11) - application= (11)
- backtrace= (11)
-
backtrace
_ locations (33) -
base
_ label (11) -
caller
_ locations (22) - fail (33)
-
filter
_ backtrace (12) -
get
_ backtrace (11) - inspect (11)
- label (11)
- lineno (11)
-
make
_ backtrace (11) - path (11)
- raise (48)
-
rb
_ backtrace (11) - rubygems (11)
-
rubygems
/ commands / build _ command (11) -
rubygems
/ commands / cert _ command (11) -
rubygems
/ commands / check _ command (11) -
rubygems
/ commands / cleanup _ command (11) -
rubygems
/ commands / contents _ command (11) -
rubygems
/ commands / dependency _ command (11) -
rubygems
/ commands / environment _ command (11) -
rubygems
/ commands / fetch _ command (11) -
rubygems
/ commands / generate _ index _ command (11) -
rubygems
/ commands / help _ command (11) -
rubygems
/ commands / install _ command (11) -
rubygems
/ commands / list _ command (11) -
rubygems
/ commands / lock _ command (11) -
rubygems
/ commands / mirror _ command (11) -
rubygems
/ commands / outdated _ command (11) -
rubygems
/ commands / pristine _ command (11) -
rubygems
/ commands / query _ command (11) -
rubygems
/ commands / rdoc _ command (11) -
rubygems
/ commands / search _ command (11) -
rubygems
/ commands / server _ command (11) -
rubygems
/ commands / sources _ command (11) -
rubygems
/ commands / specification _ command (11) -
rubygems
/ commands / uninstall _ command (11) -
rubygems
/ commands / unpack _ command (11) -
set
_ backtrace (33) -
set
_ error (11) - skip (1)
-
to
_ s (11)
検索結果
先頭5件
-
Thread
:: Backtrace :: Location # label -> String (3012.0) -
self が表すフレームのラベルを返します。通常、メソッド名、クラス名、モ ジュール名などで構成されます。
...フレームのラベルを返します。通常、メソッド名、クラス名、モ
ジュール名などで構成されます。
例: Thread::Backtrace::Location の例1を用いた例
//emlist[][ruby]{
loc = c(0..1).first
loc.label # => "a"
//}
@see Thread::Backtrace::Location#base_label... -
Thread
:: Backtrace :: Location # path -> String (3012.0) -
self が表すフレームのファイル名を返します。
...self が表すフレームのファイル名を返します。
例: Thread::Backtrace::Location の例1を用いた例
//emlist[][ruby]{
loc = c(0..1).first
loc.path # => "caller_locations.rb"
//}
@see Thread::Backtrace::Location#absolute_path... -
Thread
:: Backtrace :: Location (3006.0) -
Ruby のフレームを表すクラスです。
...s(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.to_s
end
//}
例2の実行結果:
init.rb:4:in `initialize'
init.rb:8:in `new'
init.rb:8:in `<main>'
=== 参考
* Ruby VM アドベントカレンダー #4 vm_backtrace.c: https://www.atdot.net/~ko1/diary/201212.html#d4... -
Thread
:: Backtrace :: Location # absolute _ path -> String (3006.0) -
self が表すフレームの絶対パスを返します。
...][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.absolute_path
end
# => /path/to/foo.rb
# /path/to/foo.rb
# /path/to/foo.rb
//}
@see Thread::Backtrace::Location#path... -
Thread
:: Backtrace :: Location # lineno -> Integer (3006.0) -
self が表すフレームの行番号を返します。
...self が表すフレームの行番号を返します。
例: Thread::Backtrace::Location の例1を用いた例
//emlist[][ruby]{
loc = c(0..1).first
loc.lineno # => 2
//}... -
Thread
:: Backtrace :: Location # to _ s -> String (3000.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し
ます。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.to_s
end
# => path/to/foo.rb:5:in `initialize'
# path/to/foo... -
Kernel
. # caller _ locations(range) -> [Thread :: Backtrace :: Location] | nil (124.0) -
現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。
...現在のフレームを Thread::Backtrace::Location の配列で返します。引
数で指定した値が範囲外の場合は nil を返します。
@param start 開始フレームの位置を数値で指定します。
@param length 取得するフレームの個数を指定します。
@pa......(1, 2)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'"]
# => [9, 13]
# => ["/Users/user/test.rb", "/Users/user/test.rb"]
test3(2, 1)
# => ["/Users/user/test.rb:13:in `test3'"]
# => [13]
# => ["/Users/user/test.rb"]
//}
@see Thread::Backtrace::Location, Kernel.#caller... -
Kernel
. # caller _ locations(start = 1 , length = nil) -> [Thread :: Backtrace :: Location] | nil (124.0) -
現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。
...現在のフレームを Thread::Backtrace::Location の配列で返します。引
数で指定した値が範囲外の場合は nil を返します。
@param start 開始フレームの位置を数値で指定します。
@param length 取得するフレームの個数を指定します。
@pa......(1, 2)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'"]
# => [9, 13]
# => ["/Users/user/test.rb", "/Users/user/test.rb"]
test3(2, 1)
# => ["/Users/user/test.rb:13:in `test3'"]
# => [13]
# => ["/Users/user/test.rb"]
//}
@see Thread::Backtrace::Location, Kernel.#caller... -
Kernel
. # fail(error _ type , message = nil , backtrace = caller(0) , cause: $ !) -> () (108.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...スまたは例外クラスのインスタンスで指定します。
@param message 例外のメッセージとなる文字列です。
@param backtrace 例外発生時のスタックトレースで、Kernel.#caller の戻り値と同じ
形式で指定しなければいけません。
@param cau... -
Kernel
. # raise(error _ type , message = nil , backtrace = caller(0) , cause: $ !) -> () (108.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...スまたは例外クラスのインスタンスで指定します。
@param message 例外のメッセージとなる文字列です。
@param backtrace 例外発生時のスタックトレースで、Kernel.#caller の戻り値と同じ
形式で指定しなければいけません。
@param cau...