line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
950
|
use 5.010; # _Pulp__5010_qr_m_propagate_properly |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
43
|
|
2
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
33
|
|
4
|
1
|
|
|
1
|
|
778
|
use utf8; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
6
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Net::Travis::API::UA::Response; |
7
|
|
|
|
|
|
|
$Net::Travis::API::UA::Response::VERSION = '0.001001'; |
8
|
|
|
|
|
|
|
# ABSTRACT: Subclass of HTTP::Tiny::UA::Response for utility methods |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
1
|
|
804
|
use Moo qw( extends has ); |
|
1
|
|
|
|
|
15257
|
|
|
1
|
|
|
|
|
7
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
1
|
|
|
1
|
|
2619
|
use Encode qw( FB_CROAK ); |
|
1
|
|
|
|
|
11607
|
|
|
1
|
|
|
|
|
640
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
extends 'HTTP::Tiny::UA::Response'; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
has 'json' => ( |
66
|
|
|
|
|
|
|
is => ro =>, |
67
|
|
|
|
|
|
|
lazy => 1, |
68
|
|
|
|
|
|
|
builder => sub { |
69
|
0
|
|
|
0
|
|
|
require JSON; |
70
|
0
|
|
|
|
|
|
return JSON->new(); |
71
|
|
|
|
|
|
|
}, |
72
|
|
|
|
|
|
|
); |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub content_type { |
87
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
88
|
0
|
0
|
|
|
|
|
return unless exists $self->headers->{'content-type'}; |
89
|
|
|
|
|
|
|
return |
90
|
0
|
0
|
|
|
|
|
unless my ($type) = $self->headers->{'content-type'} =~ qr{ \A ( [^/]+ / [^;]+ ) }msx; |
91
|
0
|
|
|
|
|
|
return $type; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub content_type_params { |
110
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
111
|
0
|
0
|
|
|
|
|
return [] unless exists $self->headers->{'content-type'}; |
112
|
0
|
0
|
|
|
|
|
return [] |
113
|
|
|
|
|
|
|
unless my (@params) = $self->headers->{'content-type'} =~ qr{ (?:;([^;]+))+ }msx; |
114
|
0
|
|
|
|
|
|
return [@params]; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
sub decoded_content { |
134
|
0
|
|
|
0
|
1
|
|
my ( $self, $force_encoding ) = @_; |
135
|
0
|
0
|
|
|
|
|
if ( not $force_encoding ) { |
136
|
0
|
0
|
|
|
|
|
return $self->content if not my $type = $self->content_type; |
137
|
0
|
0
|
|
|
|
|
return $self->content unless $type =~ qr{ \Atext/ }msx; |
138
|
0
|
|
|
|
|
|
for my $param ( @{ $self->content_type_params } ) { |
|
0
|
|
|
|
|
|
|
139
|
0
|
0
|
|
|
|
|
if ( $param =~ qr{ \Acharset=(.+)\z }msx ) { |
140
|
0
|
|
|
|
|
|
$force_encoding = $param; |
141
|
|
|
|
|
|
|
} |
142
|
|
|
|
|
|
|
} |
143
|
0
|
0
|
|
|
|
|
return $self->content if not $force_encoding; |
144
|
|
|
|
|
|
|
} |
145
|
0
|
|
|
|
|
|
return Encode::decode( $force_encoding, $self->content, Encode::FB_CROAK ); |
146
|
|
|
|
|
|
|
} |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
sub content_json { |
166
|
0
|
|
|
0
|
1
|
|
my ( $self, $force ) = @_; |
167
|
0
|
|
|
|
|
|
my ($has_force) = ( @_ > 1 ); |
168
|
|
|
|
|
|
|
|
169
|
0
|
|
|
|
|
|
my %whitelist = ( 'application/json' => 1 ); |
170
|
0
|
0
|
0
|
|
|
|
return unless $has_force or exists $whitelist{ $self->content_type }; |
171
|
0
|
|
|
|
|
|
my $charset = 'utf-8'; |
172
|
0
|
0
|
0
|
|
|
|
if ( $has_force and defined $force ) { |
173
|
0
|
|
|
|
|
|
$charset = $force; |
174
|
|
|
|
|
|
|
} |
175
|
|
|
|
|
|
|
else { |
176
|
0
|
|
|
|
|
|
for my $param ( @{ $self->content_type_params } ) { |
|
0
|
|
|
|
|
|
|
177
|
0
|
0
|
|
|
|
|
next unless $param =~ /\Acharset=(.+)\z/msx; |
178
|
0
|
|
|
|
|
|
$charset = $1; |
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
} |
181
|
0
|
|
|
|
|
|
return $self->json->utf8(0)->decode( $self->decoded_content($charset) ); |
182
|
|
|
|
|
|
|
} |
183
|
|
|
|
|
|
|
|
184
|
1
|
|
|
1
|
|
8
|
no Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
1; |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
__END__ |