From: Eric Hodel Date: 2009-11-25T08:06:12+09:00 Subject: Re: RubyGems current load paths On Nov 23, 2009, at 23:41, Intransition wrote: > On Nov 23, 7:26 pm, John Barnette wrote: >> On Mon, Nov 23, 2009 at 4:09 PM, Intransition >> wrote: >>> I'm doing a little meta-programming in this case -- I've created a >>> function to find "plugins". So I need to search through the >>> $LOAD_PATH >>> and Gems. But I'm all ears if there is another way to do it. >> >> Have you looked at Gem.find_files? It was written to solve this >> problem. > > Yes, I looked at that. But there is a problem. The docs say, > > "Note that find_files will return all files even if they are from > different versions of the same gem." > > I want only the active or latest gem versions. It's an encouragement to make your plugin files as light as possible, such as requiring an additional file or calling some very stable API.