Skip to content

Commit

Permalink
Merge pull request #10 from eGavr/restructure-the-benchmark
Browse files Browse the repository at this point in the history
Restructure the benchmark
  • Loading branch information
eGavr committed Sep 3, 2014
2 parents e1f4aaa + fafb26a commit 914cf30
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions lib/config.js → .cmb/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
var path = require('path'),
fs = require('fs'),
minimize = require('./utils').minimize,
archive = require('./utils').archive;
utils = require('../lib/utils'),
minimize = utils.minimize,
archive = utils.archive;

module.exports = {
// each method is the imitation of the usage of some minimizer
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# css-minimizers-benchmark
# css-minimizers-benchmark (CMB)

Сompares the work of **CSS** minimizers.

Expand Down Expand Up @@ -38,7 +38,7 @@ $ bin/compare-minimizers

### How to configure paths?

Go to the [configuration file](https://github.com/eGavr/css-minimizers-bench/blob/master/lib/config.js#L19). In this file you can configure paths with the help of these variables:
Go to the [configuration file](https://github.com/eGavr/css-minimizers-benchmark/blob/master/.cmb/config.js#L20). In this file you can configure paths with the help of these variables:

* `toRawCSS` - path to tests (raw, not minimized **CSS** files).
* `toMinCSS` - path where to output minimized **CSS** files.
Expand All @@ -48,7 +48,7 @@ Go to the [configuration file](https://github.com/eGavr/css-minimizers-bench/blo

**1**. Go to the [package.json](https://github.com/eGavr/css-minimizers-bench/blob/master/package.json#L27) and add your minimizer to the dependencies.

**2**. Go to the [configuration file](https://github.com/eGavr/css-minimizers-bench/blob/master/lib/config.js#L8) and add your code according to the following template:
**2**. Go to the [configuration file](https://github.com/eGavr/css-minimizers-benchmark/blob/master/.cmb/config.js#L9) and add your code according to the following template:

```js
name: minimize(require('module'), 'method')
Expand All @@ -70,7 +70,7 @@ npm install

### How to add your archiver?

**1**. Go to the [configuration file](https://github.com/eGavr/css-minimizers-bench/blob/master/lib/config.js#L15) and add your code according to the following template:
**1**. Go to the [configuration file](https://github.com/eGavr/css-minimizers-benchmark/blob/master/.cmb/config.js#L16) and add your code according to the following template:

```js
name: archive('bash script', 'suffix')
Expand All @@ -79,8 +79,8 @@ name: archive('bash script', 'suffix')
where:
* `name` - the name of your archiver (it will be used in the log).
* `bash script` which archives the file. This script provides several **keywords**:
* `[FILE_PATH]` will be replaced with the paths of all files which were minimized by all specified in the [configuration file](https://github.com/eGavr/css-minimizers-bench/blob/master/lib/config.js#L8) minimizers.
* `[TO_ARCH_CSS]` will be replaced with the path which you have specified in variable `paths.toArchCSS` in the [configuration file](https://github.com/eGavr/css-minimizers-bench/blob/master/lib/config.js#L22).
* `[FILE_PATH]` will be replaced with the paths of all files which were minimized by all specified in the [configuration file](https://github.com/eGavr/css-minimizers-bench/blob/master/.cmb/config.js#L9) minimizers.
* `[TO_ARCH_CSS]` will be replaced with the path which you have specified in variable `paths.toArchCSS` in the [configuration file](https://github.com/eGavr/css-minimizers-bench/blob/master/.cmb/config.js#L23).
* `suffix` which is added to a file by the archiver.

**2**. See the [usage](https://github.com/eGavr/css-minimizers-bench#usage).
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var fs = require('fs'),
path = require('path'),
shell = require('shelljs'),
bench = require('./config'),
bench = require('../.cmb/config'),
utils = require('./utils'),
minimizers = bench.minimizers,
archivers = bench.archivers,
Expand Down

0 comments on commit 914cf30

Please sign in to comment.