diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-27 16:03:35 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-27 16:03:35 +0000 |
commit | 592c6ba3b39d5803ba45f7c69f5ab2086629d653 (patch) | |
tree | 00d12be8c02a45061a3852c1d6ee89340467fbf7 /lib/tempfile.rb | |
parent | 9b612d382de382913d3eab12dac986fc5fc21864 (diff) | |
download | ruby-592c6ba3b39d5803ba45f7c69f5ab2086629d653.tar.gz |
* 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.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/tempfile.rb b/lib/tempfile.rb index 5f4e8eedf1..361d66491e 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 |