種類
- インスタンスメソッド (10)
- 文書 (6)
- ライブラリ (3)
- 変数 (1)
- 特異メソッド (1)
クラス
- Exception (2)
-
OptionParser
:: ParseError (2) - Thread (1)
-
Thread
:: Backtrace :: Location (6)
モジュール
- Kernel (1)
キーワード
-
$ @ (1) -
NEWS for Ruby 2
. 0 . 0 (1) -
NEWS for Ruby 2
. 3 . 0 (1) -
NEWS for Ruby 3
. 0 . 0 (1) -
NEWS for Ruby 3
. 1 . 0 (1) - Rubyの起動 (1)
- Ruby用語集 (1)
-
absolute
_ path (1) -
base
_ label (1) -
filter
_ backtrace (1) - inspect (1)
- label (1)
- path (1)
-
rubygems
/ commands / cert _ command (1) -
rubygems
/ commands / list _ command (1) -
rubygems
/ commands / search _ command (1) -
set
_ backtrace (2) -
to
_ s (1)
検索結果
先頭5件
-
Exception
# backtrace -> [String] (54661.0) -
バックトレース情報を返します。
バックトレース情報を返します。
デフォルトでは
* "#{sourcefile}:#{sourceline}:in `#{method}'"
(メソッド内の場合)
* "#{sourcefile}:#{sourceline}"
(トップレベルの場合)
という形式の String の配列です。
//emlist[例][ruby]{
def methd
raise
end
begin
methd
rescue => e
p e.backtrace
end
#=> ["filename.rb:2:in `methd'", "filename.rb:6... -
Thread
# backtrace -> [String] | nil (54643.0) -
スレッドの現在のバックトレースを返します。
スレッドの現在のバックトレースを返します。
スレッドがすでに終了している場合は nil を返します。
//emlist[例][ruby]{
class C1
def m1
sleep 5
end
def m2
m1
end
end
th = Thread.new {C1.new.m2; Thread.stop}
th.backtrace
# => [
# [0] "(irb):3:in `sleep'",
# [1] "(irb):3:in `m1'",
# [2] "(irb):6:in `m2'",
# [3] ... -
Exception
# set _ backtrace(errinfo) -> nil | String | [String] (19000.0) -
バックトレース情報に errinfo を設定し、設定されたバックトレース 情報を返します。
バックトレース情報に errinfo を設定し、設定されたバックトレース
情報を返します。
@param errinfo nil、String あるいは String の配列のいずれかを指定します。
//emlist[例][ruby]{
begin
begin
raise "inner"
rescue
raise "outer"
end
rescue
$!.backtrace # => ["/path/to/test.rb:5:in `rescue in <main>'", "/path/to/test.rb:2:in `<main>'"]
$!.se... -
OptionParser
:: ParseError # set _ backtrace(array) -> [String] (18607.0) -
自身に array で指定したバックトレースを設定します。
自身に array で指定したバックトレースを設定します。
@param array バックトレースを文字列の配列で指定します。
@return array を返します。 -
OptionParser
:: ParseError . filter _ backtrace(array) -> [String] (18607.0) -
array で指定されたバックトレースから optparse ライブラリに関する行を除 外します。
array で指定されたバックトレースから optparse ライブラリに関する行を除
外します。
デバッグモード($DEBUGが真)の場合は何もしません。
@param array バックトレースを文字列の配列で指定します。
@return array を返します。 -
Thread
:: Backtrace :: Location # base _ label -> String (9370.0) -
self が表すフレームの基本ラベルを返します。通常、 Thread::Backtrace::Location#label から修飾を取り除いたもので構成 されます。
self が表すフレームの基本ラベルを返します。通常、
Thread::Backtrace::Location#label から修飾を取り除いたもので構成
されます。
//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.base_label
end
# => init... -
Thread
:: Backtrace :: Location # inspect -> String (9352.0) -
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文
字列に変換したオブジェクトを返します。
//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.inspect
end
# => "path/to/foo.rb:5:in ... -
Thread
:: Backtrace :: Location # label -> String (9340.0) -
self が表すフレームのラベルを返します。通常、メソッド名、クラス名、モ ジュール名などで構成されます。
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 (9340.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 -
Thread
:: Backtrace :: Location # absolute _ path -> String (9322.0) -
self が表すフレームの絶対パスを返します。
self が表すフレームの絶対パスを返します。
//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.absolute_path
end
# => /path/to/foo.rb
# /path/to/foo.rb
# /path/to/foo.rb
//}
@see... -
Thread
:: Backtrace :: Location # to _ s -> String (9304.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
self が表すフレームを 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... -
NEWS for Ruby 3
. 0 . 0 (901.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...r
* Update to Bundler 2.2.3
* CGI
* Update to 0.2.0
* This version is Ractor compatible.
* CSV
* Update to CSV 3.1.9
* Date
* Update to Date 3.1.1
* This version is Ractor compatible.
* Digest
* Update to Digest 3.0.0
* This version is Ractor compatible.
* E... -
Kernel
$ $ @ -> [String] | nil (340.0) -
最後に例外が発生した時のバックトレースを表す配列です。 Kernel.#raise によって設定されます。
最後に例外が発生した時のバックトレースを表す配列です。
Kernel.#raise によって設定されます。
配列の各要素はメソッドの呼び出し位置を示す文字列で形式は
"filename:line"
または
"filename:line:in `methodname'"
です。これは Kernel.#caller が返す値と同じ形式です。
$@ へ値を代入するときは、$! が nil であってはいけません。
$@ の値は、$!.backtrace の値と同じです。
また、$@ への代入は $!.set_backtrace 呼び出しと同じです。
文字列の配列でも nil で... -
NEWS for Ruby 2
. 0 . 0 (289.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
NEWS for Ruby 2.0.0
このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 1.9.3 以降の変更
=== 言語仕様の変更
* キーワード引数を追加しました
* %i, %I をシンボルの配列作成のために追加しました。(%w, %W に似ています)
* デフォルトのソースエンコーディングを US-ASCI... -
Ruby用語集 (289.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...メソッドの
いくつかは未定義にされている。
: リテラル
: literal
プログラム中に直接記述された値のこと。3.14 や "foo" や /\d+/ はリテラル
だが、1 + 2 はリテラルではない。
Math::PI も定数参照なのでリテラルではない。... -
NEWS for Ruby 2
. 3 . 0 (217.0) -
NEWS for Ruby 2.3.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
NEWS for Ruby 2.3.0
このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 2.2.0 以降の変更
=== 言語仕様の変更
* frozen-string-literal プラグマ:
* 実験的な機能として fronzen-string-literal というプラグマが導入されました。
897... -
NEWS for Ruby 3
. 1 . 0 (163.0) -
NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...NEWS for Ruby 3.1.0
このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス......{
foo[0] = bar
//}
* 次の評価順序になります。
//emlist{
1. `foo`
2. `bar`
3. `[]=` called on the result of `foo`
//}
* Ruby 3.1.0より前は、多重代入の評価順序が上記のようではありませんでした。このコードでは、
//emlist[][ruby]{
foo[0], b......//emlist{
1. `a`
2. `b`
3. `foo`
4. `[]=` called on the result of `foo`
5. `bar`
6. `baz=` called on the result of `bar`
//}
* Ruby 3.1.0から単一代入と評価順序が一致するようになり、左が右より先に評価されます。
//emlist{
1. `foo`
2. `bar`
3.... -
Rubyの起動 (73.0)
-
Rubyの起動 * cmd_option * shebang
Rubyの起動
* cmd_option
* shebang
Rubyインタプリタの起動は以下の書式のコマンドラインにより行います。
ruby [ option ...] [ -- ] [ programfile ] [ argument ...]
ここで、option は後述のcmd_option
のいずれかを指定します。-- は、オプション列の終りを明示するため
に使用できます。programfile は、Ruby スクリプトを記述したファイ
ルです。これを省略したり`-' を指定した場合には標準入力を Ruby ス
クリプトとみなします。
programfile が... -
rubygems
/ commands / search _ command (73.0) -
指定された文字列を含む Gem パッケージを全て表示するためのライブラリです。
指定された文字列を含む Gem パッケージを全て表示するためのライブラリです。
Usage: gem search [STRING] [options]
Options:
-i, --[no-]installed Check for installed gem
-v, --version VERSION Specify version of gem to search
-d, --[no-]details Display detailed information of g... -
rubygems
/ commands / cert _ command (55.0) -
Gem パッケージの証明書や署名の設定を管理するためのライブラリです。
Gem パッケージの証明書や署名の設定を管理するためのライブラリです。
Usage: gem cert [options]
Options:
-a, --add CERT 信頼された証明書を追加します
-l, --list 信頼されている証明書の一覧を表示します
-r, --remove STRING STRING を含む証明書を削除します
-b, --build EMAIL_ADDR EMAIL_ADDR ... -
rubygems
/ commands / list _ command (55.0) -
Gem パッケージの名前を前方一致で検索するためのライブラリです。
Gem パッケージの名前を前方一致で検索するためのライブラリです。
Usage: gem list [STRING] [options]
Options:
-i, --[no-]installed Check for installed gem
-v, --version VERSION 指定されたバージョンの一覧を出力します
-d, --[no-]details Gem パッケージの詳細も表示します
--[no-]versions ...