<commit_before>mekano
======

[![Build Status](https://travis-ci.org/jeanlauliac/mekano.svg?branch=master)](https://travis-ci.org/jeanlauliac/mekano)

**Work in progress, this is very early.**

Synopsis
--------

*mekano(1)* – maintain, update and regenerate groups of files.

*mekano*:

  * is a make-like update tool: you have a bunch of files in some directories,
    you want to generate other files from them;
  * liberally aims to lessen the frustration that can occur working with GNU
    *make(1)* on small or medium projects;
  * tries to be balanced between speed and convenience;
  * is not tied to any specific technology and may be used to compile C/C++,
    build a web application Javascript/CSS assets, or brew your coffee.

Example
-------

In `./Mekanofile`:

    bin = `node_module/.bin`;

    Concat: `cat $in > $out`;
    Coffee: `$bin/coffee $in > $out`;
    Minify: `$bin/minify < $in > $out`;

    source/**/*.coffee
        Coffee => build/**/*.js
        Concat -> dist/concat.js;

    dist/*.js
        Minify => dist/*.min.js
        :: all `the minified JS`;

In your preferred shell:

    $ ls
    Mekanofile    source

    $ mekano update
    Updating...  25.0%   Coffee source/foo.coffee -> build/foo.js
    Updating...  50.0%   Coffee source/bar.coffee -> build/bar.js
    Updating...  75.0%   Concat build/foo.js build/bar.js -> dist/concat.js
    Updating... 100.0%   Minify dist/concat.js -> dist/concat.min.js
    Done.

    $ mekano update
    Everything is up to date.

    $ ls
    Mekanofile    source      build       dist        .mekano

    $ ls dist
    concat.js   concat.min.js

Description
-----------

*mekano* is a general-purpose update tool. It examines changes made and updates
derived files, called the targets, from the files they are derived, called the
prerequisites. Typical cases include (non-exhaustive):

  * compiling a group of C/C++ files to their respective object files;
  * linking a group of object files to a single binary;
  * transpiling a plain JavaScript to a minified JavaScript.

A description file (called mekanofile) contains a description of the
relationships between files, and the commands that need to be executed to update
the targets and reflect changes in their prerequisites.

*mekano* focuses on correctness rather than other factors like speed. It
properly takes account of removed and added files; tracks command-line changes;
automatically create output directories; and provides sane semantics for
dependency definitions. This tool is largely inspired by the UNIX *make(1)*
utility, of which it modestly tries to be a 21th-century alternative.

*mekano* only knows how to update files. It is not well suited for 'tasks' (eg.
'test', 'publish'). Plain scripts are probably a better idea (eg. sh, JS,
python) for those.

The mekanofile is generally meant to be written by hand, but there is very
little support for build-time decision-making (no 'if', no macros). However, you
can easily use a dedicaced macro or procedural language to generate the
mekanofile.

This specific implementation is made with JavaScript on top of Node.js,
but is usable for any purpose, from C/C++ compilation to web assets build.
Node.js makes it easier to be multiplatform.

Install
-------

**Important:** you need node v0.10 or higher to run this program.

    npm install mekano

The tool will be available as `node_modules/.bin/mekano`. It is not recommended
to install it globally, because different projects may need different major
and incompatible versions.

To avoid typing the path every time when installed locally, one decent solution
is to create an alias, if your shell supports it. For example:

    $ alias mk=node_modules/.bin/mekano

If you later forget to `npm install` a project, your shell will just tell you:

    $ mk update
    bash: no such file or directory: node_modules/.bin/mekano

Usage
-----
<commit_msg>Improve synopsis, desc<commit_after>mekano
======

[![Build Status](https://travis-ci.org/jeanlauliac/mekano.svg?branch=master)](https://travis-ci.org/jeanlauliac/mekano)

**This is still an alpha version of the tool, keep in mind the current version
is not feature-complete. Work is in progress toward that goal.**

Synopsis
--------

*mekano(1)* – maintain, update and regenerate groups of files.

*mekano*:

  * is a **make-like update tool**: you have a bunch of files in some
    directories, you want to **generate other files** from them, **fast** (no
    unnecessary work);
  * liberally aims to **lessen the frustration** that can occur working with GNU
    *make(1)* on small or medium projects;
  * tries to be balanced between **speed and convenience**;
  * works **best** with a **powerful shell** (like bash & co.), that it does not
    supplant;
  * is **not** tied to any **specific technology** and may be used to compile
    C/C++, build a web application Javascript/CSS assets, or **brew your
    coffee**.

Example
-------

In `./Mekanofile`:

    bin = `node_modules/.bin`;

    Concat: `cat $in > $out`;
    Coffee: `$bin/coffee -cp $in > $out`;
    Minify: `$bin/uglifyjs < $in > $out`;

    src/**/*.coffee
        Coffee => build/**/*.js
        Concat -> dist/concat.js;

    dist/*.js
        Minify => dist/*.min.js
        :: all `Update all files`;

In your preferred shell:

    $ ls
    Mekanofile    src

    $ mekano update
    Updating...  25.0%   Coffee src/foo.coffee -> build/foo.js
    Updating...  50.0%   Coffee src/bar.coffee -> build/bar.js
    Updating...  75.0%   Concat build/foo.js build/bar.js -> dist/concat.js
    Updating... 100.0%   Minify dist/concat.js -> dist/concat.min.js
    Done.

    $ mekano update
    Everything is up to date.

    $ ls
    Mekanofile    src      build       dist        .mekano

    $ ls dist
    concat.js   concat.min.js

Description
-----------

*mekano* is a general-purpose update tool. It examines changes made and updates
derived files, called the targets, from the files they are derived, called the
prerequisites. Typical cases include (non-exhaustive):

  * compiling a group of C/C++ files to their respective object files;
  * linking a group of object files to a single binary;
  * transpiling a plain JavaScript to a minified JavaScript.

A description file (called mekanofile) contains a description of the
relationships between files, and the commands that need to be executed to update
the targets and reflect changes in their prerequisites.

*mekano* focuses above all on correctness and convenience, then speed. It
properly takes account of removed and added files; tracks command-line changes;
automatically create output directories; and provides sane semantics for
dependency definitions. This tool is largely inspired by the UNIX *make(1)*
utility, of which it modestly tries to be a 21th-century alternative.

*mekano* only knows how to update files. It is not well suited for so-called
'tasks' (eg. 'test', 'publish'). Plain scripts are probably a better idea (with
bash, Javascript, Python…) for those. Using
[npm-scripts](https://www.npmjs.org/doc/misc/npm-scripts.html) is suggested
as well.

The mekanofile is generally meant to be written by hand, but there is, for now,
very little support for build-time decision-making (no 'if', no macros).
However, you can easily use a dedicaced macro or procedural language to generate
the mekanofile, like [m4](http://www.gnu.org/software/m4/manual/m4.html),
Python, Javascript…

This specific implementation is made with JavaScript on top of Node.js, but keep
in mind it is usable for any purpose, from C/C++ compilation to web assets
build. Node.js just makes it easier to be multiplatform.

Install
-------

**Important:** you need node v0.10 or higher to run this program.

    npm install mekano

The tool will be available as `node_modules/.bin/mekano`. It is not recommended
to install it globally, because different projects may need different major
and incompatible versions.

To avoid typing the path every time when installed locally, one decent solution
is to create an alias, if your shell supports it. For example:

    $ alias mk=node_modules/.bin/mekano

If you later forget to `npm install` a project, your shell will just tell you:

    $ mk update
    bash: no such file or directory: node_modules/.bin/mekano

Usage
-----

{'fraction_non_alphanumeric': 0.09607039537126326, 'fraction_numerical': 0.005424300867888139, 'mean_word_length': 3.2570548999486917, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 5, 'lorem ipsum': 0, 'www.': 2, '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': '5719486', 'n_tokens_mistral': 2517, 'n_tokens_neox': 2382, 'n_words': 1067}