diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-23 15:56:33 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-23 15:56:33 +0000 |
commit | c5485f41ea6a5b5691164924842250fcf893f770 (patch) | |
tree | 1c5a7d8c42ff55f628e8c4787fb8d7dde2249b9a /lib/tempfile.rb | |
parent | dc42e8bbe89fe194805a1371276edaf83ec069c2 (diff) | |
download | ruby-c5485f41ea6a5b5691164924842250fcf893f770.tar.gz |
* 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.rb | 3 |
1 files changed, 3 insertions, 0 deletions
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) |