From: Ryan Davis Date: 2011-09-17T06:12:27+09:00 Subject: Re: Can monkey patching be discovered when you require a library? On Sep 16, 2011, at 11:39 , Intransition wrote: > > > On Sep 12, 10:52 pm, Nick Klauer wrote: >> Is it possible to know whether a method, class, or instance was overridden >> by another when you require 'said_gem' in (i.e. monkeypatched)? I'm >> thinking something that would let gem users know if a gem is going to >> override core methods or attrs? > > Turn on warnings. > > $ cat t.rb > class String > def to_s; end > end That doesn't work. class String alias old_to_s to_s def to_s; end end