466件ヒット
[201-300件を表示]
(0.035秒)
別のキーワード
種類
- インスタンスメソッド (257)
- モジュール関数 (134)
- 特異メソッド (60)
- クラス (15)
クラス
- BasicObject (22)
- Exception (40)
- Fiber (15)
- Hash (19)
- Module (4)
- Object (4)
- Random (7)
- Thread (33)
- TracePoint (150)
モジュール
- Enumerable (11)
- Kernel (134)
-
RubyVM
:: MJIT (12)
キーワード
- == (11)
- Hash (4)
- abort (22)
-
callee
_ id (11) - cause (11)
- chunk (11)
- disable (22)
- enable (22)
- eval (22)
-
eval
_ script (6) - event (11)
- fail (33)
- freeze (8)
-
handle
_ interrupt (11) - inspect (11)
-
instance
_ eval (22) -
instruction
_ sequence (6) - lineno (11)
-
method
_ id (11) - new (19)
- parameters (6)
- path (11)
- pause (6)
-
pending
_ interrupt? (11) - raise (59)
-
raised
_ exception (11) - rehash (11)
- resume (6)
-
return
_ value (11) - system (24)
- urandom (7)
検索結果
先頭5件
-
Enumerable
# chunk {|elt| . . . } -> Enumerator (14.0) -
要素を前から順にブロックで評価し、その結果によって 要素をチャンクに分けた(グループ化した)要素を持つ Enumerator を返します。
...で始まるシンボルを指定した場合は例外が発生します。
//emlist[例][ruby]{
[1, 2].chunk { |item| :_underscore }.to_a
# => RuntimeError: symbols beginning with an underscore are reserved
# 「.to_a」無しだと Enumerator を返すのみで例外は発生しない
//}
nil......A[A-Z][A-Za-z0-9_]+\#/
open(filename) {|f|
f.chunk {|line| pat =~ line ? $& : :_alone }.each {|key, lines|
if key != :_alone
print lines.sort.join('')
else
print lines.join('')
end
}
}
//}
@raise RuntimeError 予約されている値を用いた場合に発生します... -
Exception
# cause -> Exception | nil (14.0) -
self の前の例外(self が rescue 節や ensure 節の中で発生した例外の場合、 その前に発生していた元々の例外)を返します。存在しない場合は nil を返し ます。
...その前に発生していた元々の例外)を返します。存在しない場合は nil を返し
ます。
//emlist[例][ruby]{
begin
begin
raise "inner"
rescue
raise "outer"
end
rescue
p $! # => #<RuntimeError: outer>
p $!.cause # => #<RuntimeError: inner>
end
//}... -
Module
# freeze -> self (14.0) -
モジュールを凍結(内容の変更を禁止)します。
...。
凍結したモジュールにメソッドの追加など何らかの変更を加えようとした場合に
RuntimeError
が発生します。
@see Object#freeze
//emlist[例][ruby]{
module Foo; end
Foo.freeze
module Foo
def foo; end
end # => RuntimeError: can't modify frozen module
//}... -
RubyVM
:: MJIT . resume -> bool (14.0) -
RubyVM::MJIT.pause で一時停止した JIT を再開します。
...。
@return 再開したときは true を、すでに動いているときは false を返します。
@raise RuntimeError JIT が有効ではないときに発生します。
@raise RuntimeError JIT の再開に失敗した時に発生します。
@see RubyVM::MJIT.enabled?, RubyVM::MJIT.pause... -
Thread
. pending _ interrupt?(error = nil) -> bool (14.0) -
非同期割り込みのキューが空かどうかを返します。
...Thread.handle_interrupt(Object => :immediate) {
Thread.pass
}
end
=== 使い方
th = Thread.new{
Thread.handle_interrupt(RuntimeError => :on_blocking){
while true
...
# ここまでで割り込みが発生しても安全な状態になった。
if......ッド停止。
この例は以下のように記述する事もできます。
flag = true
th = Thread.new{
Thread.handle_interrupt(RuntimeError => :on_blocking){
while true
...
# ここまでで割り込みが発生しても安全な状態になった。
bre... -
TracePoint
# disable -> bool (14.0) -
self のトレースを無効にします。
...true
//}
[注意] イベントフックのためのメソッドに、ブロックの外側で参照した場合は
RuntimeError が発生する事に注意してください。
trace.enable { p trace.lineno }
# => RuntimeError: access from outside
@see TracePoint#enable, TracePoint#enabled?... -
TracePoint
# disable { . . . } -> object (14.0) -
self のトレースを無効にします。
...true
//}
[注意] イベントフックのためのメソッドに、ブロックの外側で参照した場合は
RuntimeError が発生する事に注意してください。
trace.enable { p trace.lineno }
# => RuntimeError: access from outside
@see TracePoint#enable, TracePoint#enabled?... -
TracePoint
# enable -> bool (14.0) -
self のトレースを有効にします。
...イベントフックのためのメソッドにブロックの外側で参照した場合は
RuntimeError が発生する事に注意してください。
//emlist[例][ruby]{
trace.enable { p trace.lineno }
# => RuntimeError: access from outside
//}
@see TracePoint#disable, TracePoint#enabled?... -
TracePoint
# enable { . . . } -> object (14.0) -
self のトレースを有効にします。
...イベントフックのためのメソッドにブロックの外側で参照した場合は
RuntimeError が発生する事に注意してください。
//emlist[例][ruby]{
trace.enable { p trace.lineno }
# => RuntimeError: access from outside
//}
@see TracePoint#disable, TracePoint#enabled?... -
Kernel
. # system(env , program , *args , options={}) -> bool | nil (10.0) -
引数を外部コマンドとして実行して、成功した時に真を返します。
...ます。
@raise Errno::EXXX exception: true が指定されていて、コマンドの実行が失敗したときに発生します。
@raise RuntimeError exception: true が指定されていて、コマンドの終了ステータスが 0 以外のときに発生します。
//emlist[インタプ... -
Kernel
. # system(program , *args , options={}) -> bool | nil (10.0) -
引数を外部コマンドとして実行して、成功した時に真を返します。
...ます。
@raise Errno::EXXX exception: true が指定されていて、コマンドの実行が失敗したときに発生します。
@raise RuntimeError exception: true が指定されていて、コマンドの終了ステータスが 0 以外のときに発生します。
//emlist[インタプ... -
Exception
# full _ message(highlight: true , order: :bottom) -> String (8.0) -
例外の整形された文字列を返します。
...e[1mtest (\e[4;1mRuntimeError\e[m\e[1m)\n\e[m"
$stderr = $stdout
p e.full_message # => "test.rb:2:in `<main>': test (RuntimeError)\n"
$stderr = STDERR
p e.full_message # => "\e[1mTraceback \e[m(most recent call last):\ntest.rb:2:in `<main>': \e[1mtest (\e[4;1mRuntimeError\e[m\e[1m)\n\e[m...