File Coverage

blib/lib/Git/Release/RemoteManager.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1             package Git::Release::RemoteManager;
2 1     1   3025 use Moose;
  0            
  0            
3             use Git::Release::Remote;
4              
5             has manager => ( is => 'rw' );
6              
7             sub repo { return $_[0]->manager->repo; }
8              
9             sub add {
10             my ($self,$name,$uri) = @_;
11             $self->manager->repo->command('remote','add',$name,$uri);
12             }
13              
14             sub all {
15             my $self = shift;
16             # provide a list context to get remote names
17             return map { $self->get($_) } $self->list;
18             }
19              
20             sub list {
21             my $self = shift;
22             my @remotes = $self->manager->repo->command('remote');
23             chomp(@remotes);
24             return @remotes;
25             }
26              
27             sub get {
28             my ($self,$name) = @_;
29             return Git::Release::Remote->new( manager => $self->manager , name => $name );
30             }
31              
32             sub origin {
33             my @r = grep /origin/,$_[0]->list;
34             return pop @r if @r;
35             }
36              
37             1;