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
[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
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
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
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') //-
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
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
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')
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
:[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
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
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
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
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.
--
14 matches
Mail list logo