るりまサーチ

最速Rubyリファレンスマニュアル検索!
772件ヒット [701-772件を表示] (0.118秒)
トップページ > クエリ:a[x] > クエリ:warning[x]

別のキーワード

  1. _builtin to_a
  2. matrix to_a
  3. to_a
  4. dbm to_a
  5. argf.class to_a

ライブラリ

クラス

モジュール

検索結果

<< < ... 6 7 8 >>

Rubyの起動 (36.0)

Rubyの起動 * cmd_option * shebang

...Rubyの起動
* cmd_option
* shebang

Rubyインタプリタの起動は以下の書式のコマンドラインにより行います。

ruby [ option ...] [ -- ] [ programfile ] [ argument ...]

ここで、option は後述のcmd_option
のいずれかを指定します。-- は、オプシ...
...りを明示するため
に使用できます。programfile は、Ruby スクリプトを記述したファイ
ルです。これを省略したり`-' を指定した場合には標準入力を Ruby ス
クリプトとみなします。

programfile が `#!' で始まるファイルである場合...
...(デフォルト)
* -W:experimental : 実験的な機能を使用した際に警告を出力する(デフォルト)
* -W:no-experimental : 実験的な機能を使用した際に警告を出力しない
//}
ここで設定された値は Warning.[] で参照することができます...

NEWS for Ruby 2.4.0 (30.0)

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

...エントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。

== 2.3.0 以降の変更

=== 言語仕様の変更

* 条件式での多重代入...
...うになりました 10617
* Symbol#to_proc でメソッド呼び出し元での Refinements が有効になりました 9451
* Object#send や BasicObject#__send__ でメソッドを呼び出したときに Refinements が有効になりました 11476
* 後置 rescue をメソッドの引...
...case, Symbol#capitalize, Symbol#swapcase は
全ての Unicode に対して動作するようになりました。10085

* Thread
* Thread#report_on_exception, Thread.report_on_exception を追加 6647

* TracePoint
* TracePoint#callee_id を追加 12747

* Warning
* Warning...

cgi/session (30.0)

CGI のセッション管理を行うライブラリ。

...キーを使用してもいいですが、
この cgi/session を使用した方がよりわかりやすいでしょう。
セッション情報は Hash ライクなインターフェースです。

セッションはセッション ID とプログラムが記録した
セッション情報から...
...ion['name'] = "value"

CGI::Session オブジェクトは Hash のようなもので、キーに対応する値を記録します。
デフォルトではプログラム終了時にセッション情報はファイルに記録されます。

=== 使い方 (セッション情報を得る)

name =...
...に(warning は出ます)
@cmd = 'start' if @cmd.empty?
@header = { "type" => "text/html", "charset" => "euc-jp" }

__send__("cmd_#{@cmd}")
end

def cmd_start
@cgi.out(@header) {
<<-END
<html><head><title>CGI::Session Demo</title></head>...

Proc.new -> Proc (18.0)

ブロックをコンテキストとともにオブジェクト化して返します。

...では
$VERBOSE = true のときには警告メッセージ
warning: Capturing the given block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
A
rgumentError (tried to create Proc object without a block)
が発生します。

ブロックを指定しなけ...
...& 引数でうけるべきです。

@raise ArgumentError スタック上にブロックがないのにブロックを省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo
pr = Proc.new
pr.call(1)
end
foo {|arg| p arg }
# => 1
//}

これは以下と同...
...foo
yield(1)
end
foo {|arg| p arg }
# => 1
//}

呼び出し元のメソッドがブロックを伴わなければ、例外
A
rgumentError が発生します。

//emlist[例][ruby]{
def foo
Proc.new
end
foo
# => -:2:in `new': tried to create Proc object without a block (ArgumentError)
# f...

Proc.new { ... } -> Proc (18.0)

ブロックをコンテキストとともにオブジェクト化して返します。

...では
$VERBOSE = true のときには警告メッセージ
warning: Capturing the given block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
A
rgumentError (tried to create Proc object without a block)
が発生します。

ブロックを指定しなけ...
...& 引数でうけるべきです。

@raise ArgumentError スタック上にブロックがないのにブロックを省略した呼び出しを行ったときに発生します。

//emlist[例][ruby]{
def foo
pr = Proc.new
pr.call(1)
end
foo {|arg| p arg }
# => 1
//}

これは以下と同...
...foo
yield(1)
end
foo {|arg| p arg }
# => 1
//}

呼び出し元のメソッドがブロックを伴わなければ、例外
A
rgumentError が発生します。

//emlist[例][ruby]{
def foo
Proc.new
end
foo
# => -:2:in `new': tried to create Proc object without a block (ArgumentError)
# f...

絞り込み条件を変える

Integer#**(other) -> Numeric (12.0)

算術演算子。冪(べき乗)を計算します。

...param other 二項演算の右側の引数(対象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@ra...
...ise RangeError 2引数 pow で other に負の数を指定した場合に発生します。

//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
3.pow(3, 8) # => 3
3.pow(3, -8) # => -5
3.pow(2, -2) # => -1
-3.pow(3, 8) # => 5
-3.pow(3, -8) # => -3
5.pow(2, -8) # => -7
//}

結果が...
...になりそうなとき、警告を出したうえで Float::INFINITY を返します。

//emlist[計算を放棄して Float::INFINITY を返す例][ruby]{
p 100**9999999
# => warning: in a**b, b may be too big
# Infinity
//}

判定の閾値は変わりえます。


@see BigDecimal#power...

Integer#pow(other) -> Numeric (12.0)

算術演算子。冪(べき乗)を計算します。

...param other 二項演算の右側の引数(対象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@ra...
...ise RangeError 2引数 pow で other に負の数を指定した場合に発生します。

//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
3.pow(3, 8) # => 3
3.pow(3, -8) # => -5
3.pow(2, -2) # => -1
-3.pow(3, 8) # => 5
-3.pow(3, -8) # => -3
5.pow(2, -8) # => -7
//}

結果が...
...になりそうなとき、警告を出したうえで Float::INFINITY を返します。

//emlist[計算を放棄して Float::INFINITY を返す例][ruby]{
p 100**9999999
# => warning: in a**b, b may be too big
# Infinity
//}

判定の閾値は変わりえます。


@see BigDecimal#power...

Integer#pow(other, modulo) -> Integer (12.0)

算術演算子。冪(べき乗)を計算します。

...param other 二項演算の右側の引数(対象)
@param modulo 指定すると、計算途中に巨大な値を生成せずに (self**other) % modulo と同じ結果を返します。
@return 計算結果
@raise TypeError 2引数 pow で Integer 以外を指定した場合に発生します。
@ra...
...ise RangeError 2引数 pow で other に負の数を指定した場合に発生します。

//emlist[][ruby]{
2 ** 3 # => 8
2 ** 0 # => 1
0 ** 0 # => 1
3.pow(3, 8) # => 3
3.pow(3, -8) # => -5
3.pow(2, -2) # => -1
-3.pow(3, 8) # => 5
-3.pow(3, -8) # => -3
5.pow(2, -8) # => -7
//}

結果が...
...になりそうなとき、警告を出したうえで Float::INFINITY を返します。

//emlist[計算を放棄して Float::INFINITY を返す例][ruby]{
p 100**9999999
# => warning: in a**b, b may be too big
# Infinity
//}

判定の閾値は変わりえます。


@see BigDecimal#power...
<< < ... 6 7 8 >>