summaryrefslogtreecommitdiffstats
path: root/afb-client/bower_components/hammerjs/changelog.js
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2016-02-09 18:40:49 +0100
committerFulup Ar Foll <fulup@iot.bzh>2016-02-09 18:40:49 +0100
commit3d2fda7dd39e2363682f1fa353c951ab0d44ddfa (patch)
treeaf968a8ac5d4fde1f3cebcec5fb0973eb2bfb2cb /afb-client/bower_components/hammerjs/changelog.js
parent12a3520ba440316c76b95d92a684666f03f7b47d (diff)
Implemented URL query parsing for initial token /opa/?token=abcde
Diffstat (limited to 'afb-client/bower_components/hammerjs/changelog.js')
-rw-r--r--afb-client/bower_components/hammerjs/changelog.js71
1 files changed, 71 insertions, 0 deletions
diff --git a/afb-client/bower_components/hammerjs/changelog.js b/afb-client/bower_components/hammerjs/changelog.js
new file mode 100644
index 0000000..887a329
--- /dev/null
+++ b/afb-client/bower_components/hammerjs/changelog.js
@@ -0,0 +1,71 @@
+var changelog = require( "changelogplease" );
+var gittags = require( "git-tags" ).get( function( error, tags ) {
+ if ( error ) {
+ throw error
+ }
+ console.log( tags[ 1 ] + ".." + tags[ 0 ] );
+ var exclude = [ "Merge", "Whitespace", "Fixup", "Cleanup", "Formatting", "Ignore" ];
+ changelog( {
+ ticketUrl: "https://github.com/hammerjs/hammer.js/issues/{id}",
+ commitUrl: "https://github.com/hammerjs/hammerjs/commit/{id}",
+ sort: false,
+ repo: "./",
+ committish: tags[ 1 ] + ".." + tags[ 0 ]
+ }, function( error, log ) {
+ if ( error ) {
+ throw error;
+ }
+ log = parseLog( log );
+ console.log( log );
+ } );
+ function parseLog( log ) {
+ var lines = log.split( "\n" );
+ var newLog = [];
+ var log = [];
+ var currentComponent;
+
+
+ lines.shift();
+ lines.forEach( function( line ) {
+ var newLine = parseLine( line );
+ if ( newLine ) {
+ log.push( line );
+ }
+ } );
+ var log = log.join( "\n" );
+ return log.replace( /\*/g, "-" ).replace( /__TICKETREF__,/g, "" );
+ }
+ function parseLine( line ) {
+ var parts = getParts( line );
+
+ if ( exclude.indexOf( parts.component ) > -1 ) {
+ return false;
+ }
+ return parts;
+ }
+ function getParts( line ) {
+ var parts = line.split( ":" );
+ var component = "";
+ var message;
+ var commits = line.match( /\{\{([A-Za-z0-9 ]){0,99}\}\}/ )
+
+ if ( parts.length > 1 && parts[ 0 ].length <= 20 ) {
+ component = parts[ 0 ];
+ parts.shift();
+ message = parts.join( ":" );
+ } else {
+ parts = line.split( " " );
+ component = parts[ 1 ];
+ parts.shift();
+ message = parts.join( " " );
+ }
+
+ if ( component ) {
+ component = component.replace( /\* |,/, "" );
+ }
+ return {
+ component: component,
+ message: message
+ };
+ }
+} );