summaryrefslogtreecommitdiff
path: root/lib/tempfile.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-27 16:03:35 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-27 16:03:35 +0000
commit592c6ba3b39d5803ba45f7c69f5ab2086629d653 (patch)
tree00d12be8c02a45061a3852c1d6ee89340467fbf7 /lib/tempfile.rb
parent9b612d382de382913d3eab12dac986fc5fc21864 (diff)
* lib/tempfile.rb (Tempfile#inspect): Show "(closed)" if the tempfile
is closed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/tempfile.rb')
-rw-r--r--lib/tempfile.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb
index 5f4e8ee..361d664 100644
--- a/lib/tempfile.rb
+++ b/lib/tempfile.rb
@@ -263,7 +263,11 @@ class Tempfile < DelegateClass(File)
# :stopdoc:
def inspect
- "#<#{self.class}:#{path}>"
+ if closed?
+ "#<#{self.class}:#{path} (closed)>"
+ else
+ "#<#{self.class}:#{path}>"
+ end
end
class Remover