クラス
- Array (11)
-
Encoding
:: Converter (66) - Exception (29)
- Hash (22)
- IO (44)
- Integer (3)
- Module (11)
- Regexp (44)
-
RubyVM
:: InstructionSequence (95) - SignalException (33)
- String (11)
- Thread (49)
-
Thread
:: ConditionVariable (9) - Time (115)
モジュール
- GC (5)
オブジェクト
- ENV (11)
キーワード
-
abort
_ on _ exception (11) -
asciicompat
_ encoding (22) - at (13)
- binread (11)
- clone (11)
- compile (22)
-
compile
_ file (11) -
compile
_ option (11) - constants (11)
- disasm (11)
- disassemble (11)
- exception (11)
- gm (22)
-
handle
_ interrupt (11) -
load
_ from _ binary (9) -
load
_ from _ binary _ extra _ data (9) - local (22)
- mktime (22)
- new (133)
- of (11)
-
pending
_ interrupt? (11) -
report
_ on _ exception (8) -
report
_ on _ exception= (8) -
search
_ convpath (11) -
to
_ tty? (7) -
try
_ convert (58) - union (11)
- utc (22)
-
verify
_ compaction _ references (5) - write (22)
検索結果
先頭5件
-
Thread
. report _ on _ exception -> bool (12335.0) -
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...derr に以下のように出力します:
#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block in <main>'
1: from -e:1:in `times'
これによってスレッドのエラーを早期に捕捉でき......oin や Thread#value でそのスレッドの終了を待つことが保証できるなら、
スレッド開始時に Thread.current.report_on_exception = false でレポートを無効化しても
安全です。しかし、この場合、例外をハンドルするのが遅れたり、親......いて
終了を待つことができなかったりするかもしれません。
スレッドごとに設定する方法は Thread#report_on_exception= を参照してください。
@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを... -
Thread
. abort _ on _ exception -> bool (12323.0) -
真の時は、いずれかのスレッドが例外によって終了した時に、インタプリタ 全体を中断させます。false の場合、あるスレッドで起こった例外は、Thread#join などで検出されない限りそのスレッドだけをなにも警告を出さずに終了させます。
...ad#exceptionを参照してください。
@param newstate スレッド実行中に例外発生した場合、インタプリタ全体を終了させるかどうかを true か false で指定します。
//emlist[例][ruby]{
Thread.abort_on_exception # => false
Thread.abort_on_exception = true
Th......read.abort_on_exception # => true
//}... -
Thread
. report _ on _ exception=(newstate) (12235.0) -
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...derr に以下のように出力します:
#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block in <main>'
1: from -e:1:in `times'
これによってスレッドのエラーを早期に捕捉でき......oin や Thread#value でそのスレッドの終了を待つことが保証できるなら、
スレッド開始時に Thread.current.report_on_exception = false でレポートを無効化しても
安全です。しかし、この場合、例外をハンドルするのが遅れたり、親......いて
終了を待つことができなかったりするかもしれません。
スレッドごとに設定する方法は Thread#report_on_exception= を参照してください。
@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを... -
Encoding
:: Converter . search _ convpath(source _ encoding , destination _ encoding , options) -> Array (9583.0) -
引数で指定した文字エンコーディングの変換の経路を配列にして返します。
...nation_encoding 変換先の文字エンコーディングを
Encoding オブジェクトか文字列で指定し
ます。
@param options 変換の詳細を指定する定数やハッシュを指定します。
Encoding::Conver......:Converter.search_convpath("ISO-8859-1", "EUC-JP")
# => [[#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>],
# [#<Encoding:UTF-8>, #<Encoding:EUC-JP>]]
p Encoding::Converter.search_convpath("ISO-8859-1", "EUC-JP", universal_newline: true)
# or
p Encoding::Converter.search_convpath("ISO-8859-1", "EUC-J......# => [[#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>],
# [#<Encoding:UTF-8>, #<Encoding:EUC-JP>],
# "universal_newline"]
p Encoding::Converter.search_convpath("ISO-8859-1", "UTF-32BE", universal_newline: true)
# or
p Encoding::Converter.search_convpath("ISO-8859-1", "UTF-32BE", newline: :unive... -
Exception
. exception(error _ message = nil) -> Exception (9303.0) -
例外オブジェクトを生成して返します。
...属性 Exception#message の値になり、デフォルトの例外ハンドラで表示されます。
//emlist[例][ruby]{
e = Exception.new("some message")
p e # => #<Exception: some message>
p e.message # => "some message"
//}
//emlist[例][ruby]{
e = Exception.exception("some message......")
p e # => #<Exception: some message>
p e.message # => "some message"
//}... -
RubyVM
:: InstructionSequence . compile _ option -> Hash (9203.0) -
命令シーケンスのコンパイル時のデフォルトの最適化オプションを Hash で返 します。
...byVM::InstructionSequence.compile_option
# => {:inline_const_cache=>true,
# :peephole_optimization=>true,
# :tailcall_optimization=>false,
# :specialized_instruction=>true,
# :operands_unification=>true,
# :instructions_unification=>false,
# :stack_caching=>false,
# :trace_instruction=>true,
# :fro......zen_string_literal=>false,
# :debug_frozen_string_literal=>false,
# :coverage_enabled=>true,
# :debug_level=>0}
//}
@see RubyVM::InstructionSequence.compile_option=... -
Thread
:: ConditionVariable . new -> Thread :: ConditionVariable (6303.0) -
状態変数を生成して返します。
状態変数を生成して返します。 -
Regexp
. union(*pattern) -> Regexp (6233.0) -
引数として与えた pattern を選択 | で連結し、Regexp として返します。 結果の Regexp は与えた pattern のどれかにマッチする場合にマッチするものになります。
...union(/a/, /b/, /c/) # => /(?-mix:a)|(?-mix:b)|(?-mix:c)/
//}
引数を一つだけ与える場合は、Array を与えても Regexp を生成します。
つまり、以下のように書くことができます。
//emlist[][ruby]{
arr = [/a/, /b/, /c/]
p Regexp.union(arr) # => /(?-mix:a)|(?-mi......x:b)|(?-mix:c)/
# 1.8.7 より前は、以下のように書く必要があった
p Regexp.union(*arr) # => /(?-mix:a)|(?-mix:b)|(?-mix:c)/
//}
pattern は Regexp または String で与えます。
String で与えた場合、それ自身と等しい文字列にマッチするものと解釈され......ます。
//emlist[][ruby]{
p Regexp.union("a", "?", "b") # => /a|\?|b/
p Regexp.union(/a/, "*") # => /(?-mix:a)|\*/
//}
引数をひとつも与えなかった場合、決してマッチしない Regexp を返します。
//emlist[][ruby]{
p Regexp.union() # => /(?!)/
//}
結果の Regexp が... -
Array
. try _ convert(obj) -> Array | nil (6203.0) -
to_ary メソッドを用いて obj を配列に変換しようとします。
...引数が配列であるかどうかを調べるために使えます。
//emlist[例][ruby]{
Array.try_convert([1]) # => [1]
Array.try_convert("1") # => nil
if tmp = Array.try_convert(arg)
# the argument is an array
elsif tmp = String.try_convert(arg)
# the argument is a string
end
//}... -
ENV
. clone(freeze: true) -> object (6203.0) -
ENV オブジェクトの複製を作成して返します。
...3.1 からは複製で環境変数を操作するときに deprecated 警告がでます。
テスト実行中に環境変数を退避する用途には ENV.to_h を使用してください。
//emlist[][ruby]{
saved_env = ENV.to_h
# (テストなど)
ENV.replace(saved_env)
//}
@see Object#clone......複製で環境変数を操作するときに deprecated 警告がでます。
テスト実行中に環境変数を退避する用途には ENV.to_h を使用してください。
//emlist[][ruby]{
saved_env = ENV.to_h
# (テストなど)
ENV.replace(saved_env)
//}
@see Object#clone
@see ENV.dup...