From: Robert Klemme Date: 2005-07-04T06:30:45+09:00 Subject: Re: warning: refine foo, what!? _ugly wrote: > I've been doing some unit tests with ruby -W. Wow did I have a lot to > clean up but I still can't get past one warning. I've boiled it down > to this example: > > o = Object.new > def o.foo > 'foo' > end > class << o > undef_method :foo > end > def o.foo > 'foo' > end > > # undef_method_test.rb:8: warning: redefine foo > > Is my head broken or ruby -W broken? I'm thinking the former. Do you want your head fixed? :-) Mayby it's the way undef_method works. I never looked at the internals but maybe the knowledge is kept somewhere that foo was defined at some point in time. Kind regards robert