From b2b1e7aedf721ff069292f909acccb01d9a1d858 Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune Date: Tue, 2 Oct 2018 16:52:48 -0400 Subject: [PATCH] Add Thor.deprecation_warning This reverts commit a88ea56792c9a40d803f025ffcb63e8ae35bf5ff. --- lib/thor.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/thor.rb b/lib/thor.rb index 1409623b3..f004981ce 100644 --- a/lib/thor.rb +++ b/lib/thor.rb @@ -339,6 +339,13 @@ def disable_required_check?(command) #:nodoc: command && disable_required_check.include?(command.name.to_sym) end + def deprecation_warning(message) #:nodoc: + unless ENV['THOR_SILENCE_DEPRECATION'] + warn "Deprecation warning: #{message}\n" + + 'You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.' + end + end + protected def stop_on_unknown_option #:nodoc: