Prev: rmagick for Ruby 1.8.6 won't work for Ruby 1.8.7?
Next: re-organize original text data then write in files
From: kent yip on 24 Jul 2010 00:28 > Date: Sat, 24 Jul 2010 06:30:10 +0900 > From: alan(a)blogometer.com > Subject: Re: Determining the Source File of a Class > To: ruby-talk(a)ruby-lang.org > > Ryan Davis wrote: > > On Jul 23, 2010, at 13:40 , Alan Gutierrez wrote: > > > >> I'm trying to debug a bug where I seem to have a class that has two defintions, the one I know of, and another one, somewhere, the one I'm getting when I attempt to use the class. > >> > >> Given a class, is there a way to get name of the file in which it was defined? > >> > >> MyClass.defintion_file > >> > >> Something like that? > > > > Classes in ruby are "open", which means that they can be extended at any time. So there isn't really a "definition" (at least, for a single location) of a given class. > > Thank you. That answers my question. > > > You also have the case where something isn't opened to have stuff added to it, but instead it can be extended by modules instead. > > > > If you want, you can play with the reflective hooks in Module: method_added, included, extended, etc. > > Sounds like fire hose, but I'm sure there's a clever Ruby way to control > the torrent. > > Fortunately, I seem to have found the other definition that is being > invoked using `find` and `grep`. > > -- > Alan Gutierrez - alan(a)blogometer.com - http://twitter.com/bigeasy > _________________________________________________________________ MSN Dating: Find someone special. Start now. http://go.microsoft.com/?linkid=9734384
From: David Masover on 24 Jul 2010 18:01
On Friday, July 23, 2010 08:33:30 pm moksha wrote: > On Sat, Jul 24, 2010 at 09:59:52AM +0900, Zach Banks wrote: > > Unsubscribe > > > > Sent from my iPhone > > Why do we get multiple unsubscribe messages here? Because people don't know how to follow directions: http://www.ruby-lang.org/en/community/mailing-lists/ http://www.ruby-lang.org/en/community/mailing-lists/manual-instructions/ Specifically, this part, right here: "To unsubscribe from a list, send a mail which body is âunsubscribeâ to the controller address." CONTROLLER ADDRESS. Not to ruby-talk(a)ruby-lang.org. To ruby-talk-ctl(a)ruby-lang.org. Then again, most people only seem to send the "unsubscribe" once -- after that, presumably, they figured out how to properly unsubscribe, or they just marked it all as spam. |