1 package App::Rgit::Utils;
7 use File::Spec (); # file_name_is_absolute, updir, splitdir, splitpath
11 App::Rgit::Utils - Miscellaneous utilities for App::Rgit classes.
19 our $VERSION = '0.08';
23 Miscellaneous utilities for L<App::Rgit> classes.
25 This is an internal module to L<rgit>.
31 my $absolute_path = abs_path($path);
33 Forcefully make a path C<$path> absolute (in L<Cwd/abs_path>'s meaning of the term) when it isn't already absolute or when it contains C<'..'>.
40 if (File::Spec->file_name_is_absolute($path)) {
41 my $updir = File::Spec->updir;
42 my @chunks = File::Spec->splitdir((File::Spec->splitpath($path))[1]);
44 unless (grep $_ eq $updir, @chunks) {
49 return Cwd::abs_path($path);
62 Codes to return from the C<report> callback to respectively proceed to the next repository, retry the current one, end it all, and save the return code.
96 L<abs_path> is only exported on request.
98 C<NEXT> C<REDO>, C<LAST> and C<SAVE> are only exported on request, either by their name or by the C<'codes'> tags.
100 C<INFO>, C<WARN>, C<ERR> and C<CRIT> are only exported on request, either by their name or by the C<'levels'> tags.
104 use base qw<Exporter>;
108 funcs => [ qw<abs_path> ],
109 codes => [ qw<SAVE NEXT REDO LAST> ],
110 levels => [ qw<INFO WARN ERR CRIT> ],
112 our @EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
113 $EXPORT_TAGS{'all'} = [ @EXPORT_OK ];
121 Vincent Pit, C<< <perl at profvince.com> >>, L<http://profvince.com>.
123 You can contact me by mail or on C<irc.perl.org> (vincent).
127 Please report any bugs or feature requests to C<bug-rgit at rt.cpan.org>, or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=rgit>.
128 I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
132 You can find documentation for this module with the perldoc command.
134 perldoc App::Rgit::Utils
136 =head1 COPYRIGHT & LICENSE
138 Copyright 2008,2009,2010 Vincent Pit, all rights reserved.
140 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
144 1; # End of App::Rgit::Utils