ライブラリ
- English (11)
- ビルトイン (247)
-
minitest
/ unit (1) - optparse (11)
- rake (11)
-
rubygems
/ config _ file (22) -
webrick
/ httpresponse (11)
クラス
- Exception (33)
- Fiber (5)
-
Gem
:: ConfigFile (22) -
OptionParser
:: ParseError (11) -
Rake
:: Application (11) - Thread (33)
-
Thread
:: Backtrace :: Location (77) -
WEBrick
:: HTTPResponse (11)
キーワード
-
$ @ (11) -
$ ERROR _ INFO (11) - == (11)
-
DEFAULT
_ BACKTRACE (11) - Rubyの起動 (3)
- Ruby用語集 (11)
-
absolute
_ path (11) -
backtrace
_ locations (33) -
base
_ label (11) -
caller
_ locations (22) - fail (33)
-
filter
_ backtrace (12) - inspect (11)
- label (11)
- lineno (11)
- path (11)
- raise (38)
-
rubygems
/ commands / build _ command (11) -
rubygems
/ commands / cert _ command (11) -
rubygems
/ commands / cleanup _ command (11) -
rubygems
/ commands / contents _ command (11) -
rubygems
/ commands / dependency _ command (11) -
rubygems
/ commands / help _ command (11) -
rubygems
/ commands / install _ command (11) -
rubygems
/ commands / list _ command (11) -
rubygems
/ commands / lock _ command (11) -
rubygems
/ commands / outdated _ command (11) -
rubygems
/ commands / query _ command (11) -
rubygems
/ commands / search _ command (11) -
rubygems
/ commands / sources _ command (11) -
rubygems
/ commands / specification _ command (11) -
rubygems
/ commands / uninstall _ command (11) -
set
_ backtrace (11) -
set
_ error (11) -
to
_ s (11)
検索結果
先頭5件
-
Gem
:: ConfigFile # backtrace -> bool (27401.0) -
エラー発生時にバックトレースを出力するかどうかを返します。
エラー発生時にバックトレースを出力するかどうかを返します。
真の場合はバックトレースを出力します。そうでない場合はバックトレースを出力しません。 -
Thread
# backtrace -> [String] | nil (24413.0) -
スレッドの現在のバックトレースを返します。
...nil を返します。
//emlist[例][ruby]{
class C1
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
//}... -
OptionParser
:: ParseError . filter _ backtrace(array) -> [String] (21401.0) -
array で指定されたバックトレースから optparse ライブラリに関する行を除 外します。
...array で指定されたバックトレースから optparse ライブラリに関する行を除
外します。
デバッグモード($DEBUGが真)の場合は何もしません。
@param array バックトレースを文字列の配列で指定します。
@return array を返します。... -
Thread
# backtrace _ locations(range) -> [Thread :: Backtrace :: Location] | nil (18832.0) -
スレッドの現在のバックトレースを Thread::Backtrace::Location の配 列で返します。
...トレースを Thread::Backtrace::Location の配
列で返します。
引数で指定した値が範囲外の場合、スレッドがすでに終了している場合は nil
を返します。
@param start 開始フレームの位置を数値で指定します。
@param length 取得するフ......ram range 取得したいフレームの範囲を示す Range オブジェクトを指定します。
Kernel.#caller_locations と似ていますが、本メソッドは self に限定
した情報を返します。
//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.run
thread.backtrace_l......ocations # => ["/path/to/test.rb:1:in `sleep'", "/path/to/test.rb:1:in `block in <main>'"]
//}
@see Thread::Backtrace::Location... -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (18758.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...eption#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return if Da......00, month, -1).day == 31
raise "#{month} is not long month"
end
def get_exception
return begin
yield
rescue => e
e
end
end
e = get_exception { check_long_month(2) }
p e.backtrace_locations
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "test.rb:9:in `ge......t_exception'", "test.rb:15:in `<main>'"]
//}
@see Exception#backtrace... -
Thread
# backtrace _ locations(start = 0 , length = nil) -> [Thread :: Backtrace :: Location] | nil (18732.0) -
スレッドの現在のバックトレースを Thread::Backtrace::Location の配 列で返します。
...トレースを Thread::Backtrace::Location の配
列で返します。
引数で指定した値が範囲外の場合、スレッドがすでに終了している場合は nil
を返します。
@param start 開始フレームの位置を数値で指定します。
@param length 取得するフ......ram range 取得したいフレームの範囲を示す Range オブジェクトを指定します。
Kernel.#caller_locations と似ていますが、本メソッドは self に限定
した情報を返します。
//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.run
thread.backtrace_l......ocations # => ["/path/to/test.rb:1:in `sleep'", "/path/to/test.rb:1:in `block in <main>'"]
//}
@see Thread::Backtrace::Location... -
MiniTest
. filter _ backtrace(backtrace) -> Array (18508.0) -
バックトレースからこのライブラリに関する部分を取り除いた結果を返します。
...バックトレースからこのライブラリに関する部分を取り除いた結果を返します。
@param backtrace バックトレースを指定します。... -
Gem
:: ConfigFile :: DEFAULT _ BACKTRACE -> false (18401.0) -
バックトレースが表示されるかどうかのデフォルト値です。
バックトレースが表示されるかどうかのデフォルト値です。 -
Kernel
. # caller _ locations(range) -> [Thread :: Backtrace :: Location] | nil (12424.0) -
現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。
...ームを Thread::Backtrace::Location の配列で返します。引
数で指定した値が範囲外の場合は nil を返します。
@param start 開始フレームの位置を数値で指定します。
@param length 取得するフレームの個数を指定します。
@param range 取......示す Range オブジェクトを指定します。
//emlist[例][ruby]{
def test1(start, length)
locations = caller_locations(start, length)
p locations
p locations.map(&:lineno)
p locations.map(&:path)
end
def test2(start, length)
test1(start, length)
end
def test3(start, length)
t......start, length)
end
caller_locations # => []
test3(1, nil)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'", "/Users/user/test.rb:17:in `<main>'"]
# => [9, 13, 17]
# => ["/Users/user/test.rb", "/Users/user/test.rb", "/Users/user/test.rb"]
test3(1, 2)
# => ["/Users/user/t... -
Kernel
. # caller _ locations(start = 1 , length = nil) -> [Thread :: Backtrace :: Location] | nil (12424.0) -
現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。
...ームを Thread::Backtrace::Location の配列で返します。引
数で指定した値が範囲外の場合は nil を返します。
@param start 開始フレームの位置を数値で指定します。
@param length 取得するフレームの個数を指定します。
@param range 取......示す Range オブジェクトを指定します。
//emlist[例][ruby]{
def test1(start, length)
locations = caller_locations(start, length)
p locations
p locations.map(&:lineno)
p locations.map(&:path)
end
def test2(start, length)
test1(start, length)
end
def test3(start, length)
t......start, length)
end
caller_locations # => []
test3(1, nil)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'", "/Users/user/test.rb:17:in `<main>'"]
# => [9, 13, 17]
# => ["/Users/user/test.rb", "/Users/user/test.rb", "/Users/user/test.rb"]
test3(1, 2)
# => ["/Users/user/t...