Dancer2
view release on metacpan or search on metacpan
lib/Dancer2/Core/Role/HasLocation.pm view on Meta::CPAN
# default to the dir that contains the script...
my $location = Path::Tiny::path($script)->parent;
$location->is_dir
or Carp::croak("Caller $script is not an existing file");
#we try to find bin and lib
my $subdir = $location;
my $subdir_found = 0;
#maximum of 10 iterations, to prevent infinite loop
for ( 1 .. 10 ) {
#try to find libdir and bindir to determine the root of dancer app
my $libdir = $subdir->child('lib');
my $bindir = $subdir->child('bin');
#try to find .dancer_app file to determine the root of dancer app
my $dancerdir = $subdir->child('.dancer');
# if one of them is found, keep that; but skip ./blib since both lib and bin exist
t/session_object.t view on Meta::CPAN
my $s1 = $ENGINE->create;
my $id = $s1->id;
if (exists $seen->{$id}) {
last;
}
$seen->{$id} = 1;
$iteration++;
}
is $iteration, $count,
"no duplicate ID after $count iterations (done $iteration)";
};
done_testing;
( run in 2.517 seconds using v1.01-cache-2.11-cpan-71847e10f99 )