tasks/checkwpversion.js
function ( version, options ){
			
		var matches;
		
		//First if version is 'readme' or 'plugin' version values
		if( version === 'readme' ){
			var readme = grunt.file.read( options.readme );
			matches = readme.match( new RegExp("^Stable tag:\\s*(\\S+)","im") );
			
			if( matches.length <= 1 ){
				grunt.fail.fatal( 'Could not find version in "' + options.readme + '"' );
			}
			version = matches[1];
		
		}else if( version === 'plugin' ){
			var plugin = grunt.file.read( options.plugin );
			matches = plugin.match( new RegExp("^[\* ]*Version:\\s*(\\S+)","im") );
			if( matches.length <= 1 ){
				grunt.fail.fatal( 'Could not find version in "' + options.readme + '"' );
			}
			version = matches[1];
		}
		
		return version;
	}
function ( version, options ){
			
		var matches;
		
		//First if version is 'readme' or 'plugin' version values
		if( version === 'readme' ){
			var readme = grunt.file.read( options.readme );
			matches = readme.match( new RegExp("^Stable tag:\\s*(\\S+)","im") );
			
			if( matches.length <= 1 ){
				grunt.fail.fatal( 'Could not find version in "' + options.readme + '"' );
			}
			version = matches[1];
		
		}else if( version === 'plugin' ){
			var plugin = grunt.file.read( options.plugin );
			matches = plugin.match( new RegExp("^[\* ]*Version:\\s*(\\S+)","im") );
			if( matches.length <= 1 ){
				grunt.fail.fatal( 'Could not find version in "' + options.readme + '"' );
			}
			version = matches[1];
		}
		
		return version;
	}
function ( version , options ) { var matches ; //First if version is 'readme' or 'plugin' version values if ( version === 'readme' ) { var readme = grunt . file . read ( options . readme ) ; matches = readme . match ( new RegExp ( "^Stable tag:\\s*(\\S+)" , "im" ) ) ; if ( matches . length <= 1 ) { grunt . fail . fatal ( 'Could not find version in "' + options . readme + '"' ) ; } version = matches [ 1 ] ; } else if ( version === 'plugin' ) { var plugin = grunt . file . read ( options . plugin ) ; matches = plugin . match ( new RegExp ( "^[\* ]*Version:\\s*(\\S+)" , "im" ) ) ; if ( matches . length <= 1 ) { grunt . fail . fatal ( 'Could not find version in "' + options . readme + '"' ) ; } version = matches [ 1 ] ; } return version ; }
If version is 'readme' or 'plugin', attempts to extract the version stored in
the corresponding files as specified by options.
If version is readme or plugin attempts to extract the version stored in the corresponding files as specified by options .