2011-04-27 04:56:08 +00:00
|
|
|
#!/usr/bin/env node
|
|
|
|
/*
|
|
|
|
* jQuery Release Note Generator
|
|
|
|
*/
|
|
|
|
|
2015-09-02 23:52:01 +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,
|
2015-09-02 23:52:01 +00:00
|
|
|
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
|
|
|
|
2015-09-02 23:52:01 +00:00
|
|
|
http.request( {
|
2011-04-27 04:56:08 +00:00
|
|
|
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 );
|
2015-09-02 23:52:01 +00:00
|
|
|
} );
|
2011-04-27 04:56:08 +00:00
|
|
|
|
|
|
|
res.on( "end", function() {
|
2013-10-07 22:24:02 +00:00
|
|
|
var match, cur, cat,
|
2015-09-02 23:52:01 +00:00
|
|
|
file = data.join( "" );
|
2011-04-27 04:56:08 +00:00
|
|
|
|
2015-09-02 23:52:01 +00:00
|
|
|
while ( ( match = extract.exec( file ) ) ) {
|
|
|
|
if ( "#" + match[ 1 ] !== match[ 2 ] ) {
|
|
|
|
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 ) {
|
2015-09-02 23:52:01 +00:00
|
|
|
console.log( "</ul>" );
|
2013-01-15 02:58:09 +00:00
|
|
|
}
|
|
|
|
cur = cat;
|
2015-09-02 23:52:01 +00:00
|
|
|
console.log(
|
|
|
|
"<h3>" + cat.charAt( 0 ).toUpperCase() + cat.slice( 1 ) + "</h3>"
|
|
|
|
);
|
|
|
|
console.log( "<ul>" );
|
2011-04-27 04:56:08 +00:00
|
|
|
}
|
|
|
|
|
2013-01-15 02:58:09 +00:00
|
|
|
console.log(
|
2015-09-02 23:52:01 +00:00
|
|
|
" <li><a href=\"http://bugs.jquery.com/ticket/" + match[ 1 ] + "\">#" +
|
|
|
|
match[ 1 ] + ": " + match[ 2 ] + "</a></li>"
|
2013-01-15 02:58:09 +00:00
|
|
|
);
|
2011-04-27 04:56:08 +00:00
|
|
|
}
|
|
|
|
}
|
2013-01-15 02:58:09 +00:00
|
|
|
if ( cur ) {
|
2015-09-02 23:52:01 +00:00
|
|
|
console.log( "</ul>" );
|
2013-01-15 02:58:09 +00:00
|
|
|
}
|
2011-04-27 04:56:08 +00:00
|
|
|
|
2015-09-02 23:52:01 +00:00
|
|
|
} );
|
|
|
|
} ).end();
|