[Rubygems-developers] Overhaul of specification.rb
Chad Fowler
chad at chadfowler.com
Mon Aug 9 07:37:42 EDT 2004
On Aug 5, 2004, at 11:13 AM, Gavin Sinclair wrote:
> On Thursday, August 5, 2004, 8:23:16 AM, Chad wrote:
>
>
>> On Aug 1, 2004, at 10:56 AM, Gavin Sinclair wrote:
>
>>> Guys,
>>>
>>> I've done a lot of work on specification.rb. The motivation was to
>>> organise the code a bit better, and give special treatment to all
>>> gemspec attributes to prevent repitition. I wanted to add
>>> 'library_stubs' and 'test_files' attributes, and deprecate
>>> 'test_suite_file', but also to ensure that the overall code was
>>> written and tested well.
>>>
>
>> Looks like this introduced a major bug, probably having to do with the
>> way default values for optional dependencies are generated/handled:
>
>> chadfowler$ sudo ruby -I lib bin/gem install rake
>> Attempting local installation of 'rake'
>> Local gem file not found: rake.gem
>> Attempting remote installation of 'rake'
>> ERROR: While executing gem ... (NoMethodError)
>> undefined method `each' for nil:NilClass
>
> I took a look today but didn't have very long. It's to do with the
> way the gem spec is created. If it's deserialized from YAML, then it
> doesn't go through the #initialize process, which is the problem.
> Before my change, empty/nil properties were not written to YAML, so
> when they're loaded in, they're still empty/nil. The old spec code
> was OK with this because some of the accessors were like this:
>
> def dependencies
> @dependencies ||= []
> end
> .
...snip....
Gavin, did you get a chance to look at this anymore? I'm trying to
work on some other things, but this one's getting in the way. I have
held of on trying to fix it, thinking you had it.
Thanks,
Chad
More information about the Rubygems-developers
mailing list