[Rubygems-developers] Specifying a platform
Gavin Sinclair
gsinclair at soyabean.com.au
Sun Apr 18 02:54:05 EDT 2004
On Saturday, April 17, 2004, 11:04:28 PM, Chad wrote:
>> 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.
Fixed. I've gone and made all exception classes we create inherit
from the new class Gem::Exception. That makes it possible to catch
them separately and generally.
>> 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.
Sounds good. I agree with Rich's comment elsewhere that Ruby *is* a
platform. So we can treat it as the default platform.
But then, what if a gem includes C code as well as Ruby code? And
what if that C code uses, for instance, "fork"? This platform
business might need some more definition.
>> 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?
>>
>> 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 `('
>> [...]
> I guess it's a subjective difference, but the parentheses *really*
> bother me.
I think your POV is quite valid. I'd not thought of that.
> So, do we agree that we don't need -ruby- in the name of a gem?
Yes :)
If my assumption that an platform specification implies a binary gem
is correct (is it?) then a reordering *might* make sense.
wx-windows-0.3.2-mswin.gem
wx-windows-0.3.2-powerpc-darwin.gem
I think it's easier to parse and less likely to confuse or conflict,
but is it sensible and appealing?
Gavin
P.S. To address another point raised elsewhere in this thread, I do
believe that the platform should be present in the filename (unless
it's Ruby), because sometimes it's all that differentiates two gems.
Is it not?
More information about the Rubygems-developers
mailing list