[Rubygems-developers] Overhaul of specification.rb

Chad Fowler chad at chadfowler.com
Sun Aug 15 13:15:10 EDT 2004


On Aug 15, 2004, at 11:41 AM, Gavin Sinclair wrote:

> On Monday, August 16, 2004, 12:44:13 AM, why wrote:
>
>> Gavin Sinclair wrote:
>>>
>>> I had a thought earlier about this problem though, the general 
>>> problem
>>> of Gem::Specification objects being created in two different ways
>>> (Ruby and YAML).  A general solution would be this:
>>>
>
>> Hey, Gavin?  I really think you should move away from serialization of
>> the Gem::Specification as a !ruby/object.  I've had lots of requests 
>> for
>> the `from_yaml' and `initialize_yaml' stuff, which I'm kinda resistant
>> to.  All the scenarios I've seen which demand these methods could be
>> solved by using a domain type.
>
>> Use to_yaml_type and YAML::add_domain_type to set this up.  [....]
>
> Thanks for the tip, _why.  I'll definitely take a look at it (and
> might ask more questions about it).  However, I wasn't suggesting a
> from_yaml in YAML itself, just a special constructor for the
> Specification class.  It would then be the resonsibility of client
> code to use Specification.from_yaml(File.read(...)) rather than
> YAML.load(File.read(...)).
>
> I've a hunch that wouldn't really solve the inter-spec migration
> problem anyway.  But your domain types just might, if each version of
> the spec is a different type.  I'll have some time tomorrow night to
> look into it.
>
> Thanks again,
> Gavin
>
> _

Gavin,

I'm going to leave this one to you.  I've been fiddling with it for the 
past two days and keep running into problems with backward 
compatibility.  I'm hoping we can clean things up for a RubyGems 0.8.0 
release in the next couple of days.  I'll turn my attention to other 
areas for now.

We're going to need to do some extensive (probably manual) testing for 
this release since we've changed the underlying format _and_ the gem 
specification format drastically.

Chad



More information about the Rubygems-developers mailing list