package App::Rgit::Utils; use strict; use warnings; use Cwd ();
# abs_path use File::Spec (); # file_name_is_absolute, updir,
splitdir, splitpath =head1 NAME App::Rgit::Utils - Miscellaneous
utilities for App::Rgit classes. =head1 VERSION Version 0.08
=cut our $VERSION = '0.08'; =head1 DESCRIPTION Miscellaneous
utilities for L classes. This is an internal module to L. =head1
FUNCTIONS =head2 C Forcefully make a path C<$path> absolute (in
L's meaning of the term) when it isn't already absolute or when
it contains C<'..'>. =cut sub abs_path { my ($path) = @_; if
(File::Spec->file_name_is_absolute($path)) { my $updir =
File::Spec->updir; my @chunks =
File::Spec->splitdir((File::Spec->splitpath($path))[1]); unless
(grep $_ eq $updir, @chunks) { return $path; } } return
Cwd::abs_path($path); } =head1 CONSTANTS =head2 C, C, C, C Codes
to return from the C callback to respectively proceed to the
next repository, retry the current one, end it all, and save the
return code. =cut use constant { SAVE => 0x1, NEXT => 0x2