]> git.vpit.fr Git - perl/modules/rgit.git/blob - lib/App/Rgit.pm
Bump copyright year
[perl/modules/rgit.git] / lib / App / Rgit.pm
1 package App::Rgit;
2
3 use strict;
4 use warnings;
5
6 use Object::Tiny qw/config command/;
7
8 use App::Rgit::Command;
9 use App::Rgit::Config;
10 use App::Rgit::Utils qw/validate/;
11
12 =head1 NAME
13
14 App::Rgit - Backend that supports the rgit utility.
15
16 =head1 VERSION
17
18 Version 0.05
19
20 =cut
21
22 our $VERSION = '0.05';
23
24 =head1 DESCRIPTION
25
26 Backend that supports the L<rgit> utility.
27
28 This is an internal class to L<rgit>.
29
30 =head1 METHODS
31
32 =head2 C<< new root => $root, git => $git, cmd => $cmd, args => \@args >>
33
34 Creates a new L<App::Rgit> object that's bound to execute the command C<$cmd> on all the C<git> repositories inside C<$root> with C<@args> as arguments and C<$git> as C<git> executable.
35
36 =cut
37
38 sub new {
39  my ($class, %args) = &validate;
40  my $config = App::Rgit::Config->new(
41   root  => $args{root},
42   git   => $args{git},
43   debug => $args{debug},
44  );
45  return unless defined $config;
46  my $command = App::Rgit::Command->new(
47   cmd    => $args{cmd},
48   args   => $args{args},
49   policy => $args{policy},
50  );
51  return unless defined $command;
52  $class->SUPER::new(
53   config  => $config,
54   command => $command,
55  );
56 }
57
58 =head2 C<run>
59
60 Actually run the commands.
61
62 =cut
63
64 sub run {
65  my $self = shift;
66  $self->command->run($self->config);
67 }
68
69 =head2 C<config>
70
71 =head2 C<command>
72
73 Accessors.
74
75 =head1 SEE ALSO
76
77 L<rgit>.
78
79 =head1 AUTHOR
80
81 Vincent Pit, C<< <perl at profvince.com> >>, L<http://profvince.com>.
82    
83 You can contact me by mail or on C<irc.perl.org> (vincent).
84
85 =head1 BUGS
86
87 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.
88
89 =head1 SUPPORT
90
91 You can find documentation for this module with the perldoc command.
92
93     perldoc App::Rgit
94
95 =head1 COPYRIGHT & LICENSE
96
97 Copyright 2008-2009 Vincent Pit, all rights reserved.
98
99 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
100
101 =cut
102
103 1; # End of App::Rgit