From 31e11e8f2d1cdfbe1d06ad691cc22f582a45c282 Mon Sep 17 00:00:00 2001 From: Andinus Date: Tue, 2 Nov 2021 13:43:28 +0530 Subject: Move to Raku module structure --- .gitignore | 1 + META6.json | 19 +++++++++++++++++++ bin/fornax | 1 + fornax.raku | 14 -------------- lib/Fornax/CLI.rakumod | 19 +++++++++++++++++++ 5 files changed, 40 insertions(+), 14 deletions(-) create mode 100644 META6.json create mode 100644 bin/fornax delete mode 100644 fornax.raku create mode 100644 lib/Fornax/CLI.rakumod diff --git a/.gitignore b/.gitignore index ad9441d..3fc1503 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .precomp +.log diff --git a/META6.json b/META6.json new file mode 100644 index 0000000..eb45e73 --- /dev/null +++ b/META6.json @@ -0,0 +1,19 @@ +{ + "name" : "fornax", + "auth" : "zef:andinus", + "version" : "0.1.0", + "description" : "Collection of tools to visualize Path Finding Algorithms", + "authors" : [ "Andinus " ], + "license" : "ISC", + "perl" : "6.d", + "provides" : { + "Fornax::CLI" : "lib/Fornax/CLI.rakumod" + }, + "depends" : [ + "Cairo:ver<0.2.7+>" + ], + "tags": [ + "Fornax", "Algorithms" + ], + "source-url" : "https://github.com/andinus/fornax" +} diff --git a/bin/fornax b/bin/fornax new file mode 100644 index 0000000..307602a --- /dev/null +++ b/bin/fornax @@ -0,0 +1 @@ +use Fornax::CLI; diff --git a/fornax.raku b/fornax.raku deleted file mode 100644 index 7cac53e..0000000 --- a/fornax.raku +++ /dev/null @@ -1,14 +0,0 @@ -use Cairo; - -subset Directory of Str where *.IO.d; - -#| Collection of tools to visualize Path Finding Algorithms -unit sub MAIN( - Str $script, #= script to run (e.g. java/DFS) - Directory :$algorithms = 'algorithms/', #= algorithms directory -); - -my Str $interpreter = $script.split("/").first; -my IO() $program-path = $algorithms ~ $script ~ '.' ~ $interpreter; - -die "Program path invalid" unless $program-path.IO.f; diff --git a/lib/Fornax/CLI.rakumod b/lib/Fornax/CLI.rakumod new file mode 100644 index 0000000..78162e4 --- /dev/null +++ b/lib/Fornax/CLI.rakumod @@ -0,0 +1,19 @@ +use Cairo; + +subset Directory of Str where *.IO.d; +proto MAIN(|) is export { unless so @*ARGS { say $*USAGE; exit }; {*} } + +#| Collection of tools to visualize Path Finding Algorithms +multi sub MAIN( + Str $script, #= script to run (e.g. java/DFS) + Directory :$algorithms = 'algorithms/', #= algorithms directory +) is export { + my Str $interpreter = $script.split("/").first; + my IO() $program-path = $algorithms ~ $script ~ '.' ~ $interpreter; + + die "Program path invalid" unless $program-path.IO.f; +} + +multi sub MAIN( + Bool :$version #= print version +) { say "Fornax v" ~ $?DISTRIBUTION.meta; } -- cgit 1.4.1-2-gfad0