| Verby documentation | Contained in the Verby distribution. |
Verby::Action::MkPath - Action to create a directory path
use Verby::Step::Closure qw/step/;
step "Verby::Action::MkPath" => sub {
my ($self, $c) = @_;
$c->path("/some/path/that/will/be/created");
}
This Action uses mkpath in File::Path to create a directory path.
Creates the directory $c->path.
Ensures that the directory $c->path exists.
None that we are aware of. Of course, if you find a bug, let us know, and we will be sure to fix it.
We use Devel::Cover to test the code coverage of the tests, please refer to COVERAGE section of the Verby module for more information.
Yuval Kogman, <nothingmuch@woobling.org>
Copyright 2005-2008 by Infinity Interactive, Inc.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Verby documentation | Contained in the Verby distribution. |
#!/usr/bin/perl package Verby::Action::MkPath; use Moose; with qw/Verby::Action/; use File::Path qw/mkpath/; our $VERSION = "0.05"; sub do { my $self = shift; my $c = shift; my $path = $c->path; if ( !defined($path) || !length($path) ){ $c->logger->log_and_die(level => "error", message => "invalid path"); } $c->logger->info("creating path '$path'"); mkpath($path) or $c->logger->log_and_die(level => "error", message => "couldn't mkpath('$path'): $!"); $self->confirm($c); } sub verify { my $self = shift; my $c = shift; -d $c->path; } __PACKAGE__ __END__