| File: | blib/lib/App/Rgit/Config/Default.pm |
| Coverage: | 93.6% |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | package App::Rgit::Config::Default; | ||||||
| 2 | |||||||
| 3 | 6 6 6 | 13134 26 419 | use strict; | ||||
| 4 | 6 6 6 | 72 22 523 | use warnings; | ||||
| 5 | |||||||
| 6 | 6 6 6 | 62 34 896 | use File::Find qw/find/; | ||||
| 7 | |||||||
| 8 | 6 6 6 | 53 17 886 | use base qw/App::Rgit::Config/; | ||||
| 9 | |||||||
| 10 | 6 6 6 | 58 12 2926 | use App::Rgit::Repository; | ||||
| 11 | |||||||
| 12 - 20 | =head1 NAME App::Rgit::Config::Default - Default App::Rgit configuration class. =head1 VERSION Version 0.08 =cut | ||||||
| 21 | |||||||
| 22 | our $VERSION = '0.08'; | ||||||
| 23 | |||||||
| 24 - 38 | =head1 DESCRIPTION Default L<App::Rgit> configuration class. This is an internal class to L<rgit>. =head1 METHODS This class inherits from L<App::Rgit::Config>. It implements : =head2 C<repos> =cut | ||||||
| 39 | |||||||
| 40 | sub repos { | ||||||
| 41 | 6 | 1 | 2874 | my $self = shift; | |||
| 42 | 6 | 90 | return $self->{repos} if defined $self->{repos}; | ||||
| 43 | 5 | 20 | my %repos; | ||||
| 44 | find { | ||||||
| 45 | wanted => sub { | ||||||
| 46 | 91 | 2701 | return if m{(?:^|/)\.\.?$} | ||||
| 47 | or not (-d $_ and -r _); | ||||||
| 48 | 66 | 1010 | if (my $r = App::Rgit::Repository->new(dir => $_)) { | ||||
| 49 | 12 | 28 | $File::Find::prune = 1; | ||||
| 50 | 12 | 244 | $repos{$r->repo} = $r unless exists $repos{$r->repo}; | ||||
| 51 | } | ||||||
| 52 | }, | ||||||
| 53 | 5 | 365 | follow => 1, | ||||
| 54 | no_chdir => 1, | ||||||
| 55 | }, $self->root; | ||||||
| 56 | 5 12 | 127 200 | $self->{repos} = [ sort { $a->repo cmp $b->repo } values %repos ]; | ||||
| 57 | } | ||||||
| 58 | |||||||
| 59 - 88 | =head1 SEE ALSO
L<rgit>.
L<App::Rgit::Config>.
=head1 AUTHOR
Vincent Pit, C<< <perl at profvince.com> >>, L<http://profvince.com>.
You can contact me by mail or on C<irc.perl.org> (vincent).
=head1 BUGS
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.
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc App::Rgit::Command::Default
=head1 COPYRIGHT & LICENSE
Copyright 2008,2009,2010 Vincent Pit, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
=cut | ||||||
| 89 | |||||||
| 90 | 1; # End of App::Rgit::Command::Default | ||||||