3498件ヒット
[1-100件を表示]
(0.108秒)
ライブラリ
- English (22)
- ビルトイン (2290)
- csv (11)
- e2mmap (12)
- fiber (8)
-
fiddle
/ import (11) -
irb
/ cmd / load (11) - json (33)
-
minitest
/ unit (1) -
net
/ ftp (11) -
net
/ http (44) -
net
/ imap (11) -
net
/ pop (154) -
net
/ smtp (33) - openssl (11)
- optparse (77)
- pstore (22)
- psych (44)
- rake (22)
- readline (33)
- resolv-replace (11)
-
ripper
/ lexer (8) -
rubygems
/ installer (11) - shell (6)
- socket (11)
- stringio (11)
- strscan (55)
- syslog (22)
- thwait (6)
- time (55)
- tmpdir (22)
- tracer (22)
- tsort (11)
-
webrick
/ httpproxy (11) - win32ole (88)
- zlib (198)
クラス
-
ARGF
. class (22) - Array (55)
- BasicObject (33)
- BasicSocket (11)
- Binding (11)
- CSV (11)
- Data (4)
- Dir (176)
- Enumerator (11)
-
Enumerator
:: Lazy (11) - Exception (95)
- Fiber (48)
- File (66)
- FrozenError (5)
-
Gem
:: Installer (11) - IO (498)
-
IRB
:: ExtendCommand :: Load (11) - KeyError (7)
- MatchData (92)
- Module (200)
- Mutex (4)
-
Net
:: FTP (11) -
Net
:: HTTPResponse (11) -
Net
:: IMAP (11) -
Net
:: POP3 (55) -
Net
:: POPMail (99) -
Net
:: SMTP (33) - Numeric (84)
- Object (110)
-
OpenSSL
:: SSL :: SSLContext (11) - OptionParser (77)
- PStore (22)
- Proc (11)
-
Rake
:: InvocationChain (11) - Random (22)
- Range (44)
- Regexp (11)
- Ripper (8)
- Shell (6)
- String (22)
- StringIO (11)
- StringScanner (55)
- Struct (14)
- SystemCallError (11)
- SystemExit (11)
- Thread (66)
-
Thread
:: Mutex (18) - ThreadsWait (6)
- Time (55)
- TracePoint (106)
- Tracer (22)
- UDPSocket (11)
- UnboundMethod (11)
-
WEBrick
:: HTTPProxyServer (11) - WIN32OLE (55)
-
WIN32OLE
_ EVENT (22) -
WIN32OLE
_ TYPE (11) -
Zlib
:: GzipReader (176) -
Zlib
:: Inflate (22)
モジュール
- Comparable (5)
- Enumerable (66)
- Exception2MessageMapper (12)
-
Fiddle
:: Importer (11) - JSON (33)
- Kernel (260)
- Math (11)
-
MiniTest
:: Assertions (1) -
Net
:: HTTPHeader (33) - ObjectSpace (22)
- Process (11)
-
Process
:: GID (22) -
Process
:: UID (22) - Psych (44)
-
Rake
:: TaskManager (11) - Readline (33)
- Signal (22)
- Syslog (22)
- TSort (11)
キーワード
-
$ ERROR _ INFO (11) -
$ ERROR _ POSITION (11) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - < (11)
- <= (11)
- == (22)
- === (11)
- =~ (11)
- > (11)
- >= (11)
- Fail (6)
- Fiber (11)
-
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - Rubyの起動 (3)
- String (11)
- TracePoint (11)
- [] (77)
- accept (22)
-
add
_ filter (22) - all (33)
- append (22)
-
assert
_ send (1) - at (11)
- autoload (11)
- backtrace (11)
-
backtrace
_ locations (11) - begin (22)
- bind (11)
- binmode (11)
- byteoffset (4)
-
callee
_ id (11) - caller (33)
- cause (11)
- chdir (44)
- clamp (5)
-
class
_ variable _ get (11) - clone (11)
-
close
_ read (11) -
close
_ write (11) - commit (11)
-
completion
_ append _ character (11) -
completion
_ append _ character= (11) -
const
_ get (11) -
const
_ load (11) -
const
_ missing (11) - define (4)
-
define
_ finalizer (22) -
define
_ method (22) - delete (11)
-
delete
_ all (22) - dump (11)
- dup (11)
- each (33)
-
each
_ byte (44) -
each
_ line (22) -
ensure
_ dependency (11) -
enum
_ for (22) - errno (11)
- eval (11)
-
eval
_ script (6) - event (11)
- exception (22)
- execute (11)
- fail (33)
- fcntl (11)
- fdatasync (11)
- feed (11)
- fetch (44)
- first (22)
- flush (11)
- foreach (11)
- fork (33)
- gamma (11)
- generate (11)
- getc (11)
- gets (22)
-
handle
_ interrupt (11) - httpdate (11)
- include (11)
- inflate (22)
-
initialize
_ copy (11) - inspect (11)
-
instance
_ eval (22) -
instance
_ method (11) -
instruction
_ sequence (6) - iso8601 (11)
- lex (4)
- lineno (22)
- lineno= (11)
- load (11)
-
load
_ stream (22) -
local
_ variable _ get (11) - loop (11)
- lstat (11)
- mail (33)
- max (22)
-
method
_ id (11) -
method
_ missing (11) - min (44)
- mktmpdir (22)
- new (113)
-
next
_ wait (6) - offset (22)
-
ole
_ func _ methods (11) -
ole
_ get _ methods (11) -
ole
_ query _ interface (11) -
on
_ event (11) -
on
_ event _ with _ outargs (11) - open (66)
- parameters (6)
- parse (33)
- parse! (11)
- path (11)
- peek (11)
- peep (11)
-
pending
_ interrupt? (11) - pid (11)
- pipe (88)
- pointer= (11)
- pop (33)
- popen (154)
- pos (11)
- pos= (33)
- pread (7)
- print (11)
- private (23)
-
private
_ constant (11) - public (23)
-
public
_ constant (11) -
public
_ send (22) - pwrite (7)
- raise (59)
-
raised
_ exception (11) - rand (22)
- read (22)
- readbyte (22)
- readchar (22)
- readline (33)
- readlines (11)
- receiver (12)
- reject (22)
-
remove
_ class _ variable (11) -
remove
_ instance _ variable (11) - rename (11)
-
renegotiation
_ cb= (11) - require (11)
-
require
_ relative (11) -
respond
_ to? (11) - resume (11)
-
return
_ value (11) - rewind (11)
- rfc2822 (11)
- rfc822 (11)
-
rinda
/ rinda (11) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 4 feature (11) - seek (33)
- select (11)
- send (22)
-
send
_ mail (11) - sendcmd (11)
- sendmail (11)
-
set
_ backtrace (11) - setpriority (11)
-
singleton
_ method (11) - size (11)
- sizeof (11)
- sleep (11)
- start (33)
- stat (11)
- status (11)
- step (84)
- switch (44)
- sync (11)
- synchronize (11)
-
synthesize
_ file _ task (11) - sysseek (11)
- syswrite (11)
- tell (11)
- throw (11)
-
to
_ enum (22) - tokenize (4)
- transaction (11)
- transfer (11)
- trap (22)
- truncate (11)
- tsort (11)
-
tsort
_ each (11) -
unalias
_ command (6) - ungetc (11)
- unlink (11)
- unparse (11)
- unscan (11)
- value (11)
- variables (11)
- warn (7)
- write (11)
- xmlschema (11)
- yield (22)
- 制御構造 (11)
検索結果
先頭5件
-
Exception2MessageMapper
# Raise(exception _ class = nil , *rest) -> () (21243.0) -
登録されている情報を使用して、例外を発生させます。
...ram exception_class 例外クラス。
@param rest メッセージに埋め込む値。
@raise Exception2MessageMapper::ErrNotRegisteredException 指定された例外クラスに対応するメッセージが存在しない場合に発生します。
例:
class Foo
extend Exception2Messag......ption :NewExceptionClass, "message...%d, %d and %d" # =>
def foo
Raise NewExceptionClass, 1, 2, 3
end
end
Foo.new().foo() #=> in `Raise': message...1, 2 and 3 (Foo::NewExceptionClass)
# という例外が発生します。
Foo.Raise Foo::NewExceptio......nClass, 1, 3, 5 #=> in `Raise': message...1, 3 and 5 (Foo::NewExceptionClass)
# という例外が発生します。... -
Thread
. pending _ interrupt?(error = nil) -> bool (18330.0) -
非同期割り込みのキューが空かどうかを返します。
...Thread.handle_interrupt は非同期割り込みの発生を延期させるのに使
用しますが、本メソッドは任意の非同期割り込みが存在するかどうかを確認す
るのに使用します。
本メソッドが true を返した場合、Thread.handle_interrupt で例外......だちに発生させる。
def Thread.kick_interrupt_immediately
Thread.handle_interrupt(Object => :immediate) {
Thread.pass
}
end
=== 使い方
th = Thread.new{
Thread.handle_interrupt(RuntimeError => :on_blocking){
while true
...
# ここまでで......
if Thread.pending_interrupt?
Thread.handle_interrupt(Object => :immediate){}
end
...
end
}
}
...
th.raise # スレッド停止。
この例は以下のように記述する事もできます。
flag = true
th = Thread.new{
Thread.handle_in... -
MatchData
# end(n) -> Integer | nil (18243.0) -
n 番目の部分文字列終端のオフセットを返します。
...nil を返します。
@param n 部分文字列を指定する数値。
@raise IndexError 範囲外の n を指定した場合に発生します。
//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.end(0) # => 6
p $~.end(1) # => 3
p $~.end(2) # => 6
p $~.end(3) # => nil
p $~.end......(4) # => `end': index 4 out of matches (IndexError)
//}
@see MatchData#begin... -
Net
:: SMTP # send _ mail(mailsrc , from _ addr , *to _ addrs) -> () (12336.0) -
メールを送信します。
...メールを送信します。
mailsrc をメールとして送信します。
mailsrc は each イテレータを持つ
オブジェクトならなんでも構いません(たとえば String や File)。
from_domain は送り主のメールアドレス ('...@...'のかたち) 、
to_addrs に......で渡します。
require 'net/smtp'
Net::SMTP.start('smtp.example.com') {|smtp|
smtp.send_message mail_string,
'from@example.com',
'to1@example.net', 'to2@example.net'
}
sendmail は obsolete です。
@param mailsrc メールの内容
@par......少なくとも1個)
@raise IOError すでにセッションが終了している場合に発生します
@raise TimeoutError 接続がタイムアウトした場合に発生します
@raise Net::SMTPServerBusy SMTPエラーコード420,450の場合に発生します
@raise Net::SMTPSyntaxError SMT... -
Net
:: SMTP # sendmail(mailsrc , from _ addr , *to _ addrs) -> () (12336.0) -
メールを送信します。
...メールを送信します。
mailsrc をメールとして送信します。
mailsrc は each イテレータを持つ
オブジェクトならなんでも構いません(たとえば String や File)。
from_domain は送り主のメールアドレス ('...@...'のかたち) 、
to_addrs に......で渡します。
require 'net/smtp'
Net::SMTP.start('smtp.example.com') {|smtp|
smtp.send_message mail_string,
'from@example.com',
'to1@example.net', 'to2@example.net'
}
sendmail は obsolete です。
@param mailsrc メールの内容
@par......少なくとも1個)
@raise IOError すでにセッションが終了している場合に発生します
@raise TimeoutError 接続がタイムアウトした場合に発生します
@raise Net::SMTPServerBusy SMTPエラーコード420,450の場合に発生します
@raise Net::SMTPSyntaxError SMT... -
Rake
:: InvocationChain # append(task _ name) -> Rake :: InvocationChain (12312.0) -
与えられたタスク名を追加して新しい Rake::InvocationChain を返します。
...ク名を追加して新しい Rake::InvocationChain を返します。
@param task_name 追加するタスク名を指定します。
@raise RuntimeError 循環したタスクの呼び出しを検出した場合に発生します。
//emlist[][ruby]{
# Rakefile での記載例とする
task def......ault: :test_rake_app
task :test_rake_app do
invocation_chain= Rake::InvocationChain.new("task_a", Rake::InvocationChain::EMPTY)
invocation_chain.append("task_b") # => LL("task_b", "task_a")
end
//}... -
ObjectSpace
. # define _ finalizer(obj) {|id| . . . } -> Array (12254.0) -
obj が解放されるときに実行されるファイナライザ proc を 登録します。同じオブジェクトについて複数回呼ばれたときは置き換えで はなく追加登録されます。固定値 0 と proc を配列にして返します。
...ロックを指定した場合は、そのブロックがファイナライザになります。
obj の回収時にブロックは obj の ID (BasicObject#__id__)を引数とし
て実行されます。
しかし、後述の問題があるのでブロックでファイナライザを登録するの......回収時に obj の ID を引数として実行されます。
=== 使い方の注意
以下は、define_finalizer の使い方の悪い例です。
//emlist[悪い例][ruby]{
class Foo
def initialize
ObjectSpace.define_finalizer(self) {
puts "foo"
}
end
end
Foo.new
GC.start
//......た方が良いでしょう。
//emlist[例][ruby]{
class Baz
def initialize
ObjectSpace.define_finalizer self, eval(%q{
proc {
raise "baz" rescue puts $!
raise "baz2"
puts "baz3"
}
}, TOPLEVEL_BINDING)
end
end
Baz.new
GC.start
# => baz
//}
@see spe... -
ObjectSpace
. # define _ finalizer(obj , proc) -> Array (12254.0) -
obj が解放されるときに実行されるファイナライザ proc を 登録します。同じオブジェクトについて複数回呼ばれたときは置き換えで はなく追加登録されます。固定値 0 と proc を配列にして返します。
...ロックを指定した場合は、そのブロックがファイナライザになります。
obj の回収時にブロックは obj の ID (BasicObject#__id__)を引数とし
て実行されます。
しかし、後述の問題があるのでブロックでファイナライザを登録するの......回収時に obj の ID を引数として実行されます。
=== 使い方の注意
以下は、define_finalizer の使い方の悪い例です。
//emlist[悪い例][ruby]{
class Foo
def initialize
ObjectSpace.define_finalizer(self) {
puts "foo"
}
end
end
Foo.new
GC.start
//......た方が良いでしょう。
//emlist[例][ruby]{
class Baz
def initialize
ObjectSpace.define_finalizer self, eval(%q{
proc {
raise "baz" rescue puts $!
raise "baz2"
puts "baz3"
}
}, TOPLEVEL_BINDING)
end
end
Baz.new
GC.start
# => baz
//}
@see spe... -
Thread
# raise(error _ type , message , traceback) -> () (12231.0) -
自身が表すスレッドで強制的に例外を発生させます。
...Kernel.#raise を参照してください。
@param message Kernel.#raise を参照してください。
@param traceback Kernel.#raise を参照してください。
Thread.new {
sleep 1
Thread.main.raise "foobar"
}
begin
sleep
rescue
p $!, $@
end
=> #<RuntimeError:... -
TracePoint
# raised _ exception -> Exception (12230.0) -
発生した例外を返します。
...。
@raise RuntimeError :raise イベントのためのイベントフックの外側で実行し
た場合に発生します。
//emlist[例][ruby]{
trace = TracePoint.new(:raise) do |tp|
tp.raised_exception # => #<ZeroDivisionError: divided by 0>
end
trace.enable
begin
0/......0
rescue
end
//}...