]> git.vpit.fr Git - perl/modules/rgit.git/blob - lib/App/Rgit/Utils.pm
Replace croak() by Carp::confess()
[perl/modules/rgit.git] / lib / App / Rgit / Utils.pm
1 package App::Rgit::Utils;
2
3 use strict;
4 use warnings;
5
6 =head1 NAME
7
8 App::Rgit::Utils - Miscellaneous utilities for App::Rgit classes.
9
10 =head1 VERSION
11
12 Version 0.06
13
14 =cut
15
16 our $VERSION = '0.06';
17
18 =head1 DESCRIPTION
19
20 Miscellaneous utilities for L<App::Rgit> classes.
21
22 This is an internal module to L<rgit>.
23
24 =head1 CONSTANTS
25
26 =head2 C<NEXT>, C<REDO>, C<LAST>, C<SAVE>
27
28 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.
29
30 =cut
31
32 use constant {
33  SAVE => 0x1,
34  NEXT => 0x2,
35  REDO => 0x4,
36  LAST => 0x8,
37 };
38
39 =head2 C<DIAG>, C<INFO>, C<WARN>, C<ERR> and C<CRIT>
40
41 Message levels.
42
43 =cut
44
45 use constant {
46  INFO => 3,
47  WARN => 2,
48  ERR  => 1,
49  CRIT => 0,
50 };
51
52 =head1 EXPORT
53
54 C<NEXT> C<REDO>, C<LAST> and C<SAVE> are only exported on request, either by their name or by the C<'codes'> tags.
55
56 C<INFO>, C<WARN>, C<ERR> and C<CRIT> are only exported on request, either by their name or by the C<'levels'> tags.
57
58 =cut
59
60 use base qw/Exporter/;
61
62 our @EXPORT         = ();
63 our %EXPORT_TAGS    = (
64  codes  => [ qw/SAVE NEXT REDO LAST/ ],
65  levels => [ qw/INFO WARN ERR CRIT/ ],
66 );
67 our @EXPORT_OK      = map { @$_ } values %EXPORT_TAGS;
68 $EXPORT_TAGS{'all'} = [ @EXPORT_OK ];
69
70 =head1 SEE ALSO
71
72 L<rgit>.
73
74 =head1 AUTHOR
75
76 Vincent Pit, C<< <perl at profvince.com> >>, L<http://profvince.com>.
77
78 You can contact me by mail or on C<irc.perl.org> (vincent).
79
80 =head1 BUGS
81
82 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>.  I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
83
84 =head1 SUPPORT
85
86 You can find documentation for this module with the perldoc command.
87
88     perldoc App::Rgit::Utils
89
90 =head1 COPYRIGHT & LICENSE
91
92 Copyright 2008-2009 Vincent Pit, all rights reserved.
93
94 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
95
96 =cut
97
98 1; # End of App::Rgit::Utils