From c5485f41ea6a5b5691164924842250fcf893f770 Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 23 Dec 2011 15:56:33 +0000 Subject: * lib/tempfile.rb (Tempfile#initialize): warn if a block is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/tempfile.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/tempfile.rb b/lib/tempfile.rb index a8f22c8eb6..3321116792 100644 --- a/lib/tempfile.rb +++ b/lib/tempfile.rb @@ -126,6 +126,9 @@ class Tempfile < DelegateClass(File) # If Tempfile.new cannot find a unique filename within a limited # number of tries, then it will raise an exception. def initialize(basename, *rest) + if block_given? + warn "Tempfile.new doesn't call the given block." + end @data = [] @clean_proc = Remover.new(@data) ObjectSpace.define_finalizer(self, @clean_proc) -- cgit v1.2.3