[Rubygems-developers] Gem#status?

Hugh Sasse hgs at dmu.ac.uk
Tue Nov 11 11:42:52 EST 2008


On Tue, 11 Nov 2008, Berger, Daniel wrote:

> Hi
> 
> >From the journal of Phil Hagelberg:
> 
> http://technomancy.us/117
> 
> "It'd be better if Rubygems allowed 2.2.0.a to be treated specially as a
> prerelease version that would be superceded by a later real release, and
> that's what Josh Susser, Alex Vollmer, and myself worked on."
> 
> I'd rather not get into mangling version numbers in an attempt to parse
> every arcane schema that users come up with in the wild. However, I'm
> not opposed in principle to the notion of a gem "status" that would more
> or less be in line with the "status" field for RAA downloads, where a
> gem at 'stable' status (or 'production', or whatever you want to call
> it) would supercede a gem at 'prerelease' status.

Could this be done more simply with another "decimal" place? 
Version 2.1.0.1 to 2.1.0.9999

or possibly, as each {major, minor, minor_minor, tiddler} may  be
regarded as an int:
Version 2.2.0.-99

That might avoid having to have a list of acceptable names. How would
one rank :random_jottings, :piffle and :balderdash for the really
experimental versions that people might invent?
> 
> So, let's say on November 1, 2008 I want to put out a prerelease version
> of "foo" 1.0.0. It would look like this:

The Tardis gem, as you plan to release it in the past? :-)
> 
> Gem::Specification.new do |gem|
>    gem.name    = 'foo"
>    gem.version = '1.0.0"
>    gem.status  = Gem::Status::PRERELEASE # Or ALPHA, or whatever
> end
> 
> A month later I put out the "official" release:
> 
> Gem::Specification.new do |gem|
>    gem.name    = 'foo"
>    gem.version = '1.0.0"
>    gem.status  = Gem::Status::STABLE # The default, btw
> end
> 
> Now I have two gems out there at 1.0.0, but one is tagged as a
> prerelease gem and one is tagged as stable gem. If a user does "gem
> install foo", they'll get the 'stable' gem, since it's understood to be
> the "real" version. If a user wants a specific release version they
> could use a command line switch, e.g. "gem install foo
> --status=prerelease".
> 
> Then we just have to work out all the status options and determine their
> priority.

I think numbers would be better, as we'll always run out of names, and
the creativity with names (Shoes, raisins release for example) is
somewhat unbounded.  We won't run out of ints too quickly, unless that
chap Cantor is going to release an infinite amount of software from
his hotel chain....
> 
> Seem reasonable?
> 
> Regards,
> 
> Dan
> 
        Hugh


More information about the Rubygems-developers mailing list