ライブラリ
- ビルトイン (223)
-
minitest
/ unit (1) - objspace (60)
-
rdoc
/ context (12)
クラス
- Binding (7)
- Exception (12)
- Method (24)
-
MiniTest
:: Unit (1) - Module (12)
- Proc (12)
-
RDoc
:: Context (12) - Thread (24)
-
Thread
:: Backtrace :: Location (84) - UnboundMethod (12)
モジュール
- Kernel (24)
- ObjectSpace (60)
キーワード
- Location (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 2
. 6 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (6) -
absolute
_ path (12) -
allocation
_ sourcefile (12) -
allocation
_ sourceline (12) -
backtrace
_ locations (36) -
base
_ label (12) -
caller
_ locations (24) -
const
_ source _ location (12) - inspect (18)
- label (12)
- lineno (12)
-
mark
_ locations _ array (12) -
net
/ http (12) - path (12)
-
rb
_ gc _ mark _ locations (12) -
record
_ location (12) -
rubygems
/ security (12) -
source
_ location (43) -
to
_ s (18) -
trace
_ object _ allocations (12) -
trace
_ object _ allocations _ start (12) -
trace
_ object _ allocations _ stop (12)
検索結果
先頭5件
-
Method
# source _ location -> [String , Integer] | nil (6119.0) -
ソースコードのファイル名と行番号を配列で返します。
...@see Proc#source_location
//emlist[例][ruby]{
# ------- /tmp/foo.rb ---------
class Foo
def foo; end
end
# ----- end of /tmp/foo.rb ----
require '/tmp/foo'
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m.source_location # => ["/tmp/foo.rb", 2]
method(:puts).source_location # => nil
//}... -
Binding
# source _ location -> [String , Integer] (6107.0) -
self の Ruby のソースファイル名と行番号を返します。
...self の Ruby のソースファイル名と行番号を返します。
d:spec/variables#pseudo の __FILE__ と __LINE__ も参照してください。
//emlist[例][ruby]{
p binding.source_location # => ["test.rb", 1]
//}... -
RDoc
:: Context # record _ location(toplevel) (6101.0) -
Record the file that we happen to find it in
Record the file that we happen to find it in -
ObjectSpace
. # allocation _ sourcefile(object) -> String (6100.0) -
objectの元となったソースファイル名を返します。
...uire 'objspace'
ObjectSpace::trace_object_allocations_start
obj = Object.new
puts "file:#{ObjectSpace::allocation_sourcefile(obj)}" # => file:test.rb
ObjectSpace::trace_object_allocations_stop
//}
@see ObjectSpace.#trace_object_allocations_start,
ObjectSpace.#trace_object_allocations_stop... -
ObjectSpace
. # allocation _ sourceline(object) -> Integer (6100.0) -
objectの元となったソースファイルの行番号を返します。
...y]{
require 'objspace'
ObjectSpace::trace_object_allocations_start
obj = Object.new
puts "line:#{ObjectSpace::allocation_sourceline(obj)}" # => line:4
ObjectSpace::trace_object_allocations_stop
//}
@see ObjectSpace.#trace_object_allocations_start,
ObjectSpace.#trace_object_allocations_stop... -
ObjectSpace
. # trace _ object _ allocations { . . . } (6100.0) -
与えられたブロック内でオブジェクトのトレースを行います。
...のトレースを行います。
//emlist[例][ruby]{
require 'objspace'
class C
include ObjectSpace
def foo
trace_object_allocations do
obj = Object.new
p "#{allocation_sourcefile(obj)}:#{allocation_sourceline(obj)}"
end
end
end
C.new.foo #=> "objtrace.rb:8"
//}... -
ObjectSpace
. # trace _ object _ allocations _ start -> nil (6100.0) -
オブジェクト割り当てのトレースを開始します。
...オブジェクト割り当てのトレースを開始します。
@see ObjectSpace.#trace_object_allocations_stop... -
ObjectSpace
. # trace _ object _ allocations _ stop -> nil (6100.0) -
オブジェクト割り当てのトレースを終了します。
...オブジェクト割り当てのトレースを終了します。
トレースを終了する為には、ObjectSpace.#trace_object_allocations_startを呼んだ回数分だけこのメソッドを呼ぶ必要があります。
@see ObjectSpace.#trace_object_allocations_start... -
static void mark
_ locations _ array(register VALUE *x , register long n) (6100.0) -