diff --git a/ChangeLog b/ChangeLog index 8134928758..03dd5c4320 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +Tue Nov 6 16:50:00 2012 Masaki Matsushita + + * lib/tempfile.rb (Tempfile#inspect): 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") + #=> # + Tue Nov 6 16:22:30 2012 Naohisa Goto * atomic.h: add #include for the workaround of 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)