File Coverage

blib/lib/App/GitGot/Repositories.pm
Criterion Covered Total %
statement 20 30 66.6
branch n/a
condition n/a
subroutine 7 10 70.0
pod 2 2 100.0
total 29 42 69.0


line stmt bran cond sub pod time code
1             package App::GitGot::Repositories;
2             our $AUTHORITY = 'cpan:GENEHACK';
3             $App::GitGot::Repositories::VERSION = '1.336';
4             # ABSTRACT: Object holding a collection of repositories
5 15     15   238 use 5.014;
  15         46  
6              
7 15     15   72 use Types::Standard -types;
  15         24  
  15         86  
8              
9 15     15   55921 use App::GitGot::Types qw/ GotRepo /;
  15         26  
  15         77  
10              
11 15     15   4537 use Moo;
  15         27  
  15         68  
12 15     15   9541 use MooX::HandlesVia;
  15         113636  
  15         75  
13 15     15   1356 use namespace::autoclean;
  15         27  
  15         83  
14              
15 15     15   1131 use overload '@{}' => sub { $_[0]->all };
  15     0   25  
  15         99  
  0            
16              
17              
18             has repos => (
19             is => 'ro',
20             isa => ArrayRef[GotRepo],
21             default => sub { [] },
22             required => 1,
23             handles_via => 'Array' ,
24             handles => {
25             all => 'elements'
26             }
27             );
28              
29              
30             sub name {
31 0     0 1   my( $self, $name ) = @_;
32              
33             return App::GitGot::Repositories->new( repos => [
34 0           grep { $_->{name} eq $name } $self->all
  0            
35             ]);
36             }
37              
38              
39             sub tags {
40 0     0 1   my( $self, @tags ) = @_;
41              
42 0           my @repos = $self->all;
43              
44 0           for my $tag ( @tags ) {
45 0           @repos = grep { $_->tags =~ /\b$tag\b/ } @repos;
  0            
46             }
47              
48 0           return App::GitGot::Repositories->new( repos => \@repos );
49             }
50              
51             1;
52              
53             __END__