From 31f72cf518c58567a4f5daac64d990654d835ef8 Mon Sep 17 00:00:00 2001 From: glass Date: Tue, 6 Nov 2012 08:06:21 +0000 Subject: * lib/tempfile.rb: fix confusing inspect. previous Tempfile#inspect says it is a File, but actually it is not a File. t = Tempfile.new("foo") #=> # t.is_a? File #=> false now Tempfile#inspect returns like: t = Tempfile.new("foo") #=> # git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/tempfile.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/tempfile.rb') diff --git a/lib/tempfile.rb b/lib/tempfile.rb index 9f4ed8f3fd..fe7839158a 100644 --- a/lib/tempfile.rb +++ b/lib/tempfile.rb @@ -261,6 +261,10 @@ class Tempfile < DelegateClass(File) end alias length size + def inspect + "#<#{self.class}:#{path}>" + end + # :stopdoc: class Remover def initialize(data) -- cgit v1.2.3