From: Daniel Berger Date: 2007-04-06T00:55:05+09:00 Subject: Re: Redefining initialize while staying -w clean On Apr 5, 9:47 am, Andrew Johnson wrote: > Daniel Berger wrote: > > Hi all, > > > Is it possible to redefine initialize and stay -w clean? In win32-file- > > stat, I've redefined initialize to suit my needs for MS Windows. > > > If I do "undef_method(:initialize)" and run with -w, I'll get: > > > "warning: undefining `initialize' may cause serious problem". > > > However, if don't do that, I get "warning: method redefined; > > discarding old initialize". > > Try aliasing the method before redefining it: > > alias :old_init :initialize > def initialize() end That doesn't appear to work. Do you have a code snippet where it does work? Perhaps I've missed something. Thanks, Dan