diff --git a/META6.json b/META6.json index 10ef11d..8ae560a 100644 --- a/META6.json +++ b/META6.json @@ -1,17 +1,18 @@ { "perl" : "6.c", - "name" : "sake", + "name" : "ake", "version" : "0.0.3", "license" : "Artistic-2.0", "description" : "A make-a-like implemented in Raku", "provides" : { - "Sake" : "lib/Sake.pm6", - "Sake::Task" : "lib/Sake/Task.pm6", - "Sake::Task::IO" : "lib/Sake/Task/IO.pm6", - "Sake::TaskStore" : "lib/Sake/TaskStore.pm6" + "Ake" : "lib/Ake.rakumod", + "Sake" : "lib/Sake.rakumod", + "Ake::Task" : "lib/Ake/Task.rakumod", + "Ake::Task::IO" : "lib/Ake/Task/IO.rakumod", + "Ake::TaskStore" : "lib/Ake/TaskStore.rakumod" }, "author" : "Jonathan Scott Duff ", "depends" : [], "test-depends": [ "File::Temp" ], - "source-url" : "git://github.com/perl6/p6-sake.git" + "source-url" : "git://github.com/Raku/raku-ake.git" } diff --git a/README.md b/README.md index 82ca6ab..364efc1 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,30 @@ -## sake +## ake -`sake` is a make-a-like implemented in Raku. It was inspired by +`ake` is a make-a-like implemented in Raku. It was inspired by [rake](https://github.com/ruby/rake). ### Installation -Sake is easily installable with [`zef`](https://github.com/ugexe/zef): +Ake is easily installable with [`zef`](https://github.com/ugexe/zef): ```sh -zef install sake +zef install ake ``` If you are using `rakubrew` in `shim` mode you will need to run -`rakubrew rehash` to make the `sake` executable available. +`rakubrew rehash` to make the `ake` executable available. ### Current status -Sake is fully-functional but may lack some advanced features. Feature +Ake is fully-functional but may lack some advanced features. Feature requests and PRs are welcome! ### Example -Create a file named `Sakefile` with these contents: +Create a file named `Akefile` with these contents: ```raku task 'buy-food', { @@ -42,10 +42,10 @@ task 'dinner' => , { } ``` -Then you will be able to run `sake` from the same directory -(e.g. `sake morning`). +Then you will be able to run `ake` from the same directory +(e.g. `ake morning`). ### License -Sake is available under Artistic License 2.0. +Ake is available under Artistic License 2.0. diff --git a/bin/ake b/bin/ake new file mode 100755 index 0000000..5ef444a --- /dev/null +++ b/bin/ake @@ -0,0 +1,18 @@ +#!/usr/bin/env perl6 + +use v6; +use Ake; + +sub MAIN(*@tasks, + :$file = ‘Akefile’, + :$force = False, + ) { + + if !$file.IO.e { + note “Could not find file $file!”; + exit 2 + } + EVALFILE $file; + ake-precheck :$force; + execute @tasks || ‘default’ +} diff --git a/bin/sake b/bin/sake index e88155d..21bd5e3 100755 --- a/bin/sake +++ b/bin/sake @@ -1,7 +1,7 @@ #!/usr/bin/env perl6 use v6; -use Sake; +use Ake; sub MAIN(*@tasks, :$file = ‘Sakefile’, @@ -13,6 +13,13 @@ sub MAIN(*@tasks, exit 2 } EVALFILE $file; - sake-precheck :$force; + ake-precheck :$force; execute @tasks || ‘default’ + + say ''; + say '==================== DEPRECATION NOTE ===================='; + say '| `sake` has been renamed to `ake`. |'; + say '| Please consider using `ake` in the future. |'; + say '=========================================================='; + say ''; } diff --git a/examples/Sakefile b/examples/Akefile similarity index 100% rename from examples/Sakefile rename to examples/Akefile diff --git a/lib/Sake.pm6 b/lib/Ake.rakumod similarity index 81% rename from lib/Sake.pm6 rename to lib/Ake.rakumod index d9abe0b..d5c3404 100644 --- a/lib/Sake.pm6 +++ b/lib/Ake.rakumod @@ -1,15 +1,15 @@ -use Sake::Task; -use Sake::TaskStore; -use Sake::Task::IO; +use Ake::Task; +use Ake::TaskStore; +use Ake::Task::IO; sub EXPORT { %( - Sake::Task::EXPORT::DEFAULT::, - Sake::Task::IO::EXPORT::DEFAULT::, + Ake::Task::EXPORT::DEFAULT::, + Ake::Task::IO::EXPORT::DEFAULT::, ) } -unit module Sake; +unit module Ake; INIT { task 'help', { @@ -29,7 +29,7 @@ multi execute(Str $task) { execute %TASKS{$task} } -multi execute(Sake::Task $task) { +multi execute(Ake::Task $task) { my $result = $task.execute; $result ~~ Promise ?? await $result @@ -46,7 +46,7 @@ multi execute(*@tasks) is export { (execute $_ for @tasks) } -sub sake-precheck(:$force = False) is export { +sub ake-precheck(:$force = False) is export { my @errors = gather resolve-deps; if @errors { .note for @errors; diff --git a/lib/Sake/Task.pm6 b/lib/Ake/Task.rakumod similarity index 89% rename from lib/Sake/Task.pm6 rename to lib/Ake/Task.rakumod index 5a6a313..d2b3239 100644 --- a/lib/Sake/Task.pm6 +++ b/lib/Ake/Task.rakumod @@ -1,6 +1,6 @@ -use Sake::TaskStore; +use Ake::TaskStore; -unit class Sake::Task; +unit class Ake::Task; has $.name = !!! ‘name required’; has @.deps; #= Task dependencies @@ -39,7 +39,7 @@ method readify { multi resolve-deps($task, :$live = False) is export { $task.deps .= map: { - do if $_ ~~ Sake::Task { + do if $_ ~~ Ake::Task { $_ # already resolved } elsif %TASKS{$_}:exists { %TASKS{$_} @@ -64,9 +64,9 @@ multi resolve-deps is export { proto sub task(|) is export {*} multi sub task(Str $name, &body?) { - make-task $name, &body, type => Sake::Task + make-task $name, &body, type => Ake::Task } multi sub task(Pair (Str :key($name), :value($deps)), &body?) { - make-task $name, &body, type => Sake::Task, deps => $deps.list + make-task $name, &body, type => Ake::Task, deps => $deps.list } diff --git a/lib/Sake/Task/IO.pm6 b/lib/Ake/Task/IO.rakumod similarity index 81% rename from lib/Sake/Task/IO.pm6 rename to lib/Ake/Task/IO.rakumod index 32adece..d2a3f95 100644 --- a/lib/Sake/Task/IO.pm6 +++ b/lib/Ake/Task/IO.rakumod @@ -1,7 +1,7 @@ -use Sake::Task; -use Sake::TaskStore; +use Ake::Task; +use Ake::TaskStore; -unit class Sake::Task::IO is Sake::Task; +unit class Ake::Task::IO is Ake::Task; method modification-time { $.name.IO.e @@ -29,11 +29,11 @@ method execute { multi sub task(IO $path, &body?) is export { - make-task $path, &body, type => Sake::Task::IO + make-task $path, &body, type => Ake::Task::IO } multi sub task(Pair (IO :key($path), :value($deps)), &body?) is export { - make-task $path, &body, deps => $deps.list, type => Sake::Task::IO + make-task $path, &body, deps => $deps.list, type => Ake::Task::IO } diff --git a/lib/Sake/TaskStore.pm6 b/lib/Ake/TaskStore.rakumod similarity index 94% rename from lib/Sake/TaskStore.pm6 rename to lib/Ake/TaskStore.rakumod index fb0755c..eb777a9 100644 --- a/lib/Sake/TaskStore.pm6 +++ b/lib/Ake/TaskStore.rakumod @@ -1,4 +1,4 @@ -unit module Sake::TaskStore; +unit module Ake::TaskStore; our %TASKS is export; diff --git a/lib/Sake.rakumod b/lib/Sake.rakumod new file mode 100644 index 0000000..b3466f6 --- /dev/null +++ b/lib/Sake.rakumod @@ -0,0 +1,19 @@ +use Ake; + +sub EXPORT { + %( + Ake::Task::EXPORT::DEFAULT::, + Ake::Task::IO::EXPORT::DEFAULT::, + ) +} + +unit module Sake; + +sub execute(*@tasks) is export { + execute |@tasks; +} + +sub sake-precheck(:$force = False) is export { + ake-precheck :$force; +} + diff --git a/t/00-original-task.t b/t/00-original-task.t index 063b8cf..09a9d60 100644 --- a/t/00-original-task.t +++ b/t/00-original-task.t @@ -1,6 +1,6 @@ use v6; use lib ; -use Sake; +use Ake; use Test; plan 5; diff --git a/t/01-original-file.t b/t/01-original-file.t index c095ed3..a7320fd 100644 --- a/t/01-original-file.t +++ b/t/01-original-file.t @@ -1,11 +1,11 @@ use v6; use lib ; -use Sake; +use Ake; use Test; plan 11; -my $path = $*TMPDIR.add: ‘sake-’ ~ (^999999).pick; +my $path = $*TMPDIR.add: ‘ake-’ ~ (^999999).pick; mkdir $path; chdir $path; # ugly but OK diff --git a/t/10-dispatch.t b/t/10-dispatch.t index 61b3ad5..552ac97 100644 --- a/t/10-dispatch.t +++ b/t/10-dispatch.t @@ -1,7 +1,7 @@ use v6; use lib ; -use Sake; -use SakeTester; +use Ake; +use AkeTester; use Test; plan 6 × 3; @@ -16,14 +16,14 @@ subtest ‘task with no deps and no block’, { lives-ok { $t = task ‘no-dep-no-block’ }, ‘lives’; is-deeply $t.deps, [], ‘correct deps’; nok $t.body.defined, ‘correct body’; - is $t.^name, ‘Sake::Task’, ‘correct task type’; + is $t.^name, ‘Ake::Task’, ‘correct task type’; } subtest ‘task with no deps and a block’, { plan 4; lives-ok { $t = task ‘no-dep-block’, { 111 } }, ‘lives’; is-deeply $t.deps, [], ‘correct deps’; is-deeply $t.body.(), 111, ‘correct body’; - is $t.^name, ‘Sake::Task’, ‘correct task type’; + is $t.^name, ‘Ake::Task’, ‘correct task type’; } @@ -32,14 +32,14 @@ subtest ‘task with one dep and no block’, { lives-ok { $t = task ‘str-dep-no-block’ => ‘one’ }, ‘lives’; is-deeply $t.deps, [‘one’,], ‘correct deps’; nok $t.body.defined, ‘correct body’; - is $t.^name, ‘Sake::Task’, ‘correct task type’; + is $t.^name, ‘Ake::Task’, ‘correct task type’; } subtest ‘task with one dep and a block’, { plan 4; lives-ok { $t = task ‘str-dep-block’ => ‘two’, { 222 } }, ‘lives’; is-deeply $t.deps, [‘two’,], ‘correct deps’; is-deeply $t.body.(), 222, ‘correct body’; - is $t.^name, ‘Sake::Task’, ‘correct task type’; + is $t.^name, ‘Ake::Task’, ‘correct task type’; } @@ -48,14 +48,14 @@ subtest ‘task with deps and no block’, { lives-ok { $t = task ‘list-dep-no-block’ => }, ‘lives’; is-deeply $t.deps, [‘foo’, ‘bar’], ‘correct deps’; nok $t.body.defined, ‘correct body’; - is $t.^name, ‘Sake::Task’, ‘correct task type’; + is $t.^name, ‘Ake::Task’, ‘correct task type’; } subtest ‘task with deps and a block’, { plan 4; lives-ok { $t = task ‘list-dep-block’ => , {9} }, ‘lives’; is-deeply $t.deps, [‘foo’, ‘bar’], ‘correct deps’; is-deeply $t.body.(), 9, ‘correct body’; - is $t.^name, ‘Sake::Task’, ‘correct task type’; + is $t.^name, ‘Ake::Task’, ‘correct task type’; } @@ -66,14 +66,14 @@ subtest ‘IO task with no deps and no block’, { lives-ok { $t = task ‘no-dep-no-blockIO’.IO }, ‘lives’; is-deeply $t.deps, [], ‘correct deps’; nok $t.body.defined, ‘correct body’; - is $t.^name, ‘Sake::Task::IO’, ‘correct task type’; + is $t.^name, ‘Ake::Task::IO’, ‘correct task type’; } subtest ‘IO task with no deps and a block’, { plan 4; lives-ok { $t = task ‘no-dep-blockIO’.IO, { 111 } }, ‘lives’; is-deeply $t.deps, [], ‘correct deps’; is-deeply $t.body.(), 111, ‘correct body’; - is $t.^name, ‘Sake::Task::IO’, ‘correct task type’; + is $t.^name, ‘Ake::Task::IO’, ‘correct task type’; } @@ -82,14 +82,14 @@ subtest ‘IO task with one dep and no block’, { lives-ok { $t = task ‘str-dep-no-blockIO’.IO => ‘one’ }, ‘lives’; is-deeply $t.deps, [‘one’,], ‘correct deps’; nok $t.body.defined, ‘correct body’; - is $t.^name, ‘Sake::Task::IO’, ‘correct task type’; + is $t.^name, ‘Ake::Task::IO’, ‘correct task type’; } subtest ‘IO task with one dep and a block’, { plan 4; lives-ok { $t = task ‘str-dep-blockIO’.IO => ‘two’, { 222 } }, ‘lives’; is-deeply $t.deps, [‘two’,], ‘correct deps’; is-deeply $t.body.(), 222, ‘correct body’; - is $t.^name, ‘Sake::Task::IO’, ‘correct task type’; + is $t.^name, ‘Ake::Task::IO’, ‘correct task type’; } @@ -98,14 +98,14 @@ subtest ‘IO task with deps and no block’, { lives-ok { $t = task ‘list-dep-no-blockIO’.IO => }, ‘lives’; is-deeply $t.deps, [‘foo’, ‘bar’], ‘correct deps’; nok $t.body.defined, ‘correct body’; - is $t.^name, ‘Sake::Task::IO’, ‘correct task type’; + is $t.^name, ‘Ake::Task::IO’, ‘correct task type’; } subtest ‘IO task with deps and a block’, { plan 4; lives-ok { $t = task ‘list-dep-blockIO’.IO => , {9} }, ‘lives’; is-deeply $t.deps, [‘foo’, ‘bar’], ‘correct deps’; is-deeply $t.body.(), 9, ‘correct body’; - is $t.^name, ‘Sake::Task::IO’, ‘correct task type’; + is $t.^name, ‘Ake::Task::IO’, ‘correct task type’; } @@ -116,14 +116,14 @@ subtest ‘`file` IO task with no deps and no block’, { lives-ok { $t = file ‘no-dep-no-block-file’ }, ‘lives’; is-deeply $t.deps, [], ‘correct deps’; nok $t.body.defined, ‘correct body’; - is $t.^name, ‘Sake::Task::IO’, ‘correct task type’; + is $t.^name, ‘Ake::Task::IO’, ‘correct task type’; } subtest ‘`file` IO task with no deps and a block’, { plan 4; lives-ok { $t = file ‘no-dep-block-file’, { 111 } }, ‘lives’; is-deeply $t.deps, [], ‘correct deps’; is-deeply $t.body.(), 111, ‘correct body’; - is $t.^name, ‘Sake::Task::IO’, ‘correct task type’; + is $t.^name, ‘Ake::Task::IO’, ‘correct task type’; } @@ -132,14 +132,14 @@ subtest ‘`file` IO task with one dep and no block’, { lives-ok { $t = file ‘str-dep-no-block-file’ => ‘one’ }, ‘lives’; is-deeply $t.deps, [‘one’,], ‘correct deps’; nok $t.body.defined, ‘correct body’; - is $t.^name, ‘Sake::Task::IO’, ‘correct task type’; + is $t.^name, ‘Ake::Task::IO’, ‘correct task type’; } subtest ‘`file` IO task with one dep and a block’, { plan 4; lives-ok { $t = file ‘str-dep-block-file’ => ‘two’, { 222 } }, ‘lives’; is-deeply $t.deps, [‘two’,], ‘correct deps’; is-deeply $t.body.(), 222, ‘correct body’; - is $t.^name, ‘Sake::Task::IO’, ‘correct task type’; + is $t.^name, ‘Ake::Task::IO’, ‘correct task type’; } @@ -148,12 +148,12 @@ subtest ‘`file` IO task with deps and no block’, { lives-ok { $t = file ‘list-dep-no-block-file’ => }, ‘lives’; is-deeply $t.deps, [‘foo’, ‘bar’], ‘correct deps’; nok $t.body.defined, ‘correct body’; - is $t.^name, ‘Sake::Task::IO’, ‘correct task type’; + is $t.^name, ‘Ake::Task::IO’, ‘correct task type’; } subtest ‘`file` IO task with deps and a block’, { plan 4; lives-ok { $t = file ‘list-dep-block-file’ => , {9} }, ‘lives’; is-deeply $t.deps, [‘foo’, ‘bar’], ‘correct deps’; is-deeply $t.body.(), 9, ‘correct body’; - is $t.^name, ‘Sake::Task::IO’, ‘correct task type’; + is $t.^name, ‘Ake::Task::IO’, ‘correct task type’; } diff --git a/t/20-signatures.t b/t/20-signatures.t index 544587d..b228b85 100644 --- a/t/20-signatures.t +++ b/t/20-signatures.t @@ -1,40 +1,40 @@ use v6.c; use lib ; -use Sake; -use SakeTester; +use Ake; +use AkeTester; use Test; plan 7; -given make-sake-directory 「task ‘foo’, { put 42 }」 { +given make-ake-directory 「task ‘foo’, { put 42 }」 { test-run ‘just a block’, - , :out(“42\n”) + , :out(“42\n”) } -given make-sake-directory 「task ‘foo’, -> $ { put 43 }」 { +given make-ake-directory 「task ‘foo’, -> $ { put 43 }」 { test-run ‘one param’, - , :out(“43\n”) + , :out(“43\n”) } -given make-sake-directory 「task ‘foo’, sub ($) { put 44 }」 { +given make-ake-directory 「task ‘foo’, sub ($) { put 44 }」 { test-run ‘one param (sub)’, - , :out(“44\n”) + , :out(“44\n”) } -given make-sake-directory 「task ‘foo’, -> { put 45 }」 { +given make-ake-directory 「task ‘foo’, -> { put 45 }」 { test-run ‘no params’, - , :out(“45\n”) + , :out(“45\n”) } -given make-sake-directory 「task ‘foo’, sub { put 46 }」 { +given make-ake-directory 「task ‘foo’, sub { put 46 }」 { test-run ‘no params (sub)’, - , :out(“46\n”) + , :out(“46\n”) } # Issue #7 -given make-sake-directory 「task ‘foo’, -> $task { put $task.name }」 { +given make-ake-directory 「task ‘foo’, -> $task { put $task.name }」 { test-run ‘task is passed’, - , :out(“foo\n”) + , :out(“foo\n”) } -given make-sake-directory 「task ‘foo’, sub ($task) { put $task.name }」 { +given make-ake-directory 「task ‘foo’, sub ($task) { put $task.name }」 { test-run ‘task is passed (sub)’, - , :out(“foo\n”) + , :out(“foo\n”) } diff --git a/t/21-tasks.t b/t/21-tasks.t index 9d2126b..3a1a176 100644 --- a/t/21-tasks.t +++ b/t/21-tasks.t @@ -1,19 +1,19 @@ use v6.c; use lib ; -use Sake; -use SakeTester; +use Ake; +use AkeTester; use Test; plan 2; -given make-sake-directory 「task ‘foo’, { put ‘hello’ }」 { +given make-ake-directory 「task ‘foo’, { put ‘hello’ }」 { test-run ‘simple task’, - , :out(“hello\n”) + , :out(“hello\n”) } # Issue #12 -given make-sake-directory 「task ‘foo’, { run ‘false’ }」 { +given make-ake-directory 「task ‘foo’, { run ‘false’ }」 { test-run ‘failed Proc’, - , :out(‘’), :1exitcode, + , :out(‘’), :1exitcode, :err(/‘The spawned command 'false' exited unsuccessfully’/) } diff --git a/t/22-files.t b/t/22-files.t index 08ac406..89ef677 100644 --- a/t/22-files.t +++ b/t/22-files.t @@ -1,29 +1,29 @@ use v6.c; use lib ; -use Sake; -use SakeTester; +use Ake; +use AkeTester; use Test; plan 6; -given make-sake-directory 「task ‘foo’.IO, { put ‘hello’ }」 { +given make-ake-directory 「task ‘foo’.IO, { put ‘hello’ }」 { test-run ‘simple IO task’, - , :out(“hello\n”); + , :out(“hello\n”); ok .add(‘foo’).e, ‘file was touched’; } -given make-sake-directory 「file ‘foo’, { put ‘hello’ }」 { +given make-ake-directory 「file ‘foo’, { put ‘hello’ }」 { test-run ‘simple IO task (file sub)’, - , :out(“hello\n”); + , :out(“hello\n”); ok .add(‘foo’).e, ‘file was touched (file sub)’; } # TODO test modification time # Issue #12 -given make-sake-directory 「task ‘foo’.IO, { run ‘false’ }」 { +given make-ake-directory 「task ‘foo’.IO, { run ‘false’ }」 { test-run ‘failed Proc’, - , :out(‘’), :1exitcode, + , :out(‘’), :1exitcode, :err(/‘The spawned command 'false' exited unsuccessfully’/); ok .add(‘foo’).e.not, ‘file not touched with failed Procs’; diff --git a/t/23-deps.t b/t/23-deps.t index 5c753a1..03e78ca 100644 --- a/t/23-deps.t +++ b/t/23-deps.t @@ -1,36 +1,36 @@ use v6.c; use lib ; -use Sake; -use SakeTester; +use Ake; +use AkeTester; use Test; plan 4; -given make-sake-directory 「 +given make-ake-directory 「 task ‘A’, { say ‘A!’ } task ‘B’ => ‘A’, { say ‘B!’ } 」 { - test-run ‘one basic dep’, , :out(“A!\nB!\n”); + test-run ‘one basic dep’, , :out(“A!\nB!\n”); } -given make-sake-directory 「 +given make-ake-directory 「 task ‘A’, { say ‘A!’ } task ‘B’ => ‘A’, { say ‘B!’ } task ‘C’ => ‘B’, { say ‘C!’ } task ‘D’ => ‘C’, { say ‘D!’ } 」 { - test-run ‘dependecy chain’, , :out(“A!\nB!\nC!\nD!\n”); + test-run ‘dependecy chain’, , :out(“A!\nB!\nC!\nD!\n”); } -given make-sake-directory 「 +given make-ake-directory 「 task ‘A’, { say ‘A!’ } task ‘B’, { say ‘B!’ } task ‘C’ => , { say ‘C!’ } 」 { - test-run ‘multiple dependencies’, , :out(“A!\nB!\nC!\n”); + test-run ‘multiple dependencies’, , :out(“A!\nB!\nC!\n”); } -given make-sake-directory 「 +given make-ake-directory 「 task ‘F’ => , { say ‘F!’ } task ‘B’, { say ‘B!’ } task ‘D’ => , { say ‘D!’ } @@ -38,7 +38,7 @@ task ‘A’, { say ‘A!’ } task ‘E’, { say ‘E!’ } task ‘C’ => , { say ‘C!’ } 」 { - test-run ‘shuffled dep tree’, , :out(“A!\nB!\nC!\nD!\nE!\nF!\n”); + test-run ‘shuffled dep tree’, , :out(“A!\nB!\nC!\nD!\nE!\nF!\n”); } # TODO IO tasks? diff --git a/t/24-task-task.t b/t/24-task-task.t index 0522f52..f3f3554 100644 --- a/t/24-task-task.t +++ b/t/24-task-task.t @@ -1,18 +1,18 @@ use v6.c; use lib ; -use Sake; -use SakeTester; +use Ake; +use AkeTester; use Test; plan 1; -given make-sake-directory 「 +given make-ake-directory 「 task ‘foo’, { put ‘foo!’ } task ‘bar’, { put ‘bar!’ } task ‘baz’, { put ‘baz!’ } 」 { test-run ‘multiple’, - , :out(“foo!\nbar!\nbaz!\n”) + , :out(“foo!\nbar!\nbaz!\n”) } # TODO test and fix tasks in different order diff --git a/t/25-parallel.t b/t/25-parallel.t index 521c821..0d54f5a 100644 --- a/t/25-parallel.t +++ b/t/25-parallel.t @@ -1,14 +1,14 @@ use v6.c; use lib ; -use Sake; -use SakeTester; +use Ake; +use AkeTester; use Test; plan :skip-all(‘NYI’); # TODO this file is just a placeholder -#given make-sake-directory 「task ‘foo’, { put ‘hello’ }」 { +#given make-ake-directory 「task ‘foo’, { put ‘hello’ }」 { # test-run ‘simple task’, -# , :out(“hello\n”) +# , :out(“hello\n”) #} diff --git a/t/27-default.t b/t/27-default.t index 45a58e6..6135298 100644 --- a/t/27-default.t +++ b/t/27-default.t @@ -1,24 +1,24 @@ use v6.c; use lib ; -use Sake; -use SakeTester; +use Ake; +use AkeTester; use Test; plan 2; -given make-sake-directory 「 +given make-ake-directory 「 task ‘first’, { put ‘first’ } task ‘default’, { put ‘default ok’ } 」 { test-run ‘no task implies default’, - , :out(“default ok\n”) + , :out(“default ok\n”) } -given make-sake-directory 「 +given make-ake-directory 「 task ‘first’, { put ‘first’ } 」 { test-run ‘no task implies default’, - , :out(‘’), + , :out(‘’), :err(*), # TODO check & fix the error message :2exitcode } diff --git a/t/28-current-task.t b/t/28-current-task.t index 6a674a5..89e76b6 100644 --- a/t/28-current-task.t +++ b/t/28-current-task.t @@ -1,18 +1,18 @@ use v6.c; use lib ; -use Sake; -use SakeTester; +use Ake; +use AkeTester; use Test; plan 2; # Issue #7 -given make-sake-directory 「task ‘foo’, { say .name }」 { +given make-ake-directory 「task ‘foo’, { say .name }」 { test-run ‘current task is passed to the block’, - , :out(“foo\n”) + , :out(“foo\n”) } skip ‘What should be done with IO task names?’, 1; -#given make-sake-directory 「task ‘foo’.IO, { say .name }」 { +#given make-ake-directory 「task ‘foo’.IO, { say .name }」 { # test-run ‘current IO task is passed to the block’, -# , :out(“foo\n”) +# , :out(“foo\n”) #} diff --git a/t/30-help.t b/t/30-help.t index d4f78d8..1349011 100644 --- a/t/30-help.t +++ b/t/30-help.t @@ -1,17 +1,17 @@ use v6.c; use lib ; -use Sake; -use SakeTester; +use Ake; +use AkeTester; use Test; plan 2; -given make-sake-directory 「task ‘foo’, { put ‘hello’ }」 { +given make-ake-directory 「task ‘foo’, { put ‘hello’ }」 { test-run ‘help ’, - , :out(“Registered tasks:\n\t✓ foo\n\t✓ help\n”); + , :out(“Registered tasks:\n\t✓ foo\n\t✓ help\n”); } -given make-sake-directory 「task ‘help’, { put ‘very helpful message’ }」 { +given make-ake-directory 「task ‘help’, { put ‘very helpful message’ }」 { test-run ‘help ’, - , :out(“very helpful message\n”); + , :out(“very helpful message\n”); } diff --git a/t/31-customfile.t b/t/31-customfile.t index 6dbde24..c570348 100644 --- a/t/31-customfile.t +++ b/t/31-customfile.t @@ -1,13 +1,13 @@ use v6.c; use lib ; -use Sake; -use SakeTester; +use Ake; +use AkeTester; use Test; plan 1; -given make-sake-directory :filename(‘customfile’), +given make-ake-directory :filename(‘customfile’), 「task ‘foo’, { put ‘hello’ }」 { - test-run ‘custom sakefile name’, - , :out(“hello\n”) + test-run ‘custom akefile name’, + , :out(“hello\n”) } diff --git a/t/35-security.t b/t/35-security.t index a8454a8..a58f44a 100644 --- a/t/35-security.t +++ b/t/35-security.t @@ -1,20 +1,20 @@ use v6.c; use lib ; -use Sake; -use SakeTester; +use Ake; +use AkeTester; use Test; plan 4; # Issue #13 -given make-sake-directory 「task 「`echo foo`」.IO, { put ‘hello’ }」 { +given make-ake-directory 「task 「`echo foo`」.IO, { put ‘hello’ }」 { test-run ‘shell injection does not work’, - (‘sake’, 「`echo foo`」), :out(“hello\n”); + (‘ake’, 「`echo foo`」), :out(“hello\n”); ok .add(「`echo foo`」).e, ‘file was touched’; } -given make-sake-directory 「task 「--foo」.IO, { put ‘hello’ }」 { +given make-ake-directory 「task 「--foo」.IO, { put ‘hello’ }」 { test-run ‘filenames are not interpreted as parameters’, - (, 「--foo」), :out(“hello\n”); + (, 「--foo」), :out(“hello\n”); ok .add(「--foo」).e, ‘file was touched’; } diff --git a/t/38-graph.t b/t/38-graph.t index 716014d..d079783 100644 --- a/t/38-graph.t +++ b/t/38-graph.t @@ -1,12 +1,12 @@ use v6.c; use lib ; -use Sake; -use SakeTester; +use Ake; +use AkeTester; use Test; plan :skip-all(‘NYI’); -#given make-sake-directory 「task ‘foo’, { put ‘hello’ }」 { +#given make-ake-directory 「task ‘foo’, { put ‘hello’ }」 { # test-run ‘simple task’, -# , :out(“hello\n”) +# , :out(“hello\n”) #} diff --git a/t/lib/SakeTester.pm6 b/t/lib/AkeTester.rakumod similarity index 90% rename from t/lib/SakeTester.pm6 rename to t/lib/AkeTester.rakumod index c26b915..0b47890 100644 --- a/t/lib/SakeTester.pm6 +++ b/t/lib/AkeTester.rakumod @@ -1,9 +1,9 @@ -unit module SakeTester; +unit module AkeTester; use File::Temp; use Test; -sub make-sake-directory($contents, :$filename = ‘Sakefile’) is export { +sub make-ake-directory($contents, :$filename = ‘Akefile’) is export { my $dir = tempdir.IO; $dir.add($filename).spurt: $contents; $dir