るりまサーチ

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

別のキーワード

  1. _builtin argumenterror
  2. on argumenterror
  3. new argumenterror
  4. dump argumenterror
  5. parse argumenterror

ライブラリ

クラス

モジュール

検索結果

<< 1 2 > >>

Syslog.#warning(message, *arg) -> self (15107.0)

Syslog#log()のショートカットメソッド。 システムによっては定義されていないものもあります。

...文字列です。Kernel.#sprintf と同じ形式の引数を指定します。

@param arg フォーマットされる引数です。

@raise ArgumentError 引数が1つ以上でない場合に発生します。

@raise RuntimeError syslog がopen されていない場合発生します。

例:...

ruby 1.6 feature (186.0)

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

...が、この変更は元に戻りました。

p "#{ "" }"

=> ruby 1.6.7 (2002-03-01) [i586-linux]
""

=> -:1: warning: bad substitution in string
ruby 1.6.7 (2002-09-12) [i586-linux]
"#{ }"

=> ruby 1.6.7 (2002-09-25) [i586-linux]...
...$; が有効にな
るのは引数省略時だけでした。

$; = ":"
p "a:b:c".split(nil)
=> -:2:in `split': bad separator (ArgumentError)
from -:2
ruby 1.6.7 (2002-03-01) [i586-linux]

=> ruby 1.6.7 (2002-07-30) [i586-linux]
["a", "b", "c"]

: 2002-06...
...gexp.quote("#")

p /a#{Regexp.quote("#")}b/x =~ "ab"

=> -:3: warning: ambiguous first argument; make sure
ruby 1.6.7 (2002-03-01) [i586-linux]
"#"
0

=> -:3: warning: ambiguous first argument; make sure
ruby 1.6.7 (2002-07-30) [i58...

1.6.8から1.8.0への変更点(まとめ) (102.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...い。break が例外になる。

Proc.new {|a,b,c| p [a,b,c]}.call(1,2)
=> -:1: wrong # of arguments (2 for 3) (ArgumentError)
from -:1:in `call'
from -:1
ruby 1.6.8 (2002-12-24) [i586-linux]...
...=> -:1: wrong # of arguments (2 for 3) (ArgumentError)
from -:1:in `call'
from -:1
ruby 1.6.8 (2002-12-24) [i586-linux]
=> -:1: wrong number of arguments (2 for 3) (ArgumentError)
from -:1:in `...
...

# # derived from sample/test.rb
# a = *[]; p a # special case
# def f; yield; end; f {|a| p a} # add (warning)
# def r; return; end; a = r(); p a
# a = nil; p a
# def f; yield nil; end; f {|a| p a}
# def r; return nil; end; a = r(); p a
#...

NEWS for Ruby 2.7.0 (102.0)

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

...ド引数付きで呼び出すとArgumentErrorになります。 14183

//emlist[][ruby]{
def foo(h, **nil); end; foo(key: 1) # ArgumentError
def foo(h, **nil); end; foo(**{key: 1}) # ArgumentError
def foo(h, **nil); end; foo("str" => 1) # ArgumentError
def foo(h, **nil); end; foo({key: 1}...
...oo(**h) # {} and warning
h = {}; def foo(*a) a end; foo(h) # [{}]
h = {}; def foo(a) a end; foo(h) # {}
//}

* 非推奨に関する警告を止めたい場合は、コマンドライン引数に
「-W:no-deprecated」を指定するか、コードの中で
Warning[:deprecated] =...
...ーカル変数名として使えて、ローカル変数が優先されますが、
警告が表示されます。

_1 = 0 #=> warning: `_1' is reserved for numbered parameter; consider another name
[1].each { p _1 } # prints 0 instead of 1

==== ブロックなしの proc/lambda...

NEWS for Ruby 3.0.0 (54.0)

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

...仕様の変更

* Keyword arguments are now separated from positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosp...
...r = proc{|*a, **kw| [a, kw]}

pr.call([1])
# 2.7 => [[1], {}]
# 3.0 => [[[1]], {}]

pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}

* Arguments forwarding (`...`) now supports leading arguments.
16378

