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 | |
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
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | lib/tempfile.rb | 3 |
2 files changed, 7 insertions, 0 deletions
@@ -1,3 +1,7 @@ +Sat Dec 24 00:55:16 2011 Tanaka Akira <akr@fsij.org> + + * lib/tempfile.rb (Tempfile#initialize): warn if a block is given. + Fri Dec 23 16:14:30 2011 TAKAO Kouji <kouji@takao7.net> * ext/readline/readline.c (readline_attempted_completion_function): 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) |