Skip to content

Commit

Permalink
Add Thor.deprecation_warning
Browse files Browse the repository at this point in the history
This reverts commit a88ea56792c9a40d803f025ffcb63e8ae35bf5ff.
  • Loading branch information
marcandre committed Oct 2, 2018
1 parent 57fe753 commit b2b1e7a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/thor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b2b1e7a

Please sign in to comment.