From a8aba8957be799823391168352a435fe60e3fc7d Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Tue, 11 Mar 2014 06:34:09 +0000 Subject: docs(versions): rework the version info extraction The docs were relying on the grunt/util module for getting version info but this was unreliable and full of custom regexes. This is moved into a new version-info module that makes much better use of the semver library. --- docs/config/processors/git-data.js | 7 +- docs/config/templates/indexPage.template.html | 2 +- docs/docs.config.js | 5 +- lib/versions/version-info.js | 157 ++++++++++++++++++++++++++ 4 files changed, 164 insertions(+), 7 deletions(-) create mode 100644 lib/versions/version-info.js diff --git a/docs/config/processors/git-data.js b/docs/config/processors/git-data.js index 229864bb..16bbef43 100644 --- a/docs/config/processors/git-data.js +++ b/docs/config/processors/git-data.js @@ -1,4 +1,5 @@ var gruntUtils = require('../../../lib/grunt/utils'); +var versionInfo = require('../../../lib/versions/version-info'); module.exports = { name: 'git-data', @@ -6,9 +7,9 @@ module.exports = { description: 'This processor adds information from the local git repository to the extraData injectable', init: function(config, injectables) { injectables.value('gitData', { - version: gruntUtils.getVersion(), - versions: gruntUtils.getPreviousVersions(), - info: gruntUtils.getGitRepoInfo() + version: versionInfo.currentVersion, + versions: versionInfo.previousVersions, + info: versionInfo.gitRepoInfo }); }, process: function(extraData, gitData) { diff --git a/docs/config/templates/indexPage.template.html b/docs/config/templates/indexPage.template.html index 9582c825..0dfe6cc0 100644 --- a/docs/config/templates/indexPage.template.html +++ b/docs/config/templates/indexPage.template.html @@ -175,7 +175,7 @@
-