1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/lib
shyouhei f2a91397fd Add uplevel keyword to Kernel#warn and use it
If uplevel keyword is given, the warning message is prepended
with caller file and line information and the string "warning: ".
The use of the uplevel keyword makes Kernel#warn format output
similar to how rb_warn formats output.

This patch modifies net/ftp and net/imap to use Kernel#warn
instead of $stderr.puts or $stderr.printf, since they are used
for printing warnings.

This makes lib/cgi/core and tempfile use $stderr.puts instead of
warn for debug logging, since they are used for debug printing
and not for warning.

This does not modify bundler, rubygems, or rdoc, as those are
maintained outside of ruby and probably wish to remain backwards
compatible with older ruby versions.

rb_warn_m code is originally from nobu, but I've changed it
so that it only includes the path and lineno from uplevel
(not the method), and also prepends the string "warning: ",
to make it more similar to rb_warn.

From: Jeremy Evans code@jeremyevans.net
Signed-off-by: Urabe Shyouhei shyouhei@ruby-lang.org


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12 11:56:25 +00:00
..
bundler Merge 1-16-stable branch of bundler. 2017-12-12 06:15:44 +00:00
cgi Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
drb Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
forwardable
irb Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
matrix
net Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
optparse
racc
rdoc
rexml Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
rinda
rss Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
rubygems
shell
unicode_normalize
uri Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
webrick Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
yaml
.document Ignore gemspec under the lib directory for documentation. 2017-12-12 08:34:13 +00:00
abbrev.rb
base64.rb
benchmark.rb
bundler.gemspec Merge 1-16-stable branch of bundler. 2017-12-12 06:15:44 +00:00
bundler.rb
cgi.rb
cmath.gemspec
cmath.rb Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
csv.gemspec
csv.rb
debug.rb
delegate.rb Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
drb.rb
e2mmap.rb
English.rb
erb.rb
fileutils.gemspec Bump version to fileutils-1.0.1. 2017-12-12 10:57:58 +00:00
fileutils.rb
find.rb
forwardable.rb Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
getoptlong.rb
ipaddr.gemspec
ipaddr.rb Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
irb.rb irb.rb: preserve ARGV on binding.irb 2017-12-12 11:25:16 +00:00
logger.rb
matrix.rb Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
mkmf.rb
monitor.rb
mutex_m.rb
observer.rb
open-uri.rb
open3.rb
optionparser.rb
optparse.rb
ostruct.rb Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
pp.rb lib/pp.rb: remove alias for suppressing a redefinition warning. 2017-12-11 04:46:57 +00:00
prettyprint.rb
prime.rb
profile.rb
profiler.rb
pstore.rb
rdoc.rb
resolv-replace.rb
resolv.rb
rss.rb
rubygems.rb
scanf.gemspec Bump version to scanf-1.0.0 as default gems. 2017-12-11 08:18:01 +00:00
scanf.rb
securerandom.rb
set.rb
shell.rb
shellwords.rb
singleton.rb
sync.rb
tempfile.rb Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
thwait.rb
time.rb
timeout.rb Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
tmpdir.rb
tracer.rb
tsort.rb
un.rb
uri.rb
weakref.rb
webrick.rb
yaml.rb Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00