271件ヒット
[1-100件を表示]
(0.073秒)
種類
- インスタンスメソッド (194)
- 特異メソッド (44)
- モジュール関数 (22)
- 文書 (11)
ライブラリ
- ビルトイン (110)
- csv (11)
- pathname (11)
- rake (33)
-
rubygems
/ gem _ path _ searcher (22) -
rubygems
/ specification (55) - shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (6)
クラス
- CSV (11)
- File (11)
-
Gem
:: GemPathSearcher (22) -
Gem
:: Specification (55) - Pathname (11)
- Proc (11)
-
Rake
:: Application (11) - Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6) - Thread (22)
-
Thread
:: Backtrace :: Location (44)
キーワード
- Rubyの起動 (11)
-
absolute
_ path (11) - application (11)
- application= (11)
-
attribute
_ alias _ singular (11) -
backtrace
_ locations (22) -
caller
_ locations (22) -
extra
_ rdoc _ files= (11) - find (11)
-
find
_ all (11) -
full
_ gem _ path (11) - inspect (11)
-
installation
_ path (11) -
loaded
_ from= (11) -
original
_ dir (11) -
source
_ location (11) -
to
_ s (11) - truncate (51)
検索結果
先頭5件
-
Thread
:: Backtrace :: Location # path -> String (24113.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 # absolute _ path -> String (15231.0) -
self が表すフレームの絶対パスを返します。
...self が表すフレームの絶対パスを返します。
//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.absolute_path
end
# => /path/to/foo.rb
# /path/......to/foo.rb
# /path/to/foo.rb
//}
@see Thread::Backtrace::Location#path... -
Gem
:: Specification # full _ gem _ path -> String (15201.0) -
この Gem パッケージへのフルパスを返します。
この Gem パッケージへのフルパスを返します。 -
Gem
:: Specification # installation _ path -> String (15201.0) -
この Gem パッケージのインストール先のパスを返します。
この Gem パッケージのインストール先のパスを返します。 -
Thread
# backtrace _ locations(range) -> [Thread :: Backtrace :: Location] | nil (12412.0) -
スレッドの現在のバックトレースを Thread::Backtrace::Location の配 列で返します。
...ースを Thread::Backtrace::Location の配
列で返します。
引数で指定した値が範囲外の場合、スレッドがすでに終了している場合は nil
を返します。
@param start 開始フレームの位置を数値で指定します。
@param length 取得するフレー......ます。
Kernel.#caller_locations と似ていますが、本メソッドは self に限定
した情報を返します。
//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.run
thread.backtrace_locations # => ["/path/to/test.rb:1:in `sleep'", "/path/to/test.rb:1:in `block in <main>'"]
/....../}
@see Thread::Backtrace::Location... -
Thread
# backtrace _ locations(start = 0 , length = nil) -> [Thread :: Backtrace :: Location] | nil (12412.0) -
スレッドの現在のバックトレースを Thread::Backtrace::Location の配 列で返します。
...ースを Thread::Backtrace::Location の配
列で返します。
引数で指定した値が範囲外の場合、スレッドがすでに終了している場合は nil
を返します。
@param start 開始フレームの位置を数値で指定します。
@param length 取得するフレー......ます。
Kernel.#caller_locations と似ていますが、本メソッドは self に限定
した情報を返します。
//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.run
thread.backtrace_locations # => ["/path/to/test.rb:1:in `sleep'", "/path/to/test.rb:1:in `block in <main>'"]
/....../}
@see Thread::Backtrace::Location... -
Rake
. application -> Rake :: Application (12406.0) -
現在の Rake アプリケーションを返します。
...//emlist[][ruby]{
# Rakefile での記載例とする
require 'pp'
task default: :test_rake_app
task :test_rake_app do
pp Rake.application
end
# => #<Rake::Application:0x31b0f18
# @default_loader=#<Rake::DefaultLoader:0x31b0c78>,
# @imported=[],
# @last_description=nil,
# @loade......ultLoader:0x31b0c18>,
# ".rf"=>#<Rake::DefaultLoader:0x31b0b88>,
# ".rake"=>#<Rake::DefaultLoader:0x31b0b10>},
# @name="rake",
# @options=#<OpenStruct rakelib=["rakelib"], trace_output=#<IO:<STDERR>>>,
# @original_dir="/path/to/dir",
# @pending_imports=[],
# @rakefile......akefile",
# @rakefiles=["rakefile", "Rakefile", "rakefile.rb", "Rakefile.rb"],
# @rules=[],
# @scope=LL(),
# @tasks=
# {"default"=><Rake::Task default => [test_rake_app]>,
# "test_rake_app"=><Rake::Task test_rake_app => []>},
# @terminal_columns=0,
# @top_level_tas... -
Kernel
. # caller _ locations(range) -> [Thread :: Backtrace :: Location] | nil (12306.0) -
現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。
...現在のフレームを Thread::Backtrace::Location の配列で返します。引
数で指定した値が範囲外の場合は nil を返します。
@param start 開始フレームの位置を数値で指定します。
@param length 取得するフレームの個数を指定します。
@pa......。
//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)
test2(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/test.rb:9:in `test2'", "/Users/user/test.rb:1... -
Kernel
. # caller _ locations(start = 1 , length = nil) -> [Thread :: Backtrace :: Location] | nil (12306.0) -
現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。
...現在のフレームを Thread::Backtrace::Location の配列で返します。引
数で指定した値が範囲外の場合は nil を返します。
@param start 開始フレームの位置を数値で指定します。
@param length 取得するフレームの個数を指定します。
@pa......。
//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)
test2(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/test.rb:9:in `test2'", "/Users/user/test.rb:1... -
Proc
# source _ location -> [String , Integer] | nil (12218.0) -
ソースコードのファイル名と行番号を配列で返します。
...nil を返します。
//emlist[例][ruby]{
# /path/to/target.rb を実行
proc {}.source_location # => ["/path/to/target.rb", 1]
proc {}.source_location # => ["/path/to/target.rb", 2]
(eval "proc {}").source_location # => ["(eval)", 1]
method(:p).to_proc.source_location #......=> nil
//}
@see Method#source_location...