Skip to content

ttrau/graken

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

graken

A library and command line tool for flattening and validation of hierarchical and concurrent/parallel graphs (mainly .scxml state charts), written in crystal. This library takes advantage of the graph's ken (graphken - the guard dependencies of parallel states in .scxml) to identify feasible edges and necessary triggers to reach a target state.

Installation

Install crystal-lang

Fedora / Centos

sudo dnf -y install gcc gcc-c++ gmp-devel libbsd-devel \
  libedit-devel libevent-devel libxml2-devel libyaml-devel \
  llvm-devel llvm-static libstdc++-static make \
  openssl-devel pcre-devel redhat-rpm-config \
  fonts-cmu

sudo dnf install snapd
sudo ln -s /var/lib/snapd/snap /snap
sudo snap install crystal --classic

Debian / Ubuntu

sudo apt install gcc pkg-config git tzdata \
  libpcre3-dev libevent-dev libyaml-dev \
  libgmp-dev libssl-dev libxml2-dev libz-dev \
  fonts-cmu

sudo apt install snapd
sudo ln -s /var/lib/snapd/snap /snap
sudo snap install crystal --classic

Install as library

Add the dependency to your shard.yml:

dependencies:
  graken:
    github: ttrau/graken

Run shards install and add require "graken" to your project.

Install CLI

sudo make install

Usage

Usage CLI

graken < ./spec/simple.scxml                     ## pipe graph as .scxml file
graken -i ./spec/simple.scxml                    ## read graph from .scxml file
graken -s /tmp/graken.sock < ./spec/simple.scxml ## keep http service running with unix socket
graken -p 3000 < ./spec/simple.scxml             ## keep http service running behind port
graken -f < ./spec/simple.scxml                  ## flatten
graken -v < ./spec/simple.scxml                  ## flatten + validate
graken -h                                        ## show help

Development

Run

crystal src/cli.cr -v -o -a < spec/testmodel/simple.scxml
crystal src/cli.cr -v -o -a < spec/testmodel/cell.scxml

Test

crystal spec

Release

crystal build src/cli.cr --release

Contributors

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published