.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Path::FindDev::Object 3" .TH Path::FindDev::Object 3 2023-07-26 "perl v5.38.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Path::FindDev::Object \- Object oriented guts to FindDev .SH VERSION .IX Header "VERSION" version v0.5.3 .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 3 \& require Path::FindDev::Object; \& my $finder = Path::FindDev::Object\->new(); \& my $dev = $finder\->find_dev($path); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This module implements the innards of \f(CW\*(C`Path::FindDev\*(C'\fR, and is only recommended for use if the Exporter \f(CW\*(C`API\*(C'\fR is insufficient for your needs. .SH METHODS .IX Header "METHODS" .ie n .SS """has_set""" .el .SS \f(CWhas_set\fP .IX Subsection "has_set" Determines if the \f(CW\*(C`set\*(C'\fR attribute exists .ie n .SS """has_uplevel_max""" .el .SS \f(CWhas_uplevel_max\fP .IX Subsection "has_uplevel_max" Determines if the \f(CW\*(C`uplevel_max\*(C'\fR attribute is provided. .ie n .SS """find_dev""" .el .SS \f(CWfind_dev\fP .IX Subsection "find_dev" Find a parent at, or above \f(CW$OtherPath\fR that resembles a \f(CW\*(C`devel\*(C'\fR directory. .PP .Vb 1 \& my $path = $object\->find_dev( $OtherPath ); .Ve .SH ATTRIBUTES .IX Header "ATTRIBUTES" .ie n .SS """set""" .el .SS \f(CWset\fP .IX Subsection "set" \&\fB(optional)\fR .PP The \f(CW\*(C`Path::IsDev::HeuristicSet\*(C'\fR subclass for your desired Heuristics. .ie n .SS """uplevel_max""" .el .SS \f(CWuplevel_max\fP .IX Subsection "uplevel_max" If provided, limits the number of \f(CW\*(C`uplevel\*(C'\fR iterations done. .PP ( that is, limits the number of times it will step up the hierarchy ) .ie n .SS """nest_retry""" .el .SS \f(CWnest_retry\fP .IX Subsection "nest_retry" The number of \f(CW\*(C`dev\*(C'\fR directories to \f(CW\*(C`ignore\*(C'\fR in the hierarchy. .PP This is provided in the event you have a \f(CW\*(C`dev\*(C'\fR directory within a \f(CW\*(C`dev\*(C'\fR directory, and you wish to resolve an outer directory instead of an inner one. .PP By default, this is \f(CW0\fR, or "stop at the first \f(CW\*(C`dev\*(C'\fR directory" .ie n .SS """isdev""" .el .SS \f(CWisdev\fP .IX Subsection "isdev" The \f(CW\*(C`Path::IsDev\*(C'\fR object that checks nodes for \f(CW\*(C`dev\*(C'\fR\-ishness. .SH "PRIVATE METHODS" .IX Header "PRIVATE METHODS" .ie n .SS """_instance_id""" .el .SS \f(CW_instance_id\fP .IX Subsection "_instance_id" An opportunistic sequence number for help with debug messages. .PP Note: This is not guaranteed to be unique per instance, only guaranteed to be constant within the life of the object. .PP Based on \f(CW\*(C`refaddr\*(C'\fR, and giving out new ids when new \f(CW\*(C`refaddr\*(C'\fR's are seen. .PP .Vb 1 \& my $id = $object\->_instance_id; .Ve .ie n .SS """BUILD""" .el .SS \f(CWBUILD\fP .IX Subsection "BUILD" \&\f(CW\*(C`BUILD\*(C'\fR is an implementation detail of \f(CW\*(C`Moo\*(C'\fR/\f(CW\*(C`Moose\*(C'\fR. .PP This module hooks \f(CW\*(C`BUILD\*(C'\fR to give a self report of the object to \f(CW*STDERR\fR after \f(CW\*(C`\->new\*(C'\fR when under \f(CW$DEBUG\fR .ie n .SS """_debug""" .el .SS \f(CW_debug\fP .IX Subsection "_debug" The debugger callback. .PP .Vb 1 \& export PATH_FINDDEV_DEBUG=1 .Ve .PP to get debug info. .PP .Vb 1 \& $object\->_debug($message); .Ve .ie n .SS """_error""" .el .SS \f(CW_error\fP .IX Subsection "_error" The error reporting callback. .PP .Vb 1 \& $object\->_error($message); .Ve .ie n .SS """_step""" .el .SS \f(CW_step\fP .IX Subsection "_step" Inner code path of tree walking. .PP .Vb 1 \& my ($dev_levels, $uplevels ) = (0,0); \& \& my $result = $object\->_step( path($somepath), \e$dev_levels, \e$uplevels ); \& \& $result\->{type} eq \*(Aqstop\*(Aq # if flow control should end \& $result\->{type} eq \*(Aqnext\*(Aq # if flow control should ascend to parent \& $result\->{type} eq \*(Aqfound\*(Aq # if flow control has found the "final" dev directory .Ve .SH AUTHOR .IX Header "AUTHOR" Kent Fredric .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2017 by Kent Fredric . .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.