<commit_before>Cogs [![Build Status](https://secure.travis-ci.org/caseywebdev/cogs.png)](http://travis-ci.org/caseywebdev/cogs)
===

> <NAME>'s workweek is typical of his era: an hour a day, two days a week. His boss is <NAME>, the diminutive yet bombastic owner of Spacely Space Sprockets. Spacely has a competitor, <NAME>, owner of the rival company Cogswell Cogs (sometimes known as Cogswell's Cosmic Cogs).

Install
-------

```bash
npm install cogs
```

Test
----

```bash
make test
```<commit_msg>Bulk up the README with some CLI examples<commit_after># Cogs

[![Build Status](https://secure.travis-ci.org/caseywebdev/cogs.png)](http://travis-ci.org/caseywebdev/cogs)

> <NAME>'s workweek is typical of his era: an hour a day, two days a week. His boss is <NAME>, the diminutive yet bombastic owner of Spacely Space Sprockets. Spacely has a competitor, <NAME>, owner of the rival company Cogswell Cogs (sometimes known as Cogswell's Cosmic Cogs).

##Install


```bash
npm install -g cogs
```

To avoid unnecessary dependencies, cogs does not include any of the language
preprocessors in its dependency list. If you'd like to use CoffeeScript and
Stylus, for example, you'll want to

```bash
npm install [-g] coffee-script stylus
```

before trying to compile anything. The same is true for compressors, so if you
want to compress your concatenated JavaScript and CSS files be sure to

```bash
npm install [-g] uglify-js csso
```

## Usage

### Command Line Interface

Cogs comes with a handy command line interface.

```bash
Usage: /usr/local/share/npm/bin/cogs glob:dir [-p paths][-w paths][-o json][-C file][-cvCg]

Options:
  --paths, -p                An environment path or comma-separated paths.                 [default: "/Users/casey/projects/cogs"]
  --options, -o              JSON for options to be passed to processors and compressors.
  --compress, -c             Compress using UglifyJS and CSSO.                             [default: false]
  --watch, -w                A path or comma-separated paths to watch.
  --ignore-paths, -i         A path or comma-separated paths to ignore when watching.
  --ignore-basenames, -I     A basename regex to ignore when watching (ie \.css$).
  --verbose, -v              Log build starts, errors and completes in stdout.             [default: false]
  --growl, -g                Use growl notifications for build starts and completes.       [default: false]
  --config, -C               A config file specifying command line options.                [default: "cogs.json"]
  --fingerprint, -f          Fingerprint files with their env.algorithm value.             [default: false]
  --export-fingerprints, -F  Save a JSON file fingerprinted name mappings.
```

Generally, you'll want to put your options in a `cogs.json` or similar for each project.

Here is an example of watching all CoffeeScript files in the `src` directory and
exporting their compiled JavaScript results to the `dist` directory everytime
there is a change.

```bash
cogs -vw src src/**/*.coffee:dist
```

You can also use Sprockets-like directives in your files to make concatenation
simple.

**index.coffee**
```coffee
# require ./a
# requireSelf
# require ./b
```

Now assuming `a.coffee` and `b.coffee` exist in the same directory as `index.coffee`, we can run

```bash
cogs -vw src src/index.coffee:dist
```

And notice that whenever a change is made to `index.coffee`, `a.coffee`, or `b.coffee` the resulting `dist/index.js` is updated.

### Node API

Still a WIP, check the tests for some examples.

## Test

```bash
git clone <EMAIL>:caseywebdev/cogs
cd cogs
make test
```
{'fraction_non_alphanumeric': 0.10720221606648199, 'fraction_numerical': 0.0, 'mean_word_length': 3.080225988700565, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 12, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4053848', 'n_tokens_mistral': 1155, 'n_tokens_neox': 1072, 'n_words': 453}