File Coverage

blib/lib/App/BitBucketCli/Command/Repository.pm
Criterion Covered Total %
statement 15 31 48.3
branch 0 10 0.0
condition n/a
subroutine 5 7 71.4
pod 2 2 100.0
total 22 50 44.0


line stmt bran cond sub pod time code
1             package App::BitBucketCli::Command::Repository;
2              
3             # Created on: 2018-06-07 08:23:20
4             # Create by: Ivan Wills
5             # $Id$
6             # $Revision$, $HeadURL$, $Date$
7             # $Revision$, $Source$, $Date$
8              
9 1     1   793 use Moo;
  1         3  
  1         4  
10 1     1   250 use warnings;
  1         2  
  1         30  
11 1     1   5 use Carp;
  1         2  
  1         42  
12 1     1   5 use Data::Dumper qw/Dumper/;
  1         2  
  1         40  
13 1     1   5 use English qw/ -no_match_vars /;
  1         2  
  1         5  
14              
15             extends 'App::BitBucketCli';
16              
17             our $VERSION = 0.009;
18              
19             sub options {
20 0     0 1   return [qw/
21             colors|c=s%
22             force|f!
23             long|l
24             project|p=s
25             regexp|R
26             remote|m=s
27             repository|r=s
28             sleep|s=i
29             /]
30             }
31              
32             sub repository {
33 0     0 1   my ($self) = @_;
34              
35 0           my $details = $self->core->repository($self->opt->{project}, $self->opt->{repository});
36 0 0         my $branches = @{ $self->core->get_branches($self->opt->{project}, $self->opt->{repository}) || [] };
  0            
37 0 0         my $prs_open = @{ $self->core->get_pull_requests($self->opt->{project}, $self->opt->{repository}) || [] };
  0            
38 0 0         my $prs_merged = @{ $self->core->get_pull_requests($self->opt->{project}, $self->opt->{repository}, 'merged') || [] };
  0            
39 0 0         my $prs_declined = @{ $self->core->get_pull_requests($self->opt->{project}, $self->opt->{repository}, 'declined') || [] };
  0            
40              
41 0           print $self->opt->{repository}, "\n";
42 0 0         print " $details->{description}\n" if $details->{description};
43 0           print " git clone $details->{cloneUrl}\n";
44 0           print " Pull Requests: $prs_open / $prs_merged / $prs_declined\n";
45 0           print " Branches : $branches\n";
46             }
47              
48             1;
49              
50             __END__
51              
52             =head1 NAME
53              
54             App::BitBucketCli::Command::Repository - Shows details of a repository
55              
56             =head1 VERSION
57              
58             This documentation refers to App::BitBucketCli::Command::Repository version 0.009
59              
60             =head1 SYNOPSIS
61              
62             bb-cli repository [options]
63              
64             OPTIONS:
65             -c --colors[=]str Change colours used specified as key=value
66             eg --colors disabled=grey22
67             current colour names aborted, disabled and notbuilt
68             -f --force Force action
69             -l --long Show long form data if possible
70             -p --project[=]str
71             For commands that need a project name this is the name to use
72             -R --recipient[=]str
73             ??
74             -R --regexp[=]str ??
75             -m --remote[=]str ??
76             -r --repository[=]str
77             For commands that work on repositories this contains the repository
78             -s --sleep[=]seconds
79             ??
80             -t --test ??
81              
82             CONFIGURATION:
83             -h --host[=]str Specify the Stash/Bitbucket Servier host name
84             -P --password[=]str
85             The password to connect to the server as
86             -u --username[=]str
87             The username to connect to the server as
88              
89             -v --verbose Show more detailed option
90             --version Prints the version information
91             --help Prints this help information
92             --man Prints the full documentation for bb-cli
93              
94             =head1 DESCRIPTION
95              
96             =head1 SUBROUTINES/METHODS
97              
98             =head2 C<options ()>
99              
100             Returns the command line options
101              
102             =head2 C<repository ()>
103              
104             =head1 DIAGNOSTICS
105              
106             =head1 CONFIGURATION AND ENVIRONMENT
107              
108             =head1 DEPENDENCIES
109              
110             =head1 INCOMPATIBILITIES
111              
112             =head1 BUGS AND LIMITATIONS
113              
114             There are no known bugs in this module.
115              
116             Please report problems to Ivan Wills (ivan.wills@gmail.com).
117              
118             Patches are welcome.
119              
120             =head1 AUTHOR
121              
122             Ivan Wills - (ivan.wills@gmail.com)
123              
124             =head1 LICENSE AND COPYRIGHT
125              
126             Copyright (c) 2018 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077).
127             All rights reserved.
128              
129             This module is free software; you can redistribute it and/or modify it under
130             the same terms as Perl itself. See L<perlartistic>. This program is
131             distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
132             without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
133             PARTICULAR PURPOSE.
134              
135             =cut