[Prototype-core] Re: Adding Prototype.Revision

2008-02-23 Thread Jon L.
Wrote a stand-alone function for calculating the signature of a version string. Works from 0 to 99.99.99.99_S99, where _ is any/no filler and S is 'a', 'b', 'g', 'r', or 'rc' [case-insensitive]. Tested it in both IE7 and FF2 (I don't have any others installed, atm). I'm sure it could use some

[Prototype-core] Re: Adding Prototype.Revision

2008-02-23 Thread Jon L.
[corrections] 1) var stages = { 's' : 9, // stable 'r' : 8, // release candidate 'g' : 3, // gamma 'b' : 2, // beta 'a' : 1 // alpha }; 2) var vers = vstr === String(vstr) ? vstr : ''; 1) the function shouldn't return 0 unless the string passed

[Prototype-core] Re: Adding Prototype.Revision

2008-02-11 Thread Jon L.
An alternative could be to use the release date: var Prototype = { Version: '1.6.0.2', Release: '01/25/2008' ... }; if(Date(Prototype.Release) = Date('11/07/2007')) { // 1.6.0 (November 7, 2007) ... } On Feb 11, 6:55 pm, tancurrom [EMAIL PROTECTED] wrote: Build: '5234724' Be

[Prototype-core] Re: Adding Prototype.Revision

2008-02-11 Thread tancurrom
I think using a build number is considerably easier to manipulate in the code. Its considerably more specific that a version number. But include both var Prototype = { Build: '5234724', Version: '1.6.0.3', ... or var Prototype = { Build: '5234724', // v1.6.0.3 ... I can actually

[Prototype-core] Re: Adding Prototype.Revision

2008-02-04 Thread Nick Stakenburg
Based on Mislavs function here's on that also handles special cases like _rc1. function vnum(vstring) { var v = vstring.replace(/_.*|\./g, ''); v = parseInt(v + '0'.times(4-v.length)); return vstring.indexOf('_') -1 ? v-1 : v; } vnum('1.6.0') vnum('1.6.0_rc1') //- true vnum('1.6.0') //-

[Prototype-core] Re: Adding Prototype.Revision

2008-02-03 Thread artemy tregoubenko
Latest Prototype here: http://prototypejs.org/assets/2008/1/25/prototype-1.6.0.2.js has following lines at the top: var Prototype = { Version: '1.6.0.2', Isn't this enough? I think using revision number is mostly replacing one readable number with another unreadable. I believe versions are

[Prototype-core] Re: Adding Prototype.Revision

2008-02-03 Thread Nick Stakenburg
A build number based on both version and svn changeset could prevent those issues with backported bugfixes. A suggestion: Prototype.Build: 1602.8769 On 3 feb, 17:13, Tobie Langel [EMAIL PROTECTED] wrote: Hi Artemy, The version number is just a pain to parse. A build number also happens to

[Prototype-core] Re: Adding Prototype.Revision

2008-02-03 Thread Nick Stakenburg
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')

[Prototype-core] Re: Adding Prototype.Revision

2008-02-03 Thread artemy tregoubenko
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

[Prototype-core] Re: Adding Prototype.Revision

2008-02-03 Thread Fabian Lange
:[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

[Prototype-core] Re: Adding Prototype.Revision

2008-02-03 Thread Tobie Langel
Artemy, 1.6.0 1.6.0_rc1 false Best, Tobie On Feb 3, 8:22 pm, artemy tregoubenko [EMAIL PROTECTED] wrote: 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

[Prototype-core] Re: Adding Prototype.Revision

2008-02-03 Thread artemy tregoubenko
I see, thanks Artemy, 1.6.0 1.6.0_rc1 false Best, Tobie On Feb 3, 8:22 pm, artemy tregoubenko [EMAIL PROTECTED] wrote: 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

[Prototype-core] Re: Adding Prototype.Revision

2008-02-03 Thread Nick Stakenburg
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 A lot of questions on irc #prototype relate to people not using the correct version of prototype/scriptaculous together. Even

[Prototype-core] Re: Adding Prototype.Revision

2008-02-03 Thread artemy tregoubenko
On Sun, 03 Feb 2008 22:47:59 +0300, Fabian Lange [EMAIL PROTECTED] wrote: You will have problems in a few releases: '1.6' '1.10.1' false On Sun, 03 Feb 2008 20:00:47 +0300, Mislav Marohnić [EMAIL PROTECTED] wrote: That is because none of the version fragments will ever be bigger than 9. --