2011-04-27 04:56:08 +00:00
|
|
|
#!/usr/bin/env node
|
|
|
|
/*
|
|
|
|
* jQuery Release Note Generator
|
|
|
|
*/
|
|
|
|
|
|
|
|
var fs = require("fs"),
|
|
|
|
http = require("http"),
|
|
|
|
tmpl = require("mustache"),
|
|
|
|
extract = /<a href="\/ticket\/(\d+)" title="View ticket">(.*?)<[^"]+"component">\s*(\S+)/g;
|
|
|
|
|
|
|
|
var opts = {
|
2012-12-16 21:03:30 +00:00
|
|
|
version: "1.9 Beta 1",
|
|
|
|
short_version: "1.9b1",
|
|
|
|
final_version: "1.9",
|
2011-04-27 04:56:08 +00:00
|
|
|
categories: []
|
|
|
|
};
|
|
|
|
|
|
|
|
http.request({
|
|
|
|
host: "bugs.jquery.com",
|
|
|
|
port: 80,
|
|
|
|
method: "GET",
|
2012-08-10 00:16:06 +00:00
|
|
|
path: "/query?status=closed&resolution=fixed&max=400&component=!web&order=component&milestone=" + opts.final_version
|
2011-04-27 04:56:08 +00:00
|
|
|
}, function (res) {
|
|
|
|
var data = [];
|
|
|
|
|
|
|
|
res.on( "data", function( chunk ) {
|
|
|
|
data.push( chunk );
|
|
|
|
});
|
|
|
|
|
|
|
|
res.on( "end", function() {
|
|
|
|
var match,
|
|
|
|
file = data.join(""),
|
|
|
|
cur;
|
|
|
|
|
|
|
|
while ( (match = extract.exec( file )) ) {
|
|
|
|
if ( "#" + match[1] !== match[2] ) {
|
|
|
|
var cat = match[3];
|
|
|
|
|
|
|
|
if ( !cur || cur.name !== cat ) {
|
|
|
|
cur = { name: match[3], niceName: match[3].replace(/^./, function(a){ return a.toUpperCase(); }), bugs: [] };
|
|
|
|
opts.categories.push( cur );
|
|
|
|
}
|
|
|
|
|
|
|
|
cur.bugs.push({ ticket: match[1], title: match[2] });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
buildNotes();
|
|
|
|
});
|
|
|
|
}).end();
|
|
|
|
|
|
|
|
function buildNotes() {
|
|
|
|
console.log( tmpl.to_html( fs.readFileSync("release-notes.txt", "utf8"), opts ) );
|
|
|
|
}
|