2011-04-27 04:56:08 +00:00
|
|
|
#!/usr/bin/env node
|
|
|
|
/*
|
|
|
|
* jQuery Release Note Generator
|
|
|
|
*/
|
|
|
|
|
2013-10-07 22:24:02 +00:00
|
|
|
var http = require("http"),
|
2013-01-15 02:58:09 +00:00
|
|
|
extract = /<a href="\/ticket\/(\d+)" title="View ticket">(.*?)<[^"]+"component">\s*(\S+)/g,
|
|
|
|
version = process.argv[2];
|
2011-04-27 04:56:08 +00:00
|
|
|
|
2013-01-15 02:58:09 +00:00
|
|
|
if ( !/^\d+\.\d+/.test( version ) ) {
|
|
|
|
console.error( "Invalid version number: " + version );
|
|
|
|
process.exit( 1 );
|
|
|
|
}
|
2011-04-27 04:56:08 +00:00
|
|
|
|
|
|
|
http.request({
|
|
|
|
host: "bugs.jquery.com",
|
|
|
|
port: 80,
|
|
|
|
method: "GET",
|
2014-07-17 17:25:59 +00:00
|
|
|
path: "/query?status=closed&resolution=fixed&max=400&" +
|
|
|
|
"component=!web&order=component&milestone=" + version
|
2014-05-23 16:45:19 +00:00
|
|
|
}, function( res ) {
|
2011-04-27 04:56:08 +00:00
|
|
|
var data = [];
|
|
|
|
|
|
|
|
res.on( "data", function( chunk ) {
|
|
|
|
data.push( chunk );
|
|
|
|
});
|
|
|
|
|
|
|
|
res.on( "end", function() {
|
2013-10-07 22:24:02 +00:00
|
|
|
var match, cur, cat,
|
|
|
|
file = data.join("");
|
2011-04-27 04:56:08 +00:00
|
|
|
|
|
|
|
while ( (match = extract.exec( file )) ) {
|
|
|
|
if ( "#" + match[1] !== match[2] ) {
|
2013-10-07 22:24:02 +00:00
|
|
|
cat = match[3];
|
2011-04-27 04:56:08 +00:00
|
|
|
|
2013-01-15 02:58:09 +00:00
|
|
|
if ( !cur || cur !== cat ) {
|
|
|
|
if ( cur ) {
|
|
|
|
console.log("</ul>");
|
|
|
|
}
|
|
|
|
cur = cat;
|
2013-07-02 20:12:12 +00:00
|
|
|
console.log( "<h3>" + cat.charAt(0).toUpperCase() + cat.slice(1) + "</h3>" );
|
2013-01-15 02:58:09 +00:00
|
|
|
console.log("<ul>");
|
2011-04-27 04:56:08 +00:00
|
|
|
}
|
|
|
|
|
2013-01-15 02:58:09 +00:00
|
|
|
console.log(
|
|
|
|
" <li><a href=\"http://bugs.jquery.com/ticket/" + match[1] + "\">#" +
|
|
|
|
match[1] + ": " + match[2] + "</a></li>"
|
|
|
|
);
|
2011-04-27 04:56:08 +00:00
|
|
|
}
|
|
|
|
}
|
2013-01-15 02:58:09 +00:00
|
|
|
if ( cur ) {
|
|
|
|
console.log("</ul>");
|
|
|
|
}
|
2011-04-27 04:56:08 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
}).end();
|