| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Net::Google::Code; |
|
2
|
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
101560
|
use Any::Moose; |
|
|
6
|
|
|
|
|
154662
|
|
|
|
6
|
|
|
|
|
51
|
|
|
4
|
|
|
|
|
|
|
with 'Net::Google::Code::TypicalRoles'; |
|
5
|
6
|
|
|
6
|
|
3813
|
use Scalar::Util qw/blessed/; |
|
|
6
|
|
|
|
|
12
|
|
|
|
6
|
|
|
|
|
7116
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.19'; |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has 'project' => ( |
|
10
|
|
|
|
|
|
|
isa => 'Str', |
|
11
|
|
|
|
|
|
|
is => 'rw', |
|
12
|
|
|
|
|
|
|
); |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has 'labels' => ( |
|
15
|
|
|
|
|
|
|
isa => 'ArrayRef', |
|
16
|
|
|
|
|
|
|
is => 'rw', |
|
17
|
|
|
|
|
|
|
); |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has 'owners' => ( |
|
20
|
|
|
|
|
|
|
isa => 'ArrayRef', |
|
21
|
|
|
|
|
|
|
is => 'rw', |
|
22
|
|
|
|
|
|
|
); |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
has 'members' => ( |
|
25
|
|
|
|
|
|
|
isa => 'ArrayRef', |
|
26
|
|
|
|
|
|
|
is => 'rw', |
|
27
|
|
|
|
|
|
|
); |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
has 'summary' => ( |
|
30
|
|
|
|
|
|
|
isa => 'Str', |
|
31
|
|
|
|
|
|
|
is => 'rw', |
|
32
|
|
|
|
|
|
|
); |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
has 'description' => ( |
|
35
|
|
|
|
|
|
|
isa => 'Str', |
|
36
|
|
|
|
|
|
|
is => 'rw', |
|
37
|
|
|
|
|
|
|
); |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
has 'issues' => ( |
|
40
|
|
|
|
|
|
|
isa => 'ArrayRef[Net::Google::Code::Issue]', |
|
41
|
|
|
|
|
|
|
is => 'rw', |
|
42
|
|
|
|
|
|
|
); |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
has 'downloads' => ( |
|
45
|
|
|
|
|
|
|
isa => 'ArrayRef[Net::Google::Code::Download]', |
|
46
|
|
|
|
|
|
|
is => 'rw', |
|
47
|
|
|
|
|
|
|
); |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
has 'wikis' => ( |
|
50
|
|
|
|
|
|
|
isa => 'ArrayRef[Net::Google::Code::Wiki]', |
|
51
|
|
|
|
|
|
|
is => 'rw', |
|
52
|
|
|
|
|
|
|
); |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub download { |
|
55
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
|
56
|
1
|
|
|
|
|
11
|
require Net::Google::Code::Download; |
|
57
|
1
|
50
|
|
|
|
21
|
return Net::Google::Code::Download->new( |
|
|
|
50
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
project => $self->project, |
|
59
|
|
|
|
|
|
|
$self->email ? ( email => $self->email ) : (), |
|
60
|
|
|
|
|
|
|
$self->password ? ( password => $self->password ) : (), |
|
61
|
|
|
|
|
|
|
@_ |
|
62
|
|
|
|
|
|
|
); |
|
63
|
|
|
|
|
|
|
} |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub issue { |
|
66
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
|
67
|
1
|
|
|
|
|
973
|
require Net::Google::Code::Issue; |
|
68
|
1
|
50
|
|
|
|
23
|
return Net::Google::Code::Issue->new( |
|
|
|
50
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
project => $self->project, |
|
70
|
|
|
|
|
|
|
$self->email ? ( email => $self->email ) : (), |
|
71
|
|
|
|
|
|
|
$self->password ? ( password => $self->password ) : (), |
|
72
|
|
|
|
|
|
|
@_ |
|
73
|
|
|
|
|
|
|
); |
|
74
|
|
|
|
|
|
|
} |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub wiki { |
|
77
|
1
|
|
|
1
|
1
|
4
|
my $self = shift; |
|
78
|
1
|
|
|
|
|
968
|
require Net::Google::Code::Wiki; |
|
79
|
1
|
50
|
|
|
|
24
|
return Net::Google::Code::Wiki->new( |
|
|
|
50
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
project => $self->project, |
|
81
|
|
|
|
|
|
|
$self->email ? ( email => $self->email ) : (), |
|
82
|
|
|
|
|
|
|
$self->password ? ( password => $self->password ) : (), |
|
83
|
|
|
|
|
|
|
@_ |
|
84
|
|
|
|
|
|
|
); |
|
85
|
|
|
|
|
|
|
} |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub load { |
|
89
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
|
90
|
1
|
|
|
|
|
6
|
my $content = $self->fetch( $self->base_url ); |
|
91
|
1
|
|
|
|
|
156
|
return $self->parse( $content ); |
|
92
|
|
|
|
|
|
|
} |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub parse { |
|
95
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
|
96
|
1
|
|
|
|
|
2
|
my $tree = shift; |
|
97
|
1
|
|
|
|
|
5
|
my $need_delete = not blessed $tree; |
|
98
|
1
|
50
|
|
|
|
10
|
$tree = $self->html_tree( html => $tree ) unless blessed $tree; |
|
99
|
|
|
|
|
|
|
|
|
100
|
1
|
|
|
|
|
8
|
my $summary = |
|
101
|
|
|
|
|
|
|
$tree->look_down( id => 'psum' )->find_by_tag_name('a')->content_array_ref->[0]; |
|
102
|
1
|
50
|
|
|
|
298
|
$self->summary($summary) if $summary; |
|
103
|
|
|
|
|
|
|
|
|
104
|
1
|
|
|
|
|
4
|
my $description = |
|
105
|
|
|
|
|
|
|
$tree->look_down( id => 'wikicontent' )->content_array_ref->[0]->as_text; |
|
106
|
1
|
50
|
|
|
|
1084
|
$self->description($description) if $description; |
|
107
|
|
|
|
|
|
|
|
|
108
|
1
|
50
|
|
|
|
10
|
if ( |
|
109
|
|
|
|
|
|
|
my $members_header = $tree->look_down( |
|
110
|
|
|
|
|
|
|
_tag => 'b', |
|
111
|
6
|
|
|
6
|
|
1313
|
sub { $_[0]->as_text eq 'Committers:' } |
|
112
|
|
|
|
|
|
|
) |
|
113
|
|
|
|
|
|
|
) |
|
114
|
|
|
|
|
|
|
{ |
|
115
|
1
|
|
|
|
|
33
|
my @a = $members_header->parent->find_by_tag_name('a'); |
|
116
|
1
|
|
|
|
|
91
|
my @members; |
|
117
|
1
|
|
|
|
|
4
|
for my $member (@a) { |
|
118
|
2
|
|
|
|
|
26
|
push @members, $member->as_text; |
|
119
|
|
|
|
|
|
|
} |
|
120
|
|
|
|
|
|
|
|
|
121
|
1
|
|
|
|
|
29
|
$self->members( \@members ); |
|
122
|
|
|
|
|
|
|
} |
|
123
|
|
|
|
|
|
|
|
|
124
|
1
|
50
|
|
|
|
9
|
if ( |
|
125
|
|
|
|
|
|
|
my $owners_header = $tree->look_down( |
|
126
|
|
|
|
|
|
|
_tag => 'b', |
|
127
|
5
|
|
|
5
|
|
1438
|
sub { $_[0]->as_text eq 'Owners:' } |
|
128
|
|
|
|
|
|
|
) |
|
129
|
|
|
|
|
|
|
) |
|
130
|
|
|
|
|
|
|
{ |
|
131
|
1
|
|
|
|
|
36
|
my @a = $owners_header->parent->find_by_tag_name('a'); |
|
132
|
1
|
|
|
|
|
55
|
my @owners; |
|
133
|
1
|
|
|
|
|
4
|
for my $owner (@a) { |
|
134
|
1
|
|
|
|
|
4
|
push @owners, $owner->as_text; |
|
135
|
|
|
|
|
|
|
} |
|
136
|
|
|
|
|
|
|
|
|
137
|
1
|
|
|
|
|
32
|
$self->owners( \@owners ); |
|
138
|
|
|
|
|
|
|
} |
|
139
|
|
|
|
|
|
|
|
|
140
|
1
|
|
|
|
|
6
|
my @labels; |
|
141
|
1
|
|
|
|
|
9
|
my @labels_tags = $tree->look_down( href => qr/q\=label\:/ ); |
|
142
|
1
|
|
|
|
|
1392
|
for my $tag (@labels_tags) { |
|
143
|
1
|
|
|
|
|
8
|
push @labels, $tag->content_array_ref->[0]; |
|
144
|
|
|
|
|
|
|
} |
|
145
|
1
|
50
|
|
|
|
19
|
$self->labels( \@labels ) if @labels; |
|
146
|
1
|
50
|
|
|
|
9
|
$tree->delete if $need_delete; |
|
147
|
1
|
|
|
|
|
1993
|
return 1; |
|
148
|
|
|
|
|
|
|
} |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
sub load_downloads { |
|
152
|
1
|
|
|
1
|
1
|
833
|
my $self = shift; |
|
153
|
1
|
|
|
|
|
13
|
my $content = $self->fetch( $self->base_feeds_url . 'downloads/list' ); |
|
154
|
1
|
|
|
|
|
205
|
my @rows = $self->rows( html => $content ); |
|
155
|
1
|
|
|
|
|
3
|
my @downloads; |
|
156
|
1
|
|
|
|
|
10
|
require Net::Google::Code::Download; |
|
157
|
1
|
|
|
|
|
3
|
for my $row ( @rows ) { |
|
158
|
2
|
|
|
|
|
61
|
my $download = Net::Google::Code::Download->new( |
|
159
|
|
|
|
|
|
|
project => $self->project, |
|
160
|
|
|
|
|
|
|
%$row, |
|
161
|
|
|
|
|
|
|
); |
|
162
|
2
|
|
|
|
|
14
|
$download->load; |
|
163
|
2
|
|
|
|
|
3142
|
push @downloads, $download; |
|
164
|
|
|
|
|
|
|
} |
|
165
|
1
|
|
|
|
|
30
|
$self->downloads( \@downloads ); |
|
166
|
|
|
|
|
|
|
} |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
sub load_wikis { |
|
170
|
1
|
|
|
1
|
1
|
2246
|
my $self = shift; |
|
171
|
|
|
|
|
|
|
|
|
172
|
1
|
|
|
|
|
7
|
my $wiki_svn = $self->base_svn_url . 'wiki/'; |
|
173
|
1
|
|
|
|
|
6
|
my $content = $self->fetch( $wiki_svn ); |
|
174
|
1
|
|
|
|
|
223
|
my $tree = $self->html_tree( html => $content ); |
|
175
|
|
|
|
|
|
|
|
|
176
|
1
|
|
|
|
|
3
|
my @wikis; |
|
177
|
1
|
|
|
|
|
8
|
my @li = $tree->find_by_tag_name('li'); |
|
178
|
1
|
|
|
|
|
110
|
for my $li ( @li ) { |
|
179
|
2
|
|
|
|
|
11
|
my $name = $li->as_text; |
|
180
|
2
|
100
|
|
|
|
59
|
if ( $name =~ /(\S+)\.wiki$/ ) { |
|
181
|
1
|
|
|
|
|
5
|
$name = $1; |
|
182
|
1
|
|
|
|
|
13
|
require Net::Google::Code::Wiki; |
|
183
|
1
|
|
|
|
|
48
|
my $wiki = Net::Google::Code::Wiki->new( |
|
184
|
|
|
|
|
|
|
project => $self->project, |
|
185
|
|
|
|
|
|
|
name => $name, |
|
186
|
|
|
|
|
|
|
); |
|
187
|
1
|
|
|
|
|
9
|
$wiki->load; |
|
188
|
1
|
|
|
|
|
5
|
push @wikis, $wiki; |
|
189
|
|
|
|
|
|
|
} |
|
190
|
|
|
|
|
|
|
} |
|
191
|
1
|
|
|
|
|
5
|
$tree->delete; |
|
192
|
1
|
|
|
|
|
166
|
$self->wikis( \@wikis ); |
|
193
|
|
|
|
|
|
|
} |
|
194
|
|
|
|
|
|
|
|
|
195
|
6
|
|
|
6
|
|
42
|
no Any::Moose; |
|
|
6
|
|
|
|
|
23
|
|
|
|
6
|
|
|
|
|
38
|
|
|
196
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
1; |
|
199
|
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
__END__ |