From: Robert Dober Date: 2009-01-04T04:19:59+09:00 Subject: Re: What does 'Monkey Patching' exactly Mean in Ruby? On Sat, Jan 3, 2009 at 2:54 AM, David A. Black wrote: > > It doesn't allow it to run with 1.8, though, at least not safely. This > kind of thing is pretty common in 1.8: > > instance_methods.each {|m| undef(m) unless m =~ /^__/ } Very important point, I guess we can conclude two things from this 1st in this case it was a pretty bad idea to use symbols, using strings would have been better but not overriding instance_methods but by providing a instance_methods_as_strings method (this is somehow superfluous as we will see in the second point) 2nd we have to write a completely new class of Ruby programs for 1.8/1.9 and an example will be code like this instance_methods.each{ .... unless m.to_s =~ /^__/ } Cheers Robert