662件ヒット
[201-300件を表示]
(0.160秒)
ライブラリ
- English (11)
- ビルトイン (268)
-
minitest
/ unit (1) - optparse (22)
- rake (11)
-
rubygems
/ config _ file (22) -
webrick
/ httpresponse (11)
クラス
- Exception (44)
- Fiber (15)
-
Gem
:: ConfigFile (22) -
OptionParser
:: ParseError (22) -
Rake
:: Application (11) - Thread (33)
-
Thread
:: Backtrace :: Location (77) -
WEBrick
:: HTTPResponse (11)
キーワード
-
$ @ (11) -
$ ERROR _ INFO (11) - == (11)
-
DEFAULT
_ BACKTRACE (11) -
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - Rubyの起動 (3)
- Ruby用語集 (11)
-
absolute
_ path (11) -
backtrace
_ locations (33) -
base
_ label (11) -
caller
_ locations (22) - fail (33)
-
filter
_ backtrace (12) - inspect (11)
- label (11)
- lineno (11)
- path (11)
- raise (48)
- rubygems (11)
-
rubygems
/ commands / build _ command (11) -
rubygems
/ commands / cert _ command (11) -
rubygems
/ commands / check _ command (11) -
rubygems
/ commands / cleanup _ command (11) -
rubygems
/ commands / contents _ command (11) -
rubygems
/ commands / dependency _ command (11) -
rubygems
/ commands / environment _ command (11) -
rubygems
/ commands / fetch _ command (11) -
rubygems
/ commands / generate _ index _ command (11) -
rubygems
/ commands / help _ command (11) -
rubygems
/ commands / install _ command (11) -
rubygems
/ commands / list _ command (11) -
rubygems
/ commands / lock _ command (11) -
rubygems
/ commands / mirror _ command (11) -
rubygems
/ commands / outdated _ command (11) -
rubygems
/ commands / pristine _ command (11) -
rubygems
/ commands / query _ command (11) -
rubygems
/ commands / rdoc _ command (11) -
rubygems
/ commands / search _ command (11) -
rubygems
/ commands / server _ command (11) -
rubygems
/ commands / sources _ command (11) -
rubygems
/ commands / specification _ command (11) -
rubygems
/ commands / uninstall _ command (11) -
rubygems
/ commands / unpack _ command (11) -
set
_ backtrace (22) -
set
_ error (11) -
to
_ s (11)
検索結果
先頭5件
-
Kernel
. # raise(message , cause: $ !) -> () (6214.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...は rescue 節で捕捉できます。
引数無しの場合は、同スレッドの同じブロック内で最後に rescue された
例外オブジェクト ($!) を再発生させます。そのような
例外が存在しないが自身は捕捉されている時には例外 RuntimeError を......list[例][ruby]{
begin
open("nonexist")
rescue
raise #=> `open': No such file or directory - "nonexist" (Errno::ENOENT)
end
//}
引数を渡した場合は、例外メッセージ message を持った error_type の示す例外(省略時 RuntimeError)を
発生させます。
error_type と......きます。
@param error_type 発生させる例外を例外クラスまたは例外クラスのインスタンスで指定します。
@param message 例外のメッセージとなる文字列です。
@param backtrace 例外発生時のスタックトレースで、Kernel.#caller の戻り値と... -
Thread
:: Backtrace :: Location # label -> String (6212.0) -
self が表すフレームのラベルを返します。通常、メソッド名、クラス名、モ ジュール名などで構成されます。
...フレームのラベルを返します。通常、メソッド名、クラス名、モ
ジュール名などで構成されます。
例: Thread::Backtrace::Location の例1を用いた例
//emlist[][ruby]{
loc = c(0..1).first
loc.label # => "a"
//}
@see Thread::Backtrace::Location#base_label... -
Thread
:: Backtrace :: Location # path -> String (6212.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... -
Fiber
# raise -> object (6207.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
Fiber.yield が呼ばれていないかファイバーがすでに終了している場合、
FiberError が発生します。
引数を渡さない場合、RuntimeError が発生します。
message 引......数を渡した場合、message 引数をメッセージとした RuntimeError
が発生します。
その他のケースでは、最初の引数は Exception か Exception
のインスタンスを返す exception メソッドを持ったオブジェクトである
必要があります。
この......@param message 例外のメッセージとなる文字列です。
@param exception 発生させる例外です。
@param backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。
//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.raise "Error!"... -
Fiber
# raise(message) -> object (6207.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
Fiber.yield が呼ばれていないかファイバーがすでに終了している場合、
FiberError が発生します。
引数を渡さない場合、RuntimeError が発生します。
message 引......数を渡した場合、message 引数をメッセージとした RuntimeError
が発生します。
その他のケースでは、最初の引数は Exception か Exception
のインスタンスを返す exception メソッドを持ったオブジェクトである
必要があります。
この......@param message 例外のメッセージとなる文字列です。
@param exception 発生させる例外です。
@param backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。
//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.raise "Error!"... -
Kernel
$ $ ERROR _ INFO -> Exception | nil (6206.0) -
$! の別名
...$! の別名
require "English"
class SomethingError < StandardError; end
begin
raise SomethingError
rescue
p $ERROR_INFO.backtrace #=> ["sample.rb:5"]
p $ERROR_INFO.to_s #=> "SomethingError"
end... -
Thread
:: Backtrace :: Location # absolute _ path -> String (6206.0) -
self が表すフレームの絶対パスを返します。
...list[例][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... -
Thread
:: Backtrace :: Location # lineno -> Integer (6206.0) -
self が表すフレームの行番号を返します。
...self が表すフレームの行番号を返します。
例: Thread::Backtrace::Location の例1を用いた例
//emlist[][ruby]{
loc = c(0..1).first
loc.lineno # => 2
//}... -
rubygems
/ commands / install _ command (6204.0) -
Gem パッケージをローカルリポジトリにインストールするためのライブラリです。
...Usage: gem install GEMNAME [GEMNAME ...] [options] -- --build-flags [options]
Options:
--platform PLATFORM 指定されたプラットフォームの Gem パッケージをインストールします
-v, --version VERSION 指定されたバージョンの Ge......ons:
-i, --install-dir DIR Gem パッケージのインストー先を指定します
-n, --bindir DIR Gem パッケージに含まれるバイナリファイルの配置先を指定します
-d, --[no-]rdoc インストール時に RDoc......ヘルプを表示します
-V, --[no-]verbose 表示を詳細にします
-q, --quiet 静かに実行します
--config-file FILE 指定された設定ファイルを使用します
--backtrace バック... -
Thread
:: Backtrace :: Location # to _ s -> String (6200.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
...を Kernel.#caller と同じ表現にした文字列を返し
ます。
//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.to_s
end
# => path/to/foo.rb:5:in `......initialize'
# path/to/foo.rb:9:in `new'
# path/to/foo.rb:9:in `<main>'
//}... -
Ruby用語集 (6184.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...Ruby用語集
A B C D E F G I J M N O R S Y
a ka sa ta na ha ma ya ra wa
=== 記号・数字
: %記法
: % notation
「%」記号で始まる多種多様なリテラル記法の総称。
参照:d:spec/literal#percent
: 0 オリジン
: zero-ba......sed
番号が 0 から始まること。
例えば、
Array や Vector、Matrix などの要素の番号、
String における文字の位置、
といったものは 0 オリジンである。
: 1 オリジン
: one-based
番号が 1 から始まること。
例えば、
エラ......Kernel.#caller_locations、Kernel.#caller で現時点までの
スタックトレースを得ることができる。
また、例外オブジェクトは例外が発生した時点までのスタックトレースを保持しており、
Exception#backtrace や Exception#backtrace_locat...