]> git.vpit.fr Git - perl/modules/rgit.git/blob - lib/App/Rgit/Config/Default.pm
Import rgit-0.01
[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.01
19
20 =cut
21
22 our $VERSION = '0.01';
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 unless -d $_;
47    return if $_ eq '.' or $_ eq '..';
48    my $r = App::Rgit::Repository->new(dir => $File::Find::name);
49    $repos{$r->repo} = $r if $r 
50                          and not exists $repos{$r->repo};
51   },
52   follow => 1
53  }, $self->root;
54  $self->{repos} = [ values %repos ];
55 }
56
57 =head1 SEE ALSO
58
59 L<rgit>.
60
61 =head1 AUTHOR
62
63 Vincent Pit, C<< <perl at profvince.com> >>, L<http://profvince.com>.
64
65 You can contact me by mail or on C<irc.perl.org> (vincent).
66
67 =head1 BUGS
68
69 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.
70
71 =head1 SUPPORT
72
73 You can find documentation for this module with the perldoc command.
74
75     perldoc App::Rgit::Command::Default
76
77 =head1 COPYRIGHT & LICENSE
78
79 Copyright 2008 Vincent Pit, all rights reserved.
80
81 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
82
83 =cut
84
85 1; # End of App::Rgit::Command::Default