line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::BitBucketCli; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Created on: 2017-04-24 08:14:30 |
4
|
|
|
|
|
|
|
# Create by: Ivan Wills |
5
|
|
|
|
|
|
|
# $Id$ |
6
|
|
|
|
|
|
|
# $Revision$, $HeadURL$, $Date$ |
7
|
|
|
|
|
|
|
# $Revision$, $Source$, $Date$ |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
57694
|
use Moo; |
|
1
|
|
|
|
|
9625
|
|
|
1
|
|
|
|
|
5
|
|
10
|
1
|
|
|
1
|
|
1145
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
11
|
1
|
|
|
1
|
|
4
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
12
|
1
|
|
|
1
|
|
652
|
use WWW::Mechanize; |
|
1
|
|
|
|
|
126497
|
|
|
1
|
|
|
|
|
40
|
|
13
|
1
|
|
|
1
|
|
636
|
use JSON::XS qw/decode_json encode_json/; |
|
1
|
|
|
|
|
4300
|
|
|
1
|
|
|
|
|
56
|
|
14
|
1
|
|
|
1
|
|
520
|
use Data::Dumper qw/Dumper/; |
|
1
|
|
|
|
|
5010
|
|
|
1
|
|
|
|
|
56
|
|
15
|
1
|
|
|
1
|
|
479
|
use English qw/ -no_match_vars /; |
|
1
|
|
|
|
|
2931
|
|
|
1
|
|
|
|
|
6
|
|
16
|
1
|
|
|
1
|
|
681
|
use App::BitBucketCli::Core; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
164
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = 0.008; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has core => ( |
21
|
|
|
|
|
|
|
is => 'ro', |
22
|
|
|
|
|
|
|
handles => [qw/ |
23
|
|
|
|
|
|
|
opt |
24
|
|
|
|
|
|
|
/], |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
around BUILDARGS => sub { |
28
|
|
|
|
|
|
|
my ($orig, $class, @params) = @_; |
29
|
|
|
|
|
|
|
my %param; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
if ( ref $params[0] eq 'HASH' ) { |
32
|
|
|
|
|
|
|
%param = %{ shift @params }; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
else { |
35
|
|
|
|
|
|
|
%param = @params; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# only pass on defined params |
39
|
|
|
|
|
|
|
for my $key (keys %param) { |
40
|
|
|
|
|
|
|
delete $param{$key} if ! defined $param{$key}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
$param{core} = App::BitBucketCli::Core->new(%param); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
return $class->$orig(%param); |
46
|
|
|
|
|
|
|
}; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 NAME |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
App::BitBucketCli - Library for talking to BitBucket Server (or Stash) |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 VERSION |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
This documentation refers to App::BitBucketCli version 0.008 |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 SYNOPSIS |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
use App::BitBucketCli; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
# create a stash object |
65
|
|
|
|
|
|
|
my $stash = App::BitBucketCli->new( |
66
|
|
|
|
|
|
|
url => 'http://stash.example.com/', |
67
|
|
|
|
|
|
|
); |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
# Get a list of open pull requests for a repository |
70
|
|
|
|
|
|
|
my $prs = $stash->pull_requests($project, $repository); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 DESCRIPTION |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
This module implement the sub-commands for the L<bb-cli> command line program. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 C<projects ()> |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Lists all of the projects the user can view. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head2 C<repositories ()> |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Lists all of the repositories in a project |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head2 C<repository ()> |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Shows details of a repository |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head2 C<branches ()> |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Lists the branches of a repository |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head2 C<pull_requests ()> |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Lists the pull requests of a repository |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head2 C<BUILDARGS ()> |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Moo builder |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head2 C<core> |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
Is a L<App::BitBucketCli::Core> object for talking to the server. |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 DIAGNOSTICS |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=head1 CONFIGURATION AND ENVIRONMENT |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head1 DEPENDENCIES |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 INCOMPATIBILITIES |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 BUGS AND LIMITATIONS |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
There are no known bugs in this module. |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Please report problems to Ivan Wills (ivan.wills@gmail.com). |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
Patches are welcome. |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head1 AUTHOR |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Ivan Wills - (ivan.wills@gmail.com) |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
Copyright (c) 2017 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077). |
131
|
|
|
|
|
|
|
All rights reserved. |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
This module is free software; you can redistribute it and/or modify it under |
134
|
|
|
|
|
|
|
the same terms as Perl itself. See L<perlartistic>. This program is |
135
|
|
|
|
|
|
|
distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
136
|
|
|
|
|
|
|
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
137
|
|
|
|
|
|
|
PARTICULAR PURPOSE. |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=cut |