1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test
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
..
-ext- Add FrozenError as a subclass of RuntimeError 2017-12-12 00:46:34 +00:00
base64
benchmark
bigdecimal
cgi
coverage ext/coverage/coverage.c: remove COVERAGE_EXPERIMENTAL_MODE 2017-12-12 00:20:58 +00:00
csv
date Add FrozenError as a subclass of RuntimeError 2017-12-12 00:46:34 +00:00
dbm Add FrozenError as a subclass of RuntimeError 2017-12-12 00:46:34 +00:00
digest
drb
dtrace
erb fix test_erb.rb [GH-1763] 2017-11-21 05:01:28 +00:00
etc
excludes
fiddle
fileutils
gdbm Add FrozenError as a subclass of RuntimeError 2017-12-12 00:46:34 +00:00
io
irb irb.rb: preserve ARGV on binding.irb 2017-12-12 11:25:16 +00:00
json
lib Ignore failures related to threading. 2017-11-27 02:11:36 +00:00
logger revert r60999 2017-12-04 00:23:31 +00:00
matrix lib/matrix: Add hadamard_product/entrywise_product. 2017-11-20 02:18:43 +00:00
minitest
misc
mkmf
monitor
net remove unnecessary read_timeout. 2017-12-06 23:56:04 +00:00
nkf
objspace
open-uri
openssl openssl: sync with 2475d94517b4 2017-11-26 10:33:32 +00:00
optparse
ostruct
pathname Add FrozenError as a subclass of RuntimeError 2017-12-12 00:46:34 +00:00
psych Merge psych-3.0.0. 2017-12-01 01:52:26 +00:00
rdoc Merge rdoc-6.0.0.beta4 from upstream. 2017-11-27 10:45:24 +00:00
readline
resolv
rexml
rinda
ripper parse.y: refactor list literals 2017-11-24 04:26:27 +00:00
rss
ruby Add uplevel keyword to Kernel#warn and use it 2017-12-12 11:56:25 +00:00
rubygems Merge rubygems-2.7.3. 2017-11-28 22:30:28 +00:00
scanf
sdbm
shell
socket
stringio Add FrozenError as a subclass of RuntimeError 2017-12-12 00:46:34 +00:00
strscan strscan.c: add MatchData-like methods 2017-11-29 07:57:48 +00:00
syslog
testunit
thread
uri Append "//" if empty host for file or postgres URI 2017-12-01 15:09:41 +00:00
webrick
win32ole
yaml
zlib
colors
runner.rb
test_abbrev.rb
test_cmath.rb
test_delegate.rb Add FrozenError as a subclass of RuntimeError 2017-12-12 00:46:34 +00:00
test_extlibs.rb
test_find.rb
test_forwardable.rb
test_ipaddr.rb
test_mutex_m.rb
test_observer.rb
test_open3.rb
test_pp.rb
test_prettyprint.rb
test_prime.rb
test_pstore.rb
test_pty.rb
test_rbconfig.rb
test_securerandom.rb
test_set.rb Add FrozenError as a subclass of RuntimeError 2017-12-12 00:46:34 +00:00
test_shellwords.rb
test_singleton.rb
test_syslog.rb
test_tempfile.rb
test_time.rb
test_timeout.rb
test_tmpdir.rb
test_tracer.rb
test_tsort.rb
test_unicode_normalize.rb
test_weakref.rb
test_win32api.rb