//emlist{
def method_missing(meth, ...)
se...
...ally bundled. It is a
type analysis tool for Ruby programs.
* Deprecation warnings are no longer shown by default (since Ruby 2.7.2).
Turn them on with `-W:deprecated` (or with `-w` to show other warnings too).
16345
* `$SAFE` and `$KCODE` are now normal global variables with no...

絞り込み条件を変える

Kernel.#lambda -> Proc (42.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...れたブロック
を手続きオブジェクトとして返します。呼び出し元のメソッドがブロックなし
で呼ばれると ArgumentError 例外が発生します。

ただし、ブロックを指定しない呼び出しは推奨されていません。呼び出し元のメソ...
...warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
ArgumentError
(tried to create Proc object without a block)
が発生します。

ブロックを指定しない proc は、Ruby 2.7 では
$VERBOSE = true のときには警告メッセージ
warning: C...
...iven block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError
(tried to create Proc object without a block)
が発生します。

@raise ArgumentError スタック上にブロックがないのにブロックを省略した呼び出しを行った...

Kernel.#lambda { ... } -> Proc (42.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...れたブロック
を手続きオブジェクトとして返します。呼び出し元のメソッドがブロックなし
で呼ばれると ArgumentError 例外が発生します。

ただし、ブロックを指定しない呼び出しは推奨されていません。呼び出し元のメソ...
...warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
ArgumentError
(tried to create Proc object without a block)
が発生します。

ブロックを指定しない proc は、Ruby 2.7 では
$VERBOSE = true のときには警告メッセージ
warning: C...
...iven block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError
(tried to create Proc object without a block)
が発生します。

@raise ArgumentError スタック上にブロックがないのにブロックを省略した呼び出しを行った...

Kernel.#proc -> Proc (42.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...れたブロック
を手続きオブジェクトとして返します。呼び出し元のメソッドがブロックなし
で呼ばれると ArgumentError 例外が発生します。

ただし、ブロックを指定しない呼び出しは推奨されていません。呼び出し元のメソ...
...warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
ArgumentError
(tried to create Proc object without a block)
が発生します。

ブロックを指定しない proc は、Ruby 2.7 では
$VERBOSE = true のときには警告メッセージ
warning: C...
...iven block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError
(tried to create Proc object without a block)
が発生します。

@raise ArgumentError スタック上にブロックがないのにブロックを省略した呼び出しを行った...

Kernel.#proc { ... } -> Proc (42.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...れたブロック
を手続きオブジェクトとして返します。呼び出し元のメソッドがブロックなし
で呼ばれると ArgumentError 例外が発生します。

ただし、ブロックを指定しない呼び出しは推奨されていません。呼び出し元のメソ...
...warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
ArgumentError
(tried to create Proc object without a block)
が発生します。

ブロックを指定しない proc は、Ruby 2.7 では
$VERBOSE = true のときには警告メッセージ
warning: C...
...iven block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError
(tried to create Proc object without a block)
が発生します。

@raise ArgumentError スタック上にブロックがないのにブロックを省略した呼び出しを行った...

ruby 1.8.4 feature (42.0)

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

...-:2: syntax error, unexpected tSTRING_CONTENT
alias :"foo" :"bar"
^
-:2: warning: unused literal ignored
# => ruby 1.9.0 (2005-12-10) [i686-linux]
"bar"


2) Symbol#inspect sometimes return...
...object (0xb7e06970) (NotImplementedError)
from -:7
# => ruby 1.8.4 (2005-12-22) [i686-linux]
-:3:in `foo'-:3: warning: too many arguments for format string
: super: no superclass method `foo' (NoMethodError)
from -:7

