From: Eric Hodel Date: 2006-12-15T08:09:12+09:00 Subject: Re: gems cleverness? On Dec 14, 2006, at 11:20, Eric Hodel wrote: > On Dec 13, 2006, at 18:32, Giles Bowkett wrote: >> On 12/13/06, Eric Hodel wrote: >>> On Dec 11, 2006, at 19:31, Giles Bowkett wrote: >>> >>> > Is there an easy way to find out all the gems you're running in a >>> > particular codebase? (It's a Rails app but I'd imagine the >>> technique >>> > has general usefulness?) >>> >>> Gem::SourceIndex.from_installed_gems.search(//).map { |spec| >>> spec.full_name } # * >>> >>> You get back an Array of Gem::Specification objects. >>> >>> (I should fix that search in there.) >>> >>> * I'm running from SVN, but this should still work. >> >> I think I should submit this question to Ruby Quiz. your approach is >> very complete, but overkill -- it gives me everything on my system, >> rather than everything my app is actually using. > > Oh, sorry. > > require 'rubygems' > require 'inline' > > class << Gem; attr_reader :loaded_specs; end > > p Gem.loaded_specs.keys > > I'll make this cleaner. Ok, This will be going in once rubygems is up. Same interface. -- Eric Hodel - drbrain@segment7.net - http://blog.segment7.net I LIT YOUR GEM ON FIRE!