line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::BitBucketCli::Base; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Created on: 2015-09-16 16:41:19 |
4
|
|
|
|
|
|
|
# Create by: Ivan Wills |
5
|
|
|
|
|
|
|
# $Id$ |
6
|
|
|
|
|
|
|
# $Revision$, $HeadURL$, $Date$ |
7
|
|
|
|
|
|
|
# $Revision$, $Source$, $Date$ |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
407
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
10
|
1
|
|
|
1
|
|
225
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
11
|
1
|
|
|
1
|
|
4
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
48
|
|
12
|
1
|
|
|
1
|
|
5
|
use Scalar::Util qw/blessed/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
13
|
1
|
|
|
1
|
|
5
|
use Data::Dumper qw/Dumper/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
14
|
1
|
|
|
1
|
|
4
|
use English qw/ -no_match_vars /; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
15
|
1
|
|
|
1
|
|
612
|
use App::BitBucketCli::Links; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
28
|
|
16
|
1
|
|
|
1
|
|
8
|
use App::BitBucketCli::Link; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
201
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = 0.009; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has [qw/ |
21
|
|
|
|
|
|
|
id |
22
|
|
|
|
|
|
|
link |
23
|
|
|
|
|
|
|
links |
24
|
|
|
|
|
|
|
/] => ( |
25
|
|
|
|
|
|
|
is => 'rw', |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
around BUILDARGS => sub { |
29
|
|
|
|
|
|
|
my ( $orig, $class, @args ) = @_; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my $args |
32
|
|
|
|
|
|
|
= !@args ? {} |
33
|
|
|
|
|
|
|
: @args == 1 ? { %{ $args[0] } } |
34
|
|
|
|
|
|
|
: {@args}; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
if ( $args->{links} && ! blessed $args->{links} ) { |
37
|
|
|
|
|
|
|
$args->{links} = App::BitBucketCli::Links->new(%{ $args->{links} }); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
if ( $args->{link} && ! blessed $args->{link} ) { |
41
|
|
|
|
|
|
|
$args->{link} = App::BitBucketCli::Link->new(%{ $args->{link} }); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
return $class->$orig($args); |
45
|
|
|
|
|
|
|
}; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub TO_JSON { |
48
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
49
|
0
|
|
|
|
|
|
return { %{ $self } }; |
|
0
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 NAME |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
App::BitBucketCli::Base - Parent class for other BitBucket objects |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 VERSION |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
This documentation refers to App::BitBucketCli::Base version 0.009 |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 SYNOPSIS |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
package App::BitBucket::SomeObject; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
extends qw/App::BitBucketCli::Base/; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# class will automatically get id, link and links attributes |
71
|
|
|
|
|
|
|
# Also will autmatically be dumpable by L<JSON::XS> |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 DESCRIPTION |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
This is the base class for L<App::BitBucket::Project>, L<App::BitBucket::Repositories>, |
77
|
|
|
|
|
|
|
L<App::BitBucket::Repository>, ... |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 C<BUILDARGS ()> |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head2 C<TO_JSON ()> |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Used by L<JSON::XS> for dumping the object |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head2 id |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Most BitBucket objects return an ID |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head2 link |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Usually the URL to access this resource. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head2 links |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Usually a list of URLs for the object. |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 DIAGNOSTICS |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 CONFIGURATION AND ENVIRONMENT |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 DEPENDENCIES |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 INCOMPATIBILITIES |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 BUGS AND LIMITATIONS |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
There are no known bugs in this module. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Please report problems to Ivan Wills (ivan.wills@gmail.com). |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
Patches are welcome. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=head1 AUTHOR |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
Ivan Wills - (ivan.wills@gmail.com) |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
Copyright (c) 2015 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077). |
124
|
|
|
|
|
|
|
All rights reserved. |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
This module is free software; you can redistribute it and/or modify it under |
127
|
|
|
|
|
|
|
the same terms as Perl itself. See L<perlartistic>. This program is |
128
|
|
|
|
|
|
|
distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
129
|
|
|
|
|
|
|
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
130
|
|
|
|
|
|
|
PARTICULAR PURPOSE. |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=cut |