: 正規表現 [...
....4 (2005-12-01) [i686-linux]

# ArgumentError
printf("%2147483648$d\n") # -e:1:in `printf': invalid index - -2147483648$ (ArgumentError)
printf("%2147483649$d\n") # -e:1:in `printf': invalid index - -2147483647$ (ArgumentError)
printf("%4294967296$d\n")...

絞り込み条件を変える

Kernel.#lambda -> Proc (36.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...れたブロック
を手続きオブジェクトとして返します。呼び出し元のメソッドがブロックなし
で呼ばれると ArgumentError 例外が発生します。

ただし、ブロックを指定しない呼び出しは推奨されていません。呼び出し元のメソ...
...warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
ArgumentError
(tried to create Proc object without a block)
が発生します。

ブロックを指定しない proc は、Ruby 2.7 では
$VERBOSE = true のときには警告メッセージ
warning: C...
...iven block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError
(tried to create Proc object without a block)
が発生します。

@raise ArgumentError スタック上にブロックがないのにブロックを省略した呼び出しを行った...

Kernel.#lambda { ... } -> Proc (36.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...れたブロック
を手続きオブジェクトとして返します。呼び出し元のメソッドがブロックなし
で呼ばれると ArgumentError 例外が発生します。

ただし、ブロックを指定しない呼び出しは推奨されていません。呼び出し元のメソ...
...warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
ArgumentError
(tried to create Proc object without a block)
が発生します。

ブロックを指定しない proc は、Ruby 2.7 では
$VERBOSE = true のときには警告メッセージ
warning: C...
...iven block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError
(tried to create Proc object without a block)
が発生します。

@raise ArgumentError スタック上にブロックがないのにブロックを省略した呼び出しを行った...

Kernel.#proc -> Proc (36.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...れたブロック
を手続きオブジェクトとして返します。呼び出し元のメソッドがブロックなし
で呼ばれると ArgumentError 例外が発生します。

ただし、ブロックを指定しない呼び出しは推奨されていません。呼び出し元のメソ...
...warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
ArgumentError
(tried to create Proc object without a block)
が発生します。

ブロックを指定しない proc は、Ruby 2.7 では
$VERBOSE = true のときには警告メッセージ
warning: C...
...iven block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError
(tried to create Proc object without a block)
が発生します。

@raise ArgumentError スタック上にブロックがないのにブロックを省略した呼び出しを行った...

Kernel.#proc { ... } -> Proc (36.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...れたブロック
を手続きオブジェクトとして返します。呼び出し元のメソッドがブロックなし
で呼ばれると ArgumentError 例外が発生します。

ただし、ブロックを指定しない呼び出しは推奨されていません。呼び出し元のメソ...
...warning: tried to create Proc object without a block」
が出力され、Ruby 2.7 では
ArgumentError
(tried to create Proc object without a block)
が発生します。

ブロックを指定しない proc は、Ruby 2.7 では
$VERBOSE = true のときには警告メッセージ
warning: C...
...iven block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError
(tried to create Proc object without a block)
が発生します。

@raise ArgumentError スタック上にブロックがないのにブロックを省略した呼び出しを行った...

Proc.new -> Proc (30.0)

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

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

ブロック...
...。呼び出し元のメソッドで指定されたブロック
を得たい場合は明示的に & 引数でうけるべきです。

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

//emlist[例][ruby]...
...出し元のメソッドがブロックを伴わなければ、例外
ArgumentError
が発生します。

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

Proc...

絞り込み条件を変える

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

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

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

ブロック...
...。呼び出し元のメソッドで指定されたブロック
を得たい場合は明示的に & 引数でうけるべきです。

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

//emlist[例][ruby]...
...出し元のメソッドがブロックを伴わなければ、例外
ArgumentError
が発生します。

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

Proc...

Kernel.#lambda { ... } -> Proc (18.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...あります。

& 引数を渡した lambda は Warning[:deprecated] = true のときに警告メッセージ
warning: lambda without a literal block is deprecated; use the proc without lambda instead」
を出力します。

@raise ArgumentError ブロックを省略した呼び出しを行っ...

Kernel.#proc { ... } -> Proc (18.0)

与えられたブロックから手続きオブジェクト (Proc のインスタンス) を生成して返します。Proc.new に近い働きをします。

...あります。

& 引数を渡した lambda は Warning[:deprecated] = true のときに警告メッセージ
warning: lambda without a literal block is deprecated; use the proc without lambda instead」
を出力します。

@raise ArgumentError ブロックを省略した呼び出しを行っ...
<< 1 2 > >>