Why not adopt me?
NAME
Path::FindDev - Find a development path somewhere in an upper hierarchy.
VERSION
version v0.5.3
DESCRIPTION
This package is mostly a glue layer around Path::IsDev
with a few directory walking tricks.
if
(
my
$root
= find_dev(
'/some/path/to/something/somewhere'
)) {
"development root = $root"
;
}
else
{
"No development root :("
;
}
FUNCTIONS
find_dev
my
$result
= find_dev(
'/some/path'
);
If a dev
directory is found at, or above, /some/path
, it will be returned as a Path::Tiny
If you pass configurations to import:
Then the exported find_dev
will pass that set name to Path::IsDev
.
Though you should only do this if
the default set is inadequate for your usage
you don't want the set to be overridden by
%ENV
Additionally, you can call find_dev directly:
require
Path::FindDev;
my
$result
= Path::FindDev::find_dev(
'/some/path'
);
Which by design inhibits your capacity to specify an alternative set in code.
EXAMPLE USE-CASES
Have you ever found yourself doing
In a test?
Have you found yourself paranoid of file-system semantics and tried
use
FindBin;
Have you ever done either of the above in a test, only to find you've needed to move the test to a deeper hierarchy, and thus, need to re-write all your path resolution?
Have you ever had this problem for multiple files?
No more!
use
FindBin;
^ Should work, regardless of which test you put it in, and regardless of what $CWD
happens to be when you call it.
AUTHOR
Kent Fredric <kentnl@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2017 by Kent Fredric <kentfredric@gmail.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.