[Rubygems-developers] Why does an install command an update ofthe Gem source index ?

Jim Weirich jim at weirichhouse.org
Fri Jun 3 11:16:30 EDT 2005


Hugh Sasse said:
> that seems like a good plan.  I also wonder if it might be possible
> to use ypath to record updates to the /yaml.Z, so one only needs to
> download the update code newer than one's own yaml index.  The only
> thing about that is that it would probably need to be executable
> code and may thus be a potential security hole.

The natural split is at each gem boundary.  And once a gem exists, it
probably doesnt change often, so once it is cached, you've got it.

After reflect, I realized my scheme was a bit too simple.  You need to
included every version of every gem in the index.  And rather than keying
on  verion number, you need to key on either date or SHA1 hash.

I'm liking the hash option.  Today, a SHA1 hash index for all of the
available gems is still undef 60Kb.

Another option to reduce bandwidth is to toss the file lists in each of
the downloaded gem specs.  You only need that while installing (and at
that point you have the full gem).  Removing the file lists drops they
yaml file down to 1/4 its original size.

-- 
-- Jim Weirich     jim at weirichhouse.org    http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)



More information about the Rubygems-developers mailing list