るりまサーチ

最速Rubyリファレンスマニュアル検索!
48件ヒット [1-48件を表示] (0.046秒)
トップページ > クエリ:nil[x] > クエリ:end[x] > クエリ:warn[x]

別のキーワード

  1. _builtin nil?
  2. nilclass nil?
  3. object nil?
  4. _builtin nil
  5. object nil

検索結果

Warning.warn(message, category: nil) -> nil (21345.0)

引数 message を標準エラー出力 $stderr に出力します。

...st[][ruby]{
module Warning
# 警告メッセージに category を表示し、message 末尾に !!! を追加する
def self.warn(message, category: nil)
super("#{category} warning : #{message.chomp}!!!\n")
end

end


warn
("hoge", category: :deprecated)
# => deprecated warning : hoge!!!
//}...
...@param message 出力するオブジェクトを指定します。

@param category 警告のカテゴリを指定します。サポートされている category については Warning.[] を参照してください。

@see Kernel.#warn, Warning#warn...

Warning.warn(message) -> nil (21244.0)

引数 message を標準エラー出力 $stderr に出力します。

...ある $stderr への出力ができます。

//emlist[][ruby]{
warn
"hoge" # => hoge

module Warning
# 警告メッセージの末尾に !!! を追加する
def self.warn(message)
super(message.chomp + "!!!\n")
end

end


warn
"hoge" # => hoge!!!
//}

@param message 出力するオブジ...
...ェクトを指定します。

@param category 警告のカテゴリを指定します。サポートされている category については Warning.[] を参照してください。

@see Kernel.#warn, Warning#warn...

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

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

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

文字列以外のオブジェクトが引数として与えられた場合には、
to_s メソッドにより文字列に変換してから出力します。

upleve...
...名と行番号を表示するかを0以上の数値で指定します。 nil の場合は表示しません。
@param category 警告のカテゴリを指定します。サポートされている category については Warning.[] を参照してください。
@raise IOError 標準エラー出...
...RBOSE = nil
warn
"caution!" # 何もしない
//}

//emlist[uplevel の例][ruby]{
def foo
warn
("test message", uplevel: 0) # => test.rb:2: warning: test message
warn
("test message", uplevel: 1) # => test.rb:6: warning: test message
warn
("test message", uplevel: 2) # => test message
end

foo
//...

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

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

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

文字列以外のオブジェクトが引数として与えられた場合には、
to_s メソッドにより文字列に変換してから出力します。

upleve...
...す。 nil の場合は表示しません。
@raise IOError 標準エラー出力が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX 出力に失敗した場合に発生します。

//emlist[例][ruby]{
warn
"caution!" #=> caution!
$VERBOSE = nil
warn
"cau...
...
//}

//emlist[uplevel の例][ruby]{
def foo
warn
("test message", uplevel: 0) # => test.rb:2: warning: test message
warn
("test message", uplevel: 1) # => test.rb:6: warning: test message
warn
("test message", uplevel: 2) # => test message
end

foo
//}


@see Warning#warn, $stderr,$VERBOSE...

1.6.8から1.8.0への変更点(まとめ) (1242.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への変更点(まとめ)/サポートプラットフォームの追加>))

...りました。
* nil: 警告を出力しない (-W0 新しい警告レベル)
* false: 重要な警告のみ出力 (-W1 デフォルト)
* true: すべての警告を出力する (-W2 or -W or -v or -w or --verbose)

追加された -W オプションは $VERBOSE = nil の指定(-W0)を...
...よくわかりません(^^;

class << Object
p [self.id, self]
class << self
p [self.id, self]
end

end

=> ruby 1.6.7 (2002-03-01) [i586-linux]
[537771634, Class]
[537742484, Class]
=> ruby 1.7.3 (2002-09...
...se
# 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
# a = 1; p a
# def f; yield 1; end; f {|a| p a}
# def r; return 1; end; a = r(); p a
#...

絞り込み条件を変える

NEWS for Ruby 2.5.0 (78.0)

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

...547
* do/end ブロック内部で rescue/else/ensure を書けるようになりました 12906
* 文字列の式展開内部の暗黙の to_s 呼び出しにも refinements が影響するようになりました 13812

=== 組み込みクラスの更新

* Array
* Array#append を追加...
...13219

* Kernel
* Object#yield_self を追加 6721
* Kernel.#pp をrequireなしで使えるようにしました 14123
* Kernel.#warn :uplevel というキーワード引数を追加しました 12882

* Method
* Method#=== は Proc#===と同じようにMethod#callを呼び...
...7688
* 数値の比較メソッド(<,<=,>=,>)は、coerceメソッドで発生した例外を隠蔽しなくなりました。
coerceがnilを返す場合、変換は不可能です。7688

* Process
* getrusage(2) が存在する場合 Process.#times の精度を改良しまし...

NEWS for Ruby 3.0.0 (72.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 lo...
....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, ...)
send(:"do_#{meth}", ...)
end

//}

* Pattern matching (`case/in`) is no longer experi...
...da's arity check.
* When writing to STDOUT redirected to a closed pipe, no broken pipe error message will be shown now. 14413
* `TRUE`/`FALSE`/`NIL` constants are no longer defined.
* Integer#zero? overrides Numeric#zero? for optimization. 16961
* Enumerable#grep and Enumerable#grep_v when...

Ruby用語集 (66.0)

Ruby用語集 A B C D E F G I J M N O R S Y

...た静的型付け言語であり、処理系はコンパイラーである。

https://ja.crystal-lang.org/

: CSI 方式
CSI は Code Set Independent の頭字語。
プログラミング言語の処理系が文字列を扱う際のエンコーディングに関する方針の一つ。
...
...持つ。

https://mruby.org/

: main
トップレベルにおける self。Object クラスのインスタンスである。

===[a:N] N

: nil
Nil
Class の唯一のインスタンス。また、そのオブジェクトを指す擬似変数の名前。
論理値としては偽である。...
...るかどうかを指定するもの(frozen_string_literal)、
インデント不整合の警告を出すかどうかを指定するもの(warn_indent)
がある。

参照:d:spec/m17n#magic_comment

: ミックスイン
: mix-in
モジュールやクラスに対し、他のモジ...