Skip to content

Commit

Permalink
Merge pull request karma-runner#320 from Dignifiedquire/docs-are-coming
Browse files Browse the repository at this point in the history
chore: Update changelog generation for upcoming docs.
  • Loading branch information
dignifiedquire committed Jan 27, 2013
2 parents 557922d + 1cebb35 commit 48c2064
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* Support for Require.js
* Fix testacular init basePath

### v0.5.0
## v0.5.0
* Add preprocessor for LiveScript
* Fix JUnit reporter
* Enable process global in config file
Expand All @@ -49,7 +49,7 @@
* Allow config to be written in CoffeeScript
* Allow espaced characters in served urls

### v0.4.0 (stable)
## v0.4.0 (stable)

### v0.3.12
* Allow calling run() pragmatically from JS
Expand Down Expand Up @@ -105,12 +105,12 @@
* Run tests on start (if watching enabled)
* Add launcher for IE8, IE9

### v0.3.0
## v0.3.0
* Change browser binaries on linux to relative
* Add report-slower-than to CLI options
* Fix PhantomJS binary on Travis CI

### v0.2.0 (stable)
## v0.2.0 (stable)

### v0.1.3
* Launch Canary with crankshaft disabled
Expand All @@ -129,7 +129,7 @@
* Redirect /urlRoot to /urlRoot/
* Fix serving with urlRoot

### v0.1.0
## v0.1.0
* Adapter for AngularJS scenario runner
* Allow serving Testacular from a subpath
* Fix race condition in testacular run
Expand Down
13 changes: 10 additions & 3 deletions tasks/lib/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ var q = require('qq');
var GIT_LOG_CMD = 'git log --grep="%s" -E --format=%s %s..HEAD';
var GIT_TAG_CMD = 'git describe --tags --abbrev=0';

var HEADER_TPL = '<a name="%s"></a>\n## %s (%s)\n\n';
var PATCH_HEADER_TPL = '<a name="%s"></a>\n### %s (%s)\n\n';
var MINOR_HEADER_TPL = '<a name="%s"></a>\n## %s (%s)\n\n';
var LINK_ISSUE = '[#%s](https://github.com/vojtajina/testacular/issues/%s)';
var LINK_COMMIT = '[%s](https://github.com/vojtajina/testacular/commit/%s)';

Expand Down Expand Up @@ -91,6 +92,12 @@ var currentDate = function() {
return util.format('%d-%s-%s', now.getFullYear(), pad(now.getMonth() + 1), pad(now.getDate()));
};

// Print ## 0.2.0 if it's a minor version bump
// and ### 0.2.1 if it's just a a patch bump
var printHeader = function(stream, version) {
var header = version.split('.')[2] === '0' ? MINOR_HEADER_TPL : PATCH_HEADER_TPL;
stream.write(util.format(header, version, version, currentDate()));
};

var printSection = function(stream, title, section) {
var components = Object.getOwnPropertyNames(section).sort();
Expand All @@ -99,7 +106,7 @@ var printSection = function(stream, title, section) {
return;
}

stream.write(util.format('\n### %s\n\n', title));
stream.write(util.format('\n#### %s\n\n', title));

components.forEach(function(name) {
var prefix = '*';
Expand Down Expand Up @@ -175,7 +182,7 @@ var writeChangelog = function(stream, commits, version) {
});
});

stream.write(util.format(HEADER_TPL, version, version, currentDate()));
printHeader(stream, version);
printSection(stream, 'Bug Fixes', sections.fix);
printSection(stream, 'Features', sections.feat);
printSection(stream, 'Breaking Changes', sections.breaks);
Expand Down

0 comments on commit 48c2064

Please sign in to comment.