[Rubygems-developers] HEADS-UP RemoteInstaller overhaul, check proxy workings

Eric Hodel drbrain at segment7.net
Mon Nov 20 00:34:54 EST 2006


I've pulled all the code for updating source indexes out of:

Gem::RemoteInstaller
Gem::RemoteFetcher
Gem::CachedFetcher
Gem::IncrementalFetcher

(the last two files disappearing altogether) and moved the  
functionality into:

Gem::SourceInfoCache
Gem::SourceInfoCacheEntry
Gem::SourceIndex

and made a bunch of other changes to support this work.  In all there  
was about 600 lines of change to lib/ with rubygems dropping in size  
by about 120 lines.

If any problems were to pop up, I expect them to be in specifying an  
HTTP proxy on the command-line.  Gem::RemoteFetcher is no longer  
source-specific, so it fetches its proxy information from ENV as  
usual or from Gem.configuration.  I'm not sure if I'm adding the  
command line proxy options to Gem.configuration correctly or not,  
though.

I've run gem update and gem install and gem list, and all seem to be  
working OK.

Because of this work you can now easily do fun things like examine  
the source index:

irb(main):001:0> require 'rubygems/source_info_cache'
=> true
irb(main):002:0> Gem::SourceInfoCache.search(/ZenTest/).map { |spec|  
spec.full_name }
=> ["ZenTest-3.0.0", "ZenTest-3.1.0", "ZenTest-3.2.0",  
"ZenTest-3.3.0", "ZenTest-3.4.0", "ZenTest-3.4.1", "ZenTest-3.4.2"]

or refresh the source index from its sources:

irb(main):009:0> Gem::SourceInfoCache.cache.refresh

-- 
Eric Hodel - drbrain at segment7.net - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com




More information about the Rubygems-developers mailing list