def load(needs = {})
            needs = needs.merge({"zergrush" => INCLUDE})
          
            Gem::Specification.each { |gem|
                # don't load gems more than once
                next if @gems.has_key? gem.name        
                check = needs.dup

                # rolls through the depends and inverts anything it finds
                gem.dependencies.each do |dep|
                    # this will fail if a gem is depended more than once
                    if check.has_key? dep.name
                        check[dep.name] = !check[dep.name]
                    end
                end
            
                # now since excluded gems start as true, inverting them
                # makes them false so we'll skip this gem if any excludes are found
                if (check.select {|name,test| !test}).length == 0
                    # looks like no needs were set to false, so it's good
                    if gem.metadata["zergrushplugin"] != nil
                        require File.join(gem.gem_dir, "lib", gem.name, "init.rb")
                        @gems[gem.name] = gem.gem_dir
                    end
                end
            }
            
            return nil
        end
def load(needs = {})
            needs = needs.merge({"zergrush" => INCLUDE})
          
            Gem::Specification.each { |gem|
                # don't load gems more than once
                next if @gems.has_key? gem.name        
                check = needs.dup

                # rolls through the depends and inverts anything it finds
                gem.dependencies.each do |dep|
                    # this will fail if a gem is depended more than once
                    if check.has_key? dep.name
                        check[dep.name] = !check[dep.name]
                    end
                end
            
                # now since excluded gems start as true, inverting them
                # makes them false so we'll skip this gem if any excludes are found
                if (check.select {|name,test| !test}).length == 0
                    # looks like no needs were set to false, so it's good
                    if gem.metadata["zergrushplugin"] != nil
                        require File.join(gem.gem_dir, "lib", gem.name, "init.rb")
                        @gems[gem.name] = gem.gem_dir
                    end
                end
            }
            
            return nil
        end
Responsible for going through the list of available gems and loading
 any plugins requested.  It keeps track of what it's loaded already
 and won't load them again.

 It accepts one parameter which is a hash of gem depends that should include
 or exclude a gem from being loaded.  A gem must depend on zergrush to be
 considered, but then each system has to add it's own INCLUDE to make sure
 that only plugins related to it are loaded.

 An example again comes from Mongrel.  In order to load all Mongrel plugins:

  GemPlugin::Manager.instance.load "mongrel" => GemPlugin::INCLUDE

 Which will load all plugins that depend on mongrel AND zergrush.  Now, one
 extra thing we do is we delay loading Rails Mongrel plugins until after rails
 is configured.  Do do this the mongrel_rails script has:

 GemPlugin::Manager.instance.load "mongrel" => GemPlugin::INCLUDE, "rails" => GemPlugin::EXCLUDE
 The only thing to remember is that this is saying "include a plugin if it
 depends on zergrush, mongrel, but NOT rails".  If a plugin also depends on other
 stuff then it's loaded just fine.  Only zergrush, mongrel, and rails are
 ever used to determine if it should be included.

 NOTE: Currently RubyGems will run autorequire on gems that get required AND
 on their dependencies.  This really messes with people running edge rails
 since activerecord or other stuff gets loaded for just touching a gem plugin.
 To prevent this load requires the full path to the "init.rb" file, which
 avoids the RubyGems autorequire magic.