るりまサーチ

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

別のキーワード

  1. _builtin raise
  2. kernel raise
  3. fiber raise
  4. thread raise
  5. e2mmap raise

検索結果

<< 1 2 > >>

Matrix.empty(row_size=0, column_size=0) -> Matrix (18119.0)

要素を持たない行列を返します。

...ruby]{
require 'matrix'
m = Matrix.empty(2, 0)
m == Matrix[ [], [] ]
# => true
n = Matrix.empty(0, 3)
n == Matrix.columns([ [], [], [] ])
# => true
m * n
# => Matrix[[0, 0, 0], [0, 0, 0]]
//}

@param row_size 行列の行数
@param column_size 行列の列数
@raise ArgumentError row_size, column_si...

Object#must_be_empty -> true (6119.0)

自身が空である場合、検査にパスしたことになります。

...が空である場合、検査にパスしたことになります。

@raise MiniTest::Assertion 自身が empty? メソッドを持たない場合に発生します。
また、自身が空でない場合にも発生します。

@see MiniTest::Assertions#assert_empty...

MiniTest::Assertions#assert_empty(object, message = nil) -> true (6113.0)

与えられたオブジェクトが空である場合、検査にパスしたことになります。

...か Proc を指定します。Proc である場合は Proc#call した
結果を使用します。

@raise MiniTest::Assertion 与えられたオブジェクトが empty? メソッドを持たない場合に発生します。
また、与えられたオブ...

FileTest.#empty?(file) -> bool (6107.0)

ファイルが存在して、そのサイズが 0 である時に真を返します。 そうでない場合、あるいはシステムコールに失敗した場合には false を返します。

...に失敗した場合には false を返します。

@param file ファイル名を表す文字列か IO オブジェクトを指定します。

@raise IOError 指定された IO オブジェクト file が既に close されていた場合に発生します。

//emlist[例:][ruby]{
IO.write("zer...

FileTest.#zero?(file) -> bool (3007.0)

ファイルが存在して、そのサイズが 0 である時に真を返します。 そうでない場合、あるいはシステムコールに失敗した場合には false を返します。

...に失敗した場合には false を返します。

@param file ファイル名を表す文字列か IO オブジェクトを指定します。

@raise IOError 指定された IO オブジェクト file が既に close されていた場合に発生します。

//emlist[例:][ruby]{
IO.write("zer...

絞り込み条件を変える

制御構造 (106.0)

制御構造 条件分岐: * if * unless * case 繰り返し: * while * until * for * break * next * redo * retry 例外処理: * raise * begin その他: * return * BEGIN * END

...* if
* unless
* case
繰り返し:
* while
* until
* for
* break
* next
* redo
* retry
例外処理:
* raise
* begin
その他:
* return
* BEGIN
* END

Rubyでは(Cなどとは異なり)制御構造は式であって、何らかの値を...
...はその引数になります。


====[a:next] next

//emlist[例][ruby]{
# 空行を捨てるcat
ARGF.each_line do |line|
next if line.strip.empty?
print line
end
//}

文法:

next

next val


nextはもっとも内側のループの次の繰り返しにジャンプしま...
...gin
do_something # exception raised
rescue
# handles error
retry # restart from beginning
end
//}

rescue 節以外で retry が用いられた場合には例外 SyntaxError が発生
します。

=== 例外処理

====[a:raise] raise

//emlist[例][ruby]{
raise
"you lose" # 例外 RuntimeE...

ruby 1.8.4 feature (36.0)

ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。

....y (dsym): prohibit empty symbol literal by interpolation.
# fixed: [ruby-talk:166529]

式展開で空のSymbolを作ることができたバグの修正。 ((<ruby-talk:166529>))

p :""

# => ruby 1.8.3 (2005-09-21) [i686-linux]
-:1: empty symbol literal...
...# => ruby 1.8.4 (2005-12-16) [i686-linux]
-:1: empty symbol literal

p :"#{""}"

# => ruby 1.8.3 (2005-09-21) [i686-linux]
:
# => ruby 1.8.4 (2005-12-16) [i686-linux]
-:1: empty symbol literal

: Symbol [bug]

#Sat Oct 22 13:26:57 2005...
...[ruby-dev:27597]
#
# * ext/openssl/ossl.c (ossl_raise): ditto.
#
# ?

#Mon Oct 31 05:49:23 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
#
# * ext/openssl/ossl_cipher.c (ossl_cipher_update): input data must
# not be empty. [ruby-talk:161220]
#
# * test/openssl/test_cipher...

NEWS for Ruby 2.0.0 (30.0)

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

...m

* openssl
* Consistently raise an error when trying to encode nil values. All instances
of OpenSSL::ASN1::Primitive now raise TypeError when calling to_der on an
instance whose value is nil. All instances of OpenSSL::ASN1::Constructive
raise
NoMethodError in the same case....
...ing of records as BEAST mitigation via
OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS.
* The default options for OpenSSL::SSL::SSLContext have changed to
OpenSSL::SSL::OP_ALL & ~OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS
instead of OpenSSL::SSL::OP_ALL only. This enables the co...

IO.read(path, **opt) -> String | nil (24.0)

path で指定されたファイルを offset 位置から length バイト分読み込んで返します。

...使われるオプションをキーワード引数で指定します。

@raise Errno::EXXX path のオープン、offset 位置への設定、ファイルの読み込みに失敗した場合に発生します。

@raise ArgumentError length が負の場合に発生します。

キーワード引...
...の他、 :external_encoding など
IO.open のオプション引数が指定できます。

@see IO.binread

例:

IO.read(empty_file) #=> ""
IO.read(empty_file, 1) #=> nil
IO.read(one_byte_file, 0, 10) #=> ""
IO.read(one_byte_file, nil, 10) #=> ""
IO.read(one_byt...

IO.read(path, length = nil, **opt) -> String | nil (24.0)

path で指定されたファイルを offset 位置から length バイト分読み込んで返します。

...使われるオプションをキーワード引数で指定します。

@raise Errno::EXXX path のオープン、offset 位置への設定、ファイルの読み込みに失敗した場合に発生します。

@raise ArgumentError length が負の場合に発生します。

キーワード引...
...の他、 :external_encoding など
IO.open のオプション引数が指定できます。

@see IO.binread

例:

IO.read(empty_file) #=> ""
IO.read(empty_file, 1) #=> nil
IO.read(one_byte_file, 0, 10) #=> ""
IO.read(one_byte_file, nil, 10) #=> ""
IO.read(one_byt...

絞り込み条件を変える

IO.read(path, length = nil, offset = 0, **opt) -> String | nil (24.0)

path で指定されたファイルを offset 位置から length バイト分読み込んで返します。

...使われるオプションをキーワード引数で指定します。

@raise Errno::EXXX path のオープン、offset 位置への設定、ファイルの読み込みに失敗した場合に発生します。

@raise ArgumentError length が負の場合に発生します。

キーワード引...
...の他、 :external_encoding など
IO.open のオプション引数が指定できます。

@see IO.binread

例:

IO.read(empty_file) #=> ""
IO.read(empty_file, 1) #=> nil
IO.read(one_byte_file, 0, 10) #=> ""
IO.read(one_byte_file, nil, 10) #=> ""
IO.read(one_byt...

Kernel.#warn(*message) -> nil (18.0)

message を 標準エラー出力 $stderr に出力します。 $VERBOSE フラグ が nil のときは何も出力しません。

...puts(*message) if !$VERBOSE.nil? && !message.empty?
nil
//}

@param message 出力するオブジェクトを任意個指定します。
@raise IOError 標準エラー出力が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX 出力に失敗した場合に...

Kernel.#warn(*message, uplevel: nil) -> nil (18.0)

message を 標準エラー出力 $stderr に出力します。 $VERBOSE フラグ が nil のときは何も出力しません。

...l? && !message.empty?
nil
//}

@param message 出力するオブジェクトを任意個指定します。
@param uplevel いくつ前の呼び出し元のファイル名と行番号を表示するかを0以上の数値で指定します。 nil の場合は表示しません。
@raise IOError 標準...
...エラー出力が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX 出力に失敗した場合に発生します。

//emlist[例][ruby]{
warn "caution!" #=> caution!
$VERBOSE = nil
warn "caution!" # 何もしない
//}

//emlist[uplevel の例][ruby]{
def...
<< 1 2 > >>