summaryrefslogtreecommitdiff
path: root/lib/tempfile.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-23 15:56:33 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-23 15:56:33 +0000
commitc5485f41ea6a5b5691164924842250fcf893f770 (patch)
tree1c5a7d8c42ff55f628e8c4787fb8d7dde2249b9a /lib/tempfile.rb
parentdc42e8bbe89fe194805a1371276edaf83ec069c2 (diff)
* 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
Diffstat (limited to 'lib/tempfile.rb')
-rw-r--r--lib/tempfile.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index a8f22c8..3321116 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)