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
RDoc doesn't understand an asterisk inside the plus markers. Moving them
out of the markers looks better.
[Fix GH-1716]
From: Herwin Weststrate <herwinw@herwinw.nl>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/tempfile.rb (Tempfile.create): should not fail even if the
temporary file has been removed in the block, just ignore.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/tempfile.rb (Tempfile#size): Fix its behavior when nothing
is written. Tempfile#size should return 0 in this case.
The patch is from nobu <nobu@ruby-lang.org>.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/tempfile.rb (Tempfile#initialize): [DOC] the first parameter
`basename` is optional and defaulted to an empty string since
[GH-523]. [Fix GH-1225]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
When you change this to true, you may need to add more tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
test failures introduced at r50682. I hope that check the results of
tests before committing, at least the tests about the changed feature.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use warn instead of STDERR.print
* remove @tmpname and use @tmpfile.path
* introduce @unlinked flag
* Remover takes only @tmpfile
* mode will be modified just before file reopen
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/tempfile.rb: start rdoc parsing inside singleton class
definition to include the document there.
[ruby-core:64157] [Bug #10105]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/tempfile.rb (Tempfile#initialize): use class method to get rid
of warnings when $VERBOSE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/tempfile.rb (Tempfile#unlink): finalizer is no longer needed
after unlinking. patched by by normalperson (Eric Wong) at
[ruby-core:56521] [Bug #8768]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
The method name is proposed by Shugo Maeda. [ruby-dev:47220]
[ruby-core:41478] [Feature #5707]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
previous Tempfile#inspect says it is a File, but actually
it is not a File.
t = Tempfile.new("foo") #=> #<File:/tmp/foo20121106-31970-1ffbum0>
t.is_a? File #=> false
now Tempfile#inspect returns like:
t = Tempfile.new("foo")
#=> #<Tempfile:/tmp/foo20121106-31970-1ffbum0>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
call File.unlink and ignore ENOENT because existence check
before unlinking does not help in terms of race condition.
* lib/tempfile.rb (Tempfile#unlink, Tempfile::Remover#call): My
comment about thread safeness is obsolete.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
when an exception is raised at @tempfile.close. [ruby-dev:45113]
* lib/tempfile.rb (Tempfile#unlink): fix a typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
environment variables. based on a patch from funny-falcon at
https://gist.github.com/856296, but honors safe level.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
@data caused double closing error of the same IO in finalizer. a
patch from Simon Nicholls. [ruby-core:29395]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e