Rubyワークフローエンジンrukawaのメモ


Rubyワークフローエンジンrukawaのメモ
(注: リリースされていない機能も入っています)

## 作者による紹介

[Ruby製のシンプルなワークフローエンジンRukawaの紹介](http://qiita.com/joker1007/items/02b334d1cca76fadaf2c)

## 練習リポジトリ

[練習リポジトリ](https://github.com/hiroyuki-sato/rukawa-practice)

## ジョブネット一覧表示

```
rukawa list
+------------------+-------------------+
| Job              | Desc              |
+------------------+-------------------+
| CommandJobNet    |                   |
| HelloJobNet      | Hello Description |
| OneSuccessJobNet |                   |
| SequelJobNet     |                   |
| SkipJobNet       |                   |
+------------------+-------------------+
```

依存関係込み

```
rukawa list -j 
+------------------+-------------------+------------------------------+
| Job              | Desc              | Dependencies                 |
+------------------+-------------------+------------------------------+
| CommandJobNet    |                   |                              |
|   CommandJobOne  |                   |                              |
|   CommandJobTwo  |                   | CommandJobOne                |
| HelloJobNet      | Hello Description |                              |
|   HelloJobOne    |                   |                              |
|   HelloJobTwo    |                   | HelloJobOne                  |
| OneSuccessJobNet |                   |                              |
|   OneSuccessOne  |                   |                              |
|   OneSuccessTwo  |                   |                              |
|   OneSuccessTree |                   | OneSuccessOne, OneSuccessTwo |
| SequelJobNet     |                   |                              |
|   SequelJobOne   |                   |                              |
|   SequelJobTwo   |                   | SequelJobOne                 |
| SkipJobNet       |                   |                              |
|   SkipJobOne     |                   |                              |
|   SkipJobTwo     |                   | SkipJobOne                   |
+------------------+-------------------+------------------------------+

```

## 単一ジョブ実行

```
rukawa run_job -b HelloJobOne
Hello #<HelloJobOne:0x007ff3ba1ba9a8>
```


## 設定ファイル

```ruby:rukawa.rb
Rukawa.configure do |c|
  c.log_file = STDOUT
#  c.concurrency = 5
#  c.graph.rankdir     = "LR"
#  c.graph.size        = TODO
#  c.graph.rotate      = TODO
#  c.graph.ranksep     = TODO
#  c.graph.nodesep     = TODO
#  c.graph.concentrate = TODO
#  c.graph.node.shape  = TODO
#  c.graph.node.style  = TODO
end
```

| param       | type    | default | Description |
|-------------|---------|---------|-------------|
| rankdir     | rankdir | LR      | Graph Direction "TB", "LR", "BT", "RL" |
| size        | point   |         | Maximum width and height of drawing |
| rotate      | int     | 0       | If 90, set drawing orientation to landscape |
| raksep      | double  | 0.5     | default (minimum 0.02) In dot, this gives the desired rank separation, in inches. | 
| nodeep      | double  | 0.25    | In dot, this specifies the minimum space between two adjacent nodes in the same rank, in inches | 
| concentrate | bool    | false   | If true, use edge concentrators. This merges multiedges into a single edge and causes partially parallel edges to share part of their paths. |

styleの値

filled,invisible,diagonals,rounded,dashed,dotted,solid,bold

[shape](http://www.graphviz.org/doc/info/shapes.html)
[style](http://www.graphviz.org/doc/info/shapes.html#d:style)