mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
use warn() instead of $stderr.puts().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
03f8ef900a
commit
fd2f7ab576
3 changed files with 11 additions and 9 deletions
12
lib/date.rb
12
lib/date.rb
|
@ -532,9 +532,9 @@ class Date
|
|||
module_eval <<-"end;"
|
||||
def self.#{old}(*args, &block)
|
||||
if $VERBOSE
|
||||
$deferr.puts("\#{caller.shift.sub(/:in .*/, '')}: " \
|
||||
"warning: \#{self}::#{old} is deprecated; " \
|
||||
"use \#{self}::#{new}")
|
||||
warn("\#{caller.shift.sub(/:in .*/, '')}: " \
|
||||
"warning: \#{self}::#{old} is deprecated; " \
|
||||
"use \#{self}::#{new}")
|
||||
end
|
||||
#{new}(*args, &block)
|
||||
end
|
||||
|
@ -549,9 +549,9 @@ class Date
|
|||
module_eval <<-"end;"
|
||||
def #{old}(*args, &block)
|
||||
if $VERBOSE
|
||||
$deferr.puts("\#{caller.shift.sub(/:in .*/, '')}: " \
|
||||
"warning: \#{self.class}\##{old} is deprecated; " \
|
||||
"use \#{self.class}\##{new}")
|
||||
warn("\#{caller.shift.sub(/:in .*/, '')}: " \
|
||||
"warning: \#{self.class}\##{old} is deprecated; " \
|
||||
"use \#{self.class}\##{new}")
|
||||
end
|
||||
#{new}(*args, &block)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue