Module: JpPrefecture::Deprecation

Defined in:
lib/jp_prefecture/deprecation.rb

Overview

非推奨機能の告知

Constant Summary collapse

PREFIX =
'[jp_prefecture] DEPRECATION WARNING:'

Class Method Summary collapse

Class Method Details

.warn(message) ⇒ void

This method returns an undefined value.

非推奨の警告を標準エラー出力に出す

Kernel#warn は $VERBOSE が nil のとき (ruby -W0, RUBYOPT=-W0) 何も出力しない。 破壊的変更の告知が届かなくなるため $stderr へ直接書き出す

Parameters:

  • message (String)

    警告の本文



15
16
17
# File 'lib/jp_prefecture/deprecation.rb', line 15

def self.warn(message)
  $stderr.puts "#{PREFIX} #{message}" # rubocop:disable Style/StderrPuts
end