Skip to content

Commit

Permalink
Merge pull request #704 from BrianHawley/fixes_703
Browse files Browse the repository at this point in the history
Move deprecation_warning to lib/thor/base.rb
  • Loading branch information
rafaelfranca committed Dec 17, 2019
2 parents bbf5040 + a5cbed8 commit d994c27
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 0 additions & 7 deletions lib/thor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,6 @@ 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
9 changes: 9 additions & 0 deletions lib/thor/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ class Thor

TEMPLATE_EXTNAME = ".tt"

class << self
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
end

module Base
attr_accessor :options, :parent_options, :args

Expand Down

0 comments on commit d994c27

Please sign in to comment.