るりまサーチ

最速Rubyリファレンスマニュアル検索!
42件ヒット [1-42件を表示] (0.019秒)

別のキーワード

  1. getoptlong error_message
  2. etc sc_2_pbs_message
  3. etc sc_message_passing
  4. mkmf message
  5. exception message

種類

ライブラリ

モジュール

検索結果

Timeout.#timeout(sec, exception_class, message) {|i| ... } -> object (35495.0)

ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。

...c 秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout
::Error が発生します。

exception
_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはい...
...す.
@param exception_class タイムアウトした時、発生させる例外を指定します.
@param message エラーメッセージを指定します.省略した場合は
"execution expired" になります.

例 長い計算のタイムアウト
require 'timeout'

def cal...
...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 "%d: pi = %f\n", min[0] + min[1], min[0]*4.0/(min[0]+min[1])
#例
#=> 417519: pi =...

Timeout.#timeout(sec, exception_class = nil) {|i| ... } -> object (35395.0)

ブロックを sec 秒の期限付きで実行します。 ブロックの実行時間が制限を過ぎたときは例外 Timeout::Error が発生します。

...c 秒の期限付きで実行します。
ブロックの実行時間が制限を過ぎたときは例外
Timeout
::Error が発生します。

exception
_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がはい...
...す.
@param exception_class タイムアウトした時、発生させる例外を指定します.
@param message エラーメッセージを指定します.省略した場合は
"execution expired" になります.

例 長い計算のタイムアウト
require 'timeout'

def cal...
...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 "%d: pi = %f\n", min[0] + min[1], min[0]*4.0/(min[0]+min[1])
#例
#=> 417519: pi =...

NEWS for Ruby 2.6.0 (72.0)

NEWS for Ruby 2.6.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ser| cond(user) }
//}
* 例外が捕捉されず、バックトレースとエラーメッセージが表示されるときに、
例外の Exception#cause も表示されるようになりました。 8257

* フリップフロップが非推奨になりました。 5400

=== 組み込み...
...り、環境変数名と値のペアを新しいキーと値に変換できるようになりました。 15143

* Exception
* 新規オプション
* Exception#full_message が :highlight と :order を受け付けるようになりました。 14324

* Hash
* 変更されたメ...
...e_timeout キーワード引数が Net::HTTP.new に追加されました。 13396
* 新規メソッド
* Net::HTTP#write_timeout と Net::HTTP#write_timeout= が追加されました。 13396
* 新規定数
* Net::HTTPClientException が追加されて Net::HTTPServerException...

ruby 1.6 feature (48.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...def initialize}
end
}

=> ruby 1.6.5 (2001-09-19) [i586-linux]
NotImplementedError
MatchData
Exception

Numeric
MatchData
Segmentation fault

=> ruby 1.6.5 (2001-10-15) [i586-linux]
MatchDat...
...したリゾルバは、timeout の制御が効きます(つまり、名前解
決中にThreadが切替え可能ということです)

require 'resolv'
p Resolv.new.getaddress("www.ruby-lang.org").to_s

=> /usr/local/lib/ruby/1.6/resolv.rb:160: warning: timeout (...) interpreted as me...
...)

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) [i586-linux]
ok
=> ruby 1.6.4 (2001-08-06) [i586-linux]
-:7:in `message': wrong # of arguments(3 for 0) (ArgumentEr...

NEWS for Ruby 3.0.0 (36.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...riable `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` option limits the maximum length of a backt...
...eadable, IO#wait_writable, IO#read, IO#write and other related methods (e.g. IO#puts, IO#gets) may invoke 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_cl...
...r keep empty keyword splats, those are now removed just as they are for methods not using `ruby2_keywords`.
* When an exception is caught in the default handler, the error message and backtrace are printed in order from the innermost. 8661
* Accessing an uninitialized instance variable no longer...

絞り込み条件を変える