別のキーワード
ライブラリ
- ビルトイン (40)
- psych (14)
-
rubygems
/ installer (48)
クラス
-
Gem
:: Installer (48) - Proc (14)
- Struct (4)
キーワード
- [] (7)
- []= (6)
- categories (1)
-
home
_ install _ warning (12) -
home
_ install _ warning= (12) - new (17)
-
path
_ warning (12) -
path
_ warning= (12) -
safe
_ load (14) - warn (9)
検索結果
先頭5件
-
Warning
. warn(message , category: nil) -> nil (9031.0) -
引数 message を標準エラー出力 $stderr に出力します。
...t[][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
. []=(category , flag) -> flag (9023.0) -
category の警告を表示するかどうかのフラグを設定します。 サポートされている category については Warning.[] を参照してください。
...category の警告を表示するかどうかのフラグを設定します。
サポートされている category については Warning.[] を参照してください。
@param category 警告の種類を指定します。
@param flag 真、または偽を指定します。
@see Warning.[]... -
Warning
. warn(message) -> nil (9019.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
. categories -> Array (9007.0) -
警告カテゴリの一覧を返します。
...警告カテゴリの一覧を返します。
//emlist[][ruby]{
Warning.categories # => [:deprecated, :experimental, :performance, :strict_unused_block]
//}... -
Warning
. [](category) -> bool (9001.0) -
category の種類の警告を表示するかどうかのフラグを返します。
@param category 警告の種類を指定します。
サポートされている category は以下の通りです。
: :deprecated
非推奨の警告。
例: nil ではない値を $, や $; に設定する、キーワード引数、ブロックなしで proc / lambda を呼び出す、等
: :experimental
実験的な機能。
例: パターンマッチングcategory の種類の警告を表示するかどうかのフラグを返します。
@param category 警告の種類を指定します。
サポートされている category は以下の通りです。
: :deprecated
非推奨の警告。
例: nil ではない値を $, や $; に設定する、キーワード引数、ブロックなしで proc / lambda を呼び出す、等
: :experimental
実験的な機能。
例: パターンマッチング
: :performance
パフォーマンスに関する警告。 -
Gem
:: Installer . home _ install _ warning -> bool (6102.0) -
この値が真の場合、ホームディレクトリに Gem をインストールしようとすると警告を表示します。
この値が真の場合、ホームディレクトリに Gem をインストールしようとすると警告を表示します。 -
Gem
:: Installer . home _ install _ warning=(flag) (6102.0) -
ホームディレクトリに Gem をインストールしようとすると警告を表示するかどうかセットします。
ホームディレクトリに Gem をインストールしようとすると警告を表示するかどうかセットします。
@param flag 真を指定するとホームディレクトリに Gem をインストールしよう
とすると警告を表示するようになります。 -
Gem
:: Installer . path _ warning -> bool (6102.0) -
この値が 真の場合は Gem.bindir が PATH に含まれていない場合に警告を表示します。
この値が 真の場合は Gem.bindir が PATH に含まれていない場合に警告を表示します。 -
Gem
:: Installer . path _ warning=(flag) (6102.0) -
Gem.bindir が PATH に含まれていない場合に警告を表示するかどうかセットします。
Gem.bindir が PATH に含まれていない場合に警告を表示するかどうかセットします。
@param flag 真を指定すると、Gem.bindir が PATH に含まれていない場合に警
告を表示するようになります。 -
Proc
. new -> Proc (7.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
. new { . . . } -> Proc (7.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... -
Psych
. safe _ load(yaml , legacy _ permitted _ classes=[] , legacy _ permitted _ symbols=[] , legacy _ aliases=false , legacy _ filename=nil) -> object (7.0) -
安全に YAML フォーマットの文書を読み込み Ruby のオブジェクトを生成して返します。
...$-w が true の時にオプション引数を渡すと警告が出力されます。
//emlist[オプション引数を使用した例][ruby]{
# warning: Passing permitted_classes with the 2nd argument of Psych.safe_load is deprecated. Use keyword argument like Psych.safe_load(yaml, permitted_clas... -
Psych
. safe _ load(yaml , permitted _ classes: [] , permitted _ symbols: [] , aliases: false , filename: nil , fallback: nil , symbolize _ names: false) -> object (7.0) -
安全に YAML フォーマットの文書を読み込み Ruby のオブジェクトを生成して返します。
...$-w が true の時にオプション引数を渡すと警告が出力されます。
//emlist[オプション引数を使用した例][ruby]{
# warning: Passing permitted_classes with the 2nd argument of Psych.safe_load is deprecated. Use keyword argument like Psych.safe_load(yaml, permitted_clas... -
Psych
. safe _ load(yaml , permitted _ classes: [] , permitted _ symbols: [] , aliases: false , filename: nil , fallback: nil , symbolize _ names: false , freeze: false) -> object (7.0) -
安全に YAML フォーマットの文書を読み込み Ruby のオブジェクトを生成して返します。
...$-w が true の時にオプション引数を渡すと警告が出力されます。
//emlist[オプション引数を使用した例][ruby]{
# warning: Passing permitted_classes with the 2nd argument of Psych.safe_load is deprecated. Use keyword argument like Psych.safe_load(yaml, permitted_clas... -
Struct
. new(*args , keyword _ init: nil) -> Class (7.0) -
Struct クラスに新しいサブクラスを作って、それを返します。
...告が出る例][ruby]{
Point = Struct.new(:x, :y)
Point.new(x: 1, y: 2) # => #<struct Point x={:x=>1, :y=>2}, y=nil>
# warning: Passing only keyword arguments to Struct#initialize will behave differently from Ruby 3.2. Please use a Hash literal like .new({k: v}) instead of... -
Struct
. new(*args , keyword _ init: nil) {|subclass| block } -> Class (7.0) -
Struct クラスに新しいサブクラスを作って、それを返します。
...告が出る例][ruby]{
Point = Struct.new(:x, :y)
Point.new(x: 1, y: 2) # => #<struct Point x={:x=>1, :y=>2}, y=nil>
# warning: Passing only keyword arguments to Struct#initialize will behave differently from Ruby 3.2. Please use a Hash literal like .new({k: v}) instead of...