diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/tempfile.rb | 6 |
2 files changed, 10 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Wed May 28 01:02:54 2014 Tanaka Akira <akr@fsij.org> + + * lib/tempfile.rb (Tempfile#inspect): Show "(closed)" if the tempfile + is closed. + Wed May 28 00:38:09 2014 Tanaka Akira <akr@fsij.org> * test/lib/minitest/unit.rb: Use Tempfile#close! instead of 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 |