I previously had success at comparing version numbers as string like that:
>> '1.6' < '1.6.0.2'
true
>> '1.5.0.1' < '1.6'
true

Thus I am surprised that you parse these strings

On Sun, 03 Feb 2008 21:39:56 +0300, Nick Stakenburg <[EMAIL PROTECTED]> wrote:

>
>> I think we should have both version string and SVN revision from which it
>> was built.
>>
>> Also, Prototype versions could simply be compared like integers in this
>> fashion:
>> function vnum(vstring) { return parseInt(vstring.replace(/\./g, '') +
>> '0'.times(4-(vstring.length/2).ceil())) }
>> vnum('1.6') //-> 1600
>> vnum('1.6.0.2') //-> 1602
>>
>> That is because none of the version fragments will ever be bigger than 9.
>
> That's nice. I went into more trouble to make so Scriptaculous'
> version could be checked, it sometimes has '_pre1' or '_beta2' in it's
> version string. But I see a little more regex could do the same there,
> good idea.
>
> Even though it could be that simple, a build number will make this
> more user friendly. You could then simply do:
> Prototype.Build && Prototype.Build >= 1602
> >
>



-- 
arty ( http://arty.name )

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to