README.md in raka-0.2.3 vs README.md in raka-0.3.1

- old
+ new

@@ -3,33 +3,34 @@ ## Why Raka Data processing tasks can involve plenty of steps, each with its dependencies. Compared to bare Rake or the more classical Make, Raka offers the following advantages: 1. Advanced pattern matching and template resolving to define general rules and maximize code reuse. -2. Extensible and context-aware protocol architecture -3. Multilingual. Other programming languages can be easily embedded -4. Auto dependency and naming by conventions -5. Support scopes to ease comparative studies -6. Terser syntax +2. Extensible and context-aware protocol architecture. +3. Multilingual. Other programming languages can be easily embedded. +4. Auto dependency and naming by conventions. +5. Scopes to ease comparative studies. +6. Terser syntax. ... and more. -## Usage +Compared to more comlex, GUI-based solutions (perhaps classified as scientific-workflow software) like Kepler, etc., Raka has the following advantages: -Raka is a drop-in library for rake. Though rake is cross platform, raka may not work on Windows since it relies some shell facilities. To use raka, one has to install ruby and rake first. Ruby is available for most \*nix systems including Mac OSX so the only task is to install rake like: +1. Lightweight and easy to setup, especially on platforms with ruby preinstalled. +2. Easy to deploy, version-control, backup or share workflows since the workflows are merely text files. +3. Easy to reuse modules or create reusable modules, which are merely plain ruby code snippets (or in other languages with protocols). +4. Expressive so a few lines of code can replace many manual operations. -```bash -gem install rake -``` +## Installation -The next step is to clone this project to local machine, cd to the directory, and install the gem: +Raka is a library based on rake. Though rake is cross platform, raka may not work on Windows since it relies some shell facilities. To use raka, one has to install ruby and rake first. Ruby is available for most \*nix systems including Mac OSX so the only task is to install raka like: ```bash -gem install pkg/raka-0.1.0.gem +gem install raka ``` -## For the Impatient +## QuickStart First create a file named `main.raka` and import & initialize the DSL ```ruby require 'raka' @@ -189,15 +190,15 @@ ### Template resolving In some places of `rexpr`, templates can be written instead of strings, so that it can represent different values at runtime. There are two types of variables that can be used in templates. The first is automatic variables, which is just like `$@` in Make or `task.name` in Rake. We even preserve some Make conventions for easier migrations. All automatic varibales begin with `$`. The possible automatic variables are: -| symbol | meaning | symbol | meaning | -| -------------- | ---------------------- | ------------- | ------------------------------- | -| \$@ | output file | \$^ | all dependecies (sep by spaces) | -| \$< | first dependency | $0, $1, … \$i | ith depdency | -| \$(scope) | scope for current task | \$(output_stem) | stem of the output file | -| \$(input_stem) | stem of the input file | | | +| symbol | meaning | symbol | meaning | +| -------------- | ---------------------- | --------------- | ------------------------------- | +| \$@ | output file | \$^ | all dependecies (sep by spaces) | +| \$< | first dependency | $0, $1, … \$i | ith depdency | +| \$(scope) | scope for current task | \$(output_stem) | stem of the output file | +| \$(input_stem) | stem of the input file | | | The other type of variables are those bounded during pattern matching,which can be referred to using `%{var}`. In the example of the [pattern matching](###pattern-matching) section, `%{indicator}` will be replaced by `node_num`, `%{top}` will be replaced by `top_50` and `%{top0}` will be replaced by `50`. In such case, a template as `'calculate top %{top0} of %{indicator} for $@'` will be resolved as `'calculate top 50 of node_num for top_50__node_num__buildings.pdf'` The replacement of variables happen before any process to the template string. So do not include the symbols for automatic variables or `%{<anything>}` in templates.