On Wed, Jan 30, 2013 at 12:00 PM, Gary Weaver <garyswea...@gmail.com> wrote:

>
> Do you know (so- not for c compilation/not in extconf.rb, but just
> something you could call to get a list of loaded libraries).
>

(note: otool mentioned before is specific to xcode/xcode cmd line utils.)

Answering my own question- requires shelling out, but for OS X:

`vmmap
#{Process.pid}`.scan(/"([^"]+)"|(\S+)/).flatten.compact.delete_if{|s|
s.length > 0 && s[0] != '/'}

lists all the dylibs, bundles, ruby's exe.

And in linux:

`pmap #{Process.pid}`.scan(/"([^"]+)"|(\S+)/).flatten.compact.delete_if{|s|
s.length > 0 && s[0] != '/'}

In Windows I think need to use listdlls available at:
http://technet.microsoft.com/en-us/sysinternals/bb896656.aspx
which maybe could be packaged in the gem. Have not tried it, but I think it
lists for the current process, so could list for ruby?

Anyway, I'll shut up now.
_______________________________________________
RubyGems-Developers mailing list
http://rubyforge.org/projects/rubygems
RubyGems-Developers@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers

Reply via email to