種類
- 文書 (49)
- インスタンスメソッド (33)
- 特異メソッド (33)
- モジュール関数 (30)
クラス
- IO (11)
キーワード
-
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - httpd (11)
-
open
_ uri (22) -
ruby 1
. 6 feature (11) - select (22)
検索結果
先頭5件
- Kernel
# timeout(sec) {|i| . . . . } -> object - Kernel
# timeout(sec , exception _ class = nil) {|i| . . . . } -> object - Timeout
. # timeout(sec , exception _ class = nil) {|i| . . . } -> object - Timeout
. # timeout(sec , exception _ class , message) {|i| . . . } -> object - Timeout
. # timeout(sec , exception _ class = nil) {|i| . . . } -> object
-
Kernel
# timeout(sec) {|i| . . . . } -> object (47136.0) -
ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。
...c 秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout::Error が発生します。
exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはい......時、発生させる例外を指定します.
=== 注意
timeout による割り込みは Thread によって実現されています。C 言語
レベルで実装され、Ruby のスレッドが割り込めない処理に対して
timeout は無力です。
そのような
ものは実用レベ... -
Kernel
# timeout(sec , exception _ class = nil) {|i| . . . . } -> object (47136.0) -
ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。
...c 秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout::Error が発生します。
exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはい......時、発生させる例外を指定します.
=== 注意
timeout による割り込みは Thread によって実現されています。C 言語
レベルで実装され、Ruby のスレッドが割り込めない処理に対して
timeout は無力です。
そのような
ものは実用レベ... -
Timeout
. # timeout(sec , exception _ class = nil) {|i| . . . } -> object (35268.0) -
ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。
...c 秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout::Error が発生します。
exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはい......ウト
require 'timeout'
def calc_pi(min)
loop do
x = rand
y = rand
x**2 + y**2 < 1.0 ? min[0] += 1 : min[1] += 1
end
end
t = 5
min = [ 0, 0]
begin
Timeout.timeout(t){
calc_pi(min)
}
rescue Timeout::Error
puts "timeout"
end
printf "%......ution expired (TimeoutError)
from -:6:in `timeout'
from -:6
# gethostbyname が0.1秒かからない場合は例外が発生しないので
# その場合は、t に小さい数値(0.000001のような)に変える。
timeout による割り込みは Kernel.#system によ... -
Timeout
. # timeout(sec , exception _ class , message) {|i| . . . } -> object (35268.0) -
ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。
...c 秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout::Error が発生します。
exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはい......ウト
require 'timeout'
def calc_pi(min)
loop do
x = rand
y = rand
x**2 + y**2 < 1.0 ? min[0] += 1 : min[1] += 1
end
end
t = 5
min = [ 0, 0]
begin
Timeout.timeout(t){
calc_pi(min)
}
rescue Timeout::Error
puts "timeout"
end
printf "%......ution expired (TimeoutError)
from -:6:in `timeout'
from -:6
# gethostbyname が0.1秒かからない場合は例外が発生しないので
# その場合は、t に小さい数値(0.000001のような)に変える。
timeout による割り込みは Kernel.#system によ... -
Timeout
. # timeout(sec , exception _ class = nil) {|i| . . . } -> object (35267.0) -
ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。
...c 秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout::Error が発生します。
exception_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはい......ウト
require 'timeout'
def calc_pi(min)
loop do
x = rand
y = rand
x**2 + y**2 < 1.0 ? min[0] += 1 : min[1] += 1
end
end
t = 5
min = [ 0, 0]
begin
Timeout.timeout(t){
calc_pi(min)
}
rescue Timeout::Error
puts "timeout"
end
printf "%......ution expired (TimeoutError)
from -:6:in `timeout'
from -:6
# gethostbyname が0.1秒かからない場合は例外が発生しないので
# その場合は、t に小さい数値(0.000001のような)に変える。
timeout による割り込みは Kernel.#system によ... -
Kernel
. # select(reads , writes = [] , excepts = [] , timeout = nil) -> [[IO]] | nil (21107.0) -
IO.select と同じです。
...IO.select と同じです。
@param reads IO.select 参照
@param writes IO.select 参照
@param excepts IO.select 参照
@param timeout IO.select 参照
@see IO.select... -
Kernel
# httpd -> () (21006.0) -
WEBrick HTTP server を起動します。
...--temp-dir=DIR 一時ディレクトリを指定します
--do-not-reverse-lookup 逆引きを無効にします
--request-timeout=SECOND リクエストがタイムアウトする秒数を指定します
--http-version=VERSION HTTP version
-v......--temp-dir=DIR 一時ディレクトリを指定します
--do-not-reverse-lookup 逆引きを無効にします
--request-timeout=SECOND リクエストがタイムアウトする秒数を指定します
--http-version=VERSION HTTP version
--ssl-certificate=CERT......--temp-dir=DIR 一時ディレクトリを指定します
--do-not-reverse-lookup 逆引きを無効にします
--request-timeout=SECOND リクエストがタイムアウトする秒数を指定します
--http-version=VERSION HTTP version
--server-name=NAME... -
IO
. select(reads , writes = [] , excepts = [] , timeout = nil) -> [[IO]] | nil (113.0) -
select(2) を実行します。
...る IO オブジェクトの配列を渡します。
@param excepts 例外待ちする IO オブジェクトの配列を渡します。
@param timeout タイムアウトまでの時間を表す数値または nil を指定します。数値で指定したときの単位は秒です。nil を指定......IO.pipe
mesg = "ping "
100.times{
rs, ws, = IO.select([rp], [wp])
if r = rs[0]
ret = r.read(5)
print ret
case ret
when /ping/
mesg = "pong\n"
when /pong/
mesg = "ping "
end
end
if w = ws[0]
w.write(mesg)
end
}
@see Kernel.#select... -
NEWS for Ruby 2
. 6 . 0 (102.0) -
NEWS for Ruby 2.6.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...従来でも eval("[__FILE__, __LINE__]", binding) とすることでこれらの情報は得られましたが、
将来的に Kernel.#eval は binding のソースコード行を無視する変更を予定しているため 4352、
この新しいメソッドを用い......'x' が追加されました。 11258
* Kernel
* 別名
* Object#then が Object#yield_self の別名として追加されました。 14594
* 新規オプション
* Kernel.#Complex, Kernel.#Float, Kernel.#Integer,
Kernel.#Rational にエラー処理方法を指定......ector#[]=
* Net::HTTP
* 新規オプション
* :write_timeout キーワード引数が Net::HTTP.new に追加されました。 13396
* 新規メソッド
* Net::HTTP#write_timeout と Net::HTTP#write_timeout= が追加されました。 13396
* 新規定数
* Net:... -
NEWS for Ruby 3
. 0 . 0 (78.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...voke the scheduler hook `#io_wait(io, events, timeout)` in a non-blocking execution context. 16786
* Kernel
* Kernel#clone when called with the `freeze: false` keyword will call `#initialize_clone` with the `freeze: false` keyword. 14266
* Kernel#clone when called with the `freeze: true` k......s unfrozen. 16175
* Kernel#eval when called with two arguments will use `"(eval)"` for `__FILE__` and `1` for `__LINE__` in the evaluated code. 4352
* Kernel#lambda now warns if called without a literal block. 15973
* Kernel.sleep invokes the scheduler hook `#kernel_sleep(...)` in a non-......s as a symbol. 17314
//emlist[][ruby]{
class C; end
module M1; end
module M2; end
C.include M1
M1.include M2
p C.ancestors #=> [C, M1, M2, Object, Kernel, BasicObject]
//}
* Mutex
* `Mutex` is now acquired per-`Fiber` instead of per-`Thread`. This change should be compatible for essentially... -
NEWS for Ruby 3
. 1 . 0 (54.0) -
NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ます。 10917
* Integer
* 新規メソッド
* Integer.try_convert が追加されました。 15211
* Kernel
* 変更されたメソッド
* Kernel#load が第2引数にモジュールを渡せるようになり、渡されたモジュールをトップレベルのモジ......した。これは fork(2) のコアメソッドです。このメソッドを直接呼び出さないでください。既存のforkメソッド(Kernel.#fork、Process.fork、IO.popen("-"))によって呼び出されます。アプリケーションモニタリングライブラリは、このメ......メソッド
* Addrinfo.getaddrinfo がaddress_resolveフックをサポートしました。 17370
* ブロックなしの Timeout.timeout に timeout_after フックが導入されました。 17470
* 新しいSchedulerのフックのio_readとio_writeが導入され、zero-copy... -
NEWS for Ruby 2
. 7 . 0 (42.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ッドの中で、ブロックなしでProc.newやKernel#procを
呼び出すと警告が表示されるようになりました。
//emlist[][ruby]{
def foo
proc
end
foo { puts "Hello" } #=> warning: Capturing the given block using Kernel#proc is deprecated; use `&block` instead
//}
* 非......の中で
「Warning[:deprecated] = false」
としてください。
* ブロック付きで呼び出されたメソッドの中で、Kernel#lambdaをブロックなしで呼び出すと
例外が発生するようになりました。
//emlist[][ruby]{
def bar
lambda
end
bar { pu......は公開されていません。
* monitor
* observer
* timeout
* tracer
* uri
* yaml
* did_you_mean gemはbundled gemからdefault gemになりました。
* pathname
* Kernel#PathnameをPathnameを引数として呼んだとき、
新しいPathna... -
NEWS for Ruby 2
. 1 . 0 (30.0) -
NEWS for Ruby 2.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...IO#write_nonblock シンボルを返すためにキーワード引数 `exception: false` を受け付けるようになりました
* Kernel
* 追加: Kernel#singleton_method(Object#singleton_method)
* Module
* 追加: Module#using, which activates refinements of the specified module o......O
* 非互換: IO.open は外部エンコーディングが ASCII-8BIT のとき内部エンコーディングを無視します。
* Kernel.#eval, Kernel.#instance_eval, Module#module_eval
元の環境のスコープ情報をコピーするようになりました。これは、引数な......キャプチャをサポートしました
* syslog/logger
* ファイリティを追加
* tempfile
* 追加: Tempfile.create
* timeout
* 明示的に例外クラスを指定しない限り、ブロックを抜けるための例外はブロック内部で rescue されなくな...