File Coverage

blib/lib/App/Rgit.pm
Criterion Covered Total %
statement 25 25 100.0
branch 2 4 50.0
condition 2 3 66.6
subroutine 9 9 100.0
pod 4 4 100.0
total 42 45 93.3


line stmt bran cond sub pod time code
1             package App::Rgit;
2              
3 4     4   111964 use strict;
  4         8  
  4         132  
4 4     4   22 use warnings;
  4         6  
  4         119  
5              
6 4     4   2150 use App::Rgit::Command;
  4         9  
  4         100  
7 4     4   2233 use App::Rgit::Config;
  4         13  
  4         829  
8              
9             =head1 NAME
10              
11             App::Rgit - Backend that supports the rgit utility.
12              
13             =head1 VERSION
14              
15             Version 0.08
16              
17             =cut
18              
19             our $VERSION = '0.08';
20              
21             =head1 DESCRIPTION
22              
23             Backend that supports the L utility.
24              
25             This is an internal class to L.
26              
27             =head1 METHODS
28              
29             =head2 C<< new root => $root, git => $git, cmd => $cmd, args => \@args >>
30              
31             Creates a new L object that's bound to execute the command C<$cmd> on all the C repositories inside C<$root> with C<@args> as arguments and C<$git> as C executable.
32              
33             =cut
34              
35             sub new {
36 18     18 1 64755 my $class = shift;
37 18   66     220 $class = ref $class || $class;
38              
39 18         160 my %args = @_;
40              
41 18         308 my $config = App::Rgit::Config->new(
42             root => $args{root},
43             git => $args{git},
44             debug => $args{debug},
45             );
46 16 50       256 return unless defined $config;
47              
48 16         373 my $command = App::Rgit::Command->new(
49             cmd => $args{cmd},
50             args => $args{args},
51             policy => $args{policy},
52             );
53 16 50       88 return unless defined $command;
54              
55 16         832 bless {
56             config => $config,
57             command => $command,
58             }, $class;
59             }
60              
61             =head2 C
62              
63             Actually run the commands.
64              
65             =cut
66              
67             sub run {
68 9     9 1 9806 my $self = shift;
69              
70 9         292 $self->command->run($self->config);
71             }
72              
73             =head2 C
74              
75             =head2 C
76              
77             Read-only accessors.
78              
79             =cut
80              
81             BEGIN {
82 4     4 1 453 eval "sub $_ { \$_[0]->{$_} }" for qw/config command/;
  9     9 1 333  
  9     9   52  
83             }
84              
85             =head1 SEE ALSO
86              
87             L.
88              
89             =head1 AUTHOR
90              
91             Vincent Pit, C<< >>, L.
92              
93             You can contact me by mail or on C (vincent).
94              
95             =head1 BUGS
96              
97             Please report any bugs or feature requests to C, or through the web interface at L.
98             I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
99              
100             =head1 SUPPORT
101              
102             You can find documentation for this module with the perldoc command.
103              
104             perldoc App::Rgit
105              
106             =head1 COPYRIGHT & LICENSE
107              
108             Copyright 2008,2009,2010 Vincent Pit, all rights reserved.
109              
110             This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
111              
112             =cut
113              
114             1; # End of App::Rgit