Skip to content

Commit b2b1e7a

Browse files
committed
Add Thor.deprecation_warning
This reverts commit a88ea56792c9a40d803f025ffcb63e8ae35bf5ff.
1 parent 57fe753 commit b2b1e7a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/thor.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,13 @@ def disable_required_check?(command) #:nodoc:
339339
command && disable_required_check.include?(command.name.to_sym)
340340
end
341341

342+
def deprecation_warning(message) #:nodoc:
343+
unless ENV['THOR_SILENCE_DEPRECATION']
344+
warn "Deprecation warning: #{message}\n" +
345+
'You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.'
346+
end
347+
end
348+
342349
protected
343350

344351
def stop_on_unknown_option #:nodoc:

0 commit comments

Comments
 (0)