From 2bf3ee679c015a421c1339a07630788d3834b41d Mon Sep 17 00:00:00 2001 From: GoalSmashers Date: Thu, 5 Sep 2013 10:50:36 +0200 Subject: [PATCH] Renames `debug` into `benchmark` for transformation benchmarking to avoid confusion with new `-d/--debug` switch. --- History.md | 1 + README.md | 2 +- lib/clean.js | 2 +- test/bench.js | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/History.md b/History.md index 977f678e..b2a4565d 100644 --- a/History.md +++ b/History.md @@ -9,6 +9,7 @@ * Fixed issue [#129](https://github.com/GoalSmashers/clean-css/issues/129) - rebasing imported urls. * Fixed issue [#130](https://github.com/GoalSmashers/clean-css/issues/130) - better code modularity. * Fixed issue [#135](https://github.com/GoalSmashers/clean-css/issues/135) - require node.js 0.8+. +* Renamed lib's `debug` option to `benchmark` when doing per-minification benchmarking. 1.0.12 / 2013-07-19 =================== diff --git a/README.md b/README.md index e7dd7b55..ff321ab1 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Process method accepts a hash as a second parameter, i.e., * `keepSpecialComments` - `*` for keeping all (default), `1` for keeping first one, `0` for removing all * `keepBreaks` - whether to keep line breaks (default is false) * `removeEmpty` - whether to remove empty elements (default is false) -* `debug` - turns on debug mode measuring time spent on cleaning up +* `benchmark` - turns on benchmarking mode measuring time spent on cleaning up (run `npm run bench` to see example) * `root` - path to resolve absolute `@import` rules and rebase relative URLs * `relativeTo` - path with which to resolve relative `@import` rules and URLs diff --git a/lib/clean.js b/lib/clean.js index bb047922..20bb6930 100644 --- a/lib/clean.js +++ b/lib/clean.js @@ -38,7 +38,7 @@ var CleanCSS = { options.processImport = true; // replace function - if (options.debug) { + if (options.benchmark) { var originalReplace = replace; replace = function(pattern, replacement) { var name = typeof pattern == 'function' ? diff --git a/test/bench.js b/test/bench.js index 5fe1dd5c..8b618d31 100644 --- a/test/bench.js +++ b/test/bench.js @@ -7,7 +7,7 @@ if (!process.hrtime) { } var start = process.hrtime(); -cleanCSS.process(bigcss, { debug: true }); +cleanCSS.process(bigcss, { benchmark: true }); var itTook = process.hrtime(start); console.log('complete minification: %d ms', 1000 * itTook[0] + itTook[1] / 1000000.0); -- 2.34.1