Subject: | add support for preconditions |
It should be possible to set a precondition for a C<using> block in a step. Of course, any
step run previously comprises a precondition, but it may be desirable to be explicit about it:
step sshKeys =>
ensure { -f ".ssh/identity" }
presuming { -x "/usr/bin/ssh-keygen" }
using { system "ssh-keygen -t rsa1" }
;
C<presuming> should also take a step argument:
my $installSSH = step installSSH =>
...;
step sshKeys =>
ensure { -f ".ssh/identity" }
presuming $installSSH,
using { system "ssh-keygen -t rsa1" }
;
possibly with arguments:
step sshKeys =>
ensure { -f ".ssh/identity" }
presuming $installSSH->with(@args),
using { system "ssh-keygen -t rsa1" }
;
and if presuming returns a Commands::Guarded object, it should use that as the
precondition:
step sshKeys =>
ensure { -f ".ssh/identity" }
presuming {
$installSSH->with(@_) # Use same args as ensure and using
}
using { system "ssh-keygen -t rsa1" }
;