]> git.vpit.fr Git - perl/modules/rgit.git/blob - lib/App/Rgit/Config/Default.pm
1544e4735bcbc1a9bffb971b58e02bab2197058b
[perl/modules/rgit.git] / lib / App / Rgit / Config / Default.pm
1 package App::Rgit::Config::Default;
2
3 use strict;
4 use warnings;
5
6 use File::Find qw/find/;
7
8 use base qw/App::Rgit::Config/;
9
10 use App::Rgit::Repository;
11
12 =head1 NAME
13
14 App::Rgit::Config::Default - Default App::Rgit configuration class.
15
16 =head1 VERSION
17
18 Version 0.07
19
20 =cut
21
22 our $VERSION = '0.07';
23
24 =head1 DESCRIPTION
25
26 Default L<App::Rgit> configuration class.
27
28 This is an internal class to L<rgit>.
29
30 =head1 METHODS
31
32 This class inherits from L<App::Rgit::Config>.
33
34 It implements :
35
36 =head2 C<repos>
37
38 =cut
39
40 sub repos {
41  my $self = shift;
42  return $self->{repos} if defined $self->{repos};
43  my %repos;
44  find {
45   wanted => sub {
46    return if m{(?:^|/)\.\.?$}
47           or not (-d $_ and -r _);
48    if (my $r = App::Rgit::Repository->new(dir => $_)) {
49     $File::Find::prune = 1;
50     $repos{$r->repo} = $r unless exists $repos{$r->repo};
51    }
52   },
53   follow   => 1,
54   no_chdir => 1,
55  }, $self->root;
56  $self->{repos} = [ sort { $a->repo cmp $b->repo } values %repos ];
57 }
58
59 =head1 SEE ALSO
60
61 L<rgit>.
62
63 L<App::Rgit::Config>.
64
65 =head1 AUTHOR
66
67 Vincent Pit, C<< <perl at profvince.com> >>, L<http://profvince.com>.
68
69 You can contact me by mail or on C<irc.perl.org> (vincent).
70
71 =head1 BUGS
72
73 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>.
74 I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
75
76 =head1 SUPPORT
77
78 You can find documentation for this module with the perldoc command.
79
80     perldoc App::Rgit::Command::Default
81
82 =head1 COPYRIGHT & LICENSE
83
84 Copyright 2008,2009,2010 Vincent Pit, all rights reserved.
85
86 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
87
88 =cut
89
90 1; # End of App::Rgit::Command::Default