[Rubygems-developers] differing platforms values between Marshal.4.8 and spec.4.8 ?

Jeremy Hinegardner jeremy at hinegardner.org
Mon Sep 22 15:58:46 EDT 2008

On Mon, Sep 22, 2008 at 12:28:15PM -0700, Eric Hodel wrote:
> On Sep 22, 2008, at 10:01 AM, Jeremy Hinegardner wrote:
>> Hi all,
>> The fun part here is that the none of the Marshal named gems exist at the
>> source_uri/gems/full_name.gem path, only those that are in Specs exist
>> Is this the correct behavior?
> The Marshal file has both platform and original_platform.  
> original_platform is used to find the file to download since legacy gems 
> haven't been renamed (on disk) to be found properly.
> specs has only original_platform so it can be as lightweight as possible.  
> Combining name, version and platform gives you the name of a .gemspec file 
> to download that will give you a Gem::Specification with all the 
> information.
> RubyGems knows how to turn original_platform into platform in order to 
> match up with the figure-out-your-platform code (at least, for gems 
> released before the figure-it-out code was written).

knowing the difference between original_platform and platform would be
the issue I was having.  Thank you.

>> Is the Marshal.4.8.Z file to not be used to determine the path to gems?
> Use Gem::Specification#original_platform instead of #platform if you have a 
> Gem::Specification.  Best is to use #full_name.
>> Should I only access the specs.4.8 and latest_specs.4.8 ?
> You should use Gem::SpecFetcher which handles caching for you and is 
> easiest on bandwidth.  Don't use Gem::SourceInfoCache as it is deprecated 
> and eventually will be removed.  (Code to do a bulk fetch of the Marshal 
> file will stick around, since it is useful for doing things with the entire 
> repository.  I'm not sure if I've put in an interface to that separate from 
> SourceInfoCache.)

Thanks for all the info Eric, and all the work on rubygems.  

I'm working on a project that merges multiple gem repositories ( public
and private ) into a single repository for use as an internal gem
distribution server.  It is akin to 'gem mirror' with the ability to
restrict to a certain set of gems and specific versions of those gems.
I should have a release here in the next few days.  

For those interested:


If any of what I'm doing would be useful to incorporate back into 'gem
mirror' I'm happy to contribute.



 Jeremy Hinegardner                              jeremy at hinegardner.org 

More information about the Rubygems-developers mailing list