Skip to content

Commit d994c27

Browse files
authored
Merge pull request #704 from BrianHawley/fixes_703
Move deprecation_warning to lib/thor/base.rb
2 parents bbf5040 + a5cbed8 commit d994c27

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

lib/thor.rb

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

347-
def deprecation_warning(message) #:nodoc:
348-
unless ENV['THOR_SILENCE_DEPRECATION']
349-
warn "Deprecation warning: #{message}\n" +
350-
'You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.'
351-
end
352-
end
353-
354347
protected
355348

356349
def stop_on_unknown_option #:nodoc:

lib/thor/base.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ class Thor
2222

2323
TEMPLATE_EXTNAME = ".tt"
2424

25+
class << self
26+
def deprecation_warning(message) #:nodoc:
27+
unless ENV['THOR_SILENCE_DEPRECATION']
28+
warn "Deprecation warning: #{message}\n" +
29+
'You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.'
30+
end
31+
end
32+
end
33+
2534
module Base
2635
attr_accessor :options, :parent_options, :args
2736

0 commit comments

Comments
 (0)