[Rubygems-developers] Specifying a platform

Chad Fowler chad at chadfowler.com
Sat Apr 17 10:04:28 EDT 2004


On 17/4/2004, at 2:30 AM, Gavin Sinclair wrote:

> Folks,
>
> I'd like an opinion on the "platform" issue in RubyGems.  I was
> surprised to get this error when trying out a gemspec for ruby-dict.
>
> $ gem -b ruby-dict.gemspec
> Attempting to build gem spec 'ruby-dict.gemspec'
> /usr/local/lib/ruby/site_ruby/1.8/rubygems/specification.rb:333:in 
> `validate': Missing value for att
> ribute platform (Gem::InvalidSpecificationException)
>         from 
> /usr/local/lib/ruby/site_ruby/1.8/rubygems/specification.rb:331:in 
> `each'
>         from 
> /usr/local/lib/ruby/site_ruby/1.8/rubygems/specification.rb:331:in 
> `validate'
>         from 
> /usr/local/lib/ruby/site_ruby/1.8/rubygems/builder.rb:85:in `build'
>         from /usr/local/bin/gem:494:in `build'
>         from /usr/local/bin/gem:493:in `each'
>         from /usr/local/bin/gem:493:in `build'
>         from /usr/local/bin/gem:124:in `run'
>         from /usr/local/bin/gem:679
>
>
> There are a few points to make here.
>
> 1. The error message given there is a bit fearsome.  I'm not sure what
>    the current policy on error messages is, but I'm sure this one can
>    be improved.  I'll take advice and then make the change myself.
>

This is just one of those bad error messages (stack traces) that hasn't 
yet been cleaned up.

> 2. Why is a platform required?  I understand platform to be "what kind
>    of machine this can run on", which is fine, but what does "Ruby"
>    mean as a platform?  If a gem is platform-independent, does a
>    platform need to be specified?  If we must have "Ruby" meaning
>    "platform-independent Ruby-based gem", can it be the default
>    setting?
>
>    Platform suggests to me a binary gem, I suppose.
>

RUBY is indeed intended to mean that the gem is cross-platform.  I 
think RUBY being a default is a sensible way to go about it.

> 3. Naming.  I've brought this up before, but buried within a thread.
>    When I had "Gem::Platform::RUBY" specified as the platform for
>    "ruby-dict", it built fine, but the gem was named
>    "ruby-dict-ruby-0.9.2.gem".
>

The addition of "-ruby-" in the name crept in quietly during one of the 
enhancements someone (was it me?) was doing over the past month.  I 
feel like there's no reason to keep it for cross-platform gems, but 
someone might have a reason they needed it.  Is this true?

>    That seems unappealing and unnecessary to me.  If platform meant
>    purely a binary gem, then I could understand seeing gem names like
>
>      wx-windows-mswin-0.3.2.gem
>      wx-windows-osx-0.3.2.gem
>      etc.
>
>    But I would prefer to see
>
>      wx-windows-(mswin)-0.3.2.gem
>      wx-windows-(osx)-0.3.2.gem
>      etc.
>

I would prefer not to use characters that I have to escape in the shell.

tashi-delek:~ chadfowler$ touch test-(win32)
-bash: syntax error near unexpected token `('


>    And I prefer never to see
>
>      ruby-dict-ruby-0.9.2.gem
>
>    or
>
>      ruby-dict-(ruby)-0.9.2.gem
>
>    although the latter is more palatable :)
>
>

I guess it's a subjective difference, but the parentheses *really* 
bother me.

So, do we agree that we don't need -ruby- in the name of a gem?

Chad



More information about the Rubygems-developers mailing list