344件ヒット
[1-100件を表示]
(0.036秒)
クラス
- Coverage (8)
-
Net
:: POP3 (24) -
Net
:: POPMail (108) - Object (12)
モジュール
- Kernel (60)
- ObjectSpace (48)
- Psych (15)
キーワード
- ACL (12)
-
NEWS for Ruby 2
. 1 . 0 (12) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 3
. 0 . 0 (5) -
allocation
_ sourcefile (12) -
allocation
_ sourceline (12) - caller (36)
-
caller
_ locations (24) - coverage (8)
-
delete
_ all (24) - load (15)
- mail (36)
-
net
/ pop (12) - pop (36)
-
respond
_ to? (12) -
ruby 1
. 8 . 4 feature (12) -
trace
_ object _ allocations _ start (12) -
trace
_ object _ allocations _ stop (12)
検索結果
先頭5件
-
Coverage
. start(option = {}) -> nil (18131.0) -
カバレッジの測定を開始します。既に実行されていた場合には何も起こりません。 ただし、カバレッジ計測中に測定対象を変更しようとした場合は、RuntimeError となります。
...ようとした場合は、RuntimeError となります。
@param option カバレッジの計測モードを指定します。
:all か "all" を指定すると、全ての種類を計測します。
個別に指定する場合は、ハッシュを渡します。......erage.start(:all)
load "bool.rb"
bool(0)
pp Coverage.result
# {"bool.rb"=>
# {:lines=>[1, 1, 1, nil, 0, nil, nil],
# :branches=>
# {[:if, 0, 2, 2, 6, 5]=>
# {[:then, 1, 3, 4, 3, 8]=>1, [:else, 2, 5, 4, 5, 9]=>0}},
# :methods=>{[Object, :bool, 1, 0, 7, 3]=>1}}}
Coverage.start(metho... -
Net
:: POPMail # all -> String (18127.0) -
メールを受信します。
...。
この場合引数として渡したオブジェクトを返します。
pop, all, mail はすべて同じ効果ですが、
all と mail は obsolete です。
使用例:
require 'net/pop'
Net::POP3.start('pop.example.com', 110,
'YourAccount', 'YourPassword') {|pop|......pop.mails.each do |m|
puts m.pop
end
}
ブロックを利用する例:
require 'net/pop'
Net::POP3.start('pop.example.com', 110) {|pop|
pop.each_mail do |m|
m.pop do |str|
print str
end
end
}
@param io メールの内容を書きこむオブジェ... -
Net
:: POPMail # all {|str| . . . . } -> nil (18127.0) -
メールを受信します。
...。
この場合引数として渡したオブジェクトを返します。
pop, all, mail はすべて同じ効果ですが、
all と mail は obsolete です。
使用例:
require 'net/pop'
Net::POP3.start('pop.example.com', 110,
'YourAccount', 'YourPassword') {|pop|......pop.mails.each do |m|
puts m.pop
end
}
ブロックを利用する例:
require 'net/pop'
Net::POP3.start('pop.example.com', 110) {|pop|
pop.each_mail do |m|
m.pop do |str|
print str
end
end
}
@param io メールの内容を書きこむオブジェ... -
Net
:: POPMail # all(io) -> object (18127.0) -
メールを受信します。
...。
この場合引数として渡したオブジェクトを返します。
pop, all, mail はすべて同じ効果ですが、
all と mail は obsolete です。
使用例:
require 'net/pop'
Net::POP3.start('pop.example.com', 110,
'YourAccount', 'YourPassword') {|pop|......pop.mails.each do |m|
puts m.pop
end
}
ブロックを利用する例:
require 'net/pop'
Net::POP3.start('pop.example.com', 110) {|pop|
pop.each_mail do |m|
m.pop do |str|
print str
end
end
}
@param io メールの内容を書きこむオブジェ... -
ObjectSpace
. # trace _ object _ allocations _ start -> nil (12201.0) -
オブジェクト割り当てのトレースを開始します。
...オブジェクト割り当てのトレースを開始します。
@see ObjectSpace.#trace_object_allocations_stop... -
Kernel
. # caller _ locations(start = 1 , length = nil) -> [Thread :: Backtrace :: Location] | nil (6243.0) -
現在のフレームを 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)
test2(start, length)
end
caller_locations # => []
test3(1, nil)
# => ["/Users/user/test.rb:9:in `tes......(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(start = 1) -> [String] | nil (6224.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...
start 段上の呼び出し元の情報を $@
の形式のバックトレース(文字列の配列)として返します。
トップレベルでは空の配列を返します。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。
引数で指定した......値が範囲外の場合は nil を返します。
@param start long の範囲を超えない正の整数でスタックレベルを指定します。
@param length 取得するスタックの個数を指定します。
@param range 取得したいスタックの範囲を示す Range オブジェ......クトを指定します。
@see Kernel.#set_trace_func,Kernel.#raise,
Kernel.#caller_locations
//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end
def bar
foo
end
bar
#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:... -
Kernel
. # caller(start , length) -> [String] | nil (6224.0) -
start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。
...
start 段上の呼び出し元の情報を $@
の形式のバックトレース(文字列の配列)として返します。
トップレベルでは空の配列を返します。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。
引数で指定した......値が範囲外の場合は nil を返します。
@param start long の範囲を超えない正の整数でスタックレベルを指定します。
@param length 取得するスタックの個数を指定します。
@param range 取得したいスタックの範囲を示す Range オブジェ......クトを指定します。
@see Kernel.#set_trace_func,Kernel.#raise,
Kernel.#caller_locations
//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end
def bar
foo
end
bar
#=> ["-:2:in `foo'", "-:10:in `bar'", "-:13:in `<main>'"]
# ["-:10:... -
Kernel
. # caller _ locations(range) -> [Thread :: Backtrace :: Location] | nil (6143.0) -
現在のフレームを 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)
test2(start, length)
end
caller_locations # => []
test3(1, nil)
# => ["/Users/user/test.rb:9:in `tes......(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...