Ruby Runtime Libraries

is there a way to list the libraries a ruby script is loading when it
runs?

thanks...

···

--
Posted via http://www.ruby-forum.com/.

You can use ruby -rtracer or work from within irb --tracer.

if you work from irb, using flyrb might prove handy when examining code.

Scott

···

On Nov 30, 2010, at 11:26 AM, Robert Huber wrote:

is there a way to list the libraries a ruby script is loading when it
runs?

thanks...

--
Posted via http://www.ruby-forum.com/\.

Place this somewhere after the initialization:

p $"
p $LOADED_FEATURES

If you want to execute more control you could do

def trace_load
   a = $".dup
   r = yield
   p($".dup - a)
   r
end

trace_load do
   require 'your_lib'
end

Kind regards

  robert

···

On 11/30/2010 08:26 PM, Robert Huber wrote:

is there a way to list the libraries a ruby script is loading when it
runs?