Hi,

You will have problems in a few releases:
>> '1.6' < '1.10.1'
false

However I don't see a reason for Nicks patch. If you need to check the 4th
digit of version number due to compatibility issues then we have an
issue....

.: Fabian

-----Original Message-----
From:
[EMAIL PROTECTED]
om
[mailto:[EMAIL PROTECTED]
groups.com] On Behalf Of artemy tregoubenko
Sent: Sonntag, 3. Februar 2008 20:22
To: prototype-core@googlegroups.com
Subject: [Prototype-core] Re: Adding Prototype.Revision


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