種類
- インスタンスメソッド (56)
- 文書 (50)
- 特異メソッド (33)
- モジュール関数 (32)
ライブラリ
- ビルトイン (83)
- logger (11)
-
minitest
/ unit (16) -
syslog
/ logger (11)
クラス
- Exception (7)
- Logger (11)
-
Syslog
:: Logger :: Formatter (11) - SystemCallError (44)
モジュール
- Kernel (32)
-
MiniTest
:: Assertions (16)
キーワード
-
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (4) - abort (10)
- assert (1)
-
assert
_ block (1) -
assert
_ empty (1) -
assert
_ equal (1) -
assert
_ in _ delta (1) -
assert
_ in _ epsilon (1) -
assert
_ includes (1) -
assert
_ instance _ of (1) -
assert
_ kind _ of (1) -
assert
_ match (1) -
assert
_ nil (1) -
assert
_ operator (1) -
assert
_ respond _ to (1) -
assert
_ same (1) -
assert
_ send (1) -
assert
_ throws (1) - errno (11)
- fail (11)
- formatter (11)
- new (33)
- raise (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 4 feature (11) - 制御構造 (11)
検索結果
先頭5件
-
Syslog
:: Logger :: Formatter # call(severity , time , progname , message) -> String (18302.0) -
引数を元にフォーマットした文字列を返します。
引数を元にフォーマットした文字列を返します。
ライブラリ内部で使用します。 -
Exception
# full _ message(highlight: true , order: :bottom) -> String (6231.0) -
例外の整形された文字列を返します。
...ue => e
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"
$stderr = $stdout
p e.full_message # => "test.rb:2:in `<main>': test (RuntimeError)\n"
$stderr = STDERR
p e.full_message # => "\e[1mTrace......back \e[m(most recent call last):\ntest.rb:2:in `<main>': \e[1mtest (\e[4;1mRuntimeError\e[m\e[1m)\n\e[m"
end
//}
@see Exception.to_tty?... -
ruby 1
. 6 feature (5322.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...グ修正がメイン
になります。
((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。
== 1.6.8 (2002-12-24) -> stable-snapshot
: 2003-01-22: errno
EAGAIN と EWOULDBLOCK が同じ値の......=> -:9: warning: p (...) interpreted as method call
ruby 1.6.5 (2001-09-19) [i586-linux]
Bar
[1, 2, 3]
Bar
Array
Array
Array
=> -:9: warning: p (...) interpreted as method call
ruby 1.6.5 (2001-10-05)......by-dev:13752>))
: attr_*
アクセサに余計な引数を渡してもエラーになりませんでした。
((<ruby-dev:13748>))
class C
def initialize
@message = 'ok'
end
attr_reader :message
end
puts C.new.message(1,2,3)
=> ruby 1.6.4 (2001-06-04... -
SystemCallError
. new(error _ message) -> SystemCallError (3330.0) -
SystemCallError オブジェクトを生成して返します。
...SystemCallError オブジェクトを生成して返します。
@param error_message エラーメッセージを表す文字列
例:
p SystemCallError.new("message")
# => #<SystemCallError: unknown error - message>... -
SystemCallError
. new(error _ message , errno) -> SystemCallError (3330.0) -
整数 errno に対応する Errno::EXXX オブジェクトを生成して返します。
...は SystemCallError の直接のインスタンスではなく、サブクラスのインスタンスです。
それらのサブクラスは Errno モジュール内に定義されています。
対応するサブクラスが存在しないコードを与えた場合には、 SystemCallError の......ror_message エラーメッセージを表す文字列
@param errno システム依存のエラーコード
@raise TypeError errno を整数に変換できないときに発生します。
例:
p SystemCallError.new("message", 2)
# => #<Errno::ENOENT: No such file or directory - message>......p SystemCallError.new(2)
# => #<Errno::ENOENT: No such file or directory>
p SystemCallError.new(256)
# => #<SystemCallError: Unknown error 256>... -
SystemCallError
. new(errno) -> SystemCallError (3230.0) -
整数 errno に対応する Errno::EXXX オブジェクトを生成して返します。
...は SystemCallError の直接のインスタンスではなく、サブクラスのインスタンスです。
それらのサブクラスは Errno モジュール内に定義されています。
対応するサブクラスが存在しないコードを与えた場合には、 SystemCallError の......ror_message エラーメッセージを表す文字列
@param errno システム依存のエラーコード
@raise TypeError errno を整数に変換できないときに発生します。
例:
p SystemCallError.new("message", 2)
# => #<Errno::ENOENT: No such file or directory - message>......p SystemCallError.new(2)
# => #<Errno::ENOENT: No such file or directory>
p SystemCallError.new(256)
# => #<SystemCallError: Unknown error 256>... -
SystemCallError
# errno -> Integer | nil (3106.0) -
レシーバに対応するシステム依存のエラーコードを返します。
...Errno::ENOENT => err
p err.errno # => 2
p Errno::ENOENT::Errno # => 2
end
begin
raise SystemCallError, 'message'
rescue SystemCallError => err
p err.errno # => nil
end
なお、例外を発生させずにエラーコードを得るに... -
ruby 1
. 8 . 4 feature (1506.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど
* 互換性のある変更
* only backward-compatibility
* 影響の範囲が小さいと思われる変更もこちら
* [change]: 変更されたクラス/メソッドなど(互換......)
* ((<ruby 1.8.4 feature/mkmf: find_executable() [compat]>))
* ((<ruby 1.8.4 feature/拡張ライブラリAPI>))
* ((<ruby 1.8.4 feature/rb_funcall2() [bug]>))
* ((<ruby 1.8.4 feature/rb_respond_to() [change]>))
* ((<ruby 1.8.4 feature/rb_obj_respond_to() [new]>))
* ((<ruby 1.8.4 feature/......を指定できる。((<ruby-dev:27408>))
== プラットフォーム固有
: bccwin32 [bug]
#Mon Nov 28 13:08:54 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
#
# * win32/win32.c (rb_w32_strerror): remove all CR and LF. (avoid broken
# error message on bccwin32 + winsock)
b... -
NEWS for Ruby 3
. 0 . 0 (360.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ocs
accepting a single rest argument and no keywords.
16166
//emlist[][ruby]{
pr = proc{|*a, **kw| [a, kw]}
pr.call([1])
# 2.7 => [[1], {}]
# 3.0 => [[[1]], {}]
pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}
* Arguments forwarding (`...`)......mlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}
* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern matching is redesigned. [EXPERIMENTAL]
* `=>` is added. It can be used like a rightward assignment.
17260
* `in......=== `--help` option
When the environment variable `RUBY_PAGER` or `PAGER` is present and has
a non-empty value, and the standard input and output are tty, the `--help`
option shows the help message via the pager designated by the value.
16754
=== `--backtrace-limit` option
The `--backtrace-limit... -
Kernel
. # fail(error _ type , message = nil , backtrace = caller(0) , cause: $ !) -> () (328.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...//emlist[例][ruby]{
begin
open("nonexist")
rescue
raise #=> `open': No such file or directory - "nonexist" (Errno::ENOENT)
end
//}
引数を渡した場合は、例外メッセージ message を持った error_type の示す例外(省略時 RuntimeError)を
発生させます。
error_type......その際、exception メソッドに引数として変数 message を渡すことができます。
@param error_type 発生させる例外を例外クラスまたは例外クラスのインスタンスで指定します。
@param message 例外のメッセージとなる文字列です。
@param......backtrace 例外発生時のスタックトレースで、Kernel.#caller の戻り値と同じ
形式で指定しなければいけません。
@param cause 現在の例外($!)の代わりに Exception#cause に設定する例外を指定します。
@raise TypeError exception メソッドが例......backtrace 例外発生時のスタックトレースで、Kernel.#caller の戻り値と同じ
形式で指定しなければいけません。
@param cause 現在の例外($!)の代わりに Exception#cause に設定する例外を指定します。
Exception オブジェクトまたは nil... -
Kernel
. # raise(error _ type , message = nil , backtrace = caller(0) , cause: $ !) -> () (328.0) -
例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。
...//emlist[例][ruby]{
begin
open("nonexist")
rescue
raise #=> `open': No such file or directory - "nonexist" (Errno::ENOENT)
end
//}
引数を渡した場合は、例外メッセージ message を持った error_type の示す例外(省略時 RuntimeError)を
発生させます。
error_type......その際、exception メソッドに引数として変数 message を渡すことができます。
@param error_type 発生させる例外を例外クラスまたは例外クラスのインスタンスで指定します。
@param message 例外のメッセージとなる文字列です。
@param......backtrace 例外発生時のスタックトレースで、Kernel.#caller の戻り値と同じ
形式で指定しなければいけません。
@param cause 現在の例外($!)の代わりに Exception#cause に設定する例外を指定します。
Exception オブジェクトまたは nil...