るりまサーチ

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

別のキーワード

  1. kernel spawn
  2. kernel exec
  3. kernel system
  4. kernel open
  5. kernel fail

ライブラリ

モジュール

検索結果

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

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

... Warning.[] を参照してください。
@raise IOError 標準エラー出力が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX 出力に失敗した場合に発生します。

//emlist[例][ruby]{
warn
"caution!" #=> caution!
$VERBOSE = nil
warn
"c...
...el の例][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
//}

//emlist[category の例][ruby]{
Warn
ing[:deprecated] = true #...
...非推奨の警告を表示する
warn
("deprecated!!", category: :deprecated)
# => deprecated!

Warn
ing[:deprecated] = false # 非推奨の警告を表示しない
warn
("deprecated!!", category: :deprecated)
# 警告は出力されない
//}

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

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

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

...[例][ruby]{
warn
"caution!" #=> caution!
$VERBOSE = 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 messa...
...ge", uplevel: 2) # => test message
end
foo
//}


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

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

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

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

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



@see $stderr,$VERBOSE...
...ラー出力が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX 出力に失敗した場合に発生します。

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



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

Warning#warn(message) -> nil (21137.0)

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

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

Kernel
.#warnの挙動を変更する際は、このメソッドではなくクラスメソッドであるWarning.warnをオーバーライドする必要があります。

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

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


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

Warning#warn(message, category: nil) -> nil (21137.0)

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

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

Kernel
.#warnの挙動を変更する際は、このメソッドではなくクラスメソッドであるWarning.warnをオーバーライドする必要があります。

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

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


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

絞り込み条件を変える

Warning.warn(message) -> nil (21137.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...

Warning.warn(message, category: nil) -> nil (21131.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...

Kernel$$stderr -> object (21012.0)

標準エラー出力です。

...標準エラー出力です。

Ruby インタプリタが出力するエラーメッセージや
警告メッセージ、Kernel.#warn の出力先となります。
初期値は Object::STDERR です。

$stderr に代入するオブジェクトには
write という名前のメソッドが定義...

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

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

...log.emerg(message, *arg) は、Syslog.log(Syslog::LOG_EMERG, message, *arg)
と同じです。

@param message フォーマット文字列です。Kernel.#sprintf と同じ形式の引数を指定します。

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

@raise ArgumentError 引数が1つ...

NEWS for Ruby 2.0.0 (96.0)

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

...ts

* Kernel
* 追加: Kernel.#Hash という変換メソッド。Kernel.#Array, Kernel.#Float に似ています
* 追加: Kernel.#__dir__ 現在のソースファイル(__FILE__)のあるディレクトリ名を正規化された絶対パ スで返します。
* 追加: Kernel.#calle...
...r_locations フレーム情報の配列を返します
* 拡張: Kernel.#warn Kernel.#puts のように複数の引数を受け付けるようになりました
* 拡張: Kernel.#caller 第2引数で取得するスタックのサイズを指定できるようになりました
* 拡張:...
...Object#to_enum Object#enum_for サイズの遅延評価のためにブロックを受け取るようになりました
* 非互換: Kernel.#system, Kernel.#exec は非標準のファイルディスクリプタを閉じます
:close_others オプションのデフォルト値を true に変...

絞り込み条件を変える

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...
...pr = 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, ...)...
...wait(io, events, timeout)` in a non-blocking execution context. 16786
* Kernel
* Kernel#clone when called with the `freeze: false` keyword will call `#initialize_clone` with the `freeze: false` keyword. 14266
* Kernel#clone when called with the `freeze: true` keyword will call `#initialize...

NEWS for Ruby 2.5.0 (42.0)

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

...nybits?, Integer#nobits? を追加 12753
* Integer.sqrt を追加 13219

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

* Method...
...がマルチユーザーセーフである場合のみ。12921

* open-uri
* URI.open を open-uri の Kernel.open の別名として追加しました。
将来 open-uri の Kernel.open は非推奨になります。

* openssl
* Ruby/OpenSSLのバージョンを2.0から2.1に更...
...* WEBrick::HTTPResponse#send_body_proc を追加 855
* RubyGem としてリリース 13173
* 意図しない振舞いを避けるため Kernel.#open を使用するのをやめました 14216

* zlib
* Zlib::GzipWriter#write は複数の引数を受け取れるようになりまし...

Ruby用語集 (42.0)

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

...る時点において、そこに至るメソッド呼び出し元情報を遡るデータ。
バックトレースともいう。

Kernel
.#caller_locations、Kernel.#caller で現時点までの
スタックトレースを得ることができる。

また、例外オブジェクトは例...
...脱出
: non-local exit
Ruby においては、例外の発生もしくは Kernel.#throw によって
処理の実行が中断されること。
例外の場合は begin/rescue によって、throw の場合は
Kernel
.#catch によって捕捉されるまで、制御構造やメソッド...
...るかどうかを指定するもの(frozen_string_literal)、
インデント不整合の警告を出すかどうかを指定するもの(warn_indent)
がある。

参照:d:spec/m17n#magic_comment

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

NEWS for Ruby 2.4.0 (18.0)

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

...IO#each_line, IO#readlines, IO.foreach は
chomp というキーワード引数を受け付けるようになりました。12553

* Kernel
* Kernel#clone は freeze というキーワード引数を受け付けるようになりました。
12300

* MatchData
* MatchData#nam...
...n_exception を追加 6647

* TracePoint
* TracePoint#callee_id を追加 12747

* Warning
* Warningという名前のモジュールを導入しました。
デフォルトでは Warning.#warn という特異メソッドだけ定義されているモジュールです。
...