別のキーワード
ライブラリ
- ビルトイン (1493)
-
bigdecimal
/ util (12) - date (12)
- e2mmap (24)
- getoptlong (12)
-
io
/ console (36) - logger (1)
- matrix (96)
-
minitest
/ unit (19) - monitor (24)
-
net
/ ftp (48) -
net
/ pop (108) - open-uri (24)
- openssl (348)
- optparse (408)
- prime (24)
- pstore (12)
- rake (24)
- rubygems (12)
-
rubygems
/ indexer (12) -
rubygems
/ installer (12) -
rubygems
/ package / tar _ reader (12) -
rubygems
/ package / tar _ writer (24) -
rubygems
/ remote _ fetcher (12) -
rubygems
/ specification (12) -
rubygems
/ user _ interaction (12) - set (18)
- socket (84)
- stringio (558)
-
webrick
/ httpservlet / filehandler (12) - win32ole (60)
- zlib (192)
クラス
-
ARGF
. class (24) - Array (102)
- BasicSocket (12)
- Complex (36)
- Date (12)
- Dir (11)
- Enumerator (24)
- Exception (104)
- Fiber (6)
- File (72)
-
Gem
:: Indexer (12) -
Gem
:: Installer (12) -
Gem
:: Package :: TarReader (12) -
Gem
:: Package :: TarWriter (12) -
Gem
:: Package :: TarWriter :: BoundedStream (12) -
Gem
:: RemoteFetcher (12) -
Gem
:: Specification (12) -
Gem
:: StreamUI (12) - GetoptLong (12)
- IO (1010)
- Integer (12)
-
Logger
:: Application (1) - Matrix (96)
-
MonitorMixin
:: ConditionVariable (24) -
Net
:: FTP (48) -
Net
:: POPMail (108) -
OpenSSL
:: Config (12) -
OpenSSL
:: OCSP :: BasicResponse (12) -
OpenSSL
:: PKey :: EC :: Group (12) -
OpenSSL
:: SSL :: SSLContext (12) -
OpenSSL
:: SSL :: SSLSocket (60) -
OpenSSL
:: SSL :: Session (36) -
OpenSSL
:: X509 :: CRL (36) -
OpenSSL
:: X509 :: Certificate (36) -
OpenSSL
:: X509 :: Extension (36) -
OpenSSL
:: X509 :: Revoked (24) - OptionParser (348)
- PStore (12)
- Prime (12)
-
Rake
:: InvocationChain (12) - Rational (97)
- Set (24)
- Socket (24)
-
Socket
:: AncillaryData (12) -
Socket
:: Option (36) - StringIO (558)
- Thread (18)
- TracePoint (19)
-
WEBrick
:: HTTPServlet :: FileHandler (12) -
WIN32OLE
_ TYPE (24) -
WIN32OLE
_ TYPELIB (36) -
Zlib
:: GzipReader (192)
モジュール
- Enumerable (12)
- Exception2MessageMapper (24)
- Kernel (12)
-
MiniTest
:: Assertions (19) -
OpenSSL
:: Buffering (60) -
OpenSSL
:: SSL :: SocketForwarder (12) -
OpenURI
:: OpenRead (24) -
OptionParser
:: Arguable (60) -
Rake
:: TaskManager (12)
キーワード
- ** (1)
- - (12)
-
/ (12) - << (12)
- == (12)
- Fail (6)
- Raise (6)
- accept (12)
-
accept
_ nonblock (12) -
add
_ extension (36) -
add
_ value (12) - advise (12)
- all (36)
- append (12)
- 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
_ raises (1) -
assert
_ respond _ to (1) -
assert
_ same (1) -
assert
_ send (1) -
assert
_ throws (1) - atime (12)
- backtrace (12)
-
backtrace
_ locations (12) - binmode (12)
- bool (12)
- bytes (28)
- cause (12)
- ceil (12)
- chars (28)
-
check
_ closed (12) - chunk (12)
- clone (12)
- close (24)
-
close
_ read (24) -
close
_ write (24) - cofactor (12)
-
cofactor
_ expansion (12) - combination (24)
-
connect
_ nonblock (24) - cooked (12)
- ctime (12)
-
do
_ OPTIONS (12) - dup (12)
- each (120)
-
each
_ byte (72) -
each
_ char (48) -
each
_ line (120) - eigen (12)
- eigensystem (12)
- environment (12)
- eof (24)
- eof? (24)
- exception (24)
- extensions= (36)
- fail (6)
- fcntl (24)
- fdatasync (12)
- fileno (23)
- flock (12)
- floor (12)
- flunk (1)
- flush (12)
- fsync (12)
- gem (12)
- getbyte (12)
- getc (36)
- getopts (36)
- gets (60)
- inspect (12)
- install (12)
-
instruction
_ sequence (7) - int (12)
- intersection (18)
- ioctl (12)
- isatty (12)
-
laplace
_ expansion (12) - lineno (24)
- lineno= (24)
- lines (56)
- linger (12)
- lstat (12)
- mail (36)
-
major
_ version (24) -
minor
_ version (24) - mtime (12)
- next (12)
-
next
_ values (12) - noecho (12)
- oid= (12)
- on (144)
- open (24)
-
open
_ uri _ or _ path (12) - order (48)
- order! (48)
- paranoid (12)
- parse (24)
- parse! (24)
- permutation (24)
- permutation? (12)
- permute (24)
- permute! (24)
- pid (12)
-
point
_ conversion _ form (12) - pop (36)
- pos (12)
- pos= (24)
-
post
_ connection _ check (12) - pread (8)
-
prime
_ division (24) - print (36)
- printf (24)
- putc (24)
- puts (24)
- pwrite (8)
- quo (12)
-
raised
_ exception (12) - rationalize (24)
- raw (12)
- read (60)
-
read
_ nonblock (36) - readbyte (24)
- readchar (48)
- readline (72)
- readlines (60)
- readpartial (72)
-
recvfrom
_ nonblock (12) - reject (12)
-
renegotiation
_ cb= (12) - reopen (60)
-
repeated
_ combination (24) -
repeated
_ permutation (24) -
report
_ on _ exception (9) -
report
_ on _ exception= (9) - rewind (24)
- round (12)
- seek (24)
-
set
_ backtrace (12) - setsockopt (12)
- skip (1)
- start (1)
- stat (12)
- status (12)
- storbinary (24)
- storlines (24)
- string= (12)
- sync (12)
- sync= (12)
-
synthesize
_ file _ task (12) - sysread (60)
- sysseek (12)
- syswrite (36)
- tell (12)
-
terminate
_ interaction (12) -
to
_ d (12) -
to
_ der (24) -
to
_ i (24) -
to
_ pem (12) -
to
_ r (12) -
to
_ text (12) - tr (12)
- trace (12)
- transaction (12)
- truncate (36)
- tty? (12)
- ungetc (36)
- union (12)
-
unix
_ rights (12) - validate (12)
- value= (12)
- version (12)
- version= (24)
- wait (12)
-
wait
_ while (12) - write (36)
-
write
_ nonblock (36)
検索結果
先頭5件
-
Fiber
# raise(exception , message = nil , backtrace = nil) -> object (18216.0) -
selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。
...数をメッセージとした RuntimeError
が発生します。
その他のケースでは、最初の引数は Exception か Exception
のインスタンスを返す exception メソッドを持ったオブジェクトである
必要があります。
この場合、2つ目の引数に例外......ジとなる文字列です。
@param exception 発生させる例外です。
@param backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。
//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.raise "Error!" # => Error! (RuntimeError)
//}
//e......mlist[ファイバー内のイテレーションを終了させる例][ruby]{
f = Fiber.new do
loop do
Fiber.yield(:loop)
end
:exit
end
p f.resume # => :loop
p f.raise StopIteration # => :exit
//}... -
IO
# ioctl(cmd , arg = 0) -> Integer (15129.0) -
IO に対してシステムコール ioctl を実行し、その結果を返します。 機能の詳細は ioctl(2) を参照してください。
...
IO に対してシステムコール ioctl を実行し、その結果を返します。
機能の詳細は ioctl(2) を参照してください。
@param cmd IO に対するコマンドを整数で指定します。どのようなコマンドが使えるかはプラットフォームに依存し......。整数の時にはその値を ioctl に渡します。
文字列の場合には Array#pack した構造体だとみなして渡します。
arg が nil か false の場合には 0を、true の場合には 1 を渡します。
@raise IOError 既に close されている場... -
TracePoint
# raised _ exception -> Exception (12319.0) -
発生した例外を返します。
...例外を返します。
@raise RuntimeError :raise イベントのためのイベントフックの外側で実行し
た場合に発生します。
//emlist[例][ruby]{
trace = TracePoint.new(:raise) do |tp|
tp.raised_exception # => #<ZeroDivisionError: divided by 0>
end
tr... -
IO
# sysseek(offset , whence = IO :: SEEK _ SET) -> Integer (9222.0) -
lseek(2) と同じです。IO#seek では、 IO#sysread, IO#syswrite と併用すると正しく動作しないので代わりにこのメソッドを使います。 位置 offset への移動が成功すれば移動した位置(ファイル先頭からのオフセット)を返します。
...lseek(2) と同じです。IO#seek では、
IO#sysread, IO#syswrite と併用すると正しく動作しないので代わりにこのメソッドを使います。
位置 offset への移動が成功すれば移動した位置(ファイル先頭からのオフセット)を返します。
書き......込み用にバッファリングされた IO に対して実行すると警告が出ます。
File.open("/dev/zero") {|f|
buf = f.read(3)
f.sysseek(0)
}
# => -:3:in `sysseek': sysseek for buffered IO (IOError)
File.open("/dev/null", "w") {|f|
f.print "foo"
f.sysseek(0)......ered IO
@param offset ファイルポインタを移動させるオフセットを整数で指定します。
@param whence 値は以下のいずれかです。
それぞれ代わりに :SET、:CUR、:END、:DATA、:HOLE を指定す
る事も可能です。
* IO::SE... -
Exception
# exception(error _ message) -> Exception (9213.0) -
引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。
...を返します。引数を指定した場合 自身のコピー
を生成し Exception#message 属性を error_message にして返します。
Kernel.#raise は、実質的に、例外オブジェクトの exception
メソッドの呼び出しです。
@param error_message エラーメッセー......ジを表す文字列を指定します。
//emlist[例][ruby]{
begin
# ... # 何か処理
rescue => e
raise e.exception("an error occurs during hogehoge process") # 詳しいエラーメッセージ
end
//}... -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (9207.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...バックトレース情報を返します。Exception#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require......y == 31
raise "#{month} is not long month"
end
def get_exception
return begin
yield
rescue => e
e
end
end
e = get_exception { check_long_month(2) }
p e.backtrace_locations
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "test.rb:9:in `get_exception'", "t......est.rb:15:in `<main>'"]
//}
@see Exception#backtrace... -
IO
# clone -> IO (9207.0) -
レシーバと同じ IO を参照する新しい IO オブジェクトを返します。 参照しているファイル記述子は dup(2) されます。
...シーバと同じ IO を参照する新しい IO オブジェクトを返します。
参照しているファイル記述子は dup(2) されます。
clone の際に self は一旦 IO#flush されます。
フリーズした IO の clone は同様にフリーズされた IO を返しますが、......しいフリーズされていない IO を返します。
@raise IOError 既に close されていた場合に発生します。
//emlist[例][ruby]{
clone_io = nil
IO.write("testfile", "test")
File.open("testfile") do |io|
clone_io = io.clone
end
clone_io.read # => "test"
clone_io.close
//}... -
IO
# dup -> IO (9207.0) -
レシーバと同じ IO を参照する新しい IO オブジェクトを返します。 参照しているファイル記述子は dup(2) されます。
...シーバと同じ IO を参照する新しい IO オブジェクトを返します。
参照しているファイル記述子は dup(2) されます。
clone の際に self は一旦 IO#flush されます。
フリーズした IO の clone は同様にフリーズされた IO を返しますが、......しいフリーズされていない IO を返します。
@raise IOError 既に close されていた場合に発生します。
//emlist[例][ruby]{
clone_io = nil
IO.write("testfile", "test")
File.open("testfile") do |io|
clone_io = io.clone
end
clone_io.read # => "test"
clone_io.close
//}... -
IO
# reopen(io) -> self (9170.0) -
自身を指定された io に繋ぎ換えます。
...た io に繋ぎ換えます。
クラスも io に等しくなることに注意してください。
IO#pos, IO#lineno などは指定された io と等しくなります。
@param io 自身を繋ぎ換えたい IO オブジェクトを指定します。
@raise IOError 指定された io が c...