[rubydetroit] Tracing modules that get loaded

4 views
Skip to first unread message

Larry Siden

unread,
May 1, 2010, 1:30:58 PM5/1/10
to rubyd...@googlegroups.com
I want to trace from my console the modules that get loaded.  I tried redefining Kernel#load like so: http://pastie.org/941636.  But my new #load never gets called.  

Is it #require that I need to over-ride?   #require is already written in C and does it's own searching, so I would have to recompile Ruby to get it to tell me where it's finding stuff.  

There must be an easier way to accomplish this that I don't know about.  I checked Ruby command-line arguments but didn't find anything.  I even tried running the script in "irb --tracer" and tee'd it to a tmp file and killed it after it spewed out over 36K lines but found nothing useful.

I'm running a web server called Sproutcore.  I installed the 'thin' gem, which Sproutcore "magically" loads as a replacement to Rack, but as a result, the server reverts to some old behavior that I had to patch in Rack.  But in order to figure out what to fix now, I'd like to see what it's loading.  Surely there is a better way to achieve this.

Larry Siden, 734-926-9614, http://umich.edu/~lsiden

The United States is a nation of laws, badly written and randomly enforced.
--Frank Zappa 1940-1993

--
You received this message because you are subscribed to the Google
Groups "Detroit.rb" group.
To post to this group, send email to rubyd...@googlegroups.com
To unsubscribe from this group, send email to
rubydetroit...@googlegroups.com

Daniel Parker

unread,
May 1, 2010, 10:50:05 PM5/1/10
to rubyd...@googlegroups.com
Use $" to get a list of all files that have been loaded.

- daniel parker -

"You have granted me life and steadfast love, and your care has preserved my spirit." Job 10:12
"The LORD is my chosen portion and my cup . . . indeed, I have a beautiful inheritance." Psalm 16:5-6
"Give what you can ... take nothing back!"

lsi...@gmail.com

unread,
May 1, 2010, 11:49:19 PM5/1/10
to rubyd...@googlegroups.com
Thanks

Sent via BlackBerry from T-Mobile


From: Daniel Parker <dcpa...@gmail.com>
Date: Sat, 1 May 2010 22:50:05 -0400
Subject: Re: [rubydetroit] Tracing modules that get loaded
Reply all
Reply to author
Forward
0 new messages