るりまサーチ

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

別のキーワード

  1. _builtin except
  2. env except
  3. hash except
  4. except
  5. except _builtin

ライブラリ

クラス

モジュール

キーワード

検索結果

REXML::ParseException#line -> Integer (21101.0)

パースエラーが起きた(XML上の)場所を行数で返します。

パースエラーが起きた(XML上の)場所を行数で返します。

REXML::ParseException (6006.0)

XML のパースに失敗したときに生じる例外です。

...XML のパースに失敗したときに生じる例外です。

//emlist[][ruby]{
require 'rexml/document'
begin
REXML::Document.new("<a>foo\n</b></a> ")
rescue REXML::ParseException => ex
ex.position # => 16
ex.line # => 2
ex.context # => [16, 2, 2]
end
//}...

REXML::ParseException#context -> [Integer, Integer, Integer] (3024.0)

パースエラーが起きた(XML上の)場所を返します。

...を返します。

要素3個の配列で、
[position, lineno, line]
という形で返します。
position, line
REXML::ParseException#position
REXML::ParseException#line
と同じ値です。
line
no は IO#lineno が返す意味での行数です。
通常は line と同じ値です。...

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

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

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

except
ion_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がは...
...l のときは制限時間なしで
ブロックを実行します。

@param sec タイムアウトする時間を秒数で指定します.
@param exception_class タイムアウトした時、発生させる例外を指定します.

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

def...
...{
# system だととまらない
# system("./loop.sh")
com = IO.popen("./loop.sh")
pid = com.pid
while line = com.gets
print line
end
}
rescue Timeout::Error => err
puts "timeout: shell execution."
Process.kill('SIGINT', pid)
printf "[re...
...l のときは制限時間なしで
ブロックを実行します。

@param sec タイムアウトする時間を秒数で指定します.
@param exception_class タイムアウトした時、発生させる例外を指定します.
@param message エラーメッセージを指定します.省略...

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

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

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

except
ion_class を指定した場合には Timeout::Error の代わりに
その例外が発生します。
ブロックパラメータ i は sec がは...
...l のときは制限時間なしで
ブロックを実行します。

@param sec タイムアウトする時間を秒数で指定します.
@param exception_class タイムアウトした時、発生させる例外を指定します.
@param message エラーメッセージを指定します.省略...
...{
# system だととまらない
# system("./loop.sh")
com = IO.popen("./loop.sh")
pid = com.pid
while line = com.gets
print line
end
}
rescue Timeout::Error => err
puts "timeout: shell execution."
Process.kill('SIGINT', pid)
printf "[re...

絞り込み条件を変える

NEWS for Ruby 3.0.0 (42.0)

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

...st{
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` i...
...the toplevel scope is now a RuntimeError.
14541
* Assigning to a numbered parameter is now a SyntaxError instead of
a warning.

== Command line options

=== `--help` option

When the environment variable `RUBY_PAGER` or `PAGER` is present and has
a non-empty value, and the standard input a...
...g context. 16786
* Dir
* Dir.glob and Dir.[] now sort the results by default, and accept the `sort:` keyword option. 8709
* ENV
* ENV.except has been added, which returns a hash excluding the given keys and their values. 15822
* Windows: Read ENV names and values as UTF-8 encoded S...