Skip to content

Commit

Permalink
jake task for version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
baccigalupi committed Aug 31, 2012
1 parent e994a04 commit 171d904
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 11 deletions.
46 changes: 38 additions & 8 deletions Jakefile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
desc('Build the distributions, or pass in a particular name to just build that.');
task('build', [], function (params) {
var fs = require('fs');

desc('Concat and minify the various distributions');
task('build', function () {
var manifests = {
light: [
'vendor/javascripts/modernizr/modernizr.custom.js',
Expand Down Expand Up @@ -54,7 +56,6 @@ task('build', [], function (params) {
]
};

var fs = require('fs');
var parser = require('uglify-js').parser;
var uglifier = require('uglify-js').uglify;
var banner = fs.readFileSync('src/banner.js').toString();
Expand Down Expand Up @@ -90,11 +91,40 @@ task('build', [], function (params) {
fs.writeSync(fileOut, loader);
};

if (name) {
for( var name in manifests) {
buildFile(name);
} else {
for( var name in manifests) {
buildFile(name);
}
}
});

namespace('bump', function() {
var bump = function(i) {
var splitter = '.';
var version = fs.readFileSync('VERSION').toString();
version = version.split(splitter);
version[1] = (+version[1]) + 1;
version = version.join(splitter).trim();

console.log('bumping version to: ', version);

// write back to VERSION
var fileOut = fs.openSync('VERSION', 'w+');
fs.writeSync(fileOut, version);

// read update and write back to package.json
var package = JSON.parse(fs.readFileSync("package.json").toString());
package.version = version;
fileOut = fs.openSync('package.json', 'w+');
package = JSON.stringify(package, null, 2);
fs.writeSync(fileOut, package);
};

desc('bump the minor release number in the gem and package');
task('minor', function() {
bump(1);
});

desc('bump the patch release number in the gem and package');
task('patch', function() {
bump(2);
});
});
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Jeweler::Tasks.new do |gem|
gem.name = "wheel.js"
gem.homepage = "http://github.com/baccigalupi/wheel.js"
gem.license = "MIT"
gem.summary = %Q{MV* JavaScript framework tailored to Rails}
gem.description = %Q{MV* JavaScript framework tailored to Rails, making it easy to go from a little JavaScript with progressive inhancement to a one-page JS app.}
gem.summary = %Q{MV* JavaScript framework for mobile and beyond}
gem.description = %Q{MV* JavaScript framework making it easy to go from a little JavaScript with progressive inhancement to a one-page JS app.}
gem.email = "baccigalupi@gmail.com"
gem.authors = ["Kane Baccigalupi"]
# dependencies defined in Gemfile
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.1
0.3.2

0 comments on commit 171d904

Please sign in to comment.