From ae24e00c0fd4cd7e2d1da5d35638f0e044c2cd5c Mon Sep 17 00:00:00 2001 From: "Davis W. Frank" Date: Wed, 15 Jun 2011 18:37:12 -0700 Subject: [PATCH] Support for release candidates in the version.json file; propagates up through the version string everywhere: filenames, ZIP, source code --- example/SpecRunner.html | 8 ++++---- lib/jasmine.js | 15 ++++++++++----- src/core/Env.js | 12 ++++++++---- src/templates/version.erb | 4 ++-- src/version.js | 3 ++- src/version.json | 3 ++- tasks/build_dist.rb | 1 + tasks/helpers.rb | 4 +++- 8 files changed, 32 insertions(+), 18 deletions(-) diff --git a/example/SpecRunner.html b/example/SpecRunner.html index ed84ff6e..7658ed9c 100644 --- a/example/SpecRunner.html +++ b/example/SpecRunner.html @@ -4,11 +4,11 @@ Jasmine Spec Runner - + - - - + + + diff --git a/lib/jasmine.js b/lib/jasmine.js index 19dcf75b..922a417a 100644 --- a/lib/jasmine.js +++ b/lib/jasmine.js @@ -735,12 +735,16 @@ jasmine.Env.prototype.version = function () { * @returns string containing jasmine version build info, if set. */ jasmine.Env.prototype.versionString = function() { - if (jasmine.version_) { - var version = this.version(); - return version.major + "." + version.minor + "." + version.build + " revision " + version.revision; - } else { + if (!jasmine.version_) { return "version unknown"; } + + var version = this.version(); + var dotted_version = version.major + "." + version.minor + "." + version.build; + if (version.rc) { + dotted_version += ".rc" + version.rc; + } + return dotted_version + " revision " + version.revision; }; /** @@ -2467,5 +2471,6 @@ jasmine.version_= { "major": 1, "minor": 1, "build": 0, - "revision": 1308154429 + "revision": 1308187385, + "rc": 1 } diff --git a/src/core/Env.js b/src/core/Env.js index f469a2e0..31ceed70 100644 --- a/src/core/Env.js +++ b/src/core/Env.js @@ -51,12 +51,16 @@ jasmine.Env.prototype.version = function () { * @returns string containing jasmine version build info, if set. */ jasmine.Env.prototype.versionString = function() { - if (jasmine.version_) { - var version = this.version(); - return version.major + "." + version.minor + "." + version.build + " revision " + version.revision; - } else { + if (!jasmine.version_) { return "version unknown"; } + + var version = this.version(); + var dotted_version = version.major + "." + version.minor + "." + version.build; + if (version.rc) { + dotted_version += ".rc" + version.rc; + } + return dotted_version + " revision " + version.revision; }; /** diff --git a/src/templates/version.erb b/src/templates/version.erb index 74d92a55..71256426 100644 --- a/src/templates/version.erb +++ b/src/templates/version.erb @@ -2,5 +2,5 @@ jasmine.version_= { "major": <%= major %>, "minor": <%= minor %>, "build": <%= build %>, - "revision": <%= revision %> -} + "revision": <%= revision %><%= %Q{,\n "rc": #{rc}} if rc %> +}; diff --git a/src/version.js b/src/version.js index ae37abee..35d24bc1 100644 --- a/src/version.js +++ b/src/version.js @@ -2,5 +2,6 @@ jasmine.version_= { "major": 1, "minor": 1, "build": 0, - "revision": 1308154429 + "revision": 1308187385, + "rc": 1 } diff --git a/src/version.json b/src/version.json index a7c2dbdd..3ad51f34 100644 --- a/src/version.json +++ b/src/version.json @@ -1,5 +1,6 @@ { "major": 1, "minor": 1, - "build": 0 + "build": 0, + "rc": 1 } diff --git a/tasks/build_dist.rb b/tasks/build_dist.rb index 92357ece..f91c2e1d 100644 --- a/tasks/build_dist.rb +++ b/tasks/build_dist.rb @@ -30,6 +30,7 @@ task :write_version_file do scope = OpenStruct.new(:major => version_hash["major"], :minor => version_hash["minor"], :build => version_hash["build"], + :rc => version_hash["rc"], :revision => Time.now.to_i) File.open('src/version.js', 'w+') do |f| diff --git a/tasks/helpers.rb b/tasks/helpers.rb index cf8fa6ee..3d6ba512 100644 --- a/tasks/helpers.rb +++ b/tasks/helpers.rb @@ -29,7 +29,9 @@ def console_specfiles end def version_string - "#{version_hash['major']}.#{version_hash['minor']}.#{version_hash['build']}" + version = "#{version_hash['major']}.#{version_hash['minor']}.#{version_hash['build']}" + version += ".rc#{version_hash['rc']}" if version_hash['rc'] + version end def version_hash