Tempfile strangeness in 1.9.0

From: Steven Jenkins <steven.jenkins@...>
Date: 2004-04-24 05:19:46 UTC
List: ruby-core #2814
I didn't open a bug for this because it's from the CVS head, but it 
doesn't look right to me.

$ cat t.rb
require 'tempfile'

class IO
     def a
     end
end

f = Tempfile.new('test')
f.a
f.close

Tempfile.new('test') do |f|
     f.a
end
$ /usr/bin/ruby -v
ruby 1.8.1 (2004-04-07) [i686-linux-gnu]
$ /usr/bin/ruby t.rb
$ /tmp/ruby/bin/ruby -v
ruby 1.9.0 (2004-04-23) [i686-linux]
$ /tmp/ruby/bin/ruby t.rb
t.rb:9: undefined method `a' for #<File:/tmp/test9314.0> (NoMethodError)

Steve

In This Thread

Prev Next