Issue #7027 has been updated by headius (Charles Nutter).


In my opinion, Tempfile should not use Delegator at all.

In JRuby, Tempfile actually is a File.

irb(main):001:0> require 'tempfile'
=> true
irb(main):002:0> t = Tempfile.new('blah')
=> #<Tempfile:/var/folders/9j/yc18czps1x7cbsz76ccl__740000gn/T/blah.77744.52665>
irb(main):003:0> t.class
=> Tempfile
irb(main):004:0> t.class.superclass
=> File
irb(main):005:0> t.is_a? File
=> true
irb(main):006:0> Tempfile.ancestors
=> [Tempfile, File, IO, File::Constants, Enumerable, Object, Kernel, BasicObject]
----------------------------------------
Bug #7027: Tempfile#inspect is Confusing
https://bugs.ruby-lang.org/issues/7027#change-29562

Author: Glass_saga (Masaki Matsushita)
Status: Open
Priority: Normal
Assignee: 
Category: lib
Target version: 
ruby -v: ruby 2.0.0dev (2012-09-15 trunk 36975) [x86_64-linux]


I think Tempfile#inspect is really confusing.
It says Tempfile object is a File, but it is not a File object.

% irb -r tempfile
irb(main):001:0> t = Tempfile.new("hoge")
=> #<File:/tmp/hoge20120916-12354-uontdm>
irb(main):002:0> t.is_a? File
=> false
irb(main):003:0>

see also (Japanese): http://r7kamura.hatenablog.com/entry/2012/09/05/194630


-- 
http://bugs.ruby-lang.